コーディングエージェントの自己改善技術
Cline Blog は、単一のプロンプトで 17 時間にわたる再帰的自己改善を実行し、Terminal-Bench 2.1 で SOTA を達成したことで、AI エージェントが人間の介入なしに自律的に性能を向上させる実証例を示した。
AIニュース価値スコアβ
技術分析AI関連度、新規性、日本での有用性など6軸を公開検証中です。現在、掲載順には使用していません。
- AI関連度
- 100
- 情報源の信頼性
- 25
- 新規性
- 75
- 検索具体性
- 75
- 重複の少なさ
- 100
- 日本での有用性
- 25
記事は「Kimi K3」を用いたコーディングエージェントの自己改善技術について、具体的なベンチマーク結果(Terminal-Bench 2.1)とコストデータを提供しており、AI エージェントの実装知見として高い価値を持つ。ただし、対象が特定のモデル・ツールであり日本固有の事情や企業事例に言及していないため、日本の関連性は低めとなる。
キーポイント
再帰的自己改善による SOTA 達成
Cline は Kimi K3 モデルと GPT-5.6-Sol を用いた単一プロンプトの再帰的ヒルクライムにより、Terminal-Bench 2.1 で 88.8% のスコアを記録し、業界最高水準を達成した。
コストと効率性の劇的な向上
今回の実験は約 50 ドルで完了し、同様の成果を出す競合他社(Fable 5 や GPT-5.6 Terra)が費やした数百ドルの費用を大幅に下回った。
人間作業からエージェント自律へ
従来は数週間かけて人間のエンジニアが行っていた分析・仮説構築・修正プロセスが、17 時間のエージェント実行に置き換わり、ボトルネックがモデルから人間側にあったことが浮き彫りになった。
AI セーフティフィルターの課題
同様の手法を Fable 5 で試みた際、厳格な AI セーフティフィルターがモデルの能力を引き出せず、結果的に実験が中断された事例が示された。
LLM による再帰的改善の自動化
手動でのヒルクライミングの代わりに、GPT-5.6 に改善プロセスを記述させることで、複雑なエッジケースや明確な終状態を含む再帰的自己改善ブリーフを生成し、SOTA スコアを達成しました。
具体的な技術的課題の解決とスコア向上
レート制限への対応(リトライ)、ループ検出の改良、プロセス終了の誤検知防止など 5 つの実験で個別の問題を解決し、最終的にコストを下げつつベンチマークスコアを 86.5% から 88.8% に引き上げました。
汎用的なハネス改善による成果
すべての修正は特定のベンチマークへの過学習や報酬ハッキングではなく、エージェントの健全性を高める一般的なハネス(枠組み)の改善であり、再現性と実用性が確保されています。
重要な引用
We achieved a version of that at Cline.
That surpasses Fable 5 at less than a tenth of the price
At this point it's very clear to us that the bottleneck isn't models but the humans using them.
The goal was modest: let it run for a while and see what happens. We had no expectation it would perform this well, yet here we are at a SOTA score.
Every fix was a general harness improvement, nothing necessarily benchmark-specific or fake reward hacking.
Recursive self-improvement is no longer a sci-fi experiment, and we are very glad that frontier models are making it possible for something as intricate and time-consuming as AI evals.
影響分析・編集コメントを表示
影響分析
このニュースは、AI エージェントが単なるタスク実行ツールから、自律的に進化し続けるシステムへと進化する転換点を示しています。人間の介入を最小限に抑えた自己改善プロセスの実現は、開発コストの劇的な削減と、より複雑な問題解決能力への道を開くものであり、業界全体の開発パラダイムシフトを促す重要な一歩です。
編集コメント
Cline の今回の成果は、AI エージェントが人間を介さずに自己改善を行う「再帰的学習」の実用化における画期的な事例です。特に、競合他社と比較して圧倒的なコスト効率と、人間の作業時間をエージェント実行に置換した点は、今後の AI 開発プロセスの標準化に向けた重要な示唆を含んでいます。
序文
image自己再帰的改善(リカーシブ・セルフインプルーヴメント)とは、モデルが自らを反復して改良し、特異点への道を開くという考え方です。私たちは Cline において、その概念を実現するバージョンを達成しました。
ここ数日、Kimi K3 に対する反応は驚くべきものでした。この勢いを背景に、Cline を活用して性能を最適化し、ワンショットの自己再帰的改善によって Terminal-Bench 2.1 で SOTA(最良)の結果を達成しました。
コストは 49.8 ドルでスコア 88.8% を記録。これは Fable 5 の結果を上回るもので、しかも費用は約 10 分の 1 です。Fable は 552 ドル、GPT-5.6 Terra でさえも Tbench 2.1 に 400 ドルを費やしています。
imageシステムプロンプトと数回のヒントを除き、これは完全に自己完結したものでした。GPT-5.6-Sol をリーダーモデルとして採用し、単一のプロンプトで 17 時間にわたるコーディングエージェントの連続実行が開始されました。トークン使用量は合計 10 億。そのうち 4 億はコーディングエージェントが消費し、残りの 6 億は反復的な評価ランで使用されました。使用したプロンプトの詳細はこちらをご覧ください。
通常であれば、私たちが常に行っているようなヒルクライミング(勾配上昇法)を採用していたはずです。しかし今回は、モデル自身が PR を作成しました。これは「良いスコア」を「SOTA スコア」へと引き上げる、前例のないヒルクライミングの成功です。なお、Fable 5 でも同様の実験を試みましたが、AI セーフティフィルターがモデルを Opus-4.8 に降格させたため、結局は断念しました。
Cline のヒルクライミングの経験
ヒルクライム手法自体は、私たちにとって新しいものではありません。Cline ではすでに一定期間、評価とヒルクライムを繰り返してきました。今年 1 月には、Opus 4.5 を用いて Terminal-Bench のスコアを 47% から 57% に引き上げました。この成果を得るためには、モデルのトレースを読み込み仮説を立て、修正を試み、目の充血するほど失敗ログを見つめ続けるという、数週間にわたる人的作業が必要でした。
2 月にはそのプロセスをまとめたプレイブックを発表しました。これはエンジニアリングチームの 4 名が共同で取り組んだ成果です。
それから半年後、ハーンとモデルの両方が大幅に改善され、今回の実行はエンジニア 1 名の単一のプロンプトだけで完了しました。数週間にわたる人的作業が、17 時間に及ぶエージェントによる長時間実行へと変換されたのです。トレースの読み込みや仮説形成、修正テストといったすべての工程を、固定された目標と適応可能なコンテキストウィンドウを持つエージェントがカバーしています。
現時点で明確なのは、ボトルネックはモデルそのものではなく、それを使う人間にあるということです。
また、私たちのスコアは慰められるべきものではありません。Moonshot がベンダー報告した Terminal-Bench 2.1 の SOTA は 88.3% です。私たちは一般向けのハーンを用いて、最初の再帰的キャンペーンでこれに匹敵する結果を出しました。コスト計算と証明トレースの詳細はここに添付しています。
まずは、再帰的な実行がどのように行われたのかを手順を追って解説しましょう:
実際のヒルクライム
以下のすべては、単一のプロンプトから始まりました。
まずベースラインを設定しました。標準の Cline ハーンで Kimi K3 を OpenRouter 経由で実行し、Terminal-Bench 2.1 のフルランを行いました。結果は 69/89(77.5%)、コストは 79 ドルでした。
手動でヒルクライミングを行う代わりに、GPT-5.6 にプロンプト作成を依頼しました。通常の climbing の手順を説明すると、AI はそれを再帰的自己改善の指示書へと変換してくれました。最初のドラフトはすでに網羅的な内容でしたが、エッジケースへの対応を追加し、明確な終了状態を定義してブラッシュアップしています。目標は控えめなものに留めました。「しばらく実行してみて、結果を見てみよう」という程度です。これほどまでに高い性能を発揮するとは予想もしていませんでした。しかし、現在では SOTA(State of the Art)スコアを達成しています。
完全なプロンプトは、こちらの GitHub Gist で確認できます。
エージェントは異なる実験を順次実行し、無限ループに陥らないよう、自身の成果を巨大なファイルに記録しながら進めました。
Experiment 0: 最大推論能力の活用。最初の発見として、Cline が K3 の最大推論努力を正しく表現できていないことが判明しました。実際にはハッチが静かにそれを「高」レベルへ圧縮してしまっていたのです。モデルはこの抽象化を修正しました。スコア自体は変わりませんが、下流の処理をすべて可能にする重要な不具合修正です(コミット d1bc440)。
Experiment 1: HTTP 429 エラーへの再試行対応。5 つのベースライン失敗が同じ原因によるものでした。OpenRouter が 429(レート制限超過)を返すと、Cline はただ諦めてしまうのです。セッション自体は健全なまま、単一のレート制限によって終了してしまっていました。当時、Kimi K3 を提供していたプロバイダーは一つだけで、キャパシティが逼迫していたためです。これは単純な修正作業で、再試行回数を増やし、指数バックオフ(exponential backoff)を実装するだけでした。診断用スライスでは、失われていた 5 つのケースすべてがパスに転換しました(コミット cabfa9e)。
実験 2:より賢いループ検出機能
Cline のループ検出機能が、実際には背景処理を継続的にポーリングしている正当なエージェントを誤って停止させたため、2 つのタスクが失敗しました。同じコマンドを実行しても出力が変化しており、これは実際の進捗を示すものであり、無限ループではありませんでした。そこでモデル側で検出器を出力状況に連動するよう改善したところ、両方のタスクが成功に転じました(コミット dbcdba8)。
実験 3:7.6 秒の「幽霊」失敗
あるタスクは 7.6 秒で終了し、トークン数もセッション情報も残っていませんでした。モデルはこの現象の原因を「@a スタイルのトークンを含むプロンプトが、参照されていない非同期ワーカーへのファイル参照ルックアップを引き起こし、プロセスがモデル呼び出し前に正常に終了した」という極めて具体的な事象として特定しました。この 1 行の修正(ライフサイクル保証)により、結果は確定的に改善されました(コミット 289cb82)。
実験 4:タスクの自殺防止
2 つのタスクが失敗したのは、エージェントが pkill -f を実行した際、そのパターンが自身のハッシュコマンドラインと一致してしまい、タスク実行中に自分自身を停止させてしまったためです。解決策は、広範なパターンマッチによる終了ではなく、PID(プロセス ID)を追跡するツールガイドへの修正でした。これにより両方のタスクが成功に転じました(コミット 23d5970)。
その後の全体実行結果:
統合候補の評価では 89 タスク中 77 件(86.5%)を達成し、コストは 65 ドルでした。これはベースラインから 8 タスク分向上した結果です。確認用ランでは 89 タスク中 79 件(88.8%)を達成し、コストは 49.8 ドルに抑えられました。つまり、失敗が確実なリトライや自己停止によるトークンの無駄遣いが減り、スコアも向上しながらコストも削減できたのです。

効果があったのは、リトライ機能の実装、出力を考慮したループ検出の導入、インデックスのライブネス(生鮮度)に関する修正、そしてスコア向上のためのプロセス強制終了処理です。これらすべての改善は汎用的なハッチング(実行環境)の強化であり、ベンチマーク固有のものや、報酬ハッキングに繋がるような偽物の対策ではありませんでした。
一方、効果が出なかったのは「最大推論時間」に関する修正です。これは因果関係による評価を得られませんでした。なぜなら、OpenRouter はすでに K3 がサポートしている唯一の推論設定にマッピングされていたためです。また、「pkill(プロセス強制終了)のガイダンス」は広範なマッチングコマンドを減らしましたが、完全に排除するには至りませんでした。
確認用の 2 回の試行では、オーケストレーターを誤って停止させたために無効化され、破棄されました。この事象は報告され、除外された上で再実行されています。その他にも、モデルのスコアが低いことが明確にモデル自体の限界によるものだと判明した実験はいくつかありました。
人間の介入はほぼゼロでした。キャンペーン全体は単一のプロンプトから約 17 時間連続で稼働しました。私たちの役割は主に、エージェントを数時間ごとに監視し、偶発的に停止した際に「続行」ボタンを押す程度のものでした。エージェントが永遠に動作し続けるよう、クラウド上の VM で実行しました。
報酬ハッキングは設計段階で回避しています。最初の結果が非常に良いため、直感的には報酬ハッキングを疑いましたが、実際にはそうではありませんでした。検証者の編集やタスク名の検出、タイムアウトの誇張といった手法は一切使われていません。プロンプトでもこれを明示的に禁止していました。
驚いたことに、プロンプトによるガードレールは機能しました。モデル自体が自己監視を行い、帰属に関する制限を記録し、無効化された実行結果を自身のスコアから除外するほどでした。最終的なバックストップは完全に人間が行うもので、マージ前にプルリクエスト全体を手動レビューしました。
コストとトレース
今回の実験では、トークン数は約 10 億、費用は 680 ドル程度でした。これはエンジニアが数週間を費やす時間や機会損失と比較すれば、まだ非常に安価です。そのため、特定のタスクにおいては、Kimi K3 などの最先端モデルに実際に投資することが決して無駄ではないと考えています。今回の実験では、GPT-5.6-Sol がトップの結果を出しました。Fable を使用できればよかったのですが、前述の通り、その安全フィルターが AI 評価研究の実施を繰り返しブロックしてしまいました。また、Fable を利用した場合、費用はさらに大幅に増える可能性も高いです。すべてのトレース、コード、そしてコストの内訳については、こちらの GitHub Gist で確認できます。
Kimi K3 を実行するには Cline が最適な環境です。Moonshot 公式の Kimi ハーネスで得られた SOTA(最良)スコアと同等の結果を Cline でも達成できました。ClinePass を利用すれば、サブスクライバー向けに推論コストが割引になります。月額 9.99 ドルで、Kimi K3、DeepSeek、GLM、MiniMax、Qwen など厳選されたオープンウェイトモデルを利用でき、標準的な API レート制限の 2〜5 倍の速度で利用可能です。個別のプロバイダーキーも不要です。ぜひお試しください。
今後の展開
再帰的自己改善(RSI)はもはやSFの域を出た実験ではなく、AI 評価のように複雑で時間のかかる作業を可能にする最先端モデルが登場したことを心から歓迎しています。現在、Cline では新モデルリリース時の標準プロセスとして、まず即座にベースラインを実行し、その後 RSI スタイルのプロンプトを用いて各モデルの性能を最大限引き出す運用を開始しました。皆様に、より長時間実行されるタスクを通じてモデルの限界に挑戦していただくよう推奨します。
原文を表示
Preface
imageRecursive self-improvement is the idea that models can iterate and improve on themselves to unlock singularity. We have achieved a version of that at Cline.
In the past few days, the response to Kimi K3 has been incredible. Building on that momentum, we optimized its performance with Cline and achieved SOTA results on Terminal-Bench 2.1 using one-shot recursive self-improvement.
We got an 88.8% score with the run costing $49.8. That surpasses Fable 5 at less than a tenth of the price: Fable spent $552, and even GPT 5.6 Terra spent $400 on Tbench2.1.
imageAside from the system prompt + a few nudges, this was entirely self-contained. A single prompt kicked off 17 hours of continuous coding agent run with GPT-5.6-Sol as the leader model. One billion tokens total: 400 million spent by the coding agent, 600 million by repeated eval runs. See the prompt used here.
We could have done the normal hill climbing we always do. Instead, the model made a PR on its own, a first-of-its-kind hill climb that turned a good score into a SOTA score. Note: We tried this experiment with Fable 5 too but its AI safety filter kept downgrading the model to Opus-4.8, and we simply gave up.
Cline’s hill climbing experiences
Hill climbing isn't new to us as we've been doing evals and hill climbing at Cline for a while now. Back in January, we took Opus 4.5 from 47% to 57% on Terminal-Bench. That took a couple weeks of human work reading model traces, forming hypotheses, testing fixes, staring at failure logs until your eyes bled. In February we published the playbook. It was a joint effort from 4 people on our engineering team.
Six months later, the harness and the models have both improved so much that this run was done by a single prompt from one engineer. Weeks of human work got converted into 17 hours of long running agent work. The trace-reading, the hypothesis-forming, the fix-testing all of it, covered by agents with a fixed goal and adaptable context window. At this point it's very clear to us that the bottleneck isn't models but the humans using them.
And our score isn't a consolation prize as Moonshot's own vendor-reported SOTA on Terminal-Bench 2.1 is 88.3%. We matched it with a general-purpose harness, on the first recursive campaign. The cost math and proof traces are attached here.
First, we'll walk you through the step-by-step procedure of how the recursive run worked:
The actual hill climb
Everything below ran off one prompt.
We started with a baseline. One full Terminal-Bench 2.1 run on stock Cline harness, Kimi K3 through OpenRouter and it costed 69/89 (77.5%) for $79.
Instead of hill climbing by hand, we asked GPT-5.6 to write the prompt for us. We described how we normally climb this hill, and it turned that into a recursive self-improvement brief. The first draft was already comprehensive. We tightened it to cover the edge cases and pinned down a well-defined end state. The goal was modest: let it run for a while and see what happens. We had no expectation it would perform this well, yet here we are at a SOTA score. You can read the full prompt in this github gist.
The agent worked in different experiments and tried them one by one, maintaining a record of what it had accomplished in a massive file so that it wouldn't run in circles:
Experiment 0: max reasoning. First finding: Cline didn’t represent K3's max reasoning effort as the harness silently collapsed it to high. The model fixed the abstraction. Not a score change, but a correctness fix that unblocked everything downstream. Commit d1bc440.
Experiment 1: retry the 429s. Five baseline failures were the same story: OpenRouter returned a 429 and Cline just gave up. Healthy sessions, killed by a single rate limit, since at the time there was a single provider serving Kimi K3 and capacity was tight. This was a boring fix of raising the number of retries with exponential backoff. On the diagnostic slice, all five losses flipped to passes. Commit cabfa9e.
Experiment 2: smarter loop detection. Two tasks died because Cline's loop detector killed agents that were legitimately polling long-running background work. Same command, but the output was changing so that's actual progress, not a loop. The model made the detector output-aware. Both tasks flipped. Commit dbcdba8.
Experiment 3: the 7.6-second ghost failure. One task exited in 7.6 seconds with zero tokens and no session. The model reduced it to a wild root cause: any prompt containing @a-style tokens triggered a file-mention lookup on an unreferenced async worker, and the process legally exited before the model was ever called. This was a one-line liveness fix leading to a deterministic flip. Commit 289cb82.
Experiment 4: stopping task suicides. Two tasks failed because the agent ran pkill -f with a pattern that matched its own harness command line, so it terminated itself mid-task. The fix: tool guidance to track PIDs instead of broad pattern-kills. Both flipped. Commit 23d5970.
Then the full runs: The combined candidate scored 77/89 (86.5%) at $65 now up 8 tasks from baseline. The confirmation run landed 79/89 (88.8%) at $49.8. So we had a higher score and lower cost, with fewer wasted tokens on doomed retries and self-kills.
imageWhat worked: retries, output-aware loop detection, the indexing liveness fix, process-kill work to improve the score. Every fix was a general harness improvement, nothing necessarily benchmark-specific or fake reward hacking.
What didn't work: the max-reasoning fix never got causal credit (OpenRouter was already mapping to K3's only supported effort). The pkill guidance reduced but didn't eliminate broad-match commands. Two confirmation runs got invalidated and thrown away when we accidentally terminated the orchestrator: reported, excluded, rerun. There were other experiments where it was clear that the model's low score was a genuine model limitation.
Human intervention was nearly zero. The whole campaign ran ~17 hours off a single prompt. Our job was mostly babysitting the agent every couple of hours and pressing continue when the agent stopped by accident. We ran this on a cloud VM to keep the agent running forever.
Reward hacking was avoided by design: The first result was good enough that our immediate suspicion was reward hacking, It wasn't. The prompt banned it explicitly as there were no verifier edits, task-name detection or timeout inflation.
To our surprise, the guardrails from the prompt held. The model even policed itself, recording attribution guards and excluding invalidated runs from its own scores. The final backstop is fully human: we reviewed the full PR before merging.
Costs and traces
Overall we spent roughly a billion tokens and $680 for this experiment. This is still a lot cheaper than weeks of an engineer's time and the opportunity cost. This is why we still think spending real money on frontier models like Kimi K3 is an investment that's absolutely worth it for certain kinds of tasks. In this case the leader was GPT-5.6-Sol. We wish we could have used Fable, but as mentioned above, its safety filter repeatedly blocked us from doing AI evals research. It's also likely we would have spent a lot more money using Fable. You can view all the traces, code and the entire cost breakdown on this github gist.
Cline is the best harness to run Kimi K3. We matched the SOTA score from Moonshot's official Kimi harness. With ClinePass you get subsidized inference on it: $9.99/month for curated open-weight models (Kimi K3, DeepSeek, GLM, MiniMax, Qwen) with 2–5x standard API rate limits and no separate provider keys. Give it a go.
What happens next
Recursive self-improvement is no longer a sci-fi experiment, and we are very glad that frontier models are making it possible for something as intricate and time-consuming as AI evals. We are now making it a standard process for new model releases at Cline: an immediate baseline run, then RSI-styled prompts to get the best out of every model. We encourage everyone to push the models with more and more long-running tasks.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み