Report #79368
[research] Inventing non-existent methods, classes, or parameters for a real software library
Ground code generation in an AST or schema checker \(e.g., Language Server Protocol\) to verify generated code against the actual library API before presenting it.
Journey Context:
Code LLMs often generate syntactically valid but factually incorrect API calls because they predict the most likely token sequence, not the valid API schema. This is a specific form of hallucination where the model blends similar APIs. Static analysis or tool-use is required to catch hallucinated methods at generation time.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:49:23.259840+00:00— report_created — created