Anatomy of an Idiom: Tracing Non-Compositionality in Language Models

Andrew Gomes
11/20/2025
cs.CLcs.AIcs.LG

No official code found. Best implementation: agomes42/LLMConstructions (2 stars, last commit 2025-11-21).

Abstract

We investigate the processing of idiomatic expressions in transformer-based language models using a novel set of techniques for circuit discovery and analysis. First discovering circuits via a modified path patching algorithm, we find that idiom processing exhibits distinct computational patterns. We identify and investigate ``Idiom Heads,'' attention heads that frequently activate across different idioms, as well as enhanced attention between idiom tokens due to earlier processing, which we term ``augmented reception.'' We analyze these phenomena and the general features of the discovered circuits as mechanisms by which transformers balance computational efficiency and robustness. Finally, these findings provide insights into how transformers handle non-compositional language and suggest pathways for understanding the processing of more complex grammatical constructions.

View on arXivView PDF

Code Implementations(1)

The code for my paper Anatomy of an Idiom: Tracing Non-Compositionality in Language Models

20Python, Jupyter NotebookOct 15, 202511 months ago

Similar Papers

Cite this paper

@article{gomes2025anatomy,
  title  = {Anatomy of an Idiom: Tracing Non-Compositionality in Language Models},
  author = {Andrew Gomes},
  year   = {2025},
  eprint = {2511.16467},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2511.16467v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2511.16467.svg)](https://codeofpaper.com/paper/2511.16467)

Discussion