Invariant Atoms: Sparse Coordinates of Local Semantic Geometry in Language Model Representations
Organizations: Department of Computer Science University of Nebraska Omaha, Omaha, NE, USA
Abstract
Large language models often preserve meaning despite substantial changes in wording, style, and syntax, while small semantic edits can systematically alter their hidden representations. This suggests that semantic variation may be organized along recurring local directions. We propose the Invariant Atom Hypothesis: local semantic motion admits preferred sparse coordinates along directions that remain stable under meaning-preserving transformations. We learn a shared semantic frame and sparse coordinates that reconstruct semantic displacements while suppressing nuisance variation, with anchor-dependent diagonal modulation adjusting atom strengths without sample-specific rotations. Empirically, the atoms exhibit strong semantic--nuisance separation, sparse reconstruction, reproducible directions, and causal effects on model predictions. The learned geometry generalizes to unseen semantic neighborhoods and nuisance families, while local reweighting improves semantic selectivity and preserves a consistent global-to-local structure. Atom signatures also remain stable under model modification. These findings support reusable invariant directions as a sparse coordinate system for local semantic geometry in language models.
Figures & tables
| Model | Learned | Baselines | |||
|---|---|---|---|---|---|
| Global | Local | Recon | PCA | Random | |
| Mistral | 1.27 | 1.42 | 0.69 | 0.70 | 0.68 |
| LLaMA | 1.88 | 1.98 | 0.89 | 0.83 | 0.79 |
| Gemma | 1.59 | 2.12 | 0.62 | 0.65 | 0.59 |
| Qwen | 1.63 | 1.84 | 0.73 | 0.76 | 0.71 |
| GLM | 2.05 | 2.19 | 1.02 | 0.93 | 0.86 |
| Deletion | Injection | |||
|---|---|---|---|---|
| Model | Active | Inactive | Shuffled | Active |
| Mistral | 0.125 | 0.000 | 0.006 | 0.105 |
| LLaMA | 0.099 | 0.003 | 0.005 | 0.141 |
| Gemma | 0.101 | 0.005 | 0.008 | 0.084 |
| Qwen | 0.177 | 0.003 | 0.004 | 0.152 |
| GLM | 0.074 | 0.001 | 0.005 | 0.084 |
| Generalization Test | Global | Local |
|---|---|---|
| Unseen neighborhoods: Cos transfer | – | – |
| Unseen neighborhoods: | – | – |
| Held-out SP families: | – | – |
| Model | PCA | Global | Local |
|---|---|---|---|
| Mistral | .292 | .458 | .370 |
| LLaMA | .294 | .403 | .309 |
| Gemma | .242 | .345 | .230 |
| Qwen | .204 | .291 | .228 |
| GLM | .286 | .363 | .288 |
| DeepSeek | .248 | .368 | .260 |
| Model | Base | Fine-tuned | Distilled |
|---|---|---|---|
| Mistral | .849 | .852 | .859 |
| LLaMA | .872 | .873 | .870 |
| Qwen | .866 | .861 | .861 |
| GLM | .869 | .866 | .866 |
| DeepSeek | .851 | .851 | .851 |
| Falcon | .857 | .850 | .853 |
Appendix figures & tables26 assets
Supplementary material from the paper’s appendix.
Appendix
| Domain | # Anchor Groups |
|---|---|
| Animals | 169 |
| Science | 167 |
| Countries | 165 |
| Technology | 133 |
| Food | 110 |
| History | 108 |
| Model | Frame | |||||
|---|---|---|---|---|---|---|
| Mistral | Learned | 0.701 | 0.703 | 1.27 | 1.49 | 21.5 |
| PCA | 0.716 | 0.690 | 0.70 | 2.25 | 25.0 | |
| Random | 0.985 | 0.171 | 0.68 | 2.04 | 30.8 | |
| LLaMA | Learned | 0.729 | 0.670 | 1.88 | 1.61 | 23.0 |
| PCA | 0.750 | 0.652 | 0.83 | 2.37 | 26.5 | |
| Random | 0.984 | 0.176 | 0.79 | 2.06 | 30.8 |
| Model | Full | Recon | Full | Recon | Full | Recon |
|---|---|---|---|---|---|---|
| Mistral | 0.701 | 0.671 | 1.27 | 0.69 | 1.49 | 2.34 |
| LLaMA | 0.729 | 0.709 | 1.88 | 0.89 | 1.61 | 2.55 |
| Gemma | 0.711 | 0.676 | 1.59 | 0.62 | 2.50 | 4.14 |
| Qwen | 0.682 | 0.652 | 1.63 | 0.73 | 1.77 | 3.21 |
| GLM | 0.716 | 0.695 | 2.05 | 1.02 | 1.48 | 2.13 |
| SC Type | LLaMA | Qwen | GLM | DeepSeek |
|---|---|---|---|---|
| Entity | 0.56 | 0.56 | 0.58 | 0.49 |
| Attribute | 0.82 | 0.74 | 0.83 | 0.60 |
| Relation | 1.35 | 1.15 | 1.27 | 0.81 |
| Negation | 3.80 | 3.57 | 4.82 | 1.69 |
| Quantity | 1.52 | 1.53 | 1.76 | 0.91 |
| Temporal | 2.32 | 1.66 | 2.05 | 1.46 |
| SP Style | Learned | PCA | Random |
|---|---|---|---|
| Formal | 7.98 | 2257 | 208 |
| Casual | 10.55 | 3168 | 340 |
| Question | 7.13 | 1965 | 194 |
| Technical | 10.18 | 2599 | 256 |
| Simplified | 10.90 | 2889 | 292 |
| Verbose | 13.07 | 4897 | 465 |
| LLaMA-3.1-8B | |||||
|---|---|---|---|---|---|
| 4 | 0.918 | 0.361 | 1.88 | 2.38 | 3.2 |
| 8 | 0.875 | 0.462 | 1.83 | 2.28 | 6.2 |
| 16 | 0.829 | 0.542 | 1.68 | 2.02 | 11.8 |
| 24 | 0.794 | 0.592 | 1.91 | 1.83 | 17.2 |
| 32 | 0.772 | 0.622 | 1.86 | 1.72 | 22.1 |
| Model | Comparison | Mean | Median | Subspace | |
|---|---|---|---|---|---|
| Mistral | Learned–Learned | 0.711 | 0.820 | 36.4 | 0.845 |
| Learned–PCA | 0.287 | 0.161 | 0.4 | 0.656 | |
| Learned–Random | 0.045 | 0.044 | 0.0 | 0.213 | |
| LLaMA | Learned–Learned | 0.747 | 0.869 | 43.8 | 0.867 |
| Learned–PCA | 0.300 | 0.159 | 1.0 | 0.701 | |
| Learned–Random | 0.045 | 0.045 | 0.0 | 0.213 |
| Objective | Mistral | Qwen | Mistral | Qwen |
|---|---|---|---|---|
| Full | 1.27 | 1.63 | 1.49 | 1.77 |
| Recon-Only | 0.69 | 0.73 | 2.34 | 3.21 |
| No- | 1.24 | 1.54 | 1.51 | 1.92 |
| No- | 1.26 | 1.58 | 1.50 | 1.81 |
| No- / | 0.69 | 0.74 | 2.40 | 3.25 |
| Model | Condition | |||||
|---|---|---|---|---|---|---|
| Mistral | Active | 0.013 | 0.042 | 0.071 | 0.100 | 0.125 |
| Inactive | 0.000 | 0.001 | 0.000 | 0.002 | 0.000 | |
| Shuffled | -0.014 | -0.007 | -0.002 | -0.002 | -0.006 | |
| LLaMA | Active | 0.015 | 0.037 | 0.049 | 0.078 | 0.099 |
| Inactive | 0.000 | -0.001 | -0.002 | 0.000 | -0.003 | |
| Shuffled | -0.017 | -0.003 | -0.001 | -0.005 | -0.005 |
| Global | Local | |||
|---|---|---|---|---|
| Model | Deletion | Injection | Deletion | Injection |
| Mistral | 0.125 | 0.105 | 0.105 | 0.084 |
| LLaMA | 0.099 | 0.141 | 0.080 | 0.125 |
| Gemma | 0.101 | 0.084 | 0.063 | 0.064 |
| Qwen | 0.177 | 0.152 | 0.109 | 0.104 |
| GLM | 0.074 | 0.084 | 0.052 | 0.054 |
| Model | Frame | Seen | Unseen | Seen | Unseen | Seen | Unseen |
|---|---|---|---|---|---|---|---|
| Mistral | Global | 0.709 | 0.723 | 0.695 | 0.680 | 1.29 | 1.17 |
| Local | 0.695 | 0.714 | 0.708 | 0.689 | 1.43 | 1.10 | |
| LLaMA | Global | 0.733 | 0.747 | 0.665 | 0.650 | 1.85 | 1.68 |
| Local | 0.722 | 0.740 | 0.676 | 0.658 | 2.01 | 1.54 | |
| Gemma | Global | 0.718 | 0.732 | 0.679 | 0.665 | 1.67 | 1.30 |
| Global | Local | ||||||
|---|---|---|---|---|---|---|---|
| Model | Split | Train | Held | Transfer | Train | Held | Transfer |
| Mistral | A | 1.86 | 2.42 | 1.30 | 2.52 | 3.60 | 1.43 |
| B | 2.01 | 1.63 | 0.81 | 2.76 | 2.23 | 0.81 | |
| C | 2.07 | 1.29 | 0.62 | 2.87 | 1.78 | 0.62 | |
| LLaMA | A | 2.63 | 3.32 | 1.26 | 3.40 | 4.78 | 1.41 |
| B | 2.80 | 2.37 | 0.85 | 3.67 | 3.11 | 0.85 | |
| Model | Direction | Frame | Seen | Unseen | Transfer |
|---|---|---|---|---|---|
| Mistral | M Q | Global | 1.23 | 1.46 | 1.19 |
| Local | 1.62 | 1.87 | 1.15 | ||
| Q M | Global | 4.09 | 2.02 | 0.49 | |
| Local | 7.60 | 4.48 | 0.59 | ||
| LLaMA | M Q | Global | 1.74 | 2.10 | 1.21 |
| Local | 2.10 | 2.47 | 1.17 |
| Mistral | LLaMA | Gemma | Qwen | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Method | Dim. | R@1 | mAP | R@1 | mAP | R@1 | mAP | R@1 | mAP |
| Raw | .440 | .519 | .419 | .508 | .384 | .472 | .287 | .363 | |
| PCA | 256 | .292 | .366 | .294 | .381 | .242 | .329 | .204 | .273 |
| Global | 256 | .458 | .552 | .403 | .510 | .345 | .447 | .291 | .388 |
| Local | 256 | .370 | .462 | .309 | .413 | .230 | .324 | .228 | .319 |
| Local+ | 256 | .375 | .468 | .313 | .415 | .231 | .325 | .228 | .319 |
| GLM | DeepSeek | Falcon | |||||
|---|---|---|---|---|---|---|---|
| Method | Dim. | R@1 | mAP | R@1 | mAP | R@1 | mAP |
| Raw | .411 | .505 | .407 | .491 | .403 | .498 | |
| PCA | 256 | .286 | .375 | .248 | .330 | .258 | .344 |
| Global | 256 | .363 | .464 | .368 | .466 | .314 | .414 |
| Local | 256 | .288 | .386 | .260 | .353 | .241 | .333 |
| Local+ | 256 | .291 | .389 | .261 | .355 | .241 | .332 |
| Mistral | LLaMA | Qwen | GLM | |||||
|---|---|---|---|---|---|---|---|---|
| Style | Raw | Global | Raw | Global | Raw | Global | Raw | Global |
| Formal | .698 | .681 | .699 | .611 | .578 | .505 | .663 | .555 |
| Casual | .430 | .422 | .460 | .422 | .219 | .228 | .445 | .366 |
| Question | .680 | .671 | .654 | .629 | .552 | .500 | .679 | .611 |
| Technical | .423 | .433 | .403 | .360 | .333 | .292 | .398 | .329 |
| Simplified | .486 | .469 | .440 | .369 | .254 | .223 | .400 | .307 |
| Model | Signature | Base FT | Base Distill | ||
|---|---|---|---|---|---|
| Mistral | Raw | .770 | 41.6 | .932 | 22.5 |
| Global | .811 | 1.89 | .950 | .97 | |
| Local | .817 | .99 | .954 | .50 | |
| LLaMA | Raw | .906 | 26.8 | .953 | 18.9 |
| Global | .942 | 1.11 | .976 | .72 | |
| Model | Signature | Dim. | Base | Fine-tuned | Distilled |
|---|---|---|---|---|---|
| Mistral | Raw | 4096 | .878 | .882 | .887 |
| PCA | 256 | .849 | .852 | .855 | |
| Global | 256 | .849 | .852 | .859 | |
| Local | 256 | .833 | .843 | .843 | |
| TopK | 256 | .809 | .822 | .823 | |
| LLaMA | Raw | 4096 | .892 | .893 | .891 |
| Model | Raw | PCA | Random | Global | Local | TopK |
|---|---|---|---|---|---|---|
| Mistral | 1.000 | .986 | .984 | .986 | .974 | .862 |
| LLaMA | .999 | .937 | .940 | .942 | .907 | .684 |
| Gemma | .992 | .879 | .914 | .898 | .798 | .587 |
| Qwen | .993 | .887 | .891 | .893 | .852 | .636 |
| GLM | .998 | .909 | .916 | .916 | .866 | .632 |
| DeepSeek | .998 | .958 | .958 | .965 | .934 | .769 |
| Cos | Nui. Energy | |||||
|---|---|---|---|---|---|---|
| Method | Qwen | Mistral | Qwen | Mistral | Qwen | Mistral |
| Local | .578 | .540 | 1.60 | 1.87 | 2.27 | 2.21 |
| Global | .562 | .530 | 1.61 | 1.68 | 5.29 | 6.30 |
| PCA | .574 | .528 | 1.29 | 1.36 | 1160.1 | 1757.4 |
| Random | .186 | .172 | 1.32 | 1.54 | 134.4 | 160.0 |
| Model | Frame | |||||
|---|---|---|---|---|---|---|
| Mistral | Global | 0.701 | 0.703 | 1.27 | 1.49 | 21.5 |
| Local | 0.689 | 0.714 | 1.42 | 1.58 | 21.0 | |
| LLaMA | Global | 0.729 | 0.670 | 1.88 | 1.61 | 23.0 |
| Local | 0.719 | 0.679 | 1.98 | 1.86 | 23.1 | |
| Gemma | Global | 0.711 | 0.686 | 1.59 | 2.50 | 21.8 |
| Local | 0.696 | 0.701 | 2.12 | 2.87 | 21.7 |
| Model | Frame | |||
|---|---|---|---|---|
| Mistral | Global | 0.701 | 0.703 | 1.27 |
| Local | 0.689 | 0.714 | 1.42 | |
| LowRank-QR | 0.952 | 0.261 | 9.64 | |
| LowRank-Soft | 0.995 | 0.133 | 8.72 | |
| LLaMA | Global | 0.728 | 0.670 | 1.88 |
| Local | 0.719 | 0.679 | 1.98 |
| Mistral | Gemma | |||
|---|---|---|---|---|
| SC Type | Global | Local | Global | Local |
| Entity | 0.68 | 0.84 | 0.65 | 1.14 |
| Attribute | 0.73 | 0.92 | 0.98 | 1.64 |
| Relation | 0.94 | 1.12 | 1.44 | 2.10 |
| Negation | 2.04 | 2.21 | 2.69 | 3.35 |
| Quantity | 1.26 | 1.41 | 1.60 | 2.21 |
| SP Style | Global | Local | Reduction |
|---|---|---|---|
| Formal | 8.65 | 2.35 | |
| Casual | 8.79 | 2.44 | |
| Question | 6.44 | 1.75 | |
| Technical | 11.65 | 2.74 | |
| Simplified | 9.97 | 2.66 | |
| Verbose | 11.65 | 2.93 |
| Model | Frame | ||||
|---|---|---|---|---|---|
| Epoch 1 | Final | Epoch 1 | Final | ||
| Mistral | Global | 0.605 | 0.355 | 1.312 | 0.040 |
| Local | 0.380 | 0.342 | 0.031 | 0.010 | |
| LowRank-QR | 0.715 | 0.616 | 0.716 | 0.332 | |
| LowRank-Soft | 0.767 | 0.616 | 0.014 | 0.257 | |
| Qwen | Global | 0.599 | 0.355 | 1.910 | 0.043 |
| Model | Layer |
|---|---|
| Mistral-7B-Instruct-v0.3 | 20 |
| LLaMA-3.1-8B-Instruct | 16 |
| Gemma-2-9B | 12 |
| Qwen2.5-7B-Instruct | 20 |
| GLM-4-9B-Chat | 20 |
| DeepSeek-MoE-16B-Chat | 20 |
Representation Geometry in Language Models
Representation geometry in language models studies how embeddings and hidden states organize concepts, computation, and behavior.
See all 417 papers