基于代码的词:通过代码引导的推理克服语义惯性
Code over Words: Overcoming Semantic Inertia via Code-Grounded Reasoning
AI总结:
通过代码引导的推理(LCV)克服语义惯性,表明表示形式影响模型在动态场景中的推理能力。
摘要:
大型语言模型在语义惯性方面存在困难:即在动态上下文规则与预训练先验(例如“岩浆是危险的”)矛盾时,无法抑制这些先验。我们通过Baba Is You游戏来探测这一现象,其中物理定律是可变的文本规则,使能够精确评估模型在规则改变时抑制学习先验的能力。我们定量观察到,较大的模型表现出反比例变化:当自然语言推理需要抑制预训练关联(例如接受“岩浆是安全的”)时,它们的表现比较小的模型更差。我们的分析归因于自然语言编码,它将描述性语义与逻辑规则纠缠在一起,导致即使有明确的矛盾规则,仍然持续产生熟悉的物理幻觉。在这里,我们展示将动态表示为可执行代码而不是描述性文本,可以逆转这一趋势,并使有效的先验抑制成为可能。我们引入了代码引导的视野(LCV),该方法在反事实对上微调模型,并识别具有矛盾规则的状态,从而迫使注意力关注逻辑约束而不是视觉语义。这种训练时的方法在效率和准确性上都优于昂贵的推理时搜索方法。我们的结果表明,表示从根本上决定了扩展性是否改善或损害上下文推理。这挑战了“更大的模型总是更好的”这一假设,对需要动态覆盖学习先验的领域有影响。
英文摘要:
LLMs struggle with Semantic Inertia: the inability to inhibit pre-trained priors (e.g., "Lava is Dangerous") when dynamic, in-context rules contradict them. We probe this phenomenon using Baba Is You, where physical laws are mutable text rules, enabling precise evaluation of models' ability to override learned priors when rules change. We quantatively observe that larger models can exhibit inverse scaling: they perform worse than smaller models when natural language reasoning requires suppressing pre-trained associations (e.g., accepting "Lava is Safe"). Our analysis attributes this to natural language encoding, which entangles descriptive semantics and logical rules, leading to persistent hallucinations of familiar physics despite explicit contradictory rules. Here we show that representing dynamics as executable code, rather than descriptive text, reverses this trend and enables effective prior inhibition. We introduce Code-Grounded Vistas (LCV), which fine-tunes models on counterfactual pairs and identifies states with contradictory rules, thereby forcing attention to logical constraints rather than visual semantics. This training-time approach outperforms expensive inference-time search methods in both efficiency and accuracy. Our results demonstrate that representation fundamentally determines whether scaling improves or impairs contextual reasoning. This challenges the assumption that larger models are universally better, with implications for domains that require dynamic overriding of learned priors.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。