AI 智能体卡在代码上,这篇把模型和代码一起调
训练 AI 智能体时,大家默认只调模型参数,把控制它的代码(harness)当死工具。这篇发现瓶颈常常在代码:模型变了,原来好用的代码就废了;代码改了,模型能力又没被用上。他们提出一个简单办法:交替调——先固定代码调模型,再固定模型搜更好的代码,来回几轮。在搜索问答、数学推理、国际象棋三个任务上,比只调一边强 4 到 24 个百分点。它不是你明天能用上的,但提示了一个方向:AI 系统的天花板,可能不在模型本身,而在你给它搭的脚手架。
📄 原文摘要(英文)
Agent performance depends jointly on the model parameters and the executable harness code that manages context and control flow. Optimizing either component in isolation can leave the system bottlenecked by its frozen counterpart: weight updates can change which harness is effective, while harness updates can change which model capabilities are exposed. Existing joint-adaptation methods optimize weights and textual prompts but leave the broader harness fixed. We propose Weight-Harness Alternating LEarning (WHALE), a simple recipe that alternates two phases: updating the model under the current harness, then searching for a better harness under the updated model. We instantiate these two phases with online rejection-sampling fine-tuning and Meta-Harness, respectively. When to switch is a key design choice: to separate real improvements from noise without over-optimizing against a changing counterpart, WHALE uses either fixed phase durations or an adaptive patience rule over training signals. Using Qwen3.5-2B/4B agents across three domains (search question answering, mathematical reasoning, and chess puzzles), WHALE outperforms weight-only, harness-only, and Fast-Slow Training by 4.15-24.38 percentage points in best mean@8 accuracy. Either component can be the bottleneck: harness search matches peak weight-only accuracy with far fewer rollouts in SearchQA, but improves math accuracy only after a weight update. Small interleaved updates also outperform stagewise weight-then-harness optimization in accuracy and rollout cost. The code is available at https://github.com/krafton-ai/WHALE.