When LLMs Lag Behind: Knowledge Conflicts from Evolving APIs in Code Generation
Not on the map. Why?
Abstract (arXiv)
The rapid evolution of software libraries creates a significant challenge for Large Language Models (LLMs), whose static parametric knowledge often becomes stale post-training. While retrieval-augmented generation (RAG) is commonly used to provide up-to-date API specifications, "context-memory conflict" arises when external instructions contradict a model's internal parametric knowledge. This paper presents a systematic empirical study of LLM code generation under API evolution (e.g., API deprecation, API modification, and API addition), by constructing a benchmark of 270 real-world updates from eight Python libraries. We evaluate four LLM families of 11 models. Our results show that without comprehensive documentation, LLMs struggle to prioritize external context, averaging only 42.55% of generated code examples are executable in the target environment. While structured documentation and larger model scales improve LLMs' ability to update adoption, they do not fully resolve executability issues with a low 66.36% executable rate. In addition, reasoning-based strategies (e.g., Self-Reflection) significantly boost LLMs' performance with 11% improvement on executable rate. Our findings highlight the persistence of outdated patterns from LLMs, even when API update specifications are provided, and emphasize the need for evolution-aware benchmarks and techniques.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). First posted on arXiv 10 Apr 2026.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2026: 3.
3 papers.
- 2026When Retrieval Hurts Code Completion: A Diagnostic Study of Stale Repository Contextcited by 1
- 2026Toward User-Conditioned Evaluation of Personal LLM Agents under Temporal Interventionscited by 1
- 2026Diagnosing Knowledge Gaps in LLM Tool Use: An Agentic Benchmark for Novel API Acquisitioncited by 0
- 2026Toward User-Conditioned Evaluation of Personal LLM Agents under Temporal Interventions20 Jul 2026
- 2026Diagnosing Knowledge Gaps in LLM Tool Use: An Agentic Benchmark for Novel API Acquisition2 Jun 2026
- 2026When Retrieval Hurts Code Completion: A Diagnostic Study of Stale Repository Context14 May 2026
Similar, not cited
Close in wording, no citation either way
- 2025When LLMs Meet API Documentation: Can Retrieval Augmentation Aid Code Generation Just as It Helps Developers?
- 2025CODESYNC: Synchronizing Large Language Models with Dynamic Code Evolution at Scale
- 2025Beyond Synthetic Benchmarks: Evaluating LLM Performance on Real-World Class-Level Code Generation
- 2026Learning from Execution: Self-Evolving Memory for Private-Library Code Generation
- 2024De-Hallucinator: Mitigating LLM Hallucinations in Code Generation Tasks via Iterative Grounding
- 2026Are you Synthesizing or Recalling? Evaluating LLMs on Algorithmic Code Retrieval
- 2024A Comprehensive Framework for Evaluating API-oriented Code Generation in Large Language Models
- 2024Harnessing LLMs for API Interactions: A Framework for Classification and Synthetic Data Generation