Skip to content
InteractiveLive

Do Llamas think in English? A sphere you can rotate

Ask Llama-2 to translate fleur into Chinese and its middle layers say flower, in English, before the last layers settle on 花. A rotatable sphere shows why: the hidden state moves from input space through an English-leaning concept space to the output language.

Published
Topics
  • Interpretability
  • Multilingual
  • Logit lens
  • Llama-2
  • Interactive

The question

Llama-2 learned from text that was about 90% English, yet it translates French into Chinese without trouble. Does it quietly translate into English first? Wendler, Veselovsky, Monea and West decoded every layer with the logit lens and found three phases: early layers read no language at all, middle layers read the English word, and only the last layers switch to the target language.

Their answer is not quite: the middle of the model works in a space of concepts, and that space leans toward English. The paper explains it with a small sketch of a sphere. This explainer is that sketch, expanded so you can rotate it, steer the hidden state by hand and watch the numbers change.

What it covers

  • The logit lens, and why the authors chose it over the tuned lens
  • The translation, repetition and cloze tasks, and how the word lists are filtered
  • The three phases: input space, concept space, output space
  • Why the hidden state lives on a sphere of radius √d, and what token energy measures
  • Where the toy model departs from the paper, and the limits the authors point out
  • What later work found about language-agnostic concepts

What you can do with it

  • Pick a task, a word, the source and target language, and a 7B, 13B or 70B model
  • Scrub or play through every layer and watch the hidden state move across the sphere
  • Drag the hidden state yourself and see what the logit lens would read
  • Turn the English bias of concept space down to 0% and watch the English detour vanish
  • Read entropy, token energy and per-language probability for every layer, as in the paper's Figure 4

Questions

Do multilingual LLMs think in English?
Not exactly. Wendler et al. (2024) find that Llama-2's middle layers work in an abstract concept space, but that space sits closer to English tokens than to other languages, so the logit lens reads the English word there before the model switches to the target language.
What is token energy?
A measure from the paper of how much of a hidden state lies in the directions the output vocabulary uses. In the middle layers the logit lens is already confident, yet token energy is low: most of the hidden state points somewhere the vocabulary doesn't.
Why draw the hidden state on a sphere?
Llama normalizes the hidden state with RMSNorm before each use, which rescales every vector to the same size. So the vectors the model actually reads lie on a hypersphere of radius √d, about 90.5 for Llama-2-70B.

Credits

Do Llamas think in English? stands on open-source work and published research. Thank you to everyone behind it.

More from Sarvabhaum

Web appLive

attnlab

A set of labs, walked in order, that run real TransformerLens models behind a web page. Type a prompt, pick a model, and see how it is tokenized, where every head attends, and when the model knows its answer.

  • Mechanistic interpretability
  • TransformerLens
  • Attention
InteractiveLive

The geometry of refusal

Somewhere in the middle of a chat model, the residual stream decides whether to help you or say "I can't." A rotatable globe and measured numbers from the papers' own code show one refusal direction, a separate harmfulness direction, and where the 3D picture stops being a good guide.

  • Interpretability
  • AI safety
  • Refusal
Web appLive

Speculative Decoding Playground

A small draft model guesses a few tokens, a large target model checks them all in one forward pass, and the text comes out exactly as the large model alone would write it. The playground runs that loop on real models and lets you inspect every round.

  • Inference
  • Speculative decoding
  • Sampling