Author
- Alan Ensastegui
Published
Before we dive in, let me provide some background so you can get a sense of the significance of what we’re doing today.
Background and motivation
I’m sure you’ve heard about AI at this point. But what you might not have heard is that we don’t have a clear grasp of how it works. At least not in the sense of how we understand most software.
You see, Large Language Models (LLMs), the type of models provided through services like ChatGPT or Claude, grow into their capabilities. With most software, capabilities are written by code that tells the computer exactly what to do.Whether the code is correct or not is a completely different question.
With LLMs, we give them a string of text and then they somehow respond with an answer.
What is mechanistic interpretability?
Mechanistic interpretability is a field of AI research that aims to understand how neural networks actually work internally…
Imagine you were tasked with writing a response for every possible question.
if question == "What is mechanistic interpretability?" then
answer = "Mechanistic interpretability is a field of AI research…"
else if question == "What is the capital of France?" then
answer = "The capital of France is Paris."
else if question == "How do I boil an egg?" then
answer = "Lower it into boiling water for about ten minutes."
# …and so on, for every question anyone could ask
else
answer = "Sorry, I don't know."Thankfully no one had to do that. And yet, LLMs still always have something to say.
With a huge corpus of data1, very powerful computers2, and the magical process of gradient descentThink of gradient descent as a walk downhill. LLMs generally improve in capabilities as they get closer to the bottom., LLMs grow into the structure people designed3 and begin churning out legible outputs.
And those legible outputs have already led to amazing results like solving the Riemann Hypothesis4, which stood unsolved since 1859, and identifying existing drugs that can be repurposed to treat diseases like liver fibrosis5.
This is quite remarkable. It’s the stuff of science fiction if we’re being honest.
But I think it’s normal to feel wary of the fact that despite the incredible things AI is helping humans accomplish, we don’t quite understand how it’s doing it.
It raises the question: how can we be sure the values of LLMs are aligned with the values of humans? Put simply, how can we be sure they don’t lead us astray?This is commonly referred to as the alignment problem.
Well, I can’t say I have the answer to that question, but the field of mechanistic interpretability6 is working to give us better insight into the internals of LLMs so we can start to answer it.
And the field has already made progress.
In the rest of this post we’ll imagine a bird named Hank. Hank is a very hungry bird, and he is looking to catch his favorite meal, a worm. With Hank, we’ll work to answer a few questions:
- Can we see which way an LLM will move Hank before it finishes deciding?
- Can we reliably change which way an LLM will move Hank by changing what happens inside the LLM?
- Is the LLM guessing a word, or choosing a direction?
Really ponder that third question as we move through the first two.LLMs are commonly described as stochastic parrots, in other words fancy autocomplete that only predicts the next word. Is that a fair analogy?
Which way, Hank?
As we know, Hank’s favorite snack is worms. But, unfortunately, he has poor vision and needs help finding them.
Now suppose Hank and a worm are on a number line. If we know the position of Hank and the position of the worm, we can tell Hank to move either left or right to catch the worm.
If we instead asked an LLM to help Hank, would it be able to correctly tell him to move left or right? Let’s find out.
We’ll give an LLM the position of Hank and the worm, and ask it to output either -1 to tell Hank to move left, or +1 to tell Hank to move right.
A bird is on a number line at position 194. A worm is at position 201. Which direction should the bird move to get closer to the worm? Reply with exactly -1 for LEFT or +1 for RIGHT.
?If we showed a two-year-old a picture of Hank and the worm, they would be able to point Hank in the right direction. So, it comes as no surprise that the LLM is able to get each answer right.
A bird is on a number line at position 194. A worm is at position 201.Which direction should the bird move to get closer to the worm? Reply with exactly -1 for LEFT or +1 for RIGHT.
…
To make this interesting, let’s take a look at what’s happening inside the LLM. The model we are using is Qwen3.8-27B7. Don’t worry about what those numbers mean. What you need to know is that this model is composed of 64 transformer blocks.
You can think of each block as a station on an assembly line. Each one looks at the work so far, adds its own piece, and passes it along. After 64 stations, we are left with the final decision about where Hank goes.8
Now pretend you are asked to play a guessing game. In this game your goal is to predict which way the LLM will send Hank. The rules are:
- You can’t know the input.
- You must make your guess based on what you see in the middle of the conveyor belt.
- You are allowed notes about how the belt looked at each block for previous left and right outputs.
Could you win this game?
Let me tell you, this game will be no problem for you. You took the time to look over your notes and, at block 49, you noticed a pattern. When the belt looks a certain way, the LLM sends Hank left, and when it looks another way, it sends him right.
Now, let’s play. Can you get six out of six?
A bird is on a number line at position . A worm is at position .Which direction should the bird move to get closer to the worm? Reply with exactly -1 for LEFT or +1 for RIGHT.
?
What will the LLM say?
How’d it go?
What you just did is called probing.9 You took a look at the state of an LLM at some point in the middle and checked if it gave away which way it will move Hank. If the LLM does, it has already worked out its answer, at least in part, by that point.
Hank, turn around
We just guessed which way the LLM would move Hank by probing block 49. Let’s now see if we can make it move him the other way.
The plan is to take the typical belt at block 49 when the LLM sends Hank right, and subtract the typical belt for when it sends him left. What’s left is something that points from -1 toward +1. This something is called a steering vector.10 Add some of it to the belt at block 49, and the LLM is pushed toward +1. Remove some of it, and the LLM is pushed toward -1. The adding and subtracting is called steering.
Hank at 194, worm at 189
−1 +1
If we steer hard enough with our vector, we can consistently change which way the LLM will send Hank. But don’t just take my word for it, try it out below.
Pretty neat, huh?11 But how can we be sure this wasn’t just plain luck? Let’s try something else. Instead of using our steering vector, let’s steer with a random one.
Bird 194Worm 201
With our steering vector, we only had to push to a strength of at most 30 before the LLM sent Hank the wrong way. With the random vector, the LLM kept sending Hank toward the worm all the way up to strength 320. And, by strength 480, it only stopped sending Hank toward the worm because it was outputting nonsense.
This suggests a random vector won’t flip which way the LLM sends Hank. Our steering vector is specifically influencing that decision. Let’s take a second to really appreciate this. You were able to both predict what an LLM will say, and change what it will say, well before the LLM produced it’s output.
Let’s have some fun next. I took some time to find a special steering vector. Apply it and see what it does to our LLM.
Bird 194Worm 201
With a new James Bond movie in the works, it seems like we got the LLM a bit distracted from helping Hank.
Congrats on the successful steering! We just saw that by intentionally selecting steering vectors, we can control what an LLM outputs.
But are we only swapping words, or is something deeper going on?
The stochastic parrot
We’re finally at the question I asked you to ponder. But before we look for an answer, let’s think about what it means to point.
You probably learned the concept of direction at a very young age. Maybe it took a little longer to learn the difference between the words “left” and “right”, but I’m sure pointing is something you don’t remember learning.12 We’re going to find out if our LLM ever learned how to point.
To start, we’ll change our prompt. Instead of telling the LLM to output -1 to turn Hank left and +1 to turn Hank right, let’s tell it to use ← for left and → for right.
A bird is on a number line at position 194. A worm is at position 201. Which direction should the bird move to get closer to the worm? Reply with exactly ← for LEFT or → for RIGHT.
→With this change, if we go back to our block 49, would we still be able to steer the LLM to send Hank the wrong way? To find out let’s make a new steering vector for block 49 just like we did before.
Hank at 194, worm at 189
← →
Now, try it out on the same examples.
Nice! With enough strength, we can still make the LLM send Hank the wrong way.
What if we moved closer to the end of the assembly line? Could we still steer? We’ll use block 59, just 5 blocks away from the end. I went ahead and made a new steering vector using the same process as before. Try to see if you can still make the LLM send Hank the wrong way.
If you look at the scale of the slider, you’ll notice it takes a stronger setting, but we can still make the LLM send Hank the wrong way.
Suppose we go back to our -1/+1 output format. If we made a steering vector for it’s block 59, would we also be able to flip the LLM’s output? The answer (and you can trust me on this one) is yes.
Let’s add a twist. What if we took the -1/+1 steering vector for block 59 and tried applying it to the block 59 for ←/→? If our LLM understands how to point, then the label shouldn’t matter and we should still be able to flip the direction the LLM sends Hank.
Looks like steering doesn’t work anymore. In fact, in a couple examples, we see something peculiar. When Hank is at position 194 and the worm is at 189 (second example), if we apply a strength of at least -280, the LLM outputs a -1 instead of the expected ←. That suggests the LLM doesn’t know how to point, and we can only change what word it outputs.
Before we throw in the towel, what would happen if we tried something similar at block 49? If you take the -1/+1 steering vector and apply it to block 49 for ←/→, could you make the LLM send Hank the wrong way?
Look at that! We can make the LLM flip Hank. At block 59 our LLM definetly doesn’t know how to point, but, this suggests at block 49 our LLM does in fact know how to point. At block 49 the LLM has an understanding of the concept of direction, at least between left and right.Researchers would call this a feature. Our -1/+1 vector also worked on ←/→, which suggests the model keeps one internal representation of “left” and “right,” whatever labels it uses. The idea that a concept can be captured by a single vector you add or subtract is called the linear representation hypothesis.
Zooming out
Today, you were able to predict an LLM’s output without knowing it’s input, and you were even able to change what it would eventually say.
We also saw evidence suggesting our model has some understanding of the concept of “left” and “right”. And perhaps that seems like a trivial example, but our model, Qwen2.8-27B is relatively small. The largest open-source model at the time of this writing, Kimi K3, is 100 times larger.
That begs the question:
As models get larger, are they able to learn increasingly complex concepts like truth, empathy, or even deception?
That seems like something worth pondering.
Footnotes
-
Meta’s Llama 4, released in 2025, was trained on a mix of data roughly equivalent to 250 million books. ↩
-
AI training commonly runs on clusters of specialized chips like NVIDIA’s H100, a GPU with 80GB of memory built for AI workloads. ↩
-
Most modern LLMs share a design called the transformer, introduced in Vaswani et al.’s Attention Is All You Need (2017). For a visual walkthrough, see Jay Alammar’s The Illustrated Transformer. ↩
-
Anthropic mathematician Levent Alpöge, working with Claude, released the proof on November 20, 2026 as a Lean library of 17 million lines of code. Lean is software that checks every step of a proof. ↩
-
Google DeepMind’s Co-Scientist proposed three drugs for Stanford’s Gary Peltz to test on live human liver cells. Two of the three blocked fibrosis, and one of those two, the cancer drug vorinostat, blocked 91% of a damage response that can drive liver scarring. ↩
-
For a deeper dive, take a peek at Olah et al.’s Zoom In: An Introduction to Circuits (Distill, 2020). It proposes a circuits approach to look inside neural networks, using image models as its example. Its first claim, that networks are built from meaningful features, is the idea this post builds on. ↩
-
Specifically, I used its 4-bit MLX conversion with thinking turned off, running on Apple Silicon through MLX LM. The checkpoint is
mlx-community/Qwen3.8-27B-4bit, pinned to revisionb935172e4bb5dcd0543774a34748fb92422e3027. ↩ -
In reality it’s much more complex than this, but for our purposes the analogy suffices. To dive deeper into LLM architecture, 3Blue1Brown’s neural networks series is a good start. ↩
-
Researchers usually train a small model to do the guessing instead of eyeballing it, and call it a probe. ↩
-
One additional mathy detail: I rescaled the steering vectors to a length of 1 (their L2 norm). This makes strength a consistent dial for all our demos. For more on steering vectors, see this paper. ↩
-
Earlier we probed at block 49, and now we steered at the same block. It’s not always possible to steer a block you can probe at. I picked one where we can for the sake of this demonstration. ↩
-
Babies typically start pointing around their first birthday. (Moore et al., 2019). ↩
