TL;DR
Current Large Language Models (LLMs) are "version-oblivious," struggling to distinguish between different versions of the same software library. To address this, researchers introduced LibEvoBench, a massive benchmark for version-specific code generation, and the SEUS metric, revealing that even the most advanced models fail to respect version constraints unless explicitly provided with documentation.
What Problem Does This Paper Address?
Software libraries are not static; they evolve. A function that worked in PyTorch 1.12 might have a different signature in PyTorch 2.4, or it might be deprecated entirely. However, LLMs are typically trained on massive, "temporally mixed" corpora—essentially a giant soup of code from the last decade.
Because the training objective compresses all this heterogeneous data into a single set of weights without explicit version labels, models often suffer from anachronistic errors. This happens when a model generates code that would be correct for some version of a library, but is incorrect for the requested version. This "temporal confusion" is a major bottleneck for developers working on legacy systems or those needing to stay on the bleeding edge.
Methods
The authors developed a multi-task framework to probe how models handle this evolution:
- LibEvoBench: A benchmark consisting of three core tasks:
- API Calling (API-C): Completing code snippets from real-world GitHub projects.
- API Identification (API-I): Identifying an API based on a redacted docstring.
- Signature Recall (SR): Probing the model's "memory" to reproduce a full function signature for a specific version.
- Noise Reduction Levels (L0–L3): In the API Calling task, the authors progressively added context (docstrings, version tags, API names) to isolate whether a model's failure was due to poor retrieval or a fundamental lack of version awareness.
- SEUS (Software Evolution Understanding Score): A new metric that combines performance on "stable" APIs (those that never change) and "evolving" APIs. Crucially, it penalizes models for inconsistency across versions and for making anachronistic errors.
- Hallucination Taxonomy: Instead of just "right or wrong," the authors categorized errors into Invalid (wrong API from the right version), Anachronistic (right API but from the wrong version), and Unknown (complete fabrication).
Datasets
The authors introduced LibEvoBench, which is significantly more rigorous than previous benchmarks:
- Scope: Over 125,000 evaluation instances covering 16,000+ APIs across 29 versions of PyTorch, NumPy, and SciPy.
- Ground Truth: They didn't just scrape code; they used a "static resolution engine" to map every call site back to a specific entry point in a pinned library version. They also combined official documentation (Sphinx) with runtime introspection to ensure the "ground truth" was accurate for every single version.
Key Insights and Ideas
- The "Version Tag" Placebo: One of the most striking findings is that adding a version constraint (e.g.,
# requires: torch==2.0) in the prompt provides zero measurable improvement. The models "see" the tag and may change their output, but they lack the underlying version-stratified knowledge to make the correct adjustment. - Documentation is the Only Cure: While version tags failed, providing the actual documentation for the target API boosted accuracy by 10–20 points. This suggests models can reason about provided context even when their internal "memory" is a jumbled mess of versions.
- Scaling Doesn't Fix Temporal Confusion: By testing the Qwen-3.5 family at different sizes (35B to 397B), the authors found that while larger models are generally "smarter," they follow the exact same decay curve as smaller models when moving toward newer library versions. This indicates that version-obliviousness is a structural limitation of current training paradigms, not a lack of parameters.
- Latent Anachronisms: Models often "hedge" their bets by only emitting high-frequency parameters. When forced to provide a full signature (the SR task), anachronistic errors spiked, revealing that the models' internal knowledge of parameters is often stuck in the past.
Key Results
- Leaderboard: GPT-5.4 currently leads the pack with a SEUS score of 86.0, followed closely by GPT-5.5.
- Performance Decay: Across all model families (OpenAI, Gemini, Claude, Qwen), performance on evolving APIs degrades significantly for newer library versions.
- The Gap: Even the strongest models show a persistent 7–10 point accuracy gap between stable and evolving APIs.
- Error Types: At the parameter level, anachronistic predictions (using a parameter that was removed or renamed in a different version) constitute a substantial and consistent portion of the error budget.
Limitations and Future Work
- Zero Thinking Budget: The models were evaluated without "Chain-of-Thought" (CoT) or extended thinking time. The authors suggest CoT might help with signature recall but likely wouldn't fix the underlying lack of version-specific facts.
- Contamination: Since the benchmark uses public GitHub code, there is a risk that some test cases were in the models' training data. However, the authors argue that the systematic degradation over time suggests that "memorization" isn't the primary driver of performance.
- Future Directions: The paper motivates the need for temporally grounded training—where data is explicitly labeled by time or version—and better retrieval-augmented generation (RAG) systems that can fetch version-correct documentation automatically.
Summary updated