Can AI Mature a Model's Geometry? Training-Free Weight Baking in LLMs
Organizations: College of Engineering & Computer Science, VinUniversity, Hanoi, Vietnam. · College of Health Science, VinUniversity, Hanoi, Vietnam · Institute of Psychiatry, Psychology & Neuroscience, King’s College London, UK.
Abstract
Can an AI make a trained language model more mature, in the sense of a better organized latent space, by looking only at the geometry of that space? An analyst model reads a fixed-size digest of topological descriptors of the layers of a frozen target and proposes a transformation, which closed-form ridge regression writes into the feed-forward weights without gradient training. Using lightweight models, 126 runs show that category purity rose on unseen words and sentences, benchmark accuracy stayed within sampling error, and the analyst matched a category-aware heuristic with gentler edits. In a five-model round robin approach, 16 pairs raised purity and four left the target unchanged. The results provide a baseline for future work on LLM-guided, training-free model editing without using raw weights.
Figures & tables
| Descriptor | Plain-language meaning | How it is computed |
|---|---|---|
| Purity | How many of a word’s nearest neighbors belong to its own category; high means clean groups. | Mean, over words, of the share of the nearest neighbors with the same label. |
| Silhouette | How much closer a word is to its own category than to the other categories. | Mean silhouette under cosine distance. |
| Anisotropy | How narrow a cone the vectors fill; high means a few directions dominate. | Mean pairwise cosine similarity of the word vectors. |
| Category-pair conflation | How often words of two categories are each other’s neighbors; high means the two are mixed. | , where is the mean share of the neighbors of words in that belong to . |
| Intrinsic dimension | How many independent directions the point cloud actually uses. | Two-NN estimate from first- and second-neighbor distances. |
| Betti number | How many separate pieces the point cloud falls into. | Connected components in the persistent homology of the cosine-distance filtration, at the 25th percentile of pairwise distances. |
| Quantity | Per edit | Cumulative |
|---|---|---|
| KL to the original model | ||
| Guard-set perplexity | ||
| CKA to the original model | – | |
| Mean relative feature change | – | |
| Relative weight change | – |
| Qwen | SmolLM2 | |||
|---|---|---|---|---|
| Digest | KL | KL | ||
| (i) , | .010–.021 | .09–.11 | .003–.000 | .07–.14 |
| (ii) + | .004–.016 | .08–.09 | .001–.007 | .09–.17 |
| (iii) + ID, Betti | .020–.027 | .08–.10 | .001–.009 | .07–.14 |
| (iv) Full | .020–.029 | .09–.10 | .010–.012 | .08–.10 |
| Arm | Mode | CKA t | KL | |||
|---|---|---|---|---|---|---|
| LLM | Seq. | .010–.029 | .96–.99 | .08–.10 | 6–9 | .01–.01 |
| LLM | Par. | .004–.029 | .90–.92 | .70–1.23 | 104–185 | .09–.01 |
| Heur. | Seq. | .009–.029 | .94–.98 | .11–.12 | 5–9 | .04–.01 |
| Heur. | Par. | .107– .037 | .48–.58 | 3.97–5.56 | 4,000 | .26– .20 |
| Target | ||||||
|---|---|---|---|---|---|---|
| Analyst | Gemma | Llama | Phi | Qwen | SmolLM2 | Mean |
| Gemma | – | .016 (20) | .022 (21) | .029 (13) | .011 (13) | .019 |
| Llama | .010 (6) | – | .010 (20) | .022 (18) | .014 (13) | .014 |
| Phi | 0 (0) | .005 (27) | – | .007 (21) | .007 (9) | .005 |
| Qwen | 0 (0) | .033 (1) | .003 (1) | – | .006 (1) | .010 |
| SmolLM2 | 0 (0) | .002 (10) | .018 (7) | .000 (2) | – | .005 |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Main study | Hugging Face repository | Params (M) | |||
|---|---|---|---|---|---|---|
| Gemma-2-2B | Analyst | unsloth/gemma-2-2b-it | 26 | 2304 | 9216 | 2,614 |
| Qwen2.5-1.5B | Target | Qwen/Qwen2.5-1.5B-Instruct | 28 | 1536 | 8960 | 1,544 |
| SmolLM2-1.7B | Target | HuggingFaceTB/SmolLM2-1.7B-Instruct | 24 | 2048 | 8192 | 1,711 |
| Llama-3.2-3B | – | unsloth/Llama-3.2-3B-Instruct | 28 | 3072 | 8192 | 3,213 |
| Phi-3-mini | – | microsoft/Phi-3-mini-4k-instruct | 32 | 3072 | 8192 | 3,821 |
| Quantity | Limit |
|---|---|
| Operations per edit | |
| Mean relative feature change | |
| Gain | ( relaxed) |
| KL per edit; cumulative (nats per token, guard set) | ; |
| Guard-set perplexity, per edit; cumulative | ; |
| Per-edit layer CKA (probe words, guard tokens) |
| Arm | Target | Proposer and stage | Seed | Edits | ||
|---|---|---|---|---|---|---|
| LLM arm | Qwen | analyst, strict | 0 | 3 | 1 | 2 |
| 1 | 7 | 0 | 7 | |||
| 2 | 8 | 0 | 8 | |||
| analyst, relaxed | 0 | 10 | 10 | 0 | ||
| 1 | 13 | 13 | 0 | |||
| 2 | 15 | 13 | 2 |
| Target | Threshold | Seed | Ed. | CKA w | KL | ||||
|---|---|---|---|---|---|---|---|---|---|
| Qwen | 0 | 11 | 0.0334 | 0.0328 | 0.0120 | 0.900 | 0.100 | 7.03 | |
| 1 | 10 | 0.0373 | 0.0304 | 0.0142 | 0.872 | 0.107 | 7.95 | ||
| 2 | 10 | 0.0332 | 0.0184 | 0.0087 | 0.868 | 0.076 | 5.67 | ||
| 0 | 10 | 0.0342 | 0.0344 | 0.0131 | 0.917 | 0.091 | 6.27 | ||
| 1 | 8 | 0.0358 | 0.0296 | 0.0126 | 0.889 | 0.089 | 6.17 | ||
| 2 | 8 | 0.0333 | 0.0228 | 0.0108 | 0.892 | 0.062 | 4.64 |
| Target | Categories | Seed | Ed. | CKA w | KL | ||||
|---|---|---|---|---|---|---|---|---|---|
| Qwen | 4 | 0 | 19 | 0.0159 | 0.0200 | 0.0339 | 0.773 | 0.067 | 8.21 |
| 1 | 16 | 0.0376 | 0.0325 | 0.0228 | 0.795 | 0.076 | 6.46 | ||
| 2 | 15 | 0.0310 | 0.0349 | 0.0463 | 0.857 | 0.084 | 6.14 | ||
| 8 | 0 | 13 | 0.0239 | 0.0287 | 0.0235 | 0.897 | 0.089 | 6.45 | |
| 1 | 20 | 0.0269 | 0.0196 | 0.0484 | 0.935 | 0.086 | 6.96 | ||
| 2 | 23 | 0.0156 | 0.0264 | 0.0453 | 0.919 | 0.104 | 8.72 |
| Target | Categories | Seed | Ed. | CKA w | KL | ||||
|---|---|---|---|---|---|---|---|---|---|
| Qwen | 4 | 0 | 21 | 0.0551 | 0.0821 | 0.0696 | 0.798 | 0.112 | 13.81 |
| 1 | 19 | 0.0520 | 0.0454 | 0.0584 | 0.796 | 0.119 | 14.15 | ||
| 2 | 19 | 0.0563 | 0.0535 | 0.0649 | 0.781 | 0.115 | 13.59 | ||
| 8 | 0 | 23 | 0.0344 | 0.0285 | 0.0158 | 0.837 | 0.115 | 8.14 | |
| 1 | 21 | 0.0315 | 0.0235 | 0.0153 | 0.849 | 0.110 | 8.05 | ||
| 2 | 20 | 0.0360 | 0.0162 | 0.0110 | 0.812 | 0.108 | 8.26 |
| ID | ||||||||
|---|---|---|---|---|---|---|---|---|
| Target | Arm | Seed | orig. | edited | orig. | edited | orig. | edited |
| Qwen | LLM arm | 0 | 6.6 | 4.2 | 2.6 | 2.5 | 21.3 | 21.3 |
| 1 | 8.1 | 4.2 | 4.2 | 3.2 | 19.1 | 18.7 | ||
| 2 | 6.6 | 3.1 | 4.0 | 2.6 | 20.6 | 21.0 | ||
| Heuristic | 0 | 9.5 | 5.4 | 2.8 | 2.4 | 21.0 | 21.2 | |
| 1 | 7.7 | 4.4 | 4.3 | 3.0 | 19.1 | 18.8 | ||
| Work | Input to the editor | Edit target | Fitted component |
|---|---|---|---|
| Weight-Space Programming [ 6 ] | Raw weights as text (with tools at 0.8B parameters) | Weights, for a behavioral goal | None (no gradient training) |
| ROME [ 4 ] | One factual association | One feed-forward weight, rank one | Closed-form update |
| LEACE [ 5 ] | Concept labels | Linear map that erases one concept | Closed-form map |
| Activation steering [ 24 , 3 , 25 ] | Contrast activations or probes | Hidden states at inference | Probes in [ 24 ] ; none (mean difference) in [ 3 , 25 ] |
| Curveball steering [ 30 ] | Activation geometry | Hidden states, nonlinear | Kernel PCA on activations |
| Riemannian-manifold steering [ 31 ] | Output distances | Hidden states along geodesics | Learned encoder |
Language Model Editing
Language model editing changes a model’s knowledge or behavior, or revises its outputs, while aiming to preserve unrelated capabilities.
See all 90 papers