Divergent large language model predictions from convergent representations in ambiguous word pairs

2026-08-03Computation and Language

Computation and Language
AI summary

The authors studied how decoder-only transformers like GPT-2 and others understand words that have multiple meanings. They found that in the middle of the model, the representations of different meanings are most distinct, but they become more similar toward the end, even though the model's predictions stay very different. Their experiments show that these late layers control the final output, even if the embedding similarities suggest otherwise. This means that models keep the meaning differences internally, but these differences are harder to see with usual similarity measures, which matters for tasks like semantic search.

decoder-only transformerlexical ambiguityhomonymspolysemesKL divergenceactivation patchingembedding spacelayer-wise analysissemantic searchcosine similarity
Authors
K. Jack Scott, Narun Pat, Veronica Liesaputra
Abstract
In this work we investigate how decoder-only transformers resolve lexical ambiguity through layer-by-layer analysis of three models spanning three parameter sizes (GPT-2-Small-117M, Llama-3.2-3B, Qwen2.5-32B). For both homonyms and polysemes, we find that representations become maximally distinct in middle layers, then partially reconverge in late layers, while the KL divergence between their next-token predictions reaches its maximum in the final layers. The activation patching experiment provides causal evidence that late-layer representational differences directly determine outputs despite apparent increased similarity in embedding space. Our single-layer ablation experiment indicates that models achieve equivalent disambiguation despite qualitatively different layer-wise vulnerabilities. These findings offer a mechanism for recent observations where models' internal embedding similarities show low correlation with their behavioural outputs despite strong performance. The semantic distinctions therefore remain present but become increasingly invisible to similarity measures over the embeddings, with implications for embedding-based methods such as semantic search, retrieval, and clustering that rely on late-layer cosine similarity.