You only need the frontier model for one single edit (/prewalk)
- URL: https://www.facebook.com/share/1PWvyQGdji/?mibextid=wwXIfr
- Original Article: https://stencil.so/blog/prewalk
- Date Saved: 2026-07-25
- Source: Facebook (LargitData 大數軟體) / Stencil blog (Can Bölük)
- Tags: ai-engineering
- Repo: https://github.com/nicholasgasior/omp (Stencil’s open-source harness)
Summary
Can Bölük (Stencil) 提出 /prewalk 策略:讓 frontier 模型只做到第一次 edit,然後交給便宜模型繼續執行。核心洞見是給便宜模型一條「軌跡」(trajectory) 而非「計畫」(plan)。
為什麼 /plan 不如想像中好
- Opus 規劃 + Flash 執行(/plan):$3.18/task, 12.7min, 84.6% pass
- Opus 自己做完:$2.78/task, 10.1min, 84.6% pass
- /plan 反而更貴 14%,因為 executor 必須重新讀一遍 codebase(frontier 的理解活在 ~100K tokens 的閱讀中,plan 只帶走 ~2K)
/prewalk 的做法
- Frontier 模型讀 code、寫 TODO list、完成第一次 edit
- 在第一次 edit 後切換到便宜模型
- 便宜模型繼承完整 context(已驗證的方向 + TODO checklist 持續提醒)
SWE-Bench Pro 結果
GPT-5.6 Sol → Luna:
- Luna oneshot: 77%, $0.60, 570s
- /prewalk: 85%, $1.04, 300s(97% of Sol performance, 61% cost, 47% faster)
- Sol oneshot: 88%, $1.71, 372s
Opus 4.8 → Flash 3.5:
- Flash oneshot: 60%, $1.16, 360s
- /prewalk: 78%, $1.46, 402s(92% of Opus, 53% cost)
- Opus oneshot: 85%, $2.78, 606s
意外發現:減少作弊
/prewalk 大幅降低模型去 Google 搜答案的行為:
- Opus oneshot: 44% 作弊率
- Opus /plan: 72%(更高!)
- Opus /prewalk: 13%
原因:frontier 在「自信階段」(~7 turns) 就退出,還沒進入「絕望搜索」階段。executor 繼承的 context 裡沒有搜索行為,imitation machine 就不會搜索。
核心原理
本質是 prefill 的升級版。不再是 prefill 幾個 token(現已被各廠封鎖),而是 prefill 整段 turns:真實的探索過程、已成功的 edit、進行中的 TODO。便宜模型接手後進入「模仿模式」繼續完成。
已在 omp 開源,指令:—prewalk, —prewalk-into