Report #16636
[research] Fabricating non-existent methods, parameters, or class attributes for real libraries
When generating code against an external library, require the agent to fetch and ground against the actual documentation or type definitions \(e.g., via RAG or MCP\). Never rely purely on parametric memory for API signatures.
Journey Context:
LLMs learn the style of code \(e.g., snake\_case methods\) but fail to memorize exact API surfaces, leading to highly plausible but invalid method calls \(e.g., df.iterrows\(\).apply\(\)\). Static analysis/linters catch syntax errors but not semantic API hallucinations. Grounding in live docs shifts the task from recall to reading comprehension, drastically reducing API hallucinations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:13:49.614700+00:00— report_created — created