Source-linked AI summary

Some Tokens Behave like Magnets: Revealing Linguistic Organization in the Layers of Language Models

Andrew Liu, Devan Srinivasan, Gerald Penn

arXiv:2609.05743v1cs.CL

TL;DR

The paper asks whether language-model representations contain linguistic organization that analyses of angles alone may miss. It identifies magnets through the relationship between angular similarity and vector norms, then reports layer-wise patterns and task-related findings across models, with downstream task studies focused on BERT.

  • Problem

    Prior representational-geometry analyses commonly focus on angles and cosines while ignoring vector norms, leaving this aspect of language-model representations less examined.

    Source: §1 · p. 1
  • Method

    The paper identifies token vectors as magnets when their angular similarities predict other token vectors’ norms, and analyzes this intrinsic geometry across model layers without probes.

    Source: §1 · p. 2
  • Results

    The authors report consistent layer-wise linguistic patterns across models and find that early-layer magnets influence a chosen syntactic task more than a chosen semantic or pragmatic task, with the reverse pattern for late-layer magnets.

    Source: §1 · p. 2, §7 · p. 9
  • Takeaways & Limitations

    Magnet vectors provide a geometric perspective for studying language-model representations and support layer-wise linguistic attribution within the examined models and tasks.

    Source: §7 · p. 9

    The linguistic separation analysis is limited to English models and tasks, and downstream case studies are restricted to BERT.

    Source: Limitations · p. 9

Abstract

from arXiv · show

We identify a special group of token vectors inside large language models (LLMs), which we term magnetic vectors, that organize the surrounding tokens by either attracting or repelling them. Particularly, tokens pointing the same way as an attracting magnet are elongated; tokens pointing the same way as a repelling magnet are compressed. Just as physical magnets pull or push away the iron filings around them, these vectors organize their surroundings through two opposing polarities. Moreover, we identify a statistically significant pattern in linguistic category where function words consistently act as repelling magnets in early layers, and we also find magnets consistently reorganize their polarities in unique ways deeper in the model. In a further case study we find this observation may unveil a deliberate, layer-wise organization in how LLMs process language. This pattern is consistent across different LLM architectures, sizes, and layer configurations. It is also causally relevant. When the LLM is fine-tuned for a downstream task, the task-functional tokens emerge as magnets. E.g., in question answering, the answer-span tokens become uniquely repelling magnets in the final layer, geometrically carving the answer out of the surrounding context. Furthermore, removing early-layer repelling magnets devastates syntactic tasks (POS tagging accuracy drops from 91% to below 10%) while sparing semantic ones, and removing late-layer attracting magnets does the reverse. We believe this phenomenon warrants further investigation, as it opens the first probe-free path to understanding how language models geometrically organize linguistic computation across their layers.

1 Introduction

The paper studies whether language-model representations have linguistic structure visible in both vector angles and lengths, beyond geometry analyses that often focus on angles alone. It identifies attracting and repelling magnets and reports layer-wise linguistic patterns and task-related findings.

1 Introduction

  • The analysis addresses prior representational-geometry work that commonly examines angles and cosines while ignoring vector norms.The cited examples include Lee et al. (2025), Elhage et al. (2022), Jha et al. (2025), Ethayarajh (2019), and Mikolov et al. (2013).Source: §1 · p. 1
  • Magnets are token vectors whose polarity predicts whether similarly oriented vectors are lengthened or shortened, with the relationship mediated by representation depth.Attracting magnets lengthen similarly oriented vectors and shorten more orthogonal ones; repelling magnets do the reverse.Source: §1 · p. 2
  • Magnets show layer-wise linguistic patterns across models and topics, including distinctions between function and content words, detectable from intrinsic geometry without probes.The paper describes this as the first direct observational evidence of linguistic organization across layers intrinsic to the models.Source: §1 · p. 2
  • Early-layer magnets have outsized influence on part-of-speech tagging, while late-layer magnets are sharply connected with sentiment analysis and question answering in BERT case studies.The introduction frames these as syntactic and semantic tasks, respectively.Source: §1 · p. 2
  • The paper presents its findings as model-faithful support for layer-wise linguistic attribution, extending the analysis to modern large language models.Its listed contributions include identifying magnets in numerous models and finding consistent layer organization and linguistic-category sensitivity.Source: §1 · p. 2

2 Related Work

The paper situates its work among interpretability and representational-geometry research. It distinguishes its approach by incorporating vector magnitude and reporting linguistic structure without auxiliary training or modules.

2 Related Work

  • Earlier BERT layer-wise attribution proposed an early-syntax, later-semantics pattern, but probing raised concerns that the probe itself might learn the tested property.The passage notes this line of work has rarely extended beyond BERT.Source: §2 · p. 2
  • Geometric analyses have identified structure in concepts and representations, but they seldom incorporate vector length alongside direction.The discussion contrasts this with work on learned geometric structure, feature directions, and shared angular structure.Source: §2 · p. 3
  • The authors distinguish their phenomenon from anisotropy, describing it as a different geometric effect that changes across layers..Source: §2 · p. 3
  • Their analysis combines hidden-state angles and magnitudes to identify domain-agnostic linguistic structure without auxiliary training or modules.They characterize this as model-faithful interpretability of hidden-state representations.Source: §2 · p. 3

3 Magnetic Vectors

The paper defines magnets by how a token vector’s angular similarity to other vectors predicts those vectors’ norms. It reports strong magnetism across models and describes layer-wise patterns aligned with linguistic categories.

3 Magnetic Vectors

  • Repelling magnets shorten similarly oriented vectors and lengthen dissimilar ones, while attracting magnets produce the opposite pattern.The toy example illustrates the relationship between angular proximity and vector norm for each polarity.Source: §3 · p. 3, Figure 2 · p. 3
  • A candidate magnet is evaluated by regressing its cosine similarities to token vectors against those vectors’ norms; signed R2 gives magnet strength and polarity.Negative signed R2 denotes repulsion and positive signed R2 denotes attraction.Source: §3 · p. 3
  • In the toy example, a candidate token’s similarities to the sequence vectors are regressed against their norms to illustrate a repelling magnet.The example gives a hypothetical R2 of 0.8 with a negative relationship, yielding a strength of -0.8.Source: §3 · p. 3

3.1 Significance of Existence

  • Across models, magnets can reach strengths of ±0.7 to ±0.8 regardless of context, which the authors describe as a significant relationship rather than noise or anomaly.The passage says subsequent analysis finds layer-wise patterns aligned across architectures, linguistic separation, and downstream-task impact.Source: §3.1 · pp. 3–4

4 Experiments

Across five language models, the experiments examine how magnet properties vary by layer and token type, finding strong early-layer links to syntactic categories and a shift in magnet polarity deeper in the models. They also relate this structure to a syntax-to-semantics progression and test its presence across different model families.

4.1 Setup

  • Across BERT, GPT2, Qwen2.5-3B, Gemma3-1B, and Llama3.2-3B, the study tracks token magnet properties layer by layer in 100 manually curated paragraphs of about 200 words each.The paragraphs span contexts including news and healthcare.Source: §4.1 · p. 4

4.2 Results

  • Early layers show repelling magnets that tend to be function tokens, followed by a middle-layer polarity transition and late-layer attracting magnets becoming the majority.The transition is described as a bowtie effect, with polarity possibly changing back in the middle layers.Source: §4.1 · p. 4, Figure 3 · p. 5

4.1 Setup

  • The token-category analysis labels words as function or content using part-of-speech tags, then computes point-biserial correlation with magnet strength at each layer.For decoder models, the input is repeated so the measured portion can attend to itself via the earlier instance.Source: §4.1 · p. 4

4.2 Results

  • Early-layer point-biserial correlation reaches 0.8 between magnet properties and token syntactic type, then declines deeper in the models as magnet polarity transitions.Function tokens overwhelmingly tend to be repelling magnets in early layers.Source: §4.2 · p. 4, §4.1 · p. 4, Figure 4 · p. 5
  • The layer-wise structure resembles a syntax-to-semantics progression, and the authors report that the intrinsic-geometry approach applies across BERT, GPT2, Qwen, Gemma, and Llama.The reported pattern points to syntax early, a middle transition, and hints of semantics emerging late.Source: §4.2 · p. 5

5 BERT and Downstream Tasks

The authors test whether BERT’s early- and late-layer magnets matter differently for syntactic and semantic tasks using fine-tuned models. Ablations show task-specific effects, while question-answering answer tokens are especially repelling in late layers.

5.1 Setup

  • The study focuses on BERT, fine-tuned on CoNLL-2003 for POS tagging, SST2 for sentiment analysis, and SQuAD v1 for question answering.BERT is selected because it is widely studied for layer-wise attribution and its tasks are more closed-ended and controlled.Source: §5 · pp. 5–6, §5.1 · p. 6
  • The authors zero out strong early-layer repelling magnets and late-layer attracting magnets, comparing each intervention with zero-ablating an equal number of random tokens.Strong magnets are defined here as having R2 > 0.5; middle layers are not ablated because they contain few strong magnets.Source: §5.1 · p. 6
  • For question answering, the authors test whether answer tokens are more repelling than non-answer tokens using a Wilcoxon Signed Rank test and Rank Biserial Correlation.This analysis quantifies the difference between answer and non-answer tokens across layers.Source: §5.1 · p. 6
  • The task-specific findings come from fine-tuned models, so they do not establish how magnet geometry influences base models.The authors say the fine-tuned setting lets them study task-specific influence and speculate about function.Source: §5.1 · p. 6

5.2 Findings

  • On SQuAD, answer tokens—less than 3% of all tokens—are entirely repelling magnets at the final layer, separating answers from the surrounding paragraph.The authors report that late-layer answer tokens are uniquely delegated as more repelling.Source: §5.2 · p. 7
  • Early repelling-magnet ablation disproportionately harms POS, late attracting-magnet ablation harms semantic-task performance, and late answer tokens are more repelling than non-answer tokens.The tables compare zero-ablating magnets with zero-ablating an equal number of random vectors; POS tagging and sentiment classification are the ablation tasks.Source: §5.2 · pp. 6–7, Table 1 · p. 7, Table 2 · p. 7

6 Discussion

The discussion presents magnetism as an evolving, deliberate geometric organization with early linguistic structure and later links to semantic tasks. It relates this pattern to a layer-wise syntax-to-semantics account while treating the mechanism as speculative.

6 Discussion

  • Magnetism forms a deliberate geometric structure that evolves through the model, with early magnet strengths and linguistic types showing high PBC scores.The authors say this suggests the structure is reasonably governed by linguistic principles.Source: §6 · p. 7
  • In BERT, early magnets are tied to syntax and late magnets to semantic tasks; in question answering, answer tokens are the strongest repellers among mainly attracting magnets.The authors do not claim the same strong causal links for other models.Source: §6 · p. 8, Figure 6 · p. 8
  • The authors relate early syntactic processing, a middle-layer reorganization, and late magnets to a classical NLP pipeline, while noting reduced syntactic separation in late layers.Late-layer magnets are nevertheless strongly related to semantic tasks in BERT.Source: §6 · p. 8
  • The proposed explanation is tentative: repelling magnets may re-serve important directions and attracting magnets may highlight them during nonlinear read/write operations.The authors say the underlying features and cause of magnetism remain unknown.Source: §6 · p. 8

7 Conclusion

The conclusion reports layer-wise linguistic patterns in language-model vector representations and causal evidence from BERT linking early and late magnets to different task types. It presents magnetism as a probe-free geometric framework for further study.

7 Conclusion

  • The authors report causal evidence in BERT that early-layer magnets influence a chosen syntactic task more, while late-layer magnets influence a chosen semantic/pragmatic task more.They describe the structure as present across model sizes and architectures.Source: §7 · p. 9
  • The identified structure reveals layer-wise linguistic patterns across model sizes and architectures.The authors frame the finding as intrinsic to the model and made without probing.Source: §7 · p. 9
  • Magnetic vectors offer a geometric framework for future work on understanding language models.Source: §7 · p. 9

Limitations

The reported linguistic separation is limited to English models and English tasks, and downstream case studies are limited to BERT. The authors also note an adaptation difficulty for autoregressive models and that magnetism's cause remains unexplained.

Limitations

  • Evidence for magnetism's linguistic separation is limited to English models and English tasks.Testing other languages is identified as future work.Source: Limitations · p. 9
  • Downstream case studies are restricted to BERT, so the reported causal links have not been established for other model families.The authors cite BERT's established role in layer-wise research and its linguistically controlled tasks as reasons for this choice.Source: Limitations · p. 9
  • The autoregressive nature of larger models requires a trick to reveal the structure, currently making magnet ablations difficult to adapt downstream.Source: Limitations · p. 9
  • The authors have no concrete explanation for why magnetism occurs; its proposed links to other interpretability work are speculative.Source: Limitations · p. 9

A Magnetic Vector Implementation Details

The implementation identifies magnetic vectors through token-wise linear regressions that can be parallelized as one least-squares matrix equation. Assessing tokens, including special tokens, supports adaptation across models and tokenization architectures.

A Magnetic Vector Implementation Details

B Dataset Curation

The authors hand-curated online paragraphs across varied domains to examine natural language. Token-level labeling required aligning tokens to word-level part-of-speech labels, a laborious step that limited dataset size.

B Dataset Curation

  • The dataset comprises 100 hand-crafted paragraphs sampled from online documents across seven domains, chosen to represent complete ideas.The domains are Sports, Politics, History, Medicine, News, Technology, and Science.Source: B Dataset Curation · p. 11
  • The research team collected the data without external help or annotators from freely available online sources.Source: B Dataset Curation · p. 11
  • Token-to-word alignment was laborious, limiting dataset size, while the collection spans varied domains and supports a unanimous pattern across model families and sizes.Word-level part-of-speech labels were converted to token-level labels: 0 for function and 1 for content.Source: B Dataset Curation · p. 11

C Magnet Polarity Transition Across Layers

Magnet polarities generally shift from early-layer repulsion through middle-layer reorganization to later-layer establishment, though patterns vary by model. The authors also describe a duplicated-input procedure for calculating magnets in decoder models.

C Magnet Polarity Transition Across Layers

  • Early layers are dominated by repelling vectors, and early magnet polarity distinguishes function from content tokens; some models retain this pattern through much of their depth.The plotted counts do not account for magnet strength, so some counted magnets may be weak.Source: C Magnet Polarity Transition Across… · p. 12
  • Middle layers reorganize polarity, with gradual transitions and occasional reversals, especially in larger models; the authors speculate these may reflect linguistic tasks or architectural differences.They call the graph-shaped transitions a “bowtie effect.”Source: C Magnet Polarity Transition Across… · p. 12
  • Strong magnets are seldom found in BERT’s middle layers, preventing similar causal ablations to investigate the transition; decoder-model ablations remain future work.Source: C Magnet Polarity Transition Across… · p. 12
  • At final layers, all models except Qwen establish one polarity; the authors hypothesize this may reflect geometric stabilization before prediction by language-model heads.They state that further work is needed to understand this behavior.Source: C Magnet Polarity Transition Across… · p. 12

D Special Consideration for Decoder Models

  • For decoder models, the authors duplicate each paragraph as input and calculate magnets only on the second half, avoiding causal masking while balancing token counts and context.Calculating backward with causal masking skewed regression scores because earlier tokens have fewer other tokens to consider.Source: D Special Consideration for Decoder… · p. 12

E BERT Downstream Tasks

The BERT downstream-task analyses use task-specific methods to examine magnets, while accompanying figures illustrate answer carving, sentiment-related magnets, and polarity counts across layers. Additional examples show linguistic separation at selected layers and models.

E BERT Downstream Tasks

  • Figure 7 counts repelling and attracting vectors across layers and shows a bowtie-like transition, but the counts exclude magnet strength.Source: Figure 7 · p. 13
  • Because QA answer tokens are known, the authors test whether they are more repelling than non-answer tokens; for POS and sentiment, they use causal ablations because token contributions are unclear.They use the Wilcoxon signed-rank test and rank-biserial correlation to quantify the QA comparison; zero-ablating answer tokens would confound magnetism with removing answer context.Source: E BERT Downstream Tasks · p. 13

F Function and Content Separation Figures

  • Figures 10–17 provide additional linguistic striation and model-processing examples; their layers were chosen arbitrarily and roughly evenly spaced to demonstrate transitions throughout the model.Source: F Function and Content Separation… · p. 13

E BERT Downstream Tasks

  • In the QA example, answer tokens are carved out as repelling magnets; in sentiment classification, strong magnets include negative sentiment adjectives in a correctly classified example.Source: Figure 8 · p. 14, Figure 9 · p. 14
Loading 2609.05743v1…