Plato's Key-a rotation and a global scale let an LLM use other's representations

Hacker News by 17 min read 51x views
Plato's Key-a rotation and a global scale let an LLM use other's representations

Share Post

Plato hands a glowing aureate key alongside a beam of ray to a small robot holding a cupboard of books.

The Platonic Representation Hypothesis (PRH) posits that neural networks converge toward a shared depiction of reality. Prior activity shows that separately trained models study geometrically similar representations, but akin does not average interchangeable. Can one LLM use another’s representations in location of its own, without gradient descent?

Yes, and the map is amazingly simple. A rotation and one earth scale, fit in closed form, let one LLM use another’s representations. We display this on actual recall throughout 12 basis LLMs from eight families (1.5B–27B parameters).

For example, a recipient LLM prompted alongside “The chief of Germany is” answers “Berlin”. We obtain a donor LLM’s hidden province at “France”, rotate and measure it, and toggle it in for the recipient’s province at “Germany”. The recipient’s answer flips to “Paris” (Fig. 1).

Extract. Take the donor’s hidden province at “France”.

Figure 1. Transferring a depiction between LLMs. We toggle a sole hidden state. Tokens run remaining to right, layers base to top.

Our chief findings:

  1. Rotations transfer actual representations throughout LLMs. Our map achieves a median transfer accuracy of 41%, compared to 55% whenever we toggle in the recipient’s own “France” province (self-swap; Fig. 2a). More elastic maps (e.g., ridge regression) rarely transfer better.
  2. Rotations sequence throughout LLMs and activity in lesser dimensions. A sequence of rotations (A → B → C) retains a median 99% of a straightforward rotation’s accuracy (A → C; Fig. 4a). A rotation using fair 256 chief components per LLM retains a median 74% of a complete rotation’s accuracy (Fig. 4b).
  3. Rotations unlock dreary memories in another LLM. A rotated contributor province recovers 18% of the recipient’s dreary memories, facts it stores but fails to recall (Fig. 5). This suggests that actual recall can neglect since of an ineffective depiction fairly than missing cognition in the LLM’s weights.

These findings item toward a shared, lower-dimensional construction throughout LLMs (Fig. 6), beginning up new investigation directions specified as latent communication.

1Rotations transfer actual representations

Geometric similarity does not display whether one LLM can use another’s representations, so we test this immediately on actual recall.

Factual recall in LLMs resembles a key–value lookup: early-to-middle layers build a key at the final topic token (“France”), which afterward layers use to recover the value (“Paris”) from the weights. We swap the key fairly than the value, leaving the recipient’s afterward layers to recover the answer. If this sole hidden-state toggle changes the answer to “Paris”, the depiction has transferred.

Our map aligns keys throughout icy LLMs using only a rotation and one earth scale, fit in closed form on small than 5,000 training facts that the two LLMs recall.

Let be the average keys and the centered key matrices (one key per column) of the contributor and recipient, respectively. We compute the orthogonal Procrustes rotation via a lean SVD and choose the earth measure to approximately equivalent the recipient’s general spread:

Here, “rotation” includes reflections and semi-orthogonal maps between distinct hidden dimensions.

We test the map on 20 example pairs using 8,800 facts, all a topic and its answer under one of 16 relations, specified as capitals and authors. Our 12 basis LLMs extend eight families (1.5B–27B parameters; Fig. 6). For all pair, we use lone facts that the two LLMs recall on their own. We measure transfer accuracy as the percent of swaps that create the recipient create the donor’s answer (Fig. 1). We divided facts by topic into training, validation, and test sets: we fit the map on training facts, choose the toggle layers (ℓA in the contributor and ℓB in the recipient) that maximize validation transfer accuracy, and study test results.

aRotated keys accomplish 41% transfer accuracyone dot per example pair0%20%40%60%transfer accuracy (test facts)own key (self-swap)Llama-3.1-8B → Mistral-7B: self-swap: 44% transfer accuracyLlama-3.1-8B → Llama-3.2-3B: self-swap: 46% transfer accuracyGemma-2-27B → Llama-3.1-8B: self-swap: 50% transfer accuracyQwen2.5-14B → Llama-3.1-8B: self-swap: 51% transfer accuracyGemma-2-9B → Llama-3.1-8B: self-swap: 51% transfer accuracyGemma-2-9B → Gemma-2-27B: self-swap: 51% transfer accuracyLlama-3.2-3B → Llama-3.1-8B: self-swap: 53% transfer accuracyGemma-2-27B → Gemma-2-9B: self-swap: 53% transfer accuracyDeepSeek-7B → Llama-3.1-8B: self-swap: 54% transfer accuracyLlama-3.1-8B → Falcon3-7B: self-swap: 55% transfer accuracyLlama-3.1-8B → Gemma-2-9B: self-swap: 56% transfer accuracyQwen2.5-14B → Qwen2.5-7B: self-swap: 56% transfer accuracyGranite-3.1-2B → Llama-3.1-8B: self-swap: 57% transfer accuracyGLM-4-9B → Llama-3.1-8B: self-swap: 57% transfer accuracyLlama-3.1-8B → Qwen2.5-7B: self-swap: 57% transfer accuracyGemma-2-9B → Qwen2.5-7B: self-swap: 59% transfer accuracyQwen2.5-7B → Qwen2.5-1.5B: self-swap: 63% transfer accuracyQwen2.5-14B → Qwen2.5-1.5B: self-swap: 63% transfer accuracyQwen2.5-7B → Qwen2.5-14B: self-swap: 65% transfer accuracyQwen2.5-1.5B → Qwen2.5-7B: self-swap: 65% transfer accuracy55%rotated contributor keyLlama-3.1-8B → Mistral-7B: rotated key: 34% transfer accuracyLlama-3.1-8B → Qwen2.5-7B: rotated key: 35% transfer accuracyGemma-2-27B → Llama-3.1-8B: rotated key: 35% transfer accuracyQwen2.5-14B → Qwen2.5-7B: rotated key: 37% transfer accuracyQwen2.5-14B → Qwen2.5-1.5B: rotated key: 38% transfer accuracyGranite-3.1-2B → Llama-3.1-8B: rotated key: 38% transfer accuracyQwen2.5-7B → Qwen2.5-1.5B: rotated key: 39% transfer accuracyGemma-2-27B → Gemma-2-9B: rotated key: 39% transfer accuracyQwen2.5-14B → Llama-3.1-8B: rotated key: 40% transfer accuracyLlama-3.1-8B → Gemma-2-9B: rotated key: 40% transfer accuracyGemma-2-9B → Llama-3.1-8B: rotated key: 41% transfer accuracyLlama-3.1-8B → Falcon3-7B: rotated key: 41% transfer accuracyLlama-3.1-8B → Llama-3.2-3B: rotated key: 43% transfer accuracyGemma-2-9B → Qwen2.5-7B: rotated key: 43% transfer accuracyQwen2.5-1.5B → Qwen2.5-7B: rotated key: 43% transfer accuracyDeepSeek-7B → Llama-3.1-8B: rotated key: 44% transfer accuracyQwen2.5-7B → Qwen2.5-14B: rotated key: 45% transfer accuracyLlama-3.2-3B → Llama-3.1-8B: rotated key: 45% transfer accuracyGemma-2-9B → Gemma-2-27B: rotated key: 45% transfer accuracyGLM-4-9B → Llama-3.1-8B: rotated key: 46% transfer accuracy41%controlsbest authority per pair: 0.6%–2.2%at most 2.2%bOther maps rarely attack our rotationsignificant differences from our rotationbetternot significantworseridge, rescaledridge, rescaled: improved than the rotation in 4 of 20 pairs4ridge, rescaled: no important difference in 13 of 20 pairs13ridge, rescaled: worse than the rotation in 3 of 20 pairs3whitened rotationwhitened rotation: improved than the rotation in 2 of 20 pairs2whitened rotation: no important difference in 13 of 20 pairs13whitened rotation: worse than the rotation in 5 of 20 pairs5trained MLPtrained MLP: improved than the rotation in 1 of 20 pairs1trained MLP: no important difference in 8 of 20 pairs8trained MLP: worse than the rotation in 11 of 20 pairs11ridge regressionridge regression: improved than the rotation in 1 of 20 pairs1ridge regression: no important difference in 8 of 20 pairs8ridge regression: worse than the rotation in 11 of 20 pairs11least-squares scaleleast-squares scale: no important difference in 7 of 20 pairs7least-squares scale: worse than the rotation in 13 of 20 pairs13Wasserstein ProcrustesWasserstein Procrustes: no important difference in 4 of 20 pairs4Wasserstein Procrustes: worse than the rotation in 16 of 20 pairs1601020model pairs

Figure 2. Transfer accuracy throughout 20 example pairs. (a) Each dot represents one example pair; lines grade medians. Controls contain random and shuffled rotations. (b) Number of example pairs anywhere all map performs considerably improved or worse than our rotation (Holm-corrected p < 0.05).
  • Our rotation achieves a median transfer accuracy of 41% (range: 34–46%; Fig. 2a). For comparison, self-swap achieves a median accuracy of 55%. In a self-swap, we substitute the recipient’s key for “Germany” alongside its own key for “France” at tier ℓB (as in Fig. 1, but inside one model). Since data concerning “Germany” remains in another tokens and layers, the answer does not continually flip. We use self-swap as our citation since it requires no cross-model mapping. Across example pairs, our rotation retains a median 73% of self-swap accuracy (range: 60–93%). Retention is akin for cross-family and within-family pairs (75% vs. 69%).
  • Other maps rarely attack our rotation (Fig. 2b). At the identical toggle layers (ℓA, ℓB), ridge regression without rescaling, a whitened rotation, and a trained MLP considerably outperform our rotation in lone 7% of comparisons. Rescaling makes ridge regression competitive, during a least-squares measure never considerably improves transfer accuracy. Both propose that keeping the recipient’s customary measure matters, and least-squares fits underestimate it. Even without paired facts, Wasserstein Procrustes achieves a median 87% of our rotation’s accuracy.
  • Geometric similarity does not justify functional transfer. We use mutual nearest-neighbor similarity (mKNN), the chief metric in the PRH paper, to choose toggle layers. On the identical validation set, selecting layers by mKNN yields a median transfer accuracy of 4.5%, concerning a tenth of what selecting by transfer accuracy achieves. mKNN normally peaks inside the archetypal 5% of the recipient’s depth, during transfer accuracy peaks at 22–38% of the depth.

Representations can be geometrically akin without being functionally interchangeable. Yet a uncomplicated alter of coordinates lets one LLM use another’s representations.

2Rotations sequence and activity in lesser dimensions

Rotations align pairs of LLMs, but do all LLMs portion one underlying geometry? If so, a sequence of rotations (A → B → C) should transfer nearly as fine as a straightforward rotation (A → C). We additionally ask how many dimensions actual transfer needs (Fig. 3).

Chaining. A sequence of rotations (A → B → C) retains a median 99% of the transfer accuracy of a straightforward rotation (A → C).

Figure 3. Chaining rotations and compressing representations. Each disc represents one LLM’s depiction space.
  • A sequence of rotations retains a median 99% of the straightforward rotation’s transfer accuracy (Fig. 4a). For LLMs A, B, and C, we create the (A → B) and (B → C) maps without using the straightforward (A → C) map or operating B. The recipient tier of (A → B) is the contributor tier of (B → C). We measure the two the chained and straightforward maps at the identical endpoint layers on test facts that all three LLMs recall. Of the 47 chains, 40 keep at smallest 95% of the straightforward rotation’s accuracy, and none falls below 92%.
  • A rotation using 256 chief components per LLM retains a median 74% of the complete rotation’s transfer accuracy (Fig. 4b). We decrease all LLM’s first width (1,536–5,120 dimensions) to its top chief components, fit the map, and set the recipient’s remaining components to their training mean. The median related accuracy rises from 4% alongside 16 components to 87% alongside 512, alongside diminishing gains beyond 256 components.

aChaining retains 99% of straightforward accuracychain (A → B → C) vs. straightforward (A → C), one dot per chain40 of 47 chains keep at smallest 95%90%95%100%105%direct (A → C)Llama-3.1-8B → Gemma-2-9B → Qwen2.5-7B: sequence keeps 92.3% of straightforward (33.0% vs 35.7%)Qwen2.5-14B → Qwen2.5-1.5B → Qwen2.5-7B: sequence keeps 92.5% of straightforward (43.1% vs 46.6%)Qwen2.5-14B → Qwen2.5-7B → Qwen2.5-1.5B: sequence keeps 93.7% of straightforward (35.6% vs 38.0%)Gemma-2-27B → Llama-3.1-8B → Qwen2.5-7B: sequence keeps 94.1% of straightforward (34.4% vs 36.6%)Gemma-2-27B → Gemma-2-9B → Qwen2.5-7B: sequence keeps 94.5% of straightforward (35.2% vs 37.3%)Gemma-2-9B → Llama-3.1-8B → Falcon3-7B: sequence keeps 94.6% of straightforward (45.0% vs 47.6%)DeepSeek-7B → Llama-3.1-8B → Qwen2.5-7B: sequence keeps 94.7% of straightforward (39.3% vs 41.5%)Gemma-2-9B → Qwen2.5-7B → Qwen2.5-1.5B: sequence keeps 95.1% of straightforward (40.2% vs 42.3%)GLM-4-9B → Llama-3.1-8B → Qwen2.5-7B: sequence keeps 95.2% of straightforward (45.0% vs 47.3%)Gemma-2-27B → Llama-3.1-8B → Gemma-2-9B: sequence keeps 95.5% of straightforward (39.1% vs 41.0%)Granite-3.1-2B → Llama-3.1-8B → Llama-3.2-3B: sequence keeps 95.8% of straightforward (33.6% vs 35.1%)DeepSeek-7B → Llama-3.1-8B → Gemma-2-9B: sequence keeps 96.0% of straightforward (42.3% vs 44.1%)Qwen2.5-7B → Qwen2.5-14B → Qwen2.5-1.5B: sequence keeps 96.1% of straightforward (36.1% vs 37.6%)Gemma-2-27B → Gemma-2-9B → Llama-3.1-8B: sequence keeps 96.6% of straightforward (35.8% vs 37.1%)Gemma-2-9B → Gemma-2-27B → Llama-3.1-8B: sequence keeps 96.8% of straightforward (41.9% vs 43.3%)Gemma-2-9B → Llama-3.1-8B → Mistral-7B: sequence keeps 97.2% of straightforward (36.9% vs 38.0%)GLM-4-9B → Llama-3.1-8B → Llama-3.2-3B: sequence keeps 97.3% of straightforward (43.9% vs 45.2%)Granite-3.1-2B → Llama-3.1-8B → Qwen2.5-7B: sequence keeps 97.4% of straightforward (34.5% vs 35.5%)Llama-3.1-8B → Qwen2.5-7B → Qwen2.5-1.5B: sequence keeps 98.3% of straightforward (33.3% vs 33.8%)Qwen2.5-7B → Qwen2.5-14B → Llama-3.1-8B: sequence keeps 98.4% of straightforward (40.9% vs 41.6%)Gemma-2-27B → Llama-3.1-8B → Falcon3-7B: sequence keeps 98.4% of straightforward (37.7% vs 38.3%)Llama-3.2-3B → Llama-3.1-8B → Mistral-7B: sequence keeps 98.5% of straightforward (32.1% vs 32.6%)DeepSeek-7B → Llama-3.1-8B → Llama-3.2-3B: sequence keeps 99.0% of straightforward (39.3% vs 39.7%)DeepSeek-7B → Llama-3.1-8B → Falcon3-7B: sequence keeps 99.0% of straightforward (46.8% vs 47.2%)Llama-3.2-3B → Llama-3.1-8B → Qwen2.5-7B: sequence keeps 99.1% of straightforward (32.2% vs 32.5%)Qwen2.5-1.5B → Qwen2.5-7B → Qwen2.5-14B: sequence keeps 99.2% of straightforward (44.1% vs 44.5%)Gemma-2-9B → Llama-3.1-8B → Qwen2.5-7B: sequence keeps 99.4% of straightforward (44.5% vs 44.7%)DeepSeek-7B → Llama-3.1-8B → Mistral-7B: sequence keeps 99.6% of straightforward (36.8% vs 36.9%)Gemma-2-9B → Qwen2.5-7B → Qwen2.5-14B: sequence keeps 99.7% of straightforward (48.6% vs 48.7%)GLM-4-9B → Llama-3.1-8B → Gemma-2-9B: sequence keeps 100.0% of straightforward (50.1% vs 50.1%)Qwen2.5-14B → Llama-3.1-8B → Falcon3-7B: sequence keeps 100.0% of straightforward (43.5% vs 43.5%)Qwen2.5-14B → Llama-3.1-8B → Mistral-7B: sequence keeps 100.0% of straightforward (33.4% vs 33.4%)Granite-3.1-2B → Llama-3.1-8B → Gemma-2-9B: sequence keeps 100.4% of straightforward (40.1% vs 40.0%)Llama-3.2-3B → Llama-3.1-8B → Falcon3-7B: sequence keeps 100.4% of straightforward (39.8% vs 39.6%)Llama-3.2-3B → Llama-3.1-8B → Gemma-2-9B: sequence keeps 100.6% of straightforward (41.8% vs 41.6%)Llama-3.1-8B → Qwen2.5-7B → Qwen2.5-14B: sequence keeps 100.7% of straightforward (40.9% vs 40.7%)Gemma-2-27B → Llama-3.1-8B → Mistral-7B: sequence keeps 100.8% of straightforward (29.3% vs 29.1%)Qwen2.5-14B → Llama-3.1-8B → Gemma-2-9B: sequence keeps 101.7% of straightforward (42.2% vs 41.5%)Qwen2.5-14B → Llama-3.1-8B → Llama-3.2-3B: sequence keeps 101.7% of straightforward (36.0% vs 35.4%)Qwen2.5-14B → Llama-3.1-8B → Qwen2.5-7B: sequence keeps 101.7% of straightforward (38.6% vs 37.9%)Granite-3.1-2B → Llama-3.1-8B → Falcon3-7B: sequence keeps 101.8% of straightforward (38.6% vs 37.9%)Gemma-2-9B → Llama-3.1-8B → Llama-3.2-3B: sequence keeps 102.0% of straightforward (38.3% vs 37.6%)GLM-4-9B → Llama-3.1-8B → Falcon3-7B: sequence keeps 102.4% of straightforward (52.6% vs 51.3%)Llama-3.1-8B → Gemma-2-9B → Gemma-2-27B: sequence keeps 102.4% of straightforward (34.6% vs 33.8%)Granite-3.1-2B → Llama-3.1-8B → Mistral-7B: sequence keeps 102.6% of straightforward (34.0% vs 33.1%)GLM-4-9B → Llama-3.1-8B → Mistral-7B: sequence keeps 103.2% of straightforward (39.4% vs 38.2%)Gemma-2-27B → Llama-3.1-8B → Llama-3.2-3B: sequence keeps 103.4% of straightforward (33.4% vs 32.3%)median 99%chain accuracy as % of directb256 components keep 74% of the transferrotation fit in all model’s top chief components0%25%50%75%100%full rotation (all dimensions)top 16 components: median 4% of the complete rotation (middle fractional 3%–4%)164%top 32 components: median 13% of the complete rotation (middle fractional 11%–16%)32top 64 components: median 35% of the complete rotation (middle fractional 30%–38%)64top 128 components: median 57% of the complete rotation (middle fractional 52%–62%)128top 256 components: median 74% of the complete rotation (middle fractional 70%–81%)25674%top 512 components: median 87% of the complete rotation (middle fractional 80%–89%)51287%top 1,024 components: median 90% of the complete rotation (middle fractional 87%–94%)1,024components kept per example (widths 1,536–5,120)relative transfer accuracy

Figure 4. Transfer accuracy of chained and compressed rotations. (a) Each dot represents one chain; the collection marks 95% of straightforward accuracy and above. (b) Accuracy related to the complete rotation (median and IQR complete 20 example pairs).

Rather than a map for all pair, all LLM power need fair one rotation into a shared, lower-dimensional area (Fig. 6).

3Rotations unlock dreary memories

So far, we have used rotations to alter what an LLM recalls, but could we additionally use this shared geometry to rescue unsuccessful recall? Prior work shows that LLMs shop facts they neglect to recall, which we call dark memories. As a evidence of concept, we use a rotated key from another LLM to unlock them (Fig. 5).

Own key. With its own key for “Interstellar”, the recipient answers “Denis Villeneuve”.

Figure 5. Unlocking a dreary memory. With its own key, the recipient answers incorrectly (“Denis Villeneuve”). With the donor’s rotated key, it recalls the accurate answer (“Christopher Nolan”).
  • More than fractional of the misses we test meet requirements as dreary memories. We collect 2,600 misses from our 20 example pairs: test facts that the contributor recalls on a straightforward immediate but the recipient does not. We figure a young female as a dreary recollection if the recipient passes at smallest one of three checks: answering correctly alongside three in-context examples, answering correctly under a paraphrased prompt, or ranking the accurate answer archetypal among up to 50 answers inside the identical relation. In total, 56% of the recipient’s misses (1,463) meet requirements as dreary memories.
  • A rotated contributor key recovers 18% of these dreary memories. We regain 267 of the recipient’s dreary memories by swapping in rotated contributor keys as in Fig. 5, without updating any weights. No authority recovers additional than 1.1% of them.

Some failures of actual recall can be rescued by changing the key fairly than the weights. A uncomplicated alter of coordinates lets one LLM unlock another’s dreary memories.

Looking ahead

A closed-form rotation and measure let one LLM use another’s representations for actual recall. We peruse this as functional evidence for the PRH: the representations are not fair akin but partially interchangeable. This additionally fits our lab’s perspective of MLPs as Hebbian memories, and suggests that one LLM’s rotated keys can query another’s memory.

We’re extremely enthusiastic to examine two directions:

  • Understanding the shared geometry. Exploring whether LLMs portion a worldwide depiction area (Fig. 6) and whether our findings broaden to multi-hop reasoning, post-trained LLMs, larger models, and another modalities.
  • Building additional productive systems. Porting cognition throughout models without retraining, reusing all other’s hidden states for cheaper inference, and communicating immediately through latent representations (Neuralese).

Twelve views. Each LLM has its own depiction space.

Figure 6. Aligning all 12 LLMs in a sole depiction space?

If you’re curious in exploring these directions alongside us or have any feedback, we’d affection to comprehend from you. Please attain out to Vivien ([email protected]).

Acknowledgements

We appreciate Yasa Baig, Nasim Borazjanizadeh, Kelly Buchanan, Francois Chaubard, Cloris Cheng, Catherine Deng, Roberto Garcia, Junmiao Hu, Hermann Kumbong, Sam Layton, Iddah Mlauzi, Divya Nori, Jon Saad-Falcon, and Stuart Sul for their thoughtful feedback and discussions.

Other Article Hacker News
↑
Close Right Ads
Close Left Ads