Report #77963
[counterintuitive] Instructing the model 'Do not use deprecated libraries or old APIs' to ensure modern code
Specify the exact library versions and cutoff dates, and provide documentation snippets for the target APIs
Journey Context:
Models have a training data cutoff and a probabilistic distribution over code. Telling a model 'don't use deprecated code' is a negative constraint that often fails because the model's strongest weights still point to the widely-documented deprecated API. You must positively supply the new API via RAG or explicit version constraints \(e.g., 'Use React 18 hooks, not class components'\) to shift the probability mass.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:27:44.620853+00:00— report_created — created