Enhancing LLM Agents for Code Generation with Possibility and Pass-rate Prioritized Experience Replay
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Nowadays transformer-based Large Language Models (LLM) for code generation tasks usually apply sampling and filtering pipelines. Due to the sparse reward problem in code generation tasks caused by one-token incorrectness, transformer-based models will sample redundant programs till they find a correct one, leading to low efficiency. To overcome the challenge, we incorporate Experience Replay (ER) in the fine-tuning phase, where codes and programs produced are stored and will be replayed to give the LLM agent a chance to learn from past experiences. Based on the spirit of ER, we introduce a novel approach called BTP pipeline which consists of three phases: beam search sampling, testing phase, and prioritized experience replay phase. The approach makes use of failed programs collected by code models and replays programs with high Possibility and Pass-rate Prioritized value (P2Value) from the replay buffer to improve efficiency. P2Value comprehensively considers the possibility of transformers' output and pass rate and can make use of the redundant resources caused by the problem that most programs collected by LLMs fail to pass any tests. We empirically apply our approach in several LLMs, demonstrating that it enhances their performance in code generation tasks and surpasses existing baselines.
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 17 of its 32 references that are in the map. First posted on arXiv 16 Oct 2024.
Builds on
17 of 32 references.
References · 17
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2022Competition-Level Code Generation with AlphaCodecited by 1,462
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2015Prioritized Experience Replaycited by 1,099
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2021Measuring Coding Challenge Competence With APPScited by 902
- 2023StarCoder: may the source be with you!cited by 799
5 more
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 733
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2023Planning with Large Language Models for Code Generationcited by 182
- 2018Leveraging Grammar and Reinforcement Learning for Neural Program Synthesiscited by 84
- 2016Synthesizing Program Input Grammarscited by 3
Built on by
Citing papers per year: 2024: 1; 2025: 1; 2026: 1.
3 papers.
Similar, not cited
Close in wording, no citation either way
- 2025Rethinking Verification for LLM Code Generation: From Generation to Testing
- 2025Enhancing LLM Code Generation: A Systematic Evaluation of Multi-Agent Collaboration and Runtime Debugging for Improved Accuracy, Reliability, and Latency
- 2025A Survey on Code Generation with LLM-based Agents
- 2025Towards Advancing Code Generation with Large Language Models: A Research Roadmap
- 2024Code Repair with LLMs gives an Exploration-Exploitation Tradeoff
- 2024Enhancing Code Generation Performance of Smaller Models by Distilling the Reasoning Ability of LLMs
- 2024RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement Learning
- 2024Large Language Models as Test Case Generators: Performance Evaluation and Enhancement