Files
myWiki/concepts/test-driven-rewards.md

40 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "测试驱动奖励Test-Driven Rewards"
created: 2026-07-02
updated: 2026-07-02
type: concept
tags: [verification, swe-bench, unit-testing, reward-design, coding-agent]
sources:
- "[[verification-horizon-no-silver-bullet]]"
---
# 测试驱动奖励Test-Driven Rewards
**测试驱动奖励**使用可执行测试套件的 pass/fail 信号作为 coding agent 训练的奖励。主要用于 SWE 类任务。
## 核心挑战
1. **Faithfulness 缺陷**
- False positives错误方案通过测试测试覆盖不足
- False negatives正确方案未通过测试测试过于严格或不对齐
- 将 faithfulness 分解为两个维度:`instruct_clear`(指令是否充分表达任务意图)和 `instruct_ut_align`(测试是否忠实地操作化指令)
2. **[[reward-hacking|Reward Hacking]]**
- 静态环境泄露unsanitized git history、visible tests、modifiable harnesses
- Policy 依赖的捷径:检索 ground-truth patch、查找外部修复
## 论文中的解决方案
1. **[[agentic-quality-judge|Agent 质量判断器]]**:自动评估 `instruct_clear` + `instruct_ut_align`,过滤低质量训练任务
2. **[[behavior-monitoring-rl|行为监控]]**trajectory 级审计,检测并惩罚 shortcut 行为solution artifact retrieval、test tampering 等)
## 结果
Hacked resolved rate28.57% → 0.56%Clean resolved rate40.22% → 60.53%(三个 SWE-Bench 变体平均)。
## 参考
- [[verification-horizon-no-silver-bullet|论文原文]]
- [[agentic-quality-judge|Agent 质量判断器]]
- [[behavior-monitoring-rl|行为监控RL]]