AI
New Benchmark Exposes AI Code Models' Struggle with Library Version History
Researchers find that large language models fail to distinguish between different API versions, making costly mistakes when generating code against outdated or evolving libraries.
Large software projects routinely rely on older versions of libraries long after newer releases have introduced breaking API changes. This mismatch poses a fundamental challenge for code-generating AI models: they must juggle knowledge of multiple library incarnations simultaneously, yet current systems show little ability to do so reliably.
Researchers have now quantified this weakness through LibEvoBench, a new evaluation framework designed to measure how well AI models handle evolving code libraries. The work, published on arXiv, reveals that state-of-the-art language models are essentially indifferent to API versioning—a finding with real consequences for developers relying on these tools.
The Core Problem#
Because large language models train on mixed temporal data drawn from the open internet, they absorb knowledge of multiple library versions without any structured way to reason about which one applies in a given context. This leads to anachronistic errors: the model calls an API method using the syntax and behavior from a different version than the one actually in use, causing code to fail at runtime.
The challenge becomes acute in real-world development, where legacy projects lock dependencies to specific versions for stability, even as the broader ecosystem moves forward. A code generator must understand not just what an API does, but which version's definition of that API matters in the current task.
Measuring the Gap#
LibEvoBench introduces a new scoring method called the Software Evolution Understanding Score (SEUS) to assess how consistently models navigate version-specific reasoning. Testing against multiple releases of widely-used Python libraries, the researchers made several striking discoveries:
- State-of-the-art models show significant performance drops when APIs change across versions
- Performance remains flat for stable APIs, even across different releases
- Simply instructing the model to target a specific version does not improve accuracy
- Providing relevant library documentation substantially lifts model performance
Why It Matters#
The findings point to a systemic blind spot in how today's LLMs are trained and deployed for code generation. Without explicit mechanisms to ground knowledge in temporal context, these models will continue producing version-mismatched code that compiles but breaks in production. The work suggests that future improvements will require not just larger training sets, but new training paradigms that help models explicitly reason about how software APIs evolve over time.

