코드 보상 모델링을 위한 단위 테스트의 동적 스케일링
Dynamic Scaling of Unit Tests for Code Reward Modeling
January 2, 2025
저자: Zeyao Ma, Xiaokang Zhang, Jing Zhang, Jifan Yu, Sijia Luo, Jie Tang
cs.AI
초록
현재 대형 언어 모델(LLMs)은 코드 생성과 같은 복잡한 추론 작업에서 정확한 응답을 첫 번째 시도에서 얻는 데 어려움을 겪는 경우가 많습니다. 이전 연구는 이 도전에 대처하기 위해 여러 후보 솔루션을 생성하고 LLM이 생성한 단위 테스트로 검증하는 방식으로 접근했습니다. 단위 테스트의 실행 결과는 올바른 솔루션을 식별하기 위한 보상 신호로 작용합니다. LLM은 항상 자신 있게 실수를 하기 때문에 이러한 단위 테스트는 신뢰할 수 없어서 보상 신호의 품질을 떨어뜨립니다. 솔루션의 수를 확장하면 LLM의 성능이 향상된다는 관찰을 바탕으로, 우리는 보상 신호 품질을 향상시키기 위해 단위 테스트의 확장이 미치는 영향을 탐구합니다. 우리의 선구적인 실험 결과는 단위 테스트 수와 보상 신호 품질 사이에 긍정적인 상관 관계가 있으며, 더 어려운 문제에서 더 큰 이점이 관찰되었습니다. 이러한 통찰을 바탕으로 우리는 효율적이고 고품질의 단위 테스트 확장을 가능케 하는 경량화된 단위 테스트 생성기인 CodeRM-8B를 제안합니다. 더불어, 문제의 난이도에 따라 단위 테스트 수를 조정하는 동적 확장 메커니즘을 구현하여 효율성을 더욱 향상시킵니다. 실험 결과는 우리의 접근 방식이 세 가지 벤치마크에서 다양한 모델의 성능을 크게 향상시킨다는 것을 보여줍니다 (예: Llama3-8B의 성능 향상률은 18.43%, GPT-4o-mini의 경우 3.42%인 HumanEval Plus).
English
Current large language models (LLMs) often struggle to produce accurate
responses on the first attempt for complex reasoning tasks like code
generation. Prior research tackles this challenge by generating multiple
candidate solutions and validating them with LLM-generated unit tests. The
execution results of unit tests serve as reward signals to identify correct
solutions. As LLMs always confidently make mistakes, these unit tests are not
reliable, thereby diminishing the quality of reward signals. Motivated by the
observation that scaling the number of solutions improves LLM performance, we
explore the impact of scaling unit tests to enhance reward signal quality. Our
pioneer experiment reveals a positive correlation between the number of unit
tests and reward signal quality, with greater benefits observed in more
challenging problems. Based on these insights, we propose CodeRM-8B, a
lightweight yet effective unit test generator that enables efficient and
high-quality unit test scaling. Additionally, we implement a dynamic scaling
mechanism that adapts the number of unit tests based on problem difficulty,
further improving efficiency. Experimental results show that our approach
significantly improves performance across various models on three benchmarks
(e.g., with gains of 18.43% for Llama3-8B and 3.42% for GPT-4o-mini on
HumanEval Plus).Summary
AI-Generated Summary