﻿---
lang: zh-TW
title: "不用梯度，把一條規則寫進權重：WeightCode 的權重程式原理與局限"
description: "一個只在單獨出現時見過 jump 的 SCAN 模型，不會執行 jump twice。WeightCode 讓 LLM 寫一段 143 行的 NumPy 程式，只改 257 個權重就讓它學會。順著這個現象往下追：程式具體改了什麼；沒有梯度時程式怎麼寫、怎麼選；為什麼要保留程式而不是權重差；寫進去的計算能不能看懂；和微調比強在哪；以及它還有哪些問題和局限。"
pubDate: 2026-11-22
tags: ["AI", "神经网络", "机器学习", "源码分析"]
clc: "TP183"
hero: "./hero.svg"
refs:
  - id: wc-paper
    title: "WeightCode: Installing New Capabilities into Neural Networks via Weight-Space Programming"
    url: https://arxiv.org/abs/2611.25476
    author: "Bo Li, Taoyong Cui, Bob Zhang, Mengran Li, Chengyang Zhang, Yang Zhang, Pheng Ann Heng, Wanli Ouyang, Zhenfei Yin, Yingcheng Wu, Ling Yang"
    site: arXiv
    date: 2026-11-19
    note: "arXiv:2611.25476；SCAN 與 BabyAI（Fig. 2a）、ImageNet 對照（Fig. 2b、Tab. 8）、雜訊閘的機制與消融（Fig. 3、Tab. 10）、重跑與複製（Fig. 4、Tab. 11）、連續安裝（Fig. 5）、每場會話（Tab. 7）、協議與成本（A.1）、超出既有計算的嘗試（A.10）、用有限差分的會話（A.11）"
  - id: wc-readme
    title: "WeightCode README"
    url: https://github.com/Gen-Verse/WeightCode/blob/main/README.md
    site: GitHub · Gen-Verse/WeightCode
    note: "本文讀的是 2026-11-21 的提交 `297c24d`；W′ = p(W, I) 的五個步驟、agent skill 的預設上限與沙箱"
  - id: wc-program
    title: "SCAN 會話保留的權重程式 centroid_meanrow_floor.py"
    url: https://huggingface.co/datasets/Boom5426/WeightCode/blob/4c27541829737b8a4c438634d12792043409706d/records/sessions/s9be29c2c302e4daa/final/centroid_meanrow_floor.py
    site: Hugging Face · Boom5426/WeightCode
    note: "sha256 `b003c6b9…`；`HYPOTHESIS`、`PREDICTED_EFFECT` 與 `update(student, experience)`，執行輸出 b = 8.283"
  - id: wc-selection
    title: "SCAN 會話的選擇記錄 selection.json"
    url: https://huggingface.co/datasets/Boom5426/WeightCode/blob/4c27541829737b8a4c438634d12792043409706d/records/sessions/s9be29c2c302e4daa/final/selection.json
    site: Hugging Face · Boom5426/WeightCode
    note: "三個檢查過的候選、保留規則 joint-retain-v1、編輯者的宣告與最終保留不一致"
  - id: wc-tools
    title: "tools.py：編輯者能用的工具"
    url: https://github.com/Gen-Verse/WeightCode/blob/main/weightcode/harness/tools.py
    site: GitHub · Gen-Verse/WeightCode
    note: "`python`、`patch_check`、`status`、`declare_final` 的描述；宣告只被記錄，保留的是分數最高的檢查過的程式"
  - id: wc-limits
    title: "limits.py：權重改動的上限"
    url: https://github.com/Gen-Verse/WeightCode/blob/main/weightcode/patch/limits.py
    site: GitHub · Gen-Verse/WeightCode
    note: "`max_edit_frac` 預設 0.05，`max_rel_frob` 預設 0.5，一維張量不受相對範數限制"
  - id: wc-retention
    title: "retention.py：保留規則"
    url: https://github.com/Gen-Verse/WeightCode/blob/main/weightcode/harness/retention.py
    site: GitHub · Gen-Verse/WeightCode
    note: "`s_old_floor = -round(frac * n_old)`，在 score_old 不低於下限的候選裡取 score_new + score_old 最大者"
  - id: wc-sandbox
    title: "sandbox/program.py：在 bubblewrap 裡跑一次程式"
    url: https://github.com/Gen-Verse/WeightCode/blob/main/weightcode/sandbox/program.py
    site: GitHub · Gen-Verse/WeightCode
    note: "所有命名空間隔離、無網路、300 秒牆鐘限制；`UnisolatedRunner` 只用於 sha256 已核對的已發表程式"
  - id: scan
    title: "Generalization without Systematicity: On the Compositional Skills of Sequence-to-Sequence Recurrent Networks"
    url: https://github.com/brendenlake/SCAN
    author: "Brenden Lake, Marco Baroni"
    site: ICML
    date: "2018"
    note: "SCAN 資料集；add-primitive（jump）切分"
  - id: takehi
    title: "Sparks of Weight-Space Programming: LLMs can natively read & write neural network weights"
    url: https://rikiyat.github.io/blog/weight-space-programming/
    author: "Rikiya Takehi, Jayden Teoh, Alex Zhang, Omar Khattab"
    date: 2026-11-02
    further: true
---

SCAN 是一個經典的組合泛化測試：把「jump twice」這樣的英文命令翻成動作序列「JUMP JUMP」[^scan]。它的 add-primitive 切分故意刁難模型：訓練時 walk、look、run 都和 twice、around、after 這些詞組合過，jump 卻只單獨出現過。結果是模型學會了「walk twice → WALK WALK」，遇到「jump twice」卻一條都答不對，在含 jump 的新命令上精確匹配是 0%。

常規的修法是補資料、再訓練。WeightCode 給出的是另一條路[^wc-paper]：讓一個凍結的 LLM 讀這個網路的權重，寫一段程式直接改權重。它在 SCAN 上保留下來的程式只有 143 行 NumPy，改動 803,975 個權重裡的 257 個，含 jump 的新命令從 0.0% 升到 99.8%，舊命令維持 99.6% 不變；作為對照，用文法生成的命令重新訓練能到 99.6%，但要改 152,718 個權重[^wc-readme]。

這就帶出幾個問題：

1. 這 257 個權重改了什麼？一條規則是怎麼變成權重的？
2. 程式是 LLM 寫的。沒有梯度、也沒有標準答案可以反向傳播，憑什麼判斷一段程式寫得對？
3. 論文反覆強調保留的是「程式」而不是「權重差」。這兩者有什麼不同？
4. 寫進網路的計算，人能不能看懂、驗證？
5. 和微調相比，它強在哪？又有哪些問題和局限？

本文就順著這五個問題一層一層往下讀。讀的是 2026-11-21 的提交 `297c24d` 和隨倉庫附帶的論文。我們沒有重跑論文的實驗，文中的分數引自論文和 README；SCAN 那段程式和它的會話記錄是從作者公開的資料集下載下來逐行讀過的，圖裡的數字都來自這些記錄。

## 一、一條規則如何變成權重

### 現象：模型會組合，卻不會用新詞組合

先看模型卡在哪裡。這是一個 4 層、寬 128 的 Transformer，輸入是命令的詞，輸出是每個位置的動作[^wc-paper]。它已經學會了「X twice」「X around left」這些組合怎麼算，只是 X 必須是 walk、look、run 之一。問題出在 jump 本身：程式裡 LLM 寫下的假設是，jump 的嵌入向量長度更大，而且大多落在另外三個詞從來不用的方向上，所以網路的每一層都把含 jump 的命令當成沒見過的結構處理，例如把「jump twice」翻成「RUN RUN RUN」[^wc-program]。

### 第一次嘗試及其不足

最直覺的辦法是拿含 jump 的例子微調。論文給了兩個對照：只用任務提供的那幾行資料做微調，在保住舊命令的前提下淨增益最多 +1.21 分；用文法生成大量命令重新訓練，能到 99.6%，但改動了 152,718 個權重，約為程式的 594 倍[^wc-paper]。前者資料太少，後者等於重新學一遍。

### 解決：讓 jump 借用 walk、look、run 的位置

保留下來的程式只做了三處修改[^wc-program]：

<figure class="dd dd-figure">
<div class="dd-scroll">
<svg class="dd-svg" viewBox="0 0 800 420" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="wc-scan-title wc-scan-desc">
<title id="wc-scan-title">SCAN 程式改動的 257 個權重</title>
<desc id="wc-scan-desc">左邊是嵌入表：jump 那一行被改成 walk、look、run 三行的中心。中間 4 層、寬 128 的 Transformer 完全不動，照常計算組合。右邊是輸出層：I_JUMP 那一行改成 I_WALK、I_LOOK、I_RUN 三行的平均，偏置設為三者平均加上 b，b 等於 0.9 乘以舊命令上最小的身份邊際 9.204，即 8.283。下方是留出測試集上的結果：含 jump 的 2,568 條新命令從 0.0% 升到 99.8%，1,000 條舊命令維持 99.6%，改動 803,975 個權重中的 257 個。</desc>
<defs>
<marker id="wc-scan-arrow" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto"><path class="dd-head" d="M1 1 L7 4 L1 7"/></marker>
</defs>
<rect class="dd-frame" width="800" height="420" rx="10"/>
<rect class="dd-zone" x="16" y="16" width="236" height="276" rx="8"/>
<text class="t-zone" x="36" y="44">嵌入表 · 輸入的詞</text>
<rect class="dd-zone" x="268" y="16" width="228" height="276" rx="8"/>
<text class="t-zone" x="288" y="44">Transformer · 凍結</text>
<rect class="dd-zone" x="512" y="16" width="272" height="276" rx="8"/>
<text class="t-zone" x="532" y="44">輸出層 · 動作</text>
<rect class="dd-zone" x="16" y="308" width="768" height="96" rx="8"/>
<path class="dd-edge" d="M236 132 H284" marker-end="url(#wc-scan-arrow)"/>
<path class="dd-edge" d="M480 132 H528" marker-end="url(#wc-scan-arrow)"/>
<rect class="dd-card" x="32" y="64" width="204" height="136" rx="6"/>
<path class="dd-card-head" d="M38 64 H230 Q236 64 236 70 V96 H32 V70 Q32 64 38 64 Z"/>
<text class="t-name" x="44" y="85">embedding</text>
<text class="t-note" x="224" y="85" text-anchor="end">每行 128 維</text>
<text class="t-mono" x="44" y="113">walk</text>
<text class="t-note" x="224" y="113" text-anchor="end">組合過</text>
<line class="dd-hair" x1="32" y1="122" x2="236" y2="122"/>
<text class="t-mono" x="44" y="139">look</text>
<text class="t-note" x="224" y="139" text-anchor="end">組合過</text>
<line class="dd-hair" x1="32" y1="148" x2="236" y2="148"/>
<text class="t-mono" x="44" y="165">run</text>
<text class="t-note" x="224" y="165" text-anchor="end">組合過</text>
<line class="dd-hair" x1="32" y1="174" x2="236" y2="174"/>
<text class="t-mono t-acc" x="44" y="191">jump</text>
<text class="t-val t-acc" x="224" y="191" text-anchor="end">← 三者的中心</text>
<text class="t-say" x="36" y="232">jump 只單獨出現過，</text>
<text class="t-say" x="36" y="252">向量離另外三個很遠。</text>
<text class="t-note" x="36" y="276">改 1 行，128 個數</text>
<rect class="dd-card" x="284" y="64" width="196" height="136" rx="6"/>
<path class="dd-card-head" d="M290 64 H474 Q480 64 480 70 V96 H284 V70 Q284 64 290 64 Z"/>
<text class="t-name" x="296" y="85">4 層 · 寬 128</text>
<text class="t-name" x="296" y="113">注意力</text>
<text class="t-note" x="468" y="113" text-anchor="end">不動</text>
<line class="dd-hair" x1="284" y1="122" x2="480" y2="122"/>
<text class="t-name" x="296" y="139">MLP</text>
<text class="t-note" x="468" y="139" text-anchor="end">不動</text>
<line class="dd-hair" x1="284" y1="148" x2="480" y2="148"/>
<text class="t-mono" x="296" y="165">twice</text>
<text class="t-note" x="468" y="165" text-anchor="end">已學會</text>
<line class="dd-hair" x1="284" y1="174" x2="480" y2="174"/>
<text class="t-mono" x="296" y="191">around · after</text>
<text class="t-note" x="468" y="191" text-anchor="end">已學會</text>
<text class="t-say" x="288" y="232">walk twice 怎麼算，</text>
<text class="t-say" x="288" y="252">jump twice 就怎麼算。</text>
<rect class="dd-card" x="528" y="64" width="240" height="136" rx="6"/>
<path class="dd-card-head" d="M534 64 H762 Q768 64 768 70 V96 H528 V70 Q528 64 534 64 Z"/>
<text class="t-name" x="540" y="85">head</text>
<text class="t-note" x="756" y="85" text-anchor="end">每個動作一行</text>
<text class="t-mono" x="540" y="113">I_WALK</text>
<line class="dd-hair" x1="528" y1="122" x2="768" y2="122"/>
<text class="t-mono" x="540" y="139">I_LOOK</text>
<line class="dd-hair" x1="528" y1="148" x2="768" y2="148"/>
<text class="t-mono" x="540" y="165">I_RUN</text>
<line class="dd-hair" x1="528" y1="174" x2="768" y2="174"/>
<text class="t-mono t-acc" x="540" y="191">I_JUMP</text>
<text class="t-val t-acc" x="756" y="191" text-anchor="end">← 三行的平均</text>
<text class="t-note" x="532" y="232">偏置 = 三者的平均 + b</text>
<text class="t-mono" x="532" y="256">b = 0.9 × 9.204 = 8.283</text>
<text class="t-note" x="532" y="280">改 1 行加 1 個偏置，129 個數</text>
<text class="t-zone" x="36" y="336">留出的測試命令</text>
<text class="t-mono" x="36" y="376"><tspan class="t-acc">jump</tspan> twice → JUMP JUMP</text>
<text class="t-name" x="320" y="336">含 jump 的新命令 2,568 條</text>
<text class="t-mono t-acc" x="764" y="336" text-anchor="end">0.0% → 99.8%</text>
<text class="t-name" x="320" y="362">舊命令 1,000 條</text>
<text class="t-mono" x="764" y="362" text-anchor="end">99.6% → 99.6%</text>
<text class="t-name" x="320" y="388">改動的權重</text>
<text class="t-mono" x="764" y="388" text-anchor="end">257 / 803,975</text>
</svg>
</div>
<figcaption>圖 1 · 程式沒有教網路新的組合規則，只是把 jump 搬到 walk、look、run 中間，讓網路已有的組合計算順帶算出它</figcaption>
</figure>

**第一處，嵌入。** jump 那一行被替換成 walk、look、run 三行的中心。jump 從此變成一個「沒有身份」的原語：網路處理「jump twice」時走的是處理「walk twice」那條路，命令結構算得完全一樣。

**第二處，輸出行。** 既然 jump 沒有身份，到了該輸出它的位置，W、L、R 三個動作的分數會差不多高；而在真正的 walk、look、run 位置，贏家會明顯高出三者的平均。程式因此把 I_JUMP 這一行設成三行的平均，讓它在每個位置都拿到三者的平均分。

**第三處，偏置。** 最後在 I_JUMP 的偏置上加一個常數 b，讓它只在「三者分數差不多」的位置勝出。b 怎麼定？程式枚舉了文法能生成的每一條不含 jump 的命令，用原網路算出每個位置贏家高出平均的邊際，取最小值 9.204，再乘 0.9，得到 8.283[^wc-program]。這個值低於所有舊命令的邊際，所以舊命令一條都不會被改成 I_JUMP。

三處加起來，就是嵌入 128 個數、輸出行 128 個數、偏置 1 個數，共 257 個。要注意的是，b 的計算用到了規則本身：程式按 SCAN 的文法列出了所有命令。這正是「規則」作為任務知識的用法。

**一段程式能寫出這麼精準的修改，前提是有人知道該往哪裡改。這個「人」是 LLM。它是怎麼工作的？**

## 二、沒有梯度時程式怎麼寫、怎麼選

### 一次編輯會話

WeightCode 把程式的產生拆成一次「編輯會話」。論文用的編輯者是 Claude Opus 5.5，最高推理強度[^wc-paper]。它能用的工具只有四個：在沙箱裡執行 Python 的 `python`，提交程式接受檢查的 `patch_check`，查看剩餘預算的 `status`，以及宣告自己想保留哪個程式的 `declare_final`[^wc-tools]。整個流程是這樣：

<figure class="dd dd-figure">
<div class="dd-scroll">
<svg class="dd-svg" viewBox="0 0 800 440" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="wc-loop-title wc-loop-desc">
<title id="wc-loop-title">一次編輯會話：寫程式、跑程式、打分、選擇</title>
<desc id="wc-loop-desc">左邊是凍結的編輯者 Claude Opus 5.5，在最多 150 個儲存格、90 到 120 分鐘內讀權重、前向程式碼和任務知識，寫出候選程式。中間是只有 NumPy、沒有網路的沙箱，程式匯出 update(student, experience)，在 300 秒內回傳張量名到權重差的字典，允許統計、SVD、PCA 和閉式計算，禁止梯度和有限差分。右邊是 harness：patch_check 最多 8 次，檢查改動量不超過 20% 的權重、每個張量的變化不超過其 Frobenius 範數的一半，然後在檢查集上算出 S_new 和 S_old；保留規則是在 S_old 不低於負 20 的候選裡取 S_new 加 S_old 最大者。兩個計數回傳給編輯者。下方是 CIFAR-10 每個條件的資料切分：證據 2,000 張、檢查 4,000 張、選擇 4,000 張和只讀一次的測試集。</desc>
<defs>
<marker id="wc-loop-arrow" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto"><path class="dd-head" d="M1 1 L7 4 L1 7"/></marker>
<marker id="wc-loop-arrow-acc" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto"><path class="dd-head-acc" d="M1 1 L7 4 L1 7"/></marker>
</defs>
<rect class="dd-frame" width="800" height="440" rx="10"/>
<rect class="dd-zone" x="16" y="16" width="232" height="300" rx="8"/>
<text class="t-zone" x="36" y="44">編輯者 · 凍結的 LLM</text>
<rect class="dd-zone" x="264" y="16" width="248" height="300" rx="8"/>
<text class="t-zone" x="284" y="44">沙箱 · 只有 NumPy</text>
<rect class="dd-zone" x="528" y="16" width="256" height="300" rx="8"/>
<text class="t-zone" x="548" y="44">harness · 打分與選擇</text>
<rect class="dd-zone" x="16" y="332" width="768" height="92" rx="8"/>
<path class="dd-edge" d="M232 110 H280" marker-end="url(#wc-loop-arrow)"/>
<path class="dd-edge" d="M496 110 H544" marker-end="url(#wc-loop-arrow)"/>
<path class="dd-edge" d="M544 176 H528 Q520 176 520 184 V292 Q520 300 512 300 H224 Q216 300 216 292 V200" marker-end="url(#wc-loop-arrow)"/>
<path class="dd-edge-acc" d="M656 200 V216" marker-end="url(#wc-loop-arrow-acc)"/>
<rect class="dd-card" x="32" y="64" width="200" height="136" rx="6"/>
<path class="dd-card-head" d="M38 64 H226 Q232 64 232 70 V96 H32 V70 Q32 64 38 64 Z"/>
<text class="t-name" x="44" y="85">Claude Opus 5.5</text>
<text class="t-name" x="44" y="113">讀</text>
<text class="t-val" x="220" y="113" text-anchor="end">W、forward、I</text>
<line class="dd-hair" x1="32" y1="122" x2="232" y2="122"/>
<text class="t-name" x="44" y="139">寫</text>
<text class="t-val" x="220" y="139" text-anchor="end">候選程式 .py</text>
<line class="dd-hair" x1="32" y1="148" x2="232" y2="148"/>
<text class="t-name" x="44" y="165">儲存格</text>
<text class="t-val" x="220" y="165" text-anchor="end">≤ 150</text>
<line class="dd-hair" x1="32" y1="174" x2="232" y2="174"/>
<text class="t-name" x="44" y="191">時間</text>
<text class="t-val" x="220" y="191" text-anchor="end">90–120 分鐘</text>
<text class="t-say" x="36" y="236">它的 declare_final</text>
<text class="t-say" x="36" y="256">只被記錄，不決定結果。</text>
<rect class="dd-card" x="280" y="64" width="216" height="136" rx="6"/>
<path class="dd-card-head" d="M286 64 H490 Q496 64 496 70 V96 H280 V70 Q280 64 286 64 Z"/>
<text class="t-mono" x="292" y="85">update(student, exp)</text>
<text class="t-name" x="292" y="113">回傳</text>
<text class="t-val" x="484" y="113" text-anchor="end">{張量名: delta}</text>
<line class="dd-hair" x1="280" y1="122" x2="496" y2="122"/>
<text class="t-name" x="292" y="139">限時</text>
<text class="t-val" x="484" y="139" text-anchor="end">300 秒，無網路</text>
<line class="dd-hair" x1="280" y1="148" x2="496" y2="148"/>
<text class="t-name" x="292" y="165">允許</text>
<text class="t-val" x="484" y="165" text-anchor="end">統計、SVD、PCA</text>
<line class="dd-hair" x1="280" y1="174" x2="496" y2="174"/>
<text class="t-name" x="292" y="191">禁止</text>
<text class="t-val" x="484" y="191" text-anchor="end">梯度、有限差分</text>
<text class="t-say" x="284" y="236">程式在新沙箱裡跑一次，</text>
<text class="t-say" x="284" y="256">交出的只有權重差。</text>
<rect class="dd-card" x="544" y="64" width="224" height="136" rx="6"/>
<path class="dd-card-head" d="M550 64 H762 Q768 64 768 70 V96 H544 V70 Q544 64 550 64 Z"/>
<text class="t-mono" x="556" y="85">patch_check</text>
<text class="t-note" x="756" y="85" text-anchor="end">最多 8 次</text>
<text class="t-name" x="556" y="113">改動量</text>
<text class="t-val" x="756" y="113" text-anchor="end">≤ 20% 權重</text>
<line class="dd-hair" x1="544" y1="122" x2="768" y2="122"/>
<text class="t-name" x="556" y="139">每個張量</text>
<text class="t-val" x="756" y="139" text-anchor="end">≤ 0.5 ‖W‖F</text>
<line class="dd-hair" x1="544" y1="148" x2="768" y2="148"/>
<text class="t-mono" x="556" y="165">S_new</text>
<text class="t-val" x="756" y="165" text-anchor="end">新條件：修好 − 弄壞</text>
<line class="dd-hair" x1="544" y1="174" x2="768" y2="174"/>
<text class="t-mono" x="556" y="191">S_old</text>
<text class="t-val" x="756" y="191" text-anchor="end">舊輸入：修好 − 弄壞</text>
<rect class="dd-card" x="544" y="216" width="224" height="76" rx="6"/>
<text class="t-name t-acc" x="556" y="238">保留規則</text>
<text class="t-mono" x="556" y="260">S_old ≥ −20（0.5%）</text>
<text class="t-mono" x="556" y="282">取 S_new + S_old 最大</text>
<text class="t-note" x="236" y="292">兩個計數回傳給編輯者</text>
<text class="t-zone" x="36" y="368">資料切分</text>
<text class="t-note" x="36" y="392">CIFAR-10 每個條件</text>
<rect class="dd-card" x="240" y="348" width="128" height="60" rx="6"/>
<text class="t-name" x="252" y="372">證據 2,000 張</text>
<text class="t-note" x="252" y="394">I 從這裡抽</text>
<rect class="dd-card" x="380" y="348" width="128" height="60" rx="6"/>
<text class="t-name" x="392" y="372">檢查 4,000 張</text>
<text class="t-note" x="392" y="394">patch_check 用</text>
<rect class="dd-card" x="520" y="348" width="128" height="60" rx="6"/>
<text class="t-name" x="532" y="372">選擇 4,000 張</text>
<text class="t-note" x="532" y="394">會話碰不到</text>
<rect class="dd-card" x="660" y="348" width="108" height="60" rx="6"/>
<text class="t-name" x="672" y="372">測試集</text>
<text class="t-note" x="672" y="394">最後讀一次</text>
</svg>
</div>
<figcaption>圖 2 · LLM 負責提出候選程式，沙箱負責執行，harness 負責打分和選擇；三者分開，選擇權不在 LLM 手上</figcaption>
</figure>

圖裡有三件事值得注意。

**反饋只有兩個計數。** `patch_check` 不回傳梯度，也不回傳每張圖的對錯，只回傳兩個數：新條件上修好的減去弄壞的（S_new），舊輸入上修好的減去弄壞的（S_old）[^wc-tools]。一次會話最多檢查 8 次，和每種微調方法嘗試 8 組設定的預算對齊[^wc-paper]。程式本身只能用前向計算、統計量、SVD、PCA 和閉式計算來決定寫什麼，用梯度或有限差分去優化輸出被協議排除在外。

**選擇不由 LLM 決定。** 保留的程式由固定規則挑出：在 S_old 不低於下限的候選裡，取 S_new + S_old 最大的那個；沒有候選合格就保持原網路不變[^wc-retention]。CIFAR-10 上的下限是 −20，也就是 4,000 張乾淨檢查圖最多弄壞 0.5%；SCAN 上是 1,000 條舊命令最多弄壞 5 條[^wc-paper]。LLM 的 `declare_final` 只是被記錄下來。

**改動有上限。** 論文實驗中，一個程式最多改 20% 的權重，每個二維以上張量的變化不超過它 Frobenius 範數的一半；README 裡給使用者的 agent skill 預設更嚴，最多改 5%[^wc-readme][^wc-limits]。

### SCAN 那場會話實際發生了什麼

把作者公開的 SCAN 會話記錄打開，能看到這套規則實際怎麼運作[^wc-selection]：

<figure class="dd dd-figure dt-figure">
<div class="dt-panel">
<div class="dt-title" id="wc-sel-title">SCAN 會話檢查過的三個候選 · 8 次預算用了 3 次</div>
<div class="dt-scroll">
<table class="dt" aria-labelledby="wc-sel-title">
<colgroup><col style="width:40%"><col><col><col><col></colgroup>
<thead>
<tr><th scope="col">候選程式</th><th scope="col" class="num">S_new</th><th scope="col" class="num">S_old</th><th scope="col" class="num">改動權重</th><th scope="col">結果</th></tr>
</thead>
<tbody>
<tr><th scope="row" class="mono">centroid_meanrow.py</th><td class="mono num">2,563</td><td class="mono num">0</td><td class="mono num">257</td><td>分數較低</td></tr>
<tr><th scope="row" class="mono acc">centroid_meanrow_floor.py</th><td class="mono num acc">2,567</td><td class="mono num">0</td><td class="mono num">257</td><td class="acc">保留</td></tr>
<tr><th scope="row" class="mono">centroid_meanrow_exactfloor.py</th><td class="mono num">2,567</td><td class="mono num">0</td><td class="mono num">257</td><td>同分，較晚檢查；LLM 宣告的是它</td></tr>
</tbody>
</table>
</div>
<p class="dt-note">同分時規則先比改動的參數數，再比檢查的先後。LLM 在宣告理由裡自己寫明了這一點。</p>
</div>
<figcaption>表 1 · LLM 宣告想保留第三個，harness 按規則保留了第二個；兩者在這個網路上的檢查結果相同</figcaption>
</figure>

三個候選是同一個想法的三次微調，差別只在 b 怎麼定：第一個把 b 放在兩個分佈尾部的中點，第二個用 0.9 倍的最小邊際，第三個用 0.98 倍、並且把更多位置算進最小邊際。記錄裡 `declared_matches_final` 是 false：最後保留的不是 LLM 宣告的那個[^wc-selection]。在這個例子裡兩者結果一樣，但它說明了設計意圖：LLM 只負責提出假設和候選，判斷交給不受它影響的規則。

每個候選程式還必須寫明兩段文字：`HYPOTHESIS` 說明為什麼這樣改，`PREDICTED_EFFECT` 預測改完的效果[^wc-tools]。SCAN 程式的預測是新命令「約 99.8% 到 99.9%」、舊命令 S_old = 0，實際檢查結果是 2,567 條修好、0 條弄壞[^wc-program]。

**程式被選出來以後，論文保留的是這段程式，而不只是它算出的那 257 個數。這有什麼差別？**

## 三、保留程式，而不是權重差

### 現象：同一份權重差，換一個網路就沒用了

設想把 SCAN 模型再訓練一次，只換隨機種子。新網路的能力差不多，但每個單元的分工、每個方向的含義都不一樣。這時把上一個網路上算出的權重差原樣加過去，加的位置其實已經不是同一回事。

論文用 CIFAR-10 上的 ViT-Lite 驗證了這一點[^wc-paper]。為 seed 100 寫的高斯雜訊程式，在另外五個獨立訓練的 ViT-Lite 上有兩種用法：把權重差原樣**複製**過去，或者把程式本身拿去**重跑**，讓它讀新網路、用新網路自己的 64 + 64 張圖重新計算。

<figure class="dd dd-figure">
<div class="dd-scroll">
<svg class="dd-svg" viewBox="0 0 800 420" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="wc-rerun-title wc-rerun-desc">
<title id="wc-rerun-title">同一個程式在兩個網路上寫下不同的權重差</title>
<desc id="wc-rerun-desc">上排是程式為之而寫的 seed 100 ViT-Lite：patch 閘在 block 2 的單元 360 和 503，class 閘在 block 4 的單元 31、34 和 block 6 的單元 182、418，在自己的網路上增益 +31.63。下排是獨立訓練、LLM 沒見過的 seed 102：重跑程式後，patch 閘在 block 2 的單元 118、339，中間的 class 閘移到 block 3 的單元 431、446，最後一道在 block 6 的單元 135、298，增益 +27.18；把 seed 100 的權重差原樣複製過來只有 −0.03。下方是程式每次重跑做的三件事：量、找、寫。</desc>
<defs>
<marker id="wc-rerun-arrow-acc" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto"><path class="dd-head-acc" d="M1 1 L7 4 L1 7"/></marker>
</defs>
<rect class="dd-frame" width="800" height="420" rx="10"/>
<rect class="dd-zone" x="16" y="16" width="768" height="120" rx="8"/>
<text class="t-zone" x="36" y="40">seed 100 · 程式為它而寫</text>
<rect class="dd-zone" x="16" y="152" width="768" height="120" rx="8"/>
<text class="t-zone" x="36" y="176">seed 102 · 獨立訓練，LLM 沒見過</text>
<rect class="dd-zone" x="16" y="288" width="768" height="116" rx="8"/>
<text class="t-zone" x="36" y="312">程式每次重跑都做三件事</text>
<rect class="dd-card" x="32" y="56" width="72" height="56" rx="6"/>
<text class="t-note" x="68" y="88" text-anchor="middle">block 0</text>
<rect class="dd-card" x="112" y="56" width="72" height="56" rx="6"/>
<text class="t-note" x="148" y="88" text-anchor="middle">block 1</text>
<rect class="dd-card" x="192" y="56" width="72" height="56" rx="6"/>
<text class="t-note" x="228" y="78" text-anchor="middle">block 2</text>
<text class="t-mono" x="228" y="100" text-anchor="middle">360, 503</text>
<rect class="dd-card" x="272" y="56" width="72" height="56" rx="6"/>
<text class="t-note" x="308" y="88" text-anchor="middle">block 3</text>
<rect class="dd-card" x="352" y="56" width="72" height="56" rx="6"/>
<text class="t-note t-acc" x="388" y="78" text-anchor="middle">block 4</text>
<text class="t-mono t-acc" x="388" y="100" text-anchor="middle">31, 34</text>
<rect class="dd-card" x="432" y="56" width="72" height="56" rx="6"/>
<text class="t-note" x="468" y="88" text-anchor="middle">block 5</text>
<rect class="dd-card" x="512" y="56" width="72" height="56" rx="6"/>
<text class="t-note" x="548" y="78" text-anchor="middle">block 6</text>
<text class="t-mono" x="548" y="100" text-anchor="middle">182, 418</text>
<rect class="dd-card" x="608" y="56" width="160" height="56" rx="6"/>
<text class="t-note" x="620" y="78">在自己的網路上</text>
<text class="t-mono" x="620" y="100">+31.63</text>
<rect class="dd-card" x="32" y="192" width="72" height="56" rx="6"/>
<text class="t-note" x="68" y="224" text-anchor="middle">block 0</text>
<rect class="dd-card" x="112" y="192" width="72" height="56" rx="6"/>
<text class="t-note" x="148" y="224" text-anchor="middle">block 1</text>
<rect class="dd-card" x="192" y="192" width="72" height="56" rx="6"/>
<text class="t-note" x="228" y="214" text-anchor="middle">block 2</text>
<text class="t-mono" x="228" y="236" text-anchor="middle">118, 339</text>
<rect class="dd-card" x="272" y="192" width="72" height="56" rx="6"/>
<text class="t-note t-acc" x="308" y="214" text-anchor="middle">block 3</text>
<text class="t-mono t-acc" x="308" y="236" text-anchor="middle">431, 446</text>
<rect class="dd-card" x="352" y="192" width="72" height="56" rx="6"/>
<text class="t-note" x="388" y="224" text-anchor="middle">block 4</text>
<rect class="dd-card" x="432" y="192" width="72" height="56" rx="6"/>
<text class="t-note" x="468" y="224" text-anchor="middle">block 5</text>
<rect class="dd-card" x="512" y="192" width="72" height="56" rx="6"/>
<text class="t-note" x="548" y="214" text-anchor="middle">block 6</text>
<text class="t-mono" x="548" y="236" text-anchor="middle">135, 298</text>
<rect class="dd-card" x="608" y="192" width="160" height="56" rx="6"/>
<text class="t-note" x="620" y="214">重跑程式 <tspan class="t-mono t-acc">+27.18</tspan></text>
<text class="t-note" x="620" y="236">複製權重差 <tspan class="t-mono">−0.03</tspan></text>
<path class="dd-edge-acc dd-dash" d="M388 112 V132 Q388 140 380 140 H328 Q320 140 320 148 V192" marker-end="url(#wc-rerun-arrow-acc)"/>
<text class="t-say" x="400" y="132">中間那道閘移了一個 block</text>
<rect class="dd-card" x="32" y="324" width="232" height="68" rx="6"/>
<text class="t-name" x="44" y="346">① 量</text>
<text class="t-note" x="44" y="366">在這個網路自己的圖上，</text>
<text class="t-note" x="44" y="384">試每個 block 的修復效果</text>
<rect class="dd-card" x="280" y="324" width="232" height="68" rx="6"/>
<text class="t-name" x="292" y="346">② 找</text>
<text class="t-note" x="292" y="366">KL 最低的 block，</text>
<text class="t-note" x="292" y="384">以及乾淨圖上最閒的單元</text>
<rect class="dd-card" x="528" y="324" width="240" height="68" rx="6"/>
<text class="t-name" x="540" y="346">③ 寫</text>
<text class="t-note" x="540" y="366">閾值和偏移都在</text>
<text class="t-note" x="540" y="384">這個網路上重新量</text>
</svg>
</div>
<figcaption>圖 3 · 重跑的程式在新網路上重新決定閘放在哪、用哪些單元；原樣複製的權重差寫在了錯的位置，增益歸零（選擇集）</figcaption>
</figure>

結果很清楚。兩種條件各五場會話、共十個程式，在另外五個網路上重跑，各自保住了原網路增益的 83% 到 110%；把它們的權重差原樣複製過去，平均增益在 −1.42 到 +0.01 之間，比重跑低 7.6 到 28.2 分[^wc-paper]。就算先按激活把兩個網路的單元一一對齊再複製，雜訊程式也只拿到 −0.01。只有當網路共享同一個預訓練起點時，複製才管用：從同一份 ImageNet 權重微調出來的 ResNet-18 上，複製能保住重跑增益的 96% 和 87%。

所以論文說，程式保存的是「怎麼構造一次修改」：怎麼量這個網路、怎麼挑單元或方向、往裡面寫什麼。權重差只是這個過程在某一個網路上的一次輸出。

### 連續安裝：後一個程式要看見前一個

這個區別在連續安裝時更明顯。先在 ViT-Lite 上裝好雜訊閘（得到 W1），再要一個抗對比度降低的程式。論文試了兩種做法[^wc-paper]：

- **為 W1 重新寫程式。** 六場獨立會話寫出的對比度程式，在留出測試集上增加 +5.23 到 +14.50 分的對比度魯棒性，原本的雜訊魯棒性只變動 −0.17 到 +0.23。這六個程式都沒有碰雜訊閘用的兩個單元，也沒有碰 block 4 和 6：它們讀的是已經改過的網路，繞開了已裝的閘。
- **把為原網路寫的對比度程式拿到 W1 上重跑。** 它按「乾淨圖上最閒」的標準騰出單元，而雜訊閘在乾淨圖上恰好不活躍，於是被當成閒置單元覆寫掉，4,000 張雜訊檢查圖裡弄壞了 1,224 張，雜訊增益掉了 26.6 分；騰出這兩個單元就解釋了 81% 的損失。

換句話說，程式可以重跑，但它不知道網路裡已經裝了什麼。後裝的能力要保住先裝的，靠的是為當前狀態重新寫程式，而不是把舊程式疊上去。

**程式寫進網路的究竟是什麼計算？能不能拆開來驗證？**

## 四、寫進網路的計算能被拆開驗證

### 解決：一道只在雜訊出現時打開的閘

看 ViT-Lite 上的高斯雜訊程式[^wc-paper]。LLM 先觀察網路的激活，發現雜訊主要把早期殘差流裡的 patch token 往某個方向推（它還從資料裡推斷出雜訊是標準差約 25/255 的加性高斯白噪聲，實際值是 0.10）。程式據此做了三步：

<figure class="dd dd-figure">
<div class="dd-scroll">
<svg class="dd-svg" viewBox="0 0 800 312" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="wc-gate-title wc-gate-desc">
<title id="wc-gate-title">ViT-Lite 雜訊程式在 block 2 寫入的閘</title>
<desc id="wc-gate-desc">左邊三步：騰出乾淨圖上最閒的兩個 MLP 單元 360 和 503；把 patch token 投影到雜訊方向 d，投影超過閾值 t 時閘打開；打開時減去在資料上量到的雜訊偏移。對應的程式碼是 W1[j1] = kappa * d、b1[j1] = -kappa * t、W2[:, j1] = -off / K。閘的形式是兩個 GELU 相減的斜坡。右邊是選擇集上的量測：閘在 99.5% 的雜訊 token 和 0.5% 的乾淨 token 上打開，雜訊偏移從 5.29 降到 0.50，乾淨 token 平均只移動 0.05，雜訊 token 移動 5.02。</desc>
<defs>
<marker id="wc-gate-arrow" markerWidth="8" markerHeight="8" refX="7" refY="4" orient="auto"><path class="dd-head" d="M1 1 L7 4 L1 7"/></marker>
</defs>
<rect class="dd-frame" width="800" height="312" rx="10"/>
<rect class="dd-zone" x="16" y="16" width="520" height="280" rx="8"/>
<text class="t-zone" x="36" y="44">block 2 的 MLP · 512 個單元</text>
<rect class="dd-zone" x="552" y="16" width="232" height="280" rx="8"/>
<text class="t-zone" x="572" y="44">選擇集上量到的</text>
<path class="dd-edge" d="M184 126 H200" marker-end="url(#wc-gate-arrow)"/>
<path class="dd-edge" d="M352 126 H368" marker-end="url(#wc-gate-arrow)"/>
<rect class="dd-card" x="32" y="64" width="152" height="124" rx="6"/>
<text class="t-name" x="44" y="86">① 騰出</text>
<text class="t-note" x="44" y="108">乾淨圖上最閒的</text>
<text class="t-note" x="44" y="128">兩個單元 360、503</text>
<text class="t-mono" x="44" y="156">j1 = free[0]</text>
<text class="t-mono" x="44" y="176">j2 = free[1]</text>
<rect class="dd-card" x="200" y="64" width="152" height="124" rx="6"/>
<text class="t-name" x="212" y="86">② 偵測</text>
<text class="t-note" x="212" y="108">投影到雜訊方向 d，</text>
<text class="t-note" x="212" y="128">超過 t 才打開</text>
<text class="t-mono" x="212" y="156">W1[j1] = kappa*d</text>
<text class="t-mono" x="212" y="176">b1[j1] = -kappa*t</text>
<rect class="dd-card" x="368" y="64" width="152" height="124" rx="6"/>
<text class="t-name" x="380" y="86">③ 修正</text>
<text class="t-note" x="380" y="108">減去在資料上</text>
<text class="t-note" x="380" y="128">量到的雜訊偏移</text>
<text class="t-mono" x="380" y="156">W2[:,j1] = -off/K</text>
<text class="t-say" x="36" y="224">乾淨 token 的投影低於 t，閘關著，原樣通過；</text>
<text class="t-say" x="36" y="244">雜訊 token 高於 t，閘打開，偏移被減掉。</text>
<text class="t-mono" x="36" y="276">g(z) = GELU(k(dᵀz − t)) − GELU(k(dᵀz − t) − K)</text>
<rect class="dd-card" x="568" y="64" width="200" height="162" rx="6"/>
<text class="t-note" x="580" y="88">閘打開 · 雜訊 token</text>
<text class="t-mono t-acc" x="756" y="88" text-anchor="end">99.5%</text>
<line class="dd-hair" x1="568" y1="98" x2="768" y2="98"/>
<text class="t-note" x="580" y="120">閘打開 · 乾淨 token</text>
<text class="t-mono" x="756" y="120" text-anchor="end">0.5%</text>
<line class="dd-hair" x1="568" y1="130" x2="768" y2="130"/>
<text class="t-note" x="580" y="152">雜訊偏移</text>
<text class="t-mono" x="756" y="152" text-anchor="end">5.29 → 0.50</text>
<line class="dd-hair" x1="568" y1="162" x2="768" y2="162"/>
<text class="t-note" x="580" y="184">乾淨 token 平均移動</text>
<text class="t-mono" x="756" y="184" text-anchor="end">0.05</text>
<line class="dd-hair" x1="568" y1="194" x2="768" y2="194"/>
<text class="t-note" x="580" y="216">雜訊 token 平均移動</text>
<text class="t-mono" x="756" y="216" text-anchor="end">5.02</text>
<text class="t-note" x="572" y="256">同樣形式的閘還作用在</text>
<text class="t-note" x="572" y="276">block 4、6 的 class token</text>
</svg>
</div>
<figcaption>圖 4 · 程式把兩個閒置單元改成一道斜坡閘：只在 token 被雜訊推過閾值時打開，所以修正雜訊的同時幾乎不碰乾淨圖</figcaption>
</figure>

這道閘既解釋了增益從哪裡來，也解釋了乾淨準確率為什麼沒掉：修正只作用在被雜訊推出乾淨範圍的 token 上。

### 驗證：拆掉、替換、換做法

因為計算是程式寫出來的，可以一個部件一個部件地動它，看增益怎麼變[^wc-paper]：

<figure class="dd dd-figure dt-figure">
<div class="dt-panel">
<div class="dt-title" id="wc-abl-title">動一個部件，淨增益怎麼變 · ViT-Lite · 高斯雜訊 · 選擇集</div>
<div class="dt-scroll">
<table class="dt" aria-labelledby="wc-abl-title">
<colgroup><col style="width:62%"><col></colgroup>
<thead>
<tr><th scope="col">做法</th><th scope="col" class="num">淨增益（分）</th></tr>
</thead>
<tbody>
<tr><th scope="row">完整程式</th><td class="mono num">+31.75</td></tr>
<tr class="dt-group"><th colspan="2" scope="rowgroup">拆掉或改動程式的部件</th></tr>
<tr><th scope="row">拿掉 block 2 的閘</th><td class="mono num bad">+10.05</td></tr>
<tr><th scope="row">三道閘全部拿掉</th><td class="num">回到原始準確率</td></tr>
<tr><th scope="row">讓閘一直開著（乾淨準確率 −5.03）</th><td class="mono num bad">+19.43</td></tr>
<tr><th scope="row">換成同一個 block 裡隨機兩個單元（5 次平均）</th><td class="mono num">+31.86</td></tr>
<tr class="dt-group"><th colspan="2" scope="rowgroup">同樣的例子、檢查和規則，換一種做法</th></tr>
<tr><th scope="row">用雜訊與乾淨圖的均值差造閘</th><td class="mono num">+31.13</td></tr>
<tr><th scope="row">不用 LLM、事後寫的通用閘搜尋</th><td class="mono num">+24.12</td></tr>
<tr><th scope="row">同一個 LLM，但看不到權重值和網路輸出</th><td class="mono num bad">+10.78</td></tr>
<tr><th scope="row">只用梯度訓練程式改動的那些位置（從原值出發）</th><td class="mono num bad">+3.60</td></tr>
</tbody>
</table>
</div>
<p class="dt-note">紅字是比完整程式低 10 分以上的做法。</p>
</div>
<figcaption>表 2 · 增益來自「閘」這個結構和它的具體數值；換成哪兩個單元不重要，看不到權重、或只沿梯度走都做不到</figcaption>
</figure>

這組結果回答了三件事。第一，增益確實由閘承擔，拿掉閘增益就沒了；讓它一直開著，乾淨準確率掉 5 分，說明選擇性打開是保住乾淨準確率的原因。第二，起作用的是結構而不是具體單元，換成隨機兩個單元照樣有效。第三，LLM 看得到權重和激活很關鍵：只給參數名和形狀的同一個 LLM 只拿到 +10.78；而只對程式改動的那些位置做梯度訓練，從原值出發只有 +3.60，說明「改哪些位置」本身不夠，關鍵是程式算出的那組具體數值。

**那麼和最常用的微調相比，這套方法到底強在哪？**

## 五、和微調比：強在哪，局限在哪

### 同樣的例子和約束下

論文把對照設得很嚴：每種微調方法看到同樣的 64 張條件圖和 64 張乾淨圖，同樣只有 8 次檢查，同樣用保留規則選設定[^wc-paper]。在 torchvision 的 ImageNet ResNet-18 上：

<figure class="dd dd-figure dt-figure">
<div class="dt-panel">
<div class="dt-title" id="wc-ft-title">ImageNet ResNet-18 · 64 + 64 張標註圖 · 38,000 張留出測試圖上的淨增益</div>
<div class="dt-scroll">
<table class="dt" aria-labelledby="wc-ft-title">
<colgroup><col style="width:40%"><col><col></colgroup>
<thead>
<tr><th scope="col">方法</th><th scope="col" class="num">高斯雜訊</th><th scope="col" class="num">對比度降低</th></tr>
</thead>
<tbody>
<tr><th scope="row">8 種微調中最好的（按保留規則選）</th><td class="mono num">+8.67</td><td class="mono num">+3.38</td></tr>
<tr><th scope="row">11 種固定參照中最好的</th><td class="mono num">+8.84</td><td class="mono num">+6.00</td></tr>
<tr class="dt-group"><th colspan="3" scope="rowgroup">權重程式（兩場獨立會話）</th></tr>
<tr><th scope="row">程式 1</th><td class="mono num good">+10.47</td><td class="mono num good">+8.84</td></tr>
<tr><th scope="row">程式 2</th><td class="mono num good">+17.62</td><td class="mono num good">+14.26</td></tr>
</tbody>
</table>
</div>
<p class="dt-note">淨增益 = 條件上的準確率變化 + 乾淨準確率變化。四個程式的乾淨準確率在 ImageNetV2 上都保持在原網路 0.89 分以內。</p>
</div>
<figcaption>表 3 · 資料少、又要保住原有能力時，權重程式比同條件下的微調高出一截</figcaption>
</figure>

CIFAR-10 上的差距更大：ViT-Lite 的第一個雜訊程式淨增益 +32.79，最好的微調 +22.78；對比度 +16.51 對 +7.89[^wc-paper]。

### 問題與局限

讀完源碼和論文，我們認為有幾個問題需要看清楚。前五條直接來自論文的數據，後兩條是我們的推斷。

**1. 同一個任務，不同會話的結果差很多。** 論文在 ViT-Lite 上跑了十場會話，全部報告[^wc-paper]：

<figure class="dd dd-figure dt-figure">
<div class="dt-panel">
<div class="dt-title" id="wc-var-title">ViT-Lite 上的每一場會話 · 留出測試集上的淨增益</div>
<div class="dt-scroll">
<table class="dt" aria-labelledby="wc-var-title">
<colgroup><col style="width:28%"><col><col><col></colgroup>
<thead>
<tr><th scope="col">網路</th><th scope="col" class="num">高斯雜訊</th><th scope="col" class="num">對比度降低</th><th scope="col">預設標準</th></tr>
</thead>
<tbody>
<tr><th scope="row">seed 100 · 會話 1</th><td class="mono num">+32.79</td><td class="mono num">+16.51</td><td>都達到</td></tr>
<tr><th scope="row">seed 100 · 會話 2</th><td class="mono num bad">+12.20</td><td class="mono num bad">+9.13</td><td class="bad">都沒達到</td></tr>
<tr><th scope="row">seed 100 · 會話 3</th><td class="mono num">+30.83</td><td class="mono num">+10.74</td><td>都達到</td></tr>
<tr><th scope="row">seed 101</th><td class="mono num">+30.58</td><td class="mono num bad">+6.61</td><td>雜訊達到</td></tr>
<tr><th scope="row">seed 102</th><td class="mono num bad">+17.97</td><td class="mono num bad">+7.93</td><td class="bad">都沒達到</td></tr>
<tr class="dt-group"><th colspan="4" scope="rowgroup">對照：同一網路上最好的微調</th></tr>
<tr><th scope="row">seed 100</th><td class="mono num">+22.78</td><td class="mono num">+7.89</td><td></td></tr>
</tbody>
</table>
</div>
<p class="dt-note">預設標準在會話開始前定好：增益至少 10 分、乾淨變化不低於 −1、淨增益比程式上限內最強的參照高 1 分。紅字是沒達到標準的會話。</p>
</div>
<figcaption>表 4 · 十場會話只有五場達到事先定的標準；同一個網路、同一個條件，兩場會話可以差 20 分</figcaption>
</figure>

同一個 seed 100、同一個高斯雜訊條件，會話 1 拿到 +32.79，會話 2 只有 +12.20。README 也提醒，重新開一場會話可能寫出不同的程式[^wc-readme]。保留下來的程式本身可以逐位元重現，但「寫出一個好程式」這一步並不穩定。

**2. 它擅長的是重新利用網路已有的計算。** 論文自己的總結是，達標的程式都在把閒置容量改造成針對新條件的計算：騰出的 MLP 單元、幾乎不用的注意力頭、已有的組合規則[^wc-paper]。當目標能力在網路裡找不到可借用的計算時，效果明顯變差。附錄的兩個嘗試都是這種情況：在一個合成序列任務上，新運算單獨用時達到 100%，但和舊運算組合時只有 5.95%，而用規則生成的資料微調能到 100%；在 CIFAR-100 的小樣本增量分類上，新類別只有 17.20%，低於最強參照的 21.70%，沒達到事先定的標準。

**3. 優勢集中在「資料少、保留嚴」的區間。** 在 ViT-Lite 的雜訊條件上，全量微調要用到 4,096 張條件圖和同樣多的乾淨圖，才在保留規則下追平程式用 64 + 64 張得到的淨增益；如果不限制乾淨準確率的損失，最好的微調配方在留出測試集上也能到 +31.13，和程式的 +32.79 相差不到 2 分，只是乾淨準確率掉了 2.23 分[^wc-paper]。

**4. 協議的邊界靠審計和人工閱讀守住。** 協議禁止用梯度或有限差分優化輸出，並限制每場會話對標籤打分的次數。但「哪些打分不計入上限」這條計數規則，是在讀過兩場會話之後的 2026-11-06 才定下的；另有三場會話用有限差分決定修改幅度，自動審計沒有發現，是事後人工讀程式碼才找出來的，論文把它們排除在主要結論之外[^wc-paper]。論文對此說明得很坦白，但也說明這類協議很難只靠自動檢查守住。

**5. 實驗網路都很小，重用也限於同一架構。** 論文用的網路從 0.27M（ResNet-20）到 11.7M 權重（ResNet-18），SCAN 和 BabyAI 的網路更小；擴展到基礎模型和 LLM 被列為下一步[^wc-paper]。程式重跑只在同架構、獨立訓練的網路之間驗證過。

**6. 規模擴大後，讀權重這一步可能成為瓶頸。** 這一條是我們的推斷。編輯者在最多 150 個儲存格、兩小時以內讀完權重和激活、提出假設；對一個 4 層、寬 128 的模型，這足夠找到 jump 的嵌入問題。換成數十億參數、數十層的模型，同樣的預算能看多少、能不能找到該改的那幾個單元，論文沒有給出證據。

**7. 執行 LLM 寫的程式是一個安全面。** 這一條也是我們的看法。倉庫在這方面做得很仔細：LLM 剛寫的程式一律在 bubblewrap 裡跑，所有命名空間隔離、沒有網路、300 秒限時[^wc-sandbox]。但 README 也允許在提供 sha256 時不經沙箱直接重跑「你信任的」程式[^wc-readme]。sha256 只能證明檔案沒被換掉，不能證明程式本身無害；把別人發佈的權重程式當成依賴來用時，審閱程式碼仍然是使用者自己的責任。

成本方面，一場會話 30 到 130 分鐘，CIFAR-10、SCAN 和 BabyAI 的會話按 API 價格每場 5 到 13 美元；保留下來的程式在另一個網路上重跑只需幾分鐘，不再呼叫 LLM[^wc-paper]。

## 小結

1. **257 個權重改了什麼？** 程式把 jump 的嵌入移到 walk、look、run 的中心，把 I_JUMP 的輸出行設成三者的平均，再在偏置上加一個由規則算出的 b = 8.283。網路已有的組合計算順帶算出了 jump 的組合，新命令從 0% 到 99.8%，舊命令不變。
2. **沒有梯度，怎麼知道程式對不對？** LLM 在只有 NumPy 的沙箱裡讀權重、寫候選程式；harness 每次只回傳新舊兩組「修好減弄壞」的計數，最多 8 次，再由固定的保留規則挑出程式。LLM 的宣告只被記錄，不決定結果。
3. **為什麼保留程式而不是權重差？** 程式會在新網路上重新量、重新找、重新寫。重跑在獨立訓練的網路上保住 83% 到 110% 的增益，複製權重差幾乎為零；連續安裝時，後一個程式必須為已改過的網路重寫，否則會覆寫先裝的計算。
4. **寫進去的計算能看懂嗎？** 能。雜訊程式寫入的是只在雜訊出現時打開的閘，拿掉閘增益就消失，讓它一直開著乾淨準確率就掉，換成隨機單元照樣有效。
5. **強在哪、局限在哪？** 在資料少、保留嚴的條件下明顯優於微調；但會話之間結果差異大、十場只有五場達標，依賴網路已有的計算，實驗網路都很小，協議的守住部分靠人工審閱，執行 LLM 寫的程式也需要沙箱和審閱。

想看最直觀的例子，可以讀 SCAN 那段保留下來的程式：它的 `HYPOTHESIS` 和 `PREDICTED_EFFECT` 用自然語言寫明了假設和預測，`update` 只有三十多行實際計算[^wc-program]。README 也提供了不需要 GPU 和 API 金鑰的重現命令；它會下載並執行這段已發表的程式，執行前建議先讀一遍程式碼。

## 參考資料
