Report #17880
[research] Inventing non-existent methods, classes, or parameters for real software libraries
Ground code generation in static analysis or live documentation retrieval of the specific library version. If ungrounded, restrict API usage to the most common, well-represented patterns in the training data, and explicitly flag novel or rare API calls as 'unverified'.
Journey Context:
LLMs blend concepts fluently, leading to 'API mixing' where a method name from one library is applied to another, or a plausible-sounding parameter is added. Prompting the model to 'only use valid APIs' is insufficient because the model's internal representation of 'valid' is probabilistic, not binary. Grounding against actual ASTs or docs is the only structural fix, but when offline, relying on high-frequency API patterns reduces the surface area for hallucination.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T06:43:44.391949+00:00— report_created — created