arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.00322cs.CLcs.AIcs.SE
收藏

干扰导致的失败:当有缺陷机制掩盖健全机制时,语言模型在平衡括号任务中出错

Failure by Interference: Language Models Make Balanced Parentheses Errors When Faulty Mechanisms Overshadow Sound Ones

George Mason University(乔治·马歇尔大学);University of Central Florida(中央佛罗里达大学);Department of Computer Science(计算机科学系)

Daking Rai, Samuel Miller, Kevin Moran, Ziyu Yao

AI总结:

研究揭示语言模型在平衡括号任务中出错的原因:部分组件实现可靠机制,而其他组件引入噪声,当噪声机制主导时导致错误。提出RASteer方法,通过增强可靠组件贡献,将部分模型准确率从0%提升至近100%,并在算术推理任务中取得约20%的性能提升。

摘要:

尽管语言模型(LMs)在编码能力方面取得了显著进步,但在生成平衡括号等简单句法任务上仍然存在困难。在本研究中,我们调查了不同规模(124M-7B)的语言模型中这些错误持续存在的潜在机制,旨在理解和减少这些错误。我们的研究揭示,语言模型依赖于多个独立做出预测的组件(注意力头和前馈神经元)。虽然一些组件在广泛的输入范围内可靠地促进正确答案(即实现“健全机制”),但其他组件可靠性较低,通过促进错误标记引入噪声(即实现“有缺陷机制”)。当有缺陷机制掩盖健全机制并主导预测时,就会发生错误。受此启发,我们引入了RASteer,一种引导方法,用于系统地识别并增加可靠组件的贡献,以提升模型性能。RASteer在平衡括号任务上显著提升了性能,将某些模型的准确率从0%提高到接近100%,且不影响模型的一般编码能力。我们进一步展示了其在算术推理任务中的更广泛适用性,实现了高达约20%的性能提升。

英文摘要:

Despite remarkable advances in coding capabilities, language models (LMs) still struggle with simple syntactic tasks such as generating balanced parentheses. In this study, we investigate the underlying mechanisms behind the persistence of these errors across LMs of varying sizes (124M-7B) to both understand and mitigate the errors. Our study reveals that LMs rely on a number of components (attention heads and FF neurons) that independently make their own predictions. While some components reliably promote correct answers across a generalized range of inputs (i.e., implementing "sound mechanisms''), others are less reliable and introduce noise by promoting incorrect tokens (i.e., implementing "faulty mechanisms''). Errors occur when the faulty mechanisms overshadow the sound ones and dominantly affect the predictions. Motivated by this insight, we introduce RASteer, a steering method to systematically identify and increase the contribution of reliable components for improving model performance. RASteer substantially improves performance on balanced parentheses tasks, boosting accuracy of some models from $0$% to around $100$% without impairing the models' general coding ability. We further demonstrate its broader applicability in arithmetic reasoning tasks, achieving performance gains of up to around $20$%.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑