arXiv:2502.19669cs.CL2025-02EMNLP

发现大模型内部有专门修复错别字的神经元和注意力头。

Investigating Neurons and Heads in Transformer-based LLMs for Typographical Errors

  • 通过定位特定神经元和注意力头,识别错别字修复机制。
  • 中层神经元利用全局上下文完成核心纠错,早/晚层依赖局部上下文。
  • 纠错机制同时提升对通用语境的理解,适合模型可解释性研究。

本文探究大语言模型如何处理输入中的错别字。我们假设特定神经元和注意力头能通过局部与全局上下文主动识别并修正错别字。为此提出一种方法,用于识别在含错别字输入时活跃的错别字神经元和错别字注意力头。实验结果表明:1)当早期或晚期层的错别字神经元激活时,模型可仅凭局部上下文纠正错别字,另一层未激活亦可;2)中层错别字神经元负责利用全局上下文进行核心纠错;3)错别字注意力头通过广泛考虑上下文而非聚焦单个词来修正错误;4)错别字神经元与注意力头不仅参与纠错,也增强对一般语境的理解。

原文摘要 · Abstract (English)

This paper investigates how LLMs encode inputs with typos. We hypothesize that specific neurons and attention heads recognize typos and fix them internally using local and global contexts. We introduce a method to identify typo neurons and typo heads that work actively when inputs contain typos. Our experimental results suggest the following: 1) LLMs can fix typos with local contexts when the typo neurons in either the early or late layers are activated, even if those in the other are not. 2) Typo neurons in the middle layers are responsible for the core of typo-fixing with global contexts. 3) Typo heads fix typos by widely considering the context not focusing on specific tokens. 4) Typo neurons and typo heads work not only for typo-fixing but also for understanding general contexts.

错别字修复模型可解释性注意力机制

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。