机制改革:通过电路重塑编辑大语言模型的推理模式
Reforming the Mechanism: Editing Reasoning Patterns in LLMs with Circuit Reshaping
AI总结:
REdit通过电路重塑技术改进大语言模型的推理能力,解决通用性与局部性的权衡问题,提升推理的准确性和效率。
摘要:
大型语言模型(LLMs)往往表现出有缺陷的推理能力,这会削弱其可靠性。现有的改进推理方法通常将其视为一种通用且单一的技能,应用广泛的训练,这效率低下且无法针对特定的推理错误。我们引入了推理编辑,这是一种用于选择性地修改LLM中特定推理模式的范式,同时保持其他推理路径。这项任务呈现了一个根本性的权衡:通用性,即编辑在不同任务中的泛化能力,以及局部性,即保持其他推理能力的能力。通过系统性的研究,我们揭示了电路干扰定律:推理模式之间的编辑干扰与其神经电路的重叠成正比。基于这一原则,我们提出了REdit,这是首个主动重塑神经电路的框架,在编辑之前,从而调节推理模式之间的干扰并缓解这一权衡。REdit集成了三个组件:(i)对比电路重塑,通过解构重叠的电路直接解决通用性和局部性的权衡;(ii)元对比学习,将其扩展到新的推理模式;(iii)双层保护,通过约束重塑更新方向和正则化任务级预测来保留已有的能力。在三个难度级别的命题逻辑推理任务上,对Qwen-2.5-3B进行了广泛的实验,结果表明,REdit在通用性和局部性方面均优于基线模型,此外在数学领域中的验证也显示了更广泛的应用潜力。我们的代码可在https://github.com/LzyFischer/REdit上获取。
英文摘要:
Large language models (LLMs) often exhibit flawed reasoning ability that undermines reliability. Existing approaches to improving reasoning typically treat it as a general and monolithic skill, applying broad training which is inefficient and unable to target specific reasoning errors. We introduce Reasoning Editing, a paradigm for selectively modifying specific reasoning patterns in LLMs while preserving other reasoning pathways. This task presents a fundamental trade-off between Generality, the ability of an edit to generalize across different tasks sharing the same reasoning pattern, and Locality, the ability to preserve other reasoning capabilities. Through systematic investigation, we uncover the Circuit-Interference Law: Edit interference between reasoning patterns is proportional to the overlap of their neural circuits. Guided by this principle, we propose REdit, the first framework to actively reshape neural circuits before editing, thereby modulating interference between reasoning patterns and mitigating the trade-off. REdit integrates three components: (i) Contrastive Circuit Reshaping, which directly addresses the generality-locality trade-off by disentangling overlapping circuits; (ii) Meta-Contrastive Learning, which extends transferability to novel reasoning patterns; and (iii) Dual-Level Protection, which preserves preexisting abilities by constraining reshaping update directions and regularizing task-level predictions. Extensive experiments with Qwen-2.5-3B on propositional logic reasoning tasks across three difficulty levels demonstrate that REdit consistently achieves superior generality and locality compared to baselines, with additional validation in mathematics showing broader potential. Our code is available at https://github.com/LzyFischer/REdit.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。