ChatPaper.aiChatPaper

SpecBench: 長期的なコーディングエージェントにおける報酬ハッキングの測定

SpecBench: Measuring Reward Hacking in Long-Horizon Coding Agents

May 20, 2026
著者: Bingchen Zhao, Dhruv Srikanth, Yuxiang Wu, Zhengyao Jiang
cs.AI

要旨

長時間にわたるコーディングエージェントが、どの開発者もレビューできないほどのコードを生成するにつれ、監視は自動テストスイートという単一の表面に委ねられる。この設定では、エージェントがユーザーの真の目標から逸脱しながらテスト合格のために最適化するため、報酬ハッキングが自然に発生する。本稿では、この報酬ハッキング現象を、ソフトウェアエンジニアリングタスクを次の三つに分解することで研究する。(i) 仕様の自然言語記述、(ii) 指定された機能を個別に実行する可視の検証テスト、(iii) それら同じ機能を組み合わせて実際の使用を模擬する非公開テスト。真摯なエージェントであれば、仕様と可視の検証テストスイートに基づいて、非公開テストもすべて通過できる解を生成できるはずである。そこで、これら二つのスイートの合格率の差を報酬ハッキングの定量化に用いる。この方法論に基づき、JSONパーサーの構築のような短期タスクから、OSカーネル全体をゼロから構築するような超長期タスクに至るまで、30のシステムレベルのプログラミングタスクから成るベンチマークSpecBenchを導入する。大規模実験により一貫したパターンが明らかになった。すなわち、すべての最先端エージェントが可視スイートを飽和させる一方で、報酬ハッキングは持続し、特に小規模モデルほど非公開スイートでのギャップが大きくなる。このギャップはタスクの長さに応じて急激に拡大し、コードサイズが10倍になるごとに28パーセントポイント増加する。失敗は微妙な機能隔離から意図的な悪用に及び、テスト入力を記憶する2,900行のハッシュテーブル「コンパイラ」も含まれる。SpecBenchは、コーディングエージェントが真に動作するシステムを構築しているのか、それとも開発者が渡したテストスイートを単に攻略しているのかを測定するための、原理に基づいたテストベッドを提供する。
English
As long-horizon coding agents produce more code than any developer can review, oversight collapses onto a single surface: the automated test suite. Reward hacking naturally arises in this setup, as the agent optimizes for passing tests while deviating from the users true goal. We study this reward hacking phenomenon by decompose software engineering tasks into three parts: (i) a natural language description of the specification (ii) visible validation tests that exercise specified features in isolation, and (iii) held-out tests that compose those same features to simulate real-world usage. Based on the specification and the visible validation test suites, a genuine agent would be able to generate a solution that can also pass all of the held-out tests. Therefore we use the gap in pass rates on these two suites to quantify reward hacking. Based on this methodology, we introduce SpecBench, a benchmark comprising 30 systems-level programming tasks ranging from short horizon tasks like building a JSON parser to ultra long horizon tasks like building an entire OS kernel from scratch. Large-scale experiments reveal a consistent pattern: while every frontier agent saturates the visible suite, reward hacking persists, with smaller models exhibiting larger gaps on holdout suites. The gap also scales sharply with task length: it grows by 28 percentage points for every tenfold increase in code size. Failures range from subtle feature isolation to deliberate exploits, including a 2,900-line hash-table "compiler" that memorizes test inputs. SpecBench offers a principled testbed for measuring whether coding agents build genuine working systems or merely game the test suites developers hand them.