One suspended ivory-and-graphite sculpture casting several distinctly different geometric shadows onto angled planes.
One learned object. Several visible projections.

FIELD NOTE / MODEL INTERNALS

Understanding LLMs by seeing language as a shadow of a higher-dimensional state

Words are just shadows

Saying that a language model “predicts the next token” describes its training objective, not its inner machinery. Saying it is “a massive pile of matrix multiplications” is technically true, but about as illuminating as defining a restaurant as a building where carbon compounds change temperature.

To understand what is actually happening inside the network between the prompt and the reply, we need a better mental model–one designed so that you never get confused by layer counts, floating-point coordinates, or abstract high-dimensional spaces.

The easiest way I’ve found to picture what’s happening is through computational shadow art–along with optics like beam splitters, projection, and changing representations.

This picture also helps us see where the idea leads: once we understand the computations inside a model, how finely can we split them across devices? I explore that question in How Small Can We Slice an AI Model?

One object, several shadows

In 2009, Niloy J. Mitra and Mark Pauly published Shadow Art. Their algorithm searches for a single sculpture that can cast several requested silhouettes. On its own, the object can look like a very suspicious piece of plastic.

Start with this object. From one light direction, its shadow is a bull. From another, a winged creature. From a third, an eagle. The object stays put. The image on the wall changes.

One suspended sculpture casts three different animal silhouettes. The panel at left compares desired, conflicting, and optimized shadows.
One object, three shadows. Figure 1 from Niloy J. Mitra and Mark Pauly, Shadow Art, ACM Transactions on Graphics 28(5), Article 156, 2009. © 2009 ACM. Figure extracted from the paper’s first page.

This is computational shadow art. In the 2009 work, you specify the silhouettes and projection directions, and an algorithm searches for a compatible sculpture. Some requests conflict: the material needed for one shadow gets in the way of another. The method adjusts the targets to make the geometry possible.

Apparently even a piece of plastic has to negotiate conflicting requirements.

Then there is Mojoptix’s digital sundial. As the Sun moves, carefully arranged channels let light through to form changing digits inside its shadow. No battery. No screen. A clock whose display driver is the rotation of the Earth.

Mojoptix’s 3D-printed sundial on a jar projects bright numerical time digits inside a long dark shadow.
Geometry that displays numbers. Photo by Mojoptix, 2015, CC BY 3.0, unchanged. These are illuminated digits within a shadow, rather than dark digit silhouettes.

That gives us a way to picture this computational shadow art framework so you never get confused: the underlying representation carrying the information is richer than any single view or word we read from it. Think of it like optics: a beam splitter takes an incoming beam and splits or routes it across pathways, while projection takes a high-dimensional state down to a flat surface. In a language model, the internal hidden state is the 3D sculpture; the vocabulary probabilities we read out are just one projection or shadow cast onto a wall.

Researchers exploring the mind have found optics a fruitful way to think about how information becomes experience. Andrés Gómez-Emilsson, for example, explores this through nonlinear optics, beam splitters, and interacting projections. His work helped me see a connection: transformer blocks also combine and transform information, passing an evolving state through a sequence of learned operations.

The geometry behind a thought

If you understood the shadow art concept above, that is fundamentally how an LLM operates under the hood. As one line from my conversation with Gemini put it:

Human language is just the serialized, lossy output format of a complex, high-dimensional computation graph executing inside the network's layers.

Now take that metaphor and add motion. A language model doesn’t just cast a static shadow. The thing we’re picturing as the sculpture continuously morphs as information passes through the network.

In DeepSeek-R1-Distill-Qwen-7B–the model I was trying to adapt–28 transformer blocks run in sequence. During prompt processing, the model carries a dynamic hidden state for each token position (tokens can be individual words or pieces of words). Mathematically, each state is simply a vector–a point described by a list of coordinates.

Its published configuration gives each state 3,584 coordinates. A 512-token prompt is therefore a constellation of 512 points, each positioned across 3,584 axes.

It is the exact same concept as the shadow art from earlier–just scaled up. Instead of a 3D physical sculpture casting 2D silhouettes on a wall, picture an ultra-high-dimensional geometric object living in a 3,584-dimensional space. As computation unfolds, different components and linear projections act like directional light sources, casting "shadows" of this intricate high-dimensional geometry down into lower-dimensional subspaces and regions.

“High-dimensional” doesn’t mean a mystical realm behind the universe; it simply means keeping track of that many coordinates at once. The sculpture is our bridge to visualize it, giving physical form to mathematical projections the human mind can't directly picture.

Do all 28 blocks have the same “shadows”?

They share a workspace width, but each block has its own learned tools. At block boundaries, each token state has 3,584 values. The query, key, value, and MLP weights differ between blocks; the views needn’t mean the same things.

The spaces inside a block can have different widths too. This model’s MLP expands to 18,944 values before returning to 3,584. Its built-in vocabulary readout comes after the stack and produces 152,064 scores. Those widths come from the published configuration. “Shadows” is an analogy, so there isn’t one literal shadow count that applies to every component.

One point, a cloud, or a whole vector field?

Those pictures have different storage costs. Counting stored numerical values at one block boundary, and ignoring batches:

What is storedNumber of values
One token stated
N token statesN × d
A sampled field with a d-value vector at each of M locationsM × d

Here d is the hidden width. The transformer evaluates learned functions on the states it receives; it doesn’t store a vector at every possible point in that space. Weights, attention intermediates, and cached keys and values have additional costs. During cached generation, the model typically computes the new position using saved keys and values rather than recomputing every earlier position.

The learned query, key, and value matrices take different linear views of the representations. “Move the light” is a useful starting picture, but these transformations can scale and mix coordinates as well as project them. Attention then calculates input-dependent weights and mixes information from the available token positions. The original transformer paper gives the mechanism.

The MLP applies a nonlinear transformation at each position, and residual connections add the resulting updates back. The representation itself changes. The next block works with the updated state. The transformer-circuits framework describes this shared stream as a communication channel between components.

READ

Take learned views and gather context.

UPDATE

Transform features and add updates.

REPEAT

The next block receives the changed state.

For “bank,” the words “river” and “mortgage” provide different context. The model can use that context to change what it carries forward. We don’t need to invent a dedicated “riverbank removal department” on layer 12 to explain the idea.

Related experiment: teaching a small model sarcasm

When I tried to teach a small language model sarcasm, I started with what felt like a practical engineering question: which layer do I bolt the sarcasm onto? It didn’t take long to realize that was the wrong question. It assumed neural networks work like an assembly line where early layers assemble grammar, middle layers add factual memory, and final layers apply a coat of stylistic paint.

Predicting the next token can involve combining clues, tracking relationships, and carrying intermediate results forward. A useful way to picture this is as a soft graph-execution engine operating on representations of concepts and context.

Concepts and context – how the model carries a thought forward

Here, “concepts” means patterns encoded in the hidden state. “Soft” reflects how information is weighted and combined. Attention gathers information from the available context; successive blocks transform the state and build on intermediate results. Together, these learned operations can carry out a procedure even while the model’s weights stay fixed.

The layer wiring of this dense model is specified in advance. What changes with the input is the state and the attention weights that determine how information is mixed. The blueprint stays; the traffic changes. That gives us a useful picture of input-dependent computation through learned circuitry, without assuming the model compiles a fresh symbolic program for every reply.

One concrete example is the induction circuit studied in small, attention-only transformers. Given a pattern like A B … A, it helps predict B: find an earlier matching context, then copy what followed it. Researchers identified how attention heads in successive layers cooperate to do that. It is a learned copying procedure, and its evidence is strongest in those small models.

Another is Othello-GPT. Researchers trained a transformer on sequences of board-game moves, without giving it the board or explicit rules as inputs. They found evidence for an internal representation of the board state. Intervening on that representation changed its move predictions. Predicting the next move had led to something useful for prediction: tracking the situation those moves created.

The training target didn’t say, “Please build a board in there.” Apparently “guess the next thing” can turn into a more involved job description.

Can fixed weights even run a learning algorithm?

In controlled regression experiments, von Oswald and colleagues constructed and trained transformers whose forward computations implement or resemble gradient-descent updates on the examples in context. The network can apply a learned learning procedure without updating its own stored weights for that prompt. Those results concern the studied regression settings; they don’t establish one universal algorithm for all language-model behavior.

To me, this resembles something familiar about human thinking: holding a situation in mind, connecting pieces of information, and letting each intermediate result shape what comes next. Calling LLMs ‘just next-token predictors’ can make all of that sound trivial. Viewed this way, predicting the next token can involve building representations, tracking relationships, and carrying out learned procedures. The words arrive one token at a time; the computation producing them can be much richer than that description suggests.

Because rich internal computations become a sequence we can read, those words can then become part of the next computation, which is why the scratchpad matters too.

That also makes language part of the computation. Once the model writes an intermediate step, later tokens can use it as context. In Show Your Work, researchers trained models to write scratchpads and found that this helped with multi-step computations. Language can be both a readout and a scratchpad. The model needn’t finish the whole calculation before it starts writing.

The scratchpad still needs checking. Research on unfaithful explanations shows that plausible reasoning text needn’t report every influence on an answer. My saved replies let me inspect the behavior; they don’t expose a complete internal execution trace.

A key goal of alignment should be to make this soft graph-execution process understandable to humans at every step, allowing us to inspect how intermediate operations lead to the final output.

How a state becomes the next word

At the output, the shadow picture becomes useful again. After final normalization, the state at the current output position is compared with a learned vector for each vocabulary entry. Each dot product gives one score; a matrix multiplication collects those scores together. “Dot products” and “a linear projection to vocabulary scores” describe the same readout. This isn’t an orthogonal projection onto a literal wall.

The published configuration specifies 152,064 output scores from a 3,584-value state. More scores don’t create more independent dimensions. Think of many learned measuring directions looking at the same state together. They aren’t one tidy axis per concept, and the vocabulary includes word fragments and punctuation.

Softmax turns the scores into probabilities, then the decoding rule selects a token. The task is predicting a continuation, not finding the word most similar in meaning to the prompt. After “The capital of France is,” the useful continuation would be “Paris,” not another word resembling “France.”

Does that put every token on a hypersphere?

No. A dot product depends on vector lengths as well as angles. Normalizing a hidden state does not automatically normalize all vocabulary vectors to unit length. Input and output embeddings can also be separate; this model’s configuration says they are untied. A sphere can illustrate a specially normalized example, but it isn’t the general mechanism. A larger vector norm is not a certificate of correctness, either.

The language-model geometry has its own public research. Park, Choe, and Veitch study how concept directions relate to readouts and interventions. Toy Models of Superposition demonstrates how sparse features can share fewer dimensions in simplified networks. There needn’t be a separate coordinate labeled “sarcasm.” Apparently the concepts have to share office space too.

Could it take more rounds–or work without spelling everything out?

That was my next question. Why exactly 28 rounds? It’s this model’s architecture, not a law of thought. Universal Transformers explored repeated computation with a learned, per-position stopping mechanism. Adaptive computation has real research behind it; making it accurate and efficient is an engineering problem.

Coconut explores feeding hidden states back as inputs instead of decoding every intermediate reasoning step into text. Ordinary transformers already compute in continuous hidden states between their layers; Coconut adds a way to continue across generation steps without making each intermediate state a vocabulary token.

LLaDA explores a different route: progressively filling masked token positions through a diffusion process. Multiple positions can be updated in a pass, but passes still take computation and can depend on earlier passes. Diffusion, continuous latent reasoning, and adaptive depth are different choices. None guarantees that every question becomes one instantaneous calculation.

Nor is there a universal schedule where early layers do grammar and the last layer becomes certain. Layer roles and confidence vary with the model and input. The sculpture helps me ask questions; it doesn’t supply experimental answers.

I now have three things to keep separate: the states carrying context, the learned rules that update them, and the vocabulary scores we read out. The computation graph names the operations and their dependencies. Its wiring can stay fixed while the states and attention patterns change from one input to another.

That distinction also matters when I try to change a model. A different prompt changes its context. Activation steering changes a passing state. Training an adapter changes some of the learned rules. My attempt to teach a model sarcasm tested those interventions; the sculpture is a way to think about them, not evidence that I found a sarcasm mechanism.

I still want to know which computations make a tone survive a change of subject. At least now I have a better question than “which layer do I put the sarcasm in?”

Interactive demo

Let’s make the picture concrete. This interactive demo shows how attention and transformation work together: information from the context changes the state, and that updated state becomes the starting point for the next step. Follow the process through to the words it produces.

OPERATOR X SOFT EXECUTION / OVERVIEW

SOFT COMPUTATION ENGINE.

DUCK EXAMPLE / A feathered bird with a broad beak. It is a …

03 / TRANSFORM
EXAMPLE

Click an optic to explore the state inside.

A toy transformer, viewed through nine optical steps. Each example has its own context, with the same six features and candidate words. Follow state → attention → context gathering → attention write → normalization → MLP update → residual addition → next block → vocabulary readout. Every numbered optic opens its own geometry. Signed values show components and updates; attention weights and final token probabilities sum to 100%. Beam brightness compares magnitudes within each step. The weights and feature regions are hand-authored illustrations, not measurements from a trained model. Architecture reference ↗

Hopefully, you can now picture more of what happens between a prompt and a reply: information comes together, representations change, and each step shapes what follows. The words are the part we get to see–the shadow of that unfolding computation.

Bonus – newer takes on shadow art

The sculpture at the start of this note came from 2009. Later work revisits the same idea with different tools.

Shadow Art Revisited, presented at WACV 2022, brings differentiable rendering to the problem. Its examples range from letters and animal silhouettes to faces and a car constrained by several views.

Shadow Art Revisited examples show letters and fish shadows, one sculpture with three animal shadows, halftone faces, and a car shaped by silhouette constraints.
Choose the images; optimize the object. Opening figure from K. Sadekar, A. Tiwari, and S. Raman, Shadow Art Revisited: A Differentiable Rendering Based Approach, WACV 2022; preprint 2021. Original figure, unchanged.

Neural Shadow Art, first posted in 2024 and revised for Pacific Graphics 2025, extends this using a neural representation of occupied space. It can optimize light directions and screen orientations alongside the sculpture. The paper includes a fabricated example.

Three target human silhouettes lead to a neural occupancy representation, a rendered sculpture, and a fabricated sculpture casting the corresponding shadows.
From requested shadows to a physical object. Opening figure from Caoliwen Wang, Bailin Deng, and Juyong Zhang, Neural Shadow Art, revised 2025. Original figure, unchanged.

These are newer versions of the physical example that opened this note. They make the analogy visible; they don’t establish how my model represents sarcasm.

A mental-model note, developed from a conversation with a coding assistant and linked research. The shadow analogy illustrates an idea; the cited experiments support specific claims about specific models.

Comments