Report #13397
[research] Confusing obscure libraries or APIs with popular ones that share similar names or namespaces
When referencing an API, require the model to output the exact package/module path. If ambiguous, prompt the model to disambiguate by checking imports in the codebase context before generating code.
Journey Context:
LLMs have a strong prior for high-frequency tokens. If a user asks about a niche library 'fast-json' and a popular library 'fastjson' exists, the model will hallucinate the API of the popular one. This is extremely hard to catch because the generated code looks syntactically perfect. Enforcing strict, fully-qualified naming forces the model out of its lazy, high-frequency token generation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:41:39.656717+00:00— report_created — created