EUVIMEDEUVIMED entdecken
Crossref

ReCode: Updating Code API Knowledge with Reinforcement Learning

Haoze Wu, Yunzhi Yao, Wenhao Yu, Ningyu Zhang

Proceedings of the AAAI Conference on Artificial Intelligence · 14.03.2026 · 40 (40) · 33908-33916

DOI: 10.1609/aaai.v40i40.40683 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Proceedings of the AAAI Conference on Artificial Intelligence, online erschienen am 14.03.2026. Verfasst von Haoze Wu und 3 weiteren Autor:innen. Die Arbeit wurde bisher 3-mal zitiert (Crossref).

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

Large Language Models (LLMs) exhibit remarkable code generation capabilities but falter when adapting to frequent updates in external library APIs. This critical limitation, stemming from reliance on outdated API knowledge from their training data, even with access to current documentation, impedes reliable code generation in dynamic environments. To tackle this issue, we propose ReCode (rule-based Reinforcement learning for Code Update), a novel framework that mimics human programmer adaptation to API changes. Specifically, we construct a dataset of approximately 2,000 data entries to train the LLMs to perform version migration based on updated information. Then, we introduce a modified string similarity metric for code evaluation as the reward for reinforcement learning. Our experiments demonstrate that ReCode substantially boosts LLMs' code generation performance in dynamic API scenarios, especially on the unseen CodeUpdateArena task. Crucially, compared to supervised fine-tuning, ReCode has less impact on LLMs' general code generation abilities. We apply ReCode on various LLMs and reinforcement learning algorithms (GRPO and DAPO), all achieving consistent improvements. Notably, after training, Qwen2.5-Coder-7B outperforms that of the 32B parameter code instruction-tuned model and the reasoning model with the same architecture.

Zitieren

APA

Wu, H., Yao, Y., Yu, W., & Zhang, N. (2026). ReCode: Updating Code API Knowledge with Reinforcement Learning. Proceedings of the AAAI Conference on Artificial Intelligence, 40(40), 33908-33916. https://doi.org/10.1609/aaai.v40i40.40683

Vancouver

Wu H, Yao Y, Yu W, Zhang N. ReCode: Updating Code API Knowledge with Reinforcement Learning. Proceedings of the AAAI Conference on Artificial Intelligence. 2026;40(40):33908-33916. doi:10.1609/aaai.v40i40.40683

BibTeX
@article{Wu2026,
  author = {Wu, Haoze and Yao, Yunzhi and Yu, Wenhao and Zhang, Ningyu},
  title = {ReCode: Updating Code API Knowledge with Reinforcement Learning},
  journal = {Proceedings of the AAAI Conference on Artificial Intelligence},
  year = {2026},
  volume = {40},
  number = {40},
  pages = {33908--33916},
  doi = {10.1609/aaai.v40i40.40683}
}
Kostenlos starten →