paper-with-me

홈 › Papers

Reinforcement Learning from Automatic Feedback for High-Quality Unit Test Generation

2024-12-18 · Benjamin Steenhoek, Michele Tufano, Neel Sundaresan, Alexey Svyatkovskiy

Software testing is a crucial but time-consuming aspect of software development, and recently, Large Language Models (LLMs) have gained popularity for automated test case generation. However, because LLMs are trained on vast amounts of open-source code, they often generate test cases that do not adhere to best practices and may even contain test smells (anti-patterns). To address this issue, we propose Reinforcement Learning from Static Quality Metrics (RLSQM), wherein we utilize Reinforcement Learning to generate high-quality unit tests based on static analysis-based quality metrics. First, we analyzed LLM-generated tests and show that LLMs frequently do generate undesirable test smells -- up to 37% of the time. Then, we implemented lightweight static analysis-based reward model and trained LLMs using this reward model to optimize for five code quality metrics. Our experimental results demonstrate that the RL-optimized Codex model consistently generated higher-quality test cases than the base LLM, improving quality metrics by up to 23%, and generated nearly 100% syntactically-correct code. RLSQM also outperformed GPT-4 on all code quality metrics, in spite of training a substantially cheaper Codex model. We provide insights into how reliably utilize RL to improve test generation quality and show that RLSQM is a significant step towards enhancing the overall efficiency and reliability of automated software testing. Our data are available at https://doi.org/10.6084/m9.figshare.25983166.

📄 PDF Abstract BibTeX arXiv:2412.14308

Code (0)

등록된 구현이 없습니다.

Tasks

software testing

Methods 이 논문이 사용한 방법론

Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Dropout Dropout is a regularization technique for neural networks that drops a unit (along with connections) at training time with a specified probability $p$ (a common value is…
Multi-Head Attention 설명 없음
Position-Wise Feed-Forward Layer 설명 없음
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…
Residual Connection 설명 없음
Adam 설명 없음
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…

Similar Papers 제목 키워드 기반

Self-play with Execution Feedback: Improving Instruction-following Capabilities of Large Language Models

2024-06-19 · Guanting Dong, Keming Lu, Chengpeng Li, Tingyu Xia 외

One core capability of large language models (LLMs) is to follow natural language instructions. However, the issue of automatically constructing high-quality training data to enhance the complex instruction-following abi…

Instruction Following

RLTF: Reinforcement Learning from Unit Test Feedback

2023-07-10 · Jiate Liu, Yiqin Zhu, Kaiwen Xiao, Qiang Fu 외

The goal of program synthesis, or code generation, is to generate executable code based on given descriptions. Recently, there has been an increasing number of studies employing reinforcement learning (RL) to improve the…

Code GenerationmbppProgram Synthesisreinforcement-learning+2

UltraFeedback: Boosting Language Models with Scaled AI Feedback

2023-10-02 · Ganqu Cui, Lifan Yuan, Ning Ding, Guanming Yao 외

Learning from human feedback has become a pivot technique in aligning large language models (LLMs) with human preferences. However, acquiring vast and premium human feedback is bottlenecked by time, labor, and human capa…

Language Modelling

Generating Constructive Feedback on Stories via Reinforcement Learning

2026-09-04 · Maja Stahl, Timon Ziegenbein, Henning Wachsmuth arxiv

Constructive feedback is crucial for creative writers to refine their storytelling abilities. Since receiving feedback from human experts is often costly and time-intensive, large language models (LLMs) offer a scalable …

Reinforcement Learning

Mapping out the Space of Human Feedback for Reinforcement Learning: A Conceptual Framework

2024-11-18 · Yannick Metz, David Lindner, Raphaël Baur, Mennatallah El-Assady

Reinforcement Learning from Human feedback (RLHF) has become a powerful tool to fine-tune or train agentic machine learning models. Similar to how humans interact in social contexts, we can use many types of feedback to …