RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement Learning

Jonas Gehring, Kunhao Zheng, Jade Copet, Vegard Mella, Taco Cohen, Gabriel Synnaeve

arXiv:2410.02089 · 2026-07-27 공개 · arXiv · PDF

reinforcement-learning large-language-models llm-training parameter-efficient execution-feedback competitive-programming code-synthesis automatic-feedback

Abstract

Large language models (LLMs) deployed as agents solve user-specified tasks over multiple steps while keeping the required manual engagement to a minimum. Crucially, such LLMs need to ground their generations in any feedback obtained to reliably achieve the desired outcomes. We propose an end-to-end reinforcement learning method for teaching models to leverage execution feedback in the realm of code synthesis, where state-of-the-art LLMs struggle to improve code iteratively compared to independent sampling. We benchmark on competitive programming tasks, where we achieve new state-of-the art results with both small (8B parameters) and large (70B) models while reducing the amount of samples required by an order of magnitude. Our analysis of inference-time behavior demonstrates that our method produces LLMs that effectively leverage automatic feedback over multiple steps.

한국어 요약

한 줄 요약

RLEF는 실행 피드백을 강화 학습으로 활용해 코드 생성 성능을 향상시키는 LLM 학습 방법이다.

핵심 기여도

핵심 아이디어

코드 생성 과정에서 생성된 코드의 실행 결과(에러 메시지, 유닛 테스트 결과)를 피드백으로 활용하는 것이 중요하다. 기존 LLM은 독립 샘플링 방식보다 실행 피드백을 반복적으로 활용하는 데 한계가 있었다. RLEF는 강화 학습을 통해 이 문제를 해결한다.

RLEF는 코드 생성을 반복적 작업(iterative task)으로 모델링하고, 각 생성 후 실행 결과를 관찰(observation)으로 취급한다. 이 과정에서 이진 보상(binary reward)을 사용한다: 최종 코드가 테스트 케이스를 통과하면 보상을 주고, 그렇지 않으면 0을 준다. 이는 LLM이 피드백을 기반으로 코드를 개선하도록 유도한다.

기술적 접근법

주요 결과

의의 및 한계

RLEF는 LLM이 실행 피드백을 반복적으로 활용하는 능력을 향상시켜, 코드 생성 과정에서 실질적인 오류 수정 능력을 갖게 한다. 이는 코드 생성 분야에서 LLM의 자율성을 높이는 중요한 기여이다. 또한, 샘플 수를 줄이며 효율성을 확보한 점이 실용적 가치가 있다.

하지만, RLEF는 특정 벤치마크(예: CodeContests)에서의 성능 개선에 초점을 맞추고 있으며, 다른 도메인(예: 자연어 생성, 문서 요약 등)으로의 확장 가능성은 명시되지 않았다. 또한, 강화 학습의 학습 과정 자체가 계산 비용이 높을 수 있다는 점도 한계로 지적될 수 있다.

실용적 활용

RLEF는 소프트웨어 개발 도구, 자동화된 코드 리뷰 시스템, 프로그래밍 튜토리얼 플랫폼 등에서 활용 가능하다. 특히, 코드 생성 과정에서 실시간 피드백을 반영해 오류를 자동 수정하는 기능이 필요한 산업 분야에 유용하다.