E2K-40:把验真的可泛化知识内化进权重E2K-40: Internalizing verified, generalizable knowledge into weights

进展 2026-09-12Progress 2026-09-12 ·

设置Setup

模型Model
Qwen3.8-27B
(Qwen3.5 架构:Gated-DeltaNet + 注意力混合)(Qwen3.5 architecture: hybrid Gated-DeltaNet + attention)
Benchmark
ARC-AGI-3
交互式网格游戏;本文一道题 cd82-fb555c5d(ARC3_004),6 个 level,64×64 棋盘,16 色interactive grid games; one game here, cd82-fb555c5d (ARC3_004): 6 levels, 64×64 board, 16 colours
Harness
Qwen Code 代理循环:模型按其后训练的方式用工具玩游戏(MCP 工具 look / act / status);知识以工作区 QWEN.md 进入上下文;每个条件 100 局Qwen Code agent loop: the model plays through tools the way it was post-trained (MCP tools look / act / status); knowledge enters as the workspace's QWEN.md; 100 episodes per condition
RL 策略RL policy
同一模型,裸 prompt:每步收到棋盘,输出一个 JSON 动作;slime(Megatron 训练 + SGLang 采样),16×GH200Same model, bare prompt: receives the board each step, emits one JSON action; slime (Megatron training + SGLang sampling), 16×GH200

一局的前八步(真实引擎)Eight steps of one episode (real engine)

Board of cd82 level 1 after the current step
  1. 0startlevel 1 起始level 1 start
  2. 1ACTION6 37 4点左侧色板框 → 选白色click the left colour box → select whiteΔ95
  3. 2ACTION5画布已是白色 → 什么都没变canvas already white → nothing changesΔ0
  4. 3ACTION6 43 4点右侧色板框 → 选紫色click the right colour box → select purpleΔ95
  5. 4ACTION5上半画布涂成紫色paint the top half of the canvas purpleΔ51
  6. 5ACTION3涂色器移到左上角applicator moves to the top-left cornerΔ200
  7. 6ACTION5左上三角涂成紫色paint the top-left triangle purpleΔ16
  8. 7ACTION1角上再"上" → 无效果"up" from a corner → no effectΔ0
  9. 8RESET恢复起始back to the startΔ269

图 1.Figure 1. Δ = 该步改变的格子数,是模型能观察到的全部反馈。Δ = cells changed by the step — the only feedback the model can observe.

State: NOT_FINISHED
Levels completed: 0
Win levels: 6

Current frame (row-major numeric grid):
[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3…
[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3…
[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,3,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3…
[5,5,5,0,0,0,0,0,0,0,0,0,0,5,5,5,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,0,0,0,4,3,4,15,15,15,4,3,3,3,3,3,3,3,3,3,3,3,3,…
  …  (64 rows × 64 integers; 8,657 characters ≈ 8.6k tokens per observation)

Available actions:
- ACTION1
- ACTION2
- ACTION3
- ACTION4
- ACTION5
- ACTION6 x y (integers 0-63)

模型每步收到的观测:状态、完成的 level 数、整数网格、可用动作名 —— 仅此而已。The observation the model receives each step: state, levels completed, the integer grid, the available action names — and nothing else.

动机:从自蒸馏到显式、可验证、可组合的知识Motivation: from self-distillation to explicit, verifiable, composable knowledge

SDPO(自蒸馏策略优化)怎么做。同一个模型跑两遍:教师的 prompt 里放进 oracle 答案(或其它特权信息),学生只看原 prompt;在学生自己采出的 token 上最小化 KL(π学生 ∥ π教师),可再加 RL reward。学生学会"像看到了答案那样"作答。How SDPO (self-distillation policy optimization) works. The same model is run twice: the teacher's prompt contains the oracle answer (or other privileged information), the student sees only the original prompt; on the student's own samples the KL(πstudent ∥ πteacher) is minimized, optionally with an RL reward. The student learns to answer "as if it had seen the answer".

问题。信号全部来自模型对那个答案的自我反思:学到的东西隐含在答案里、绑定于具体题目,没有外部检验,也不会超出 oracle 给的范围 —— 它复制答案,不产生新知识。The problem. All signal comes from the model reflecting on that answer: what is learned stays implicit and answer-bound, nothing checks it externally, and it never grows beyond what the oracle handed over — it copies answers rather than producing knowledge.

我们的想法。LLM 擅长组合创新,缺的是对"什么算知识"的约束。所以把知识做成显式的声明式规则,用两个 reward 引导模型自己去获得:正确性(在游戏里复现)和泛化性(在别的 level 上仍成立)。多轮迭代:第一轮拿到最底层的原子(ARC 里的动作映射),后面各轮把原子放在一起,组合出新的、更高层的知识;每轮的知识再通过 SFT ⊕ RL 内化。整个过程只需在现有 multi-step RL(harness)循环里加一个 SFT 项。Our idea. LLMs are good at combinatorial innovation; what is missing is a constraint on what counts as knowledge. So knowledge becomes explicit declarative rules that the model acquires itself under two rewards: correctness (reproduced in the game) and generalization (still holds on other levels). Iterated over rounds: round 1 yields the lowest-level atoms (ARC action mappings), later rounds put atoms together and compose new, higher-level knowledge; each round's set is internalized by SFT ⊕ RL. Only one SFT term is added to the existing multi-step RL (harness) loop.

(a) SDPO prompt + oracle 答案prompt + oracle answer 教师(同一模型)teacher (same model) prompt 学生 πθstudent πθ π(y | x, a*) πθ(y | x) min KL 信号 = 对答案 a* 的自我反思;隐式、绑定题目、无外部检验 signal = self-reflection on the answer a*; implicit, answer-bound, unchecked (b) 本文:迭代获取显式知识(b) Ours: iterated explicit knowledge 游玩 | 𝒦r−1play | 𝒦r−1 经验 𝒟rexperience 𝒟r 提取 · 组合extract · compose 候选 claimscandidate claims 验真(游戏)verify (in game) Rcorr · Rgen 𝒦r 内化:SFT(𝒦r)⊕ RL,同一个 multi-step 循环 internalize: SFT(𝒦r) ⊕ RL, one multi-step loop θ ← θ − η∇[ℒPG + w·NLL(𝒦r)] 下一轮:𝒦r 入上下文,原子被组合成更高层知识 next round: 𝒦r in context, atoms compose into higher-level knowledge 信号 = 游戏给的正确性 + 跨 level 泛化;显式、可组合、可迁移 signal = correctness from the game + cross-level generalization; explicit, composable, transferable
图 2.Figure 2. (a) SDPO 让模型对着 oracle 答案反思自己;(b) 本文让模型在正确性与泛化性两个 reward 下多轮获取显式知识,并在同一 RL 循环里内化。(a) SDPO has the model reflect on itself against an oracle answer; (b) ours has the model acquire explicit knowledge over rounds under correctness and generalization rewards, internalized inside the same RL loop.

框架Framework

算法 1 迭代式知识获取与内化Algorithm 1 Iterated knowledge acquisition and internalization
  1. 𝒦0 ← ∅; for r = 1 … R do
  2.   𝒟r ← Play(πθ, levels 1–4 | 𝒦r−1 in context) ▷ 带当前知识的经验experience with current knowledge
  3.   𝒞 ← Extract(𝒟r, 𝒦r−1) ▷ 原子 → 组合atoms → compositions
  4.   𝒦r ← 𝒦r−1 ∪ { c ∈ 𝒞 : Rcorr(c) = 1, Rgen(c) ≥ γ } ▷ 在游戏里验真;答案型拒绝verified by play; answers rejected
  5.   θ ← θ − η ∇θ [ ℒPG(τ ∼ πθ) + w · NLLθ(𝒦r) ] ▷ 同一 multi-step RL 循环same multi-step RL loop
  6. return Eval(πθ, levels 5–6 | 𝒦 ∉ context)

当前实现的是 r = 1;NLL 项只作用于声明式陈述,从不作用于轨迹。Currently r = 1; the NLL term applies to declarative statements only, never to trajectories.

实验组ArmSFT 何时进入When SFT enters每步目标Per-step objective
baseline—ℒPG
sft_firstRL 前 4 轮纯 SFT4 SFT-only rollouts before RLNLL → ℒPG
sft_interleaved每轮 RL 后 2 轮 SFT2 SFT rollouts after every RL rolloutℒPG ⇄ NLL
sft_joint每一步every stepℒPG + w·NLL
oracle同 sft_first,𝒦 = 手写规则(14 条)as sft_first, 𝒦 = hand-written rules (14)NLL → ℒPG

表 1.Table 1. 消融:同一 𝒦、同一 RL(Dr.GRPO,每轮 32 局 × ≤80 步)、同一评测(level 5–6,prompt 中无 𝒦);只改 SFT 的调度。Ablation: same 𝒦, same RL (Dr.GRPO, 32 episodes × ≤80 decisions per rollout), same evaluation (levels 5–6, no 𝒦 in the prompt); only the SFT schedule changes.

怎么验真:让代码替模型检验How a claim is verified: code checks the model

验真者是同一个模型的另一个会话,拿到一条 claim 和过去的对局记录。它不判断 claim 对不对,而是写代码去复现:把 claim 拆成子句,对每个子句设计检查 —— 在对局记录里数、或开一局新游戏用 act 去试;计数 reproduced / total,声明极性(数成功还是数违例:"从不发生"的子句 0/N 才算通过);再用 set_level(k) 在至少两个别的 level 上重跑同样的检查。产出一份结构化 ledger。过滤器只读 ledger:任一子句被驳回 → 删掉该子句;本 level 检查成立 → 正确;别的 level 的结果 → 泛化分 0–3;点击配方 / 解法型 → 拒绝。The verifier is another session of the same model, given one claim and the past episode journals. It does not judge the claim; it writes code that reproduces it: the claim is split into clauses, each gets a check — counted in the journals, or tried in a fresh episode through act; it records reproduced / total with a declared polarity (successes or violations: a "never happens" clause passes at 0/N); then the same checks are re-run on at least two other levels via set_level(k). The output is a structured ledger. The filter reads only the ledger: any refuted clause is cut; home-level checks hold → correct; the other-level results → a generalization score 0–3; click recipes / solutions → rejected.

claim c 子句 c1 … cNclauses c1 … cN 验真者写代码verifier writes code 同一模型,另一会话same model, own session 代码跑游戏code runs the game look · act · status set_level(k) + 读对局记录+ reads journals ledger 每子句 reproduced/total,极性per clause reproduced/total, polarity 每个别的 level:held / failedper other level: held / failed 被驳回的子句 + 观察证据refuted clauses + the observation 过滤 → 𝒦filter → 𝒦 正确:硬门槛correctness: gate 泛化:打分 0–3generalization: score 0–3 答案型:拒绝answer-like: rejected 验真者拿不到游戏源码,只能通过 look / act / status / set_level 操作;源码只用于人工审计。 The verifier never sees the game source; it can only drive the game via look / act / status / set_level. The source is used for human audit only. 检查种类是固定词表(home_level_fresh, other_level:k, negative_expectation, …),写的是"测了什么条件",不是"希望说明什么"。 Check kinds are a fixed vocabulary (home_level_fresh, other_level:k, negative_expectation, …) naming the condition tested, not the hoped-for conclusion.
图 3.Figure 3. 验真回路。正确性和泛化性都由游戏本身给出,不由模型的自我评价给出。The verification loop. Correctness and generalization come from the game itself, never from the model's self-assessment.
子句 c1 · holds · home_level_fresh 4 次检查clause c1 · holds · home_level_fresh, 4 checksClicking any cell of a framed legend box, frame included, sets the applicator's fill colour to that box's colour.别的 level:level 2 held(7 个色框、坐标不同,机制相同)· level 3 held → 泛化 3other levels: level 2 held (7 boxes at other coordinates, same mechanism) · level 3 held → generalization 3
子句 c2 · refuted · 被删clause c2 · refuted · cutRows 3 and 6 of the frame are inert targets: clicking them changes nothing.观察:在 (39,3)、(37,6)、(43,6) 点击各改变 94–95 格;记录里 18 次中 13 次"无变化"都是涂色器已持有该色的情形。observation: clicks at (39,3), (37,6), (43,6) changed 94–95 cells; the 13 of 18 journal instances that changed nothing were all cases where the applicator already held that colour.

一份真实 ledger 的两条子句(verifier v2 示例):一条 claim 里对的部分进入 𝒦,错的子句连同证据被去掉 —— 不是整条接受或整条拒绝。Two clauses of a real ledger (verifier v2 example): the correct part of a claim enters 𝒦, the wrong clause is removed with its evidence — not accept-or-reject the whole claim.

上下文中的知识有效;RL 起点无信号Knowledge in context works; the RL start has no signal

Bar chart of level-1 clear rate: agent harness with no knowledge 9/100, mechanism rules in context 33/91, full knowledge set in context 100/100; RL starting policy with no knowledge 0/320. Error bars are 95% Wilson intervals.
图 4.Figure 4. 同一策略,只改上下文:level 1 通关率 9/100 → 33/91 → 100/100(agent harness)。RL 起点 π₀(裸 prompt,无知识)为 0/320,纯 RL 基线梯度恒为 0 —— 内化只能从 SFT 组开始。误差棒:95% Wilson 区间。Same policy, only the context changes: level-1 clear rate 9/100 → 33/91 → 100/100 (agent harness). The RL start π₀ (bare prompt, no knowledge) is 0/320, so the pure-RL baseline's gradient is identically zero — internalization has to start from the SFT arms. Error bars: 95% Wilson intervals.

知识长什么样What the knowledge looks like

Level 1 starting board
L1 · train
Level 2 starting board
L2 · train
Level 3 starting board
L3 · train
Level 4 starting board
L4 · train
Level 5 starting board
L5 · test
Level 6 starting board
L6 · test

图 5.Figure 5. 六个 level 的起始棋盘。同一套机制、不同布局:知识若可泛化,应在 L5–L6 上仍成立。Starting boards of the six levels. Same mechanics, different layouts: knowledge that generalizes should still hold on L5–L6.

已验真 · level 1 · 泛化 3/3verified · level 1 · generalization 3/3Clicking the colour box whose colour the applicator already holds changes no board cell.
已验真 · level 1 · 泛化 3/3verified · level 1 · generalization 3/3An ACTION5 that changes no cell means that region already holds that colour.
已验真 · level 1 · 泛化 3/3verified · level 1 · generalization 3/3The canvas is written only by a painting action or by a level (re)load.
已验真 · level 1 · 泛化 3/3verified · level 1 · generalization 3/3ACTION6 aimed at a cell that belongs to no interactive sprite changes no board cell.
新 · L2+L3 合并 · L1–L4 成立 · 泛化 3/3new · merged from L2+L3 · holds on L1–L4 · generalization 3/3Clicking a swatch whose color differs from the interior recolors the interior to that swatch's color.条件:内部颜色与所点色块不同condition: the interior's color differs from the tapped swatch's color
新 · L3+L4 合并 · L1–L4 成立 · 泛化 3/3new · merged from L3+L4 · holds on L1–L4 · generalization 3/3Clicking a palette slot moves the marker bar to sit directly under the clicked slot.
新 · L4 · L2–L4 成立 · 泛化 3/3new · L4 · holds on L2–L4 · generalization 3/3Clicking a spout cell pours 6–13 cells of liquid into the pit.
新 · L2 · L1–L3 成立 · 泛化 3/3new · L2 · holds on L1–L3 · generalization 3/3Each act call drains at most one cell from the rightmost end of the timer bar.

蓝色:旧 level-1 集深审保留的原子(36 条中的 4 条);橙色:最终 𝒦₁ 中来自 level 2–4 的新原子(888 条中的 4 条),已由代码验真,标注其成立的 level。每条 = 一个机制 + 条件,不含解法。Blue: level-1 atoms kept after the claim-by-claim review (4 of 36); amber: new atoms of the final 𝒦₁ from levels 2–4 (4 of 888), verified by code and tagged with the levels they hold on. Each = one mechanism + its condition, no solution.

进展Progress

Level局Episodes清关Clearedclaims (v3)Claims (v3)已验真Verified子句通过Clauses kept原子Atoms
1100910196167198
21000121100167194
31000128123168244
41000124117172228
Σ4009474436674888

表 2.Table 2. 知识流水线(四个 level 同一流程)。已验真 = 有账本的 claim(38 条验真会话超预算未出账本);子句通过 = 过 v2 门控的子句;原子 = 两遍 Qwen(原子化、同事实合并)+ 门控后的最终 𝒦₁:888 条,其中 24 条跨 level 合并、269 条泛化 3/3。Knowledge pipeline (one procedure for all four levels). Verified = claims with a ledger (38 verifier sessions ran out of budget before writing one); clauses kept = clauses passing the v2 gates; atoms = the final 𝒦₁ after two Qwen passes (atomize, merge same-fact) and the gates: 888 atoms, 24 merged across levels, 269 with generalization 3/3.