Skip to main content
QUICK REVIEW

[論文レビュー] Code-A1: Adversarial Evolving of Code LLM and Test LLM via Reinforcement Learning

Aozhe Wang, Yuchen Yan|arXiv (Cornell University)|Mar 16, 2026
Software Testing and Debugging Techniques被引用数 0
ひとこと要約

tldr: Code-A1 は Code LLM と Test LLM の敵対的共進化を導入し、Mistake Book を用いた安定的な RL 学習を実現する white-box 敵対的テスト生成を可能にし、人間が注釈したテストなしでも強力なコード生成とテスト生成の性能を達成します。

ABSTRACT

Reinforcement learning for code generation relies on verifiable rewards from unit test pass rates. Yet high-quality test suites are scarce, existing datasets offer limited coverage, and static rewards fail to adapt as models improve. Recent self-play methods unify code and test generation in a single model, but face a inherent dilemma: white-box access leads to self-collusion where the model produces trivial tests for easy rewards, yet black-box restriction yields generic tests that miss implementation-specific bugs. We introduce Code-A1, an adversarial co-evolution framework that jointly optimizes a Code LLM and a Test LLM with opposing objectives. The Code LLM is rewarded for passing more tests, while the Test LLM is rewarded for exposing more defects. This architectural separation eliminates self-collusion risks and safely enables white-box test generation, where the Test LLM can inspect candidate code to craft targeted adversarial tests. We further introduce a Mistake Book mechanism for experience replay and a composite reward balancing test validity with adversarial difficulty. Experiments on Qwen2.5-Coder models demonstrate that Code-A1 achieves code generation performance matching or exceeding models trained on human-annotated tests, while significantly improving test generation capability.

研究の動機と目的

  • scarce static test suites を超えるコード生成の検証可能報酬の改善を動機づける。
  • Code LLM と Test LLM が互いに競合する目的を持つ分離された敵対的フレームワークを提案し、自己共謀を回避する。
  • Mistake Book を導入して経験再生を安定化させ、歴史的な失敗を追跡する。
  • テストの妥当性と敵対的難易度をバランスさせる複合報酬を設計する。
  • 敵対的共進化が人間注釈付きテスト RL と同等以上を達成し、より良いテストを生成することを示す。

提案手法

  • Code LLM が候補解を生成し、Test LLM がコードに条件付けられた挑戦的なテストを生成する、分離した二重モデルアーキテクチャ。
  • 敵対的ローアウト:複数のコード候補を生成し、各候補に対して複数のテストスイートを生成、テストを真の解と照合して妥当性を検証し、妥当なテストでコードを実行してパス率を得る。
  • Mistake Book:各質問の経験再生として歴史的に失敗したテストを保存し、報酬計算を安定化させ能力の進化を追跡する。
  • 複合報酬:Code LLM の報酬は過去のテスト成功率と新規テスト成功率を組み合わせて堅牢性を促進する;Test LLM の報酬は妥当性と敵対難易度のバランスを重み付き和で取る。
  • GRPO(Group Relative Policy Optimization)による方針最適化を用い、非対称なサンプリングとトップ分散の選択で訓練計算量のバランスを取る。
  • 訓練ダイナミクスは、より強いコードはより難しいテストを要求し、より難しいテストはより強いコードを促進する、カリキュラム様の共進化を促進する。
Figure 1 : Comparison of three training paradigms for code generation. Vanilla GRPO relies on static golden tests with rigid rewards. GRPO with Self-Play unifies code and test generation but must operate in black-box mode to prevent self-collusion. Code-A1 decouples the two tasks into models with op
Figure 1 : Comparison of three training paradigms for code generation. Vanilla GRPO relies on static golden tests with rigid rewards. GRPO with Self-Play unifies code and test generation but must operate in black-box mode to prevent self-collusion. Code-A1 decouples the two tasks into models with op

実験結果

リサーチクエスチョン

  • RQ1自己共謀を回避しつつ白箱の敵対的テスト生成を安全に可能にするにはどうすればよいか?
  • RQ2Code LLM と Test LLM の敵対的共進化は、人間 annot 付きテストで訓練された RL を複数のコードベンチマークで上回ることができるか?
  • RQ3Mistake Book は訓練を安定させ、敵対的共進化中の壊滅的忘却を防ぐか?
  • RQ4妥当性と敵対的難易度のバランスが学習ダイナミクスと最終性能に与える影響は何か?
  • RQ5Code-A1 からのテスト生成品質は従来のゴールデンテスト RL アプローチと同等か、それを上回るか?

主な発見

  • Code-A1 は HumanEval+、MBPP+、BigCodeBench における人間が注釈したテストで訓練されたモデルと同等またはそれを上回るコード生成性能を示す。
  • Code-A1 の Test LLM は、監視付き微調整や自己プレイのベースラインよりも高い判別的テスト生成能力を達成する。
  • 3B モデルのテスト生成の Mul スコアが 15.29 で、7B ベースモデルの 14.72 を上回り、敵対的共進化による効率性を示す。
  • Mistake Book は訓練を安定化させ、歴史的な失敗が報酬計算を導き、忘却を防ぐ形でバグの段階的発見を可能にする。
  • 白箱アクセスを取り除く、Mistake Book を削除する、予測回答要件を課すといった場合は性能が低下し、各要素の貢献が確認される。
Figure 2 : Overview of the Code-A1 training framework. The Code LLM generates solutions accessible to the Test LLM for white-box testing. Generated tests are validated and merged with historical tests from the Mistake Book. The Code LLM is rewarded for passing more tests; the Test LLM is rewarded fo
Figure 2 : Overview of the Code-A1 training framework. The Code LLM generates solutions accessible to the Test LLM for white-box testing. Generated tests are validated and merged with historical tests from the Mistake Book. The Code LLM is rewarded for passing more tests; the Test LLM is rewarded fo

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。