NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CodeUpdateArena: Benchmarking Knowledge Editing on API Updates

Zeyu Leo Liu, Shrey Pandit, Xi Ye, Eunsol Choi, Greg Durrett · DOI

Abstract

Large Language Models (LLMs) are typically trained on static snapshots of the internet, causing them to become outdated as software libraries and APIs evolve. This paper introduces CodeUpdateArena, a benchmark designed to evaluate "knowledge editing" (KE) for code—the process of updating a model's weights or context to incorporate new API semantics. Our evaluation reveals that while models struggle to internalize updates from documentation alone, fine-tuning on usage examples allows them to successfully apply new coding patterns. We analyze the performance of both proprietary and open-source models, highlighting a critical trade-off between update efficacy and the preservation of general coding knowledge.

1. Introduction

Software development is a moving target. APIs are constantly updated with new arguments, changed return types, and renamed functions. When an LLM’s training data is stale, it produces buggy code based on deprecated syntax. While knowledge editing is well-studied for factual updates (e.g., changing a public figure's title), applying it to source code requires functional competence. The model must not only memorize a new signature but also understand the logic well enough to solve novel programming problems.

Overview of the CodeUpdateArena framework, illustrating the transition from synthetic API updates to LLM parameter editing and final evaluation in the program synthesis arena.

2. Methodology and Dataset Generation

The authors propose a formal framework for code knowledge editing, defining an update ($f \leftarrow u$) where a function $f$ receives new semantics $u$. To evaluate this, they introduce two primary metrics:

  • UPass@k (Efficacy): Measures if the model solves a problem specifically by using the updated functionality.
  • SPass@k (Specificity): Measures if the update breaks the model's existing knowledge of unrelated code, avoiding catastrophic forgetting.

To facilitate this evaluation, the authors created the CodeUpdateArena dataset using a sophisticated pipeline driven by GPT-4. The dataset covers 161 unique API updates across 54 functions from seven popular Python packages, including numpy, pandas, and torch. It includes 670 program synthesis problems where the most efficient solution requires the updated API, supported by rigorous unit testing to ensure code validity.

The CodeUpdateArena generation pipeline, detailing the three-step process of update generation, unit test creation, and reference solution synthesis.

3. Key Insights and Experimental Results

The study compared three editing strategies: Prepend (RAG), which places documentation in the prompt; FT(U), fine-tuning on docstrings; and FT(PS), fine-tuning on usage examples.

  • The Failure of Documentation Tuning: A striking finding was that fine-tuning on docstrings (FT(U)) almost never improved a model's ability to solve problems. While the model might "know" the text of the documentation, it cannot apply it functionally without examples.
  • The Power of Examples: Conversely, fine-tuning on just a few usage examples (FT(PS)) significantly boosted performance. Open-source models like DeepSeek-Coder-V1.5 jumped from near-zero success to a 47.2% UPass@5 using this method.
  • Model Performance: Claude-3.5-Sonnet emerged as the top performer, achieving 71.9% UPass@5 when updates were provided in the prompt, notably outperforming GPT-4 despite GPT-4 being the source of the dataset generation.
  • Specificity Trade-offs: There is a clear "no free lunch" trade-off. Increasing the learning rate to improve update efficacy often degrades performance on standard benchmarks like HumanEval. The authors found that mixing random code examples into the update process is essential to preserve general coding ability.

4. Conclusion

CodeUpdateArena demonstrates that internalizing documentation into model weights remains a significant challenge. Future work should focus on improving how models reason about documentation without explicit examples and developing better "unlearning" methods to remove deprecated knowledge. As software continues to evolve, these techniques will be vital for maintaining the utility of LLMs in real-world development environments.

Summary updated

BibTeX
@misc{liu2024codeupdatearena,
  author = {Zeyu Leo Liu and Shrey Pandit and Xi Ye and Eunsol Choi and Greg Durrett},
  title = {{CodeUpdateArena: Benchmarking Knowledge Editing on API Updates}},
  year = {2024},
  eprint = {2407.06249},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.06249},
}
Figure