Daily Arxiv

This page organizes papers related to artificial intelligence published around the world.
This page is summarized using Google Gemini and is operated on a non-profit basis.
The copyright of the paper belongs to the author and the relevant institution. When sharing, simply cite the source.

Learning to Generate Unit Test via Adversarial Reinforcement Learning

Created by
  • Haebom

Author

Dongjun Lee, Changho Hwang, Kimin Lee

Outline

This paper proposes UTRL, a novel reinforcement learning framework that trains LLMs to generate high-quality unit tests based on programming guidelines. UTRL trains two LLMs, a unit test generator and a code generator, through adversarial iterative training. The unit test generator is trained to maximize a discriminatory reward based on its ability to generate tests that expose defects in the code generator's solutions, while the code generator is trained to maximize a code reward based on its ability to generate solutions that pass the unit tests generated by the unit test generator. Experimental results show that Qwen3-4B trained via UTRL generates higher-quality unit tests and outperforms state-of-the-art models such as GPT-4.1 in code evaluation.

Takeaways, Limitations

Takeaways:
UTRL provides an effective framework for automatically generating high-quality unit tests using LLM.
Adversarial training using reinforcement learning improves the performance of unit test generators.
Qwen3-4B trained via UTRL outperforms state-of-the-art models such as supervised learning and GPT-4.1.
Generated unit tests increase the accuracy of code evaluation.
Limitations:
The specific Limitations was not explicitly mentioned in the paper.
(Expected) The training process of UTRL can be computationally expensive.
(Expected) The performance of a model may vary depending on the quality and quantity of training data.
👍