mlsanityData to 14 Oct 2026

ReCode: Updating Code API Knowledge with Reinforcement Learning

arXiv 2506.20495 ↗First posted 25 Jun 2025cs.CL cs.AI cs.IRcited by 12

On the map: Deep reinforcement learning methods → RL training of language and agent models

Abstract (arXiv)

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. Code is available at https://github.com/zjunlp/ReCode.

Key facts. Cited by 12 papers in the map (data through 14 Oct 2026). Placed in RL training of language and agent models, one of 15 directions in Deep reinforcement learning methods. Builds on 48 of its 69 references that are in the map. First posted on arXiv 25 Jun 2025.

Builds on

48 of 69 references.

Closest ancestors · 2

Same direction, newest first

  1. 2025SimpleRL-Zoo: Investigating and Taming Zero Reinforcement Learning for Open Base Models in the Wild24 Mar
  2. 2025SFT Memorizes, RL Generalizes: A Comparative Study of Foundation Model Post-training28 Jan

Other references · 46

  1. 2022Training language models to follow instructions with human feedbackcited by 15,971
  2. 2017Proximal Policy Optimization Algorithmscited by 15,215
  3. 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
  4. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  6. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
  7. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
  8. 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,371
  9. 2021Program Synthesis with Large Language Modelscited by 3,637
  10. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
  11. 2025DAPO: An Open-Source LLM Reinforcement Learning System at Scalecited by 2,810
  12. 2023Code Llama: Open Foundation Models for Codecited by 2,139
34 more
  1. 2025Search-R1: Training LLMs to Reason and Leverage Search Engines with Reinforcement Learningcited by 1,444
  2. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
  3. 2025Kimi k1.5: Scaling Reinforcement Learning with LLMscited by 1,210
  4. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  5. 2024The AI Scientist: Towards Fully Automated Open-Ended Scientific Discoverycited by 1,071
  6. 2025Does Reinforcement Learning Really Incentivize Reasoning Capacity in LLMs Beyond the Base Model?cited by 982
  7. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
  8. 2024A Survey on Large Language Models for Code Generationcited by 658
  9. 2023An Empirical Study of Catastrophic Forgetting in Large Language Models During Continual Fine-tuningcited by 639
  10. 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 546
  11. 2025Video-R1: Reinforcing Video Reasoning in MLLMscited by 484
  12. 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 452
  13. 2023Editing Large Language Models: Problems, Methods, and Opportunitiescited by 372
  14. 2025ToolRL: Reward is All Tool Learning Needscited by 362
  15. 2021Entity-Based Knowledge Conflicts in Question Answeringcited by 356
  16. 2024LoRA Learns Less and Forgets Lesscited by 328
  17. 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 300
  18. 2024Knowledge Conflicts for LLMs: A Surveycited by 283
  19. 2024Data Interpreter: An LLM Agent For Data Sciencecited by 225
  20. 2024CodeGemma: Open Code Models Based on Gemmacited by 150
  21. 2022Large Language Models Meet NL2Code: A Surveycited by 138
  22. 2024MathBench: Evaluating the Theory and Application Proficiency of LLMs with a Hierarchical Mathematics Benchmarkcited by 105
  23. 2025SimpleAR: Pushing the Frontier of Autoregressive Visual Generation through Pretraining, SFT, and RLcited by 86
  24. 2025SQL-R1: Training Natural Language to SQL Reasoning Model By Reinforcement Learningcited by 68
  25. 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
  26. 2023A Survey on Large Language Models for Software Engineeringcited by 59
  27. 2025SynLogic: Synthesizing Verifiable Reasoning Data at Scale for Learning Logical Reasoning and Beyondcited by 50
  28. 2025MT-R1-Zero: Advancing LLM-based Machine Translation via R1-Zero-like Reinforcement Learningcited by 48
  29. 2024LLMs Meet Library Evolution: Evaluating Deprecated API Usage in LLM-based Code Completioncited by 32
  30. 2024U-MATH: A University-Level Benchmark for Evaluating Mathematical Skills in LLMscited by 24
  31. 2024CodeUpdateArena: Benchmarking Knowledge Editing on API Updatescited by 19
  32. 2024VersiCode: Towards Version-controllable Code Generationcited by 17
  33. 2024A Comprehensive Survey of Reinforcement Learning: From Algorithms to Practical Challengescited by 13
  34. 2024GitChameleon: Unmasking the Version-Switching Capabilities of Code Generation Modelscited by 6

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 4; 2026: 8.

12 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025CODESYNC: Synchronizing Large Language Models with Dynamic Code Evolution at Scale
  2. 2025APRIL: API Synthesis with Automatic Prompt Optimization and Reinforcement Learning
  3. 2026When LLMs Lag Behind: Knowledge Conflicts from Evolving APIs in Code Generation
  4. 2024Enhancing Code LLMs with Reinforcement Learning in Code Generation: A Survey
  5. 2025Towards Better Correctness and Efficiency in Code Generation
  6. 2026Code2LoRA: Hypernetwork-Generated Adapters for Code Language Models under Software Evolution
  7. 2024RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement Learning
  8. 2025Afterburner: Reinforcement Learning Facilitates Self-Improving Code Efficiency Optimization