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

Kohei Tsuji, Tatsuya Hiraoka, Yuchang Cheng, Eiji Aramaki, Tomoya Iwakura


Abstract
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 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.
Anthology ID:
2025.emnlp-main.313
Volume:
Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing
Month:
November
Year:
2025
Address:
Suzhou, China
Editors:
Christos Christodoulopoulos, Tanmoy Chakraborty, Carolyn Rose, Violet Peng
Venue:
EMNLP
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
6156–6174
Language:
URL:
https://preview.aclanthology.org/ingest-emnlp/2025.emnlp-main.313/
DOI:
Bibkey:
Cite (ACL):
Kohei Tsuji, Tatsuya Hiraoka, Yuchang Cheng, Eiji Aramaki, and Tomoya Iwakura. 2025. Investigating Neurons and Heads in Transformer-based LLMs for Typographical Errors. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 6156–6174, Suzhou, China. Association for Computational Linguistics.
Cite (Informal):
Investigating Neurons and Heads in Transformer-based LLMs for Typographical Errors (Tsuji et al., EMNLP 2025)
Copy Citation:
PDF:
https://preview.aclanthology.org/ingest-emnlp/2025.emnlp-main.313.pdf
Checklist:
 2025.emnlp-main.313.checklist.pdf