Enhancing LLM Agents for Code Generation with Possibility and Pass-rate Prioritized Experience Replay

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Chen, Yuyang, Zhao, Kaiyan, Wang, Yiming, Yang, Ming, Zhang, Jian, Niu, Xiaoguang
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866929670869483520
author Chen, Yuyang
Zhao, Kaiyan
Wang, Yiming
Yang, Ming
Zhang, Jian
Niu, Xiaoguang
author_facet Chen, Yuyang
Zhao, Kaiyan
Wang, Yiming
Yang, Ming
Zhang, Jian
Niu, Xiaoguang
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2410_12236
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Enhancing LLM Agents for Code Generation with Possibility and Pass-rate Prioritized Experience Replay
Chen, Yuyang
Zhao, Kaiyan
Wang, Yiming
Yang, Ming
Zhang, Jian
Niu, Xiaoguang
Machine Learning
Artificial Intelligence
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.
title Enhancing LLM Agents for Code Generation with Possibility and Pass-rate Prioritized Experience Replay
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2410.12236