Lune

EMNLP2025Top-tier venue

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 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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Finding Skill Neurons in Pre-trained Transformer-based Language Models cites Transformer Feed-Forward Layers Are Key-Value Memories
  • How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language model cites Transformer Feed-Forward Layers Are Key-Value Memories
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on13

  1. TextBugger: Generating Adversarial Text Against Real-world ApplicationsJinfeng Li, Shouling Ji, Tianyu Du, Bo Li et al.NDSS 2019 · 876 citations
  2. How does GPT-2 compute greater-than?: Interpreting mathematical abilities in a pre-trained language modelMichael Hanna, Ollie Liu, Alexandre VariengienNeurIPS 2023 · 251 citations
  3. Successor Heads: Recurring, Interpretable Attention Heads In The WildRhys Gould, Euan Ong, George Ogden, Arthur ConmyICLR 2024 · 75 citations
  4. Transformer Feed-Forward Layers Are Key-Value MemoriesMor Geva, Roei Schuster, Jonathan Berant, Omer LevyEMNLP 2021 · 33 citations
  5. Finding Skill Neurons in Pre-trained Transformer-based Language ModelsXiaozhi Wang, Kaiyue Wen, Zhengyan Zhang, Lei Hou et al.EMNLP 2022 · 19 citations

Related papers

  1. Interpreting Context Look-ups in Transformers: Investigating Attention-MLP InteractionsClement Neo, Shay B. Cohen, Fazl BarezEMNLP 2024 · 3 citations
  2. The Validation Gap: A Mechanistic Analysis of How Language Models Compute Arithmetic but Fail to Validate ItLeonardo Bertolazzi, Philipp Mondorf, Barbara Plank, Raffaella BernardiEMNLP 2025 · 8 citations
  3. From Tokens to Words: On the Inner Lexicon of LLMsGuy Kaplan, Matanel Oren, Yuval Reif, Roy SchwartzICLR 2025
  4. Context-aware Stand-alone Neural Spelling CorrectionXiangci Li, Hairong Liu, Liang HuangEMNLP Findings 2020 · 7 citations
  5. How Does Alignment Enhance LLMs' Multilingual Capabilities? A Language Neurons PerspectiveShimao Zhang, Zhejian Lai, Xiang Liu, Shuaijie She et al.AAAI 2026 · 4 citations
Dusk over the sea between two cliffs drawn in fine vertical lines