语言模型执行条件规则时,判断条件是独立模块,但路由逻辑不抽象。
Test, then Route: How Language Models Execute In-Context Conditional Rules Across Models and Languages
- 通过激活替换实验发现,中间层专门存储条件真假值。
- 条件判断模块能完美切换答案,跨模型和语言迁移能力强。
- 路由机制依赖具体词元,不具备通用抽象能力,适合做细粒度分析。
当语言模型遵循上下文中的条件规则(如“若P(x)则A否则B”)时,它是否构建了一个由测试模块和路由模块组成的运行时电路?我们通过四捐赠者设计的激活替换探测这一问题:两个互换规则的捐赠者使条件与答案词语不一致,从而揭示每一层所承载的内容。在来自两个模型家族的三个开源模型及六种语言中,共享一个固定项目库,中间堆叠的残差带携带条件的真值:替换该区域可近乎完美地翻转结果(预测翻转接近1.0,映射翻转接近0.0),在18个单元中有17个满足预设隔离标准,且在五类条件中均保持定位一致性。路由器则呈现相反特征。一个学习到的子空间能几乎完美翻转训练对中的A和B,但在所有模型中对新配对的迁移率约为0;而在仅跨语言探测的Gemma-3-4B中,对同对在其他语言的迁移率达约0.98。所有探测条件下,路由器方向均为词元绑定且不可迁移(在Gemma中主要为答案读出,在Qwen中为配对特异),而非抽象路由模块。测试模块是模块化的;在这些探测下,路由不是。
原文摘要 · Abstract (English)
When a language model follows an in-context conditional rule such as "if P(x) then A else B," does it assemble a runtime circuit with one module that tests the predicate and another that routes the answer? We probe this with activation patching under a four-donor design whose two swapped-rule donors make the condition and the answer word disagree, so each layer reveals which of the two it carries. Across three open models from two families and six languages sharing one fixed item bank, a mid-stack residual band carries the predicate's truth value: patching it reroutes the answer with predicate-outcome flip near 1.0 and mapping flip near 0.0, meeting a strict pre-specified isolation criterion in 17 of 18 cells, and the same localization holds across five predicate families. The router shows the opposite profile. A learned subspace flips A and B near-perfectly within the trained pair yet transfers to a new pair at approximately 0 in every model, while in Gemma-3-4B (the only model probed cross-lingually) it transfers at approximately 0.98 to the same pair in other languages. Under every probe we ran, the router direction is token-bound and non-transferable (largely answer-readout in Gemma, pair-specific in Qwen) rather than an abstract routing module. Test is modular; under these probes, route is not.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。