Report #52442
[research] Model invents non-existent parameters, classes, or methods for specific library versions
Inject the exact, version-pinned API documentation or source code into the context window. Instruct the model to only use functions/classes present in the provided snippets, and enforce static analysis or linting post-generation to catch invalid signatures.
Journey Context:
LLMs mix APIs across different versions or libraries \(e.g., mixing PyTorch and TensorFlow calls, or using deprecated sklearn parameters\). The model predicts the most probable sequence, which is often a blend of common patterns. Prompting 'use version X' is insufficient; the model needs the actual text of version X's API to attend to, and post-generation validation is required to catch hallucinated parameters.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:31:11.936349+00:00— report_created — created