AI Interpretability Is Just Cognitive Science
For me, AI interpretability research is just cognitive science on matrices. Cognitive scientists have been asking how the mind represents the world for decades. Interpretability researchers ask the same question, except that they work with weights and biases instead.
Let me map a few of the main concepts in cognitive science onto AI interpretability, with specific examples, because the parallels are way too clean to be a coincidence.
Representations
A big chunk of cognitive science is about mental representation: how does the brain encode a concept so that you can recognize your friend's face, remember your childhood kitchen, and know that a dog is a dog? The classic answer is that the brain builds features in stacked layers. Edge detectors feed into shape detectors, which feed into face detectors. Hubel and Wiesel won the 1981 Nobel Prize for finding exactly this in the visual cortex, with cells that respond to bars and edges at specific orientations.
In a model, we call these activations and embeddings. The "edge detectors" show up in early layers, and the "dog" concept shows up as a direction in activation space. Feature visualization and sparse autoencoders are essentially our version of single-neuron recording. We find a feature, we poke it, and the model starts talking about dogs. In the toy-model version of that paper, you get wonderfully mundane features like "instances of the letter W and words beginning with w." Scale the same technique up and Anthropic found millions of features in Claude 3 Sonnet, including cities, people, chemical elements, and Python function calls, many of them multilingual and multimodal. Same experiment, just with gradient descent instead of electrodes.
Attention
Selective attention is another old idea with a new name. Cognitive science asks: given a million things hitting your senses, how do you pick the one that matters? You focus on the loud voice in a crowded room and ignore the rest.
Transformers have literal attention heads. They decide which tokens to look at when predicting the next one. Researchers find heads that track subject-verb agreement, or indentation, or the previous occurrence of a name. In one famous case, they reverse-engineered how GPT-2 small completes "When Mary and John went to the store, John gave a drink to ___" and traced the answer to a circuit of 26 attention heads in seven classes. That is basically a connect-the-dots map of a thought. The difference is that we can plot the weights. Your average cognitive scientist would kill for that kind of resolution.
Working memory and the context window
Working memory is the small scratchpad where you hold a few things in mind at once. Try remembering a phone number while someone talks to you and you'll feel the limit pretty quickly.
The context window is the model's working memory. It is finite, it decays with distance, and it gets messy when you cram too much into it. There's even a paper titled "Lost in the Middle": models are best at retrieving facts at the beginning or end of a long context and worst when the fact sits in the middle, producing a U-shaped performance curve. The authors point out that this mirrors the serial-position effect in human memory, where we remember the first and last items of a list best. That's not a metaphor I'm forcing; it's their own comparison. Attention is a budget in both systems, and both systems have to decide what to keep and what to throw away.
System 1 and System 2
Dual-process theory splits cognition into the fast, automatic System 1 and the slow, deliberate System 2. Reading the word "flower" and immediately knowing what it means is System 1. Working through a math proof is System 2.
Models have this too, at least in a rough way. Next-token prediction is System 1: fast, intuitive, and sometimes wrong in embarrassing ways. Chain-of-thought reasoning is System 2: slower, more expensive, and much better at anything that takes multiple steps. When we ask a model to "think step by step," we are basically asking it to engage System 2. That's a cognitive science instruction disguised as a prompt.
Where the analogy gets weird
Of course, the analogy breaks somewhere. A brain is a mess of biology that took a few million years to evolve. A model is a giant matrix trained on the internet in a few months. We can't scan a transformer with an fMRI, and we can't exactly ask a human to dump their weights.
But the questions are the same: what is represented, where is it stored, and how does it cause behavior? I think interpretability people would save themselves a lot of reinventing if they read more cognitive science, and cognitive scientists would get a much better toy to test their theories on. Same questions, different century.
So maybe interpretability isn't a new field at all. Maybe it's just cognitive science finally getting the microscope it always wanted.
References
- The Nobel Prize in Physiology or Medicine 1981 (Hubel and Wiesel, information processing in the visual system)
- Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 small (Wang et al., 2022)
- Sparse Autoencoders Find Highly Interpretable Features in Language Models (Cunningham et al., 2023)
- Lost in the Middle: How Language Models Use Long Contexts (Liu et al., 2023)
- Mapping the mind of a large language model (Anthropic, 2024)