面向小语言模型智能体的Harness感知蒸馏
研究论文 · 2026/10/07
语言模型智能体在部署时依赖一个“harness”(管理上下文、工具和反馈的软件)。当此类智能体被蒸馏为更小的模型时,harness保持不变,因此学生模型主要需要教师模型特有的、harness无法提供的能力,例如根据harness信息正确行动。然而,标准蒸馏模仿教师的完整输出,并将harness视为输入的一部分。我们提出Harness-Aware Distillation (HAD),将蒸馏重点放在教师模型超越harness所增加的部分。HAD在在线策略蒸馏的基础上补充了两个组件:一个动作偏好,对比同一教师模型在有和没有harness信息时的动作,在学生模型自身推理之后进行评分;以及一个有效性检查,丢弃那些偏好动作与harness记录相矛盾的偏好对。我们表明,这种对比为学生模型提供了仅模仿教师无法提供的信息,且HAD不需要任务奖励、成功标签或未来信息。在多个长时程智能体基准和模型上,HAD在相同固定harness下优于在线策略蒸馏基线。我们的分析表明,与基线相比,HAD进入无效循环的次数更少,从错误中恢复的频率更高,并表明它自适应地将可学习的反馈保留在权重中,同时从harness读取状态信息。
该研究针对智能体蒸馏中harness固定不变的实际场景,提出了无需额外监督信号的HAD方法,在多个长时程任务上验证了其有效性,并提供了对智能体行为改善的深入分析,对小型语言模型智能体的部署具有实用价值。
Language model agents are deployed with a harness, the software around the model that manages its context, tools, and feedback. When such an agent is distilled into a smaller one, the harness stays in place, so the student mainly needs the teacher-specific abilities that the harness cannot provide, such as acting correctly on harness information. Standard distillation, however, imitates the teacher's full outputs and treats the harness as part of the input. We propose Harness-Aware Distillation (HAD), which focuses distillation on what the teacher adds beyond the harness. HAD complements on-policy distillation with two components: an action preference that contrasts the same teacher's actions with and without the harness information, scored after the student's own reasoning, and a validity check that drops preference pairs whose preferred action contradicts the harness records. We show that the contrast gives the student information that imitating the teacher alone cannot provide, and HAD needs no task rewards, success labels, or future information. Across multiple long-horizon agent benchmarks and models, HAD outperforms on-policy distillation baselines with the same fixed harness. Our analysis shows that HAD enters fewer unproductive loops and recovers from errors more often than the baselines, and suggests that it adaptively keeps learnable feedback in its weights while reading state information from the harness.