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

The words are the shadow

Shadow art, changing representations, and the computations a language model can learn.

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 a mental model of neural networks that was far too tidy—as if the model were an assembly line where early layers assemble grammar, middle layers add factual memory, and final layers apply a coat of stylistic paint.

To understand why that picture falls short, I needed to answer a stranger, more fundamental question: what is actually happening inside the network between the prompt and the reply?

Saying “it predicts the next token” describes the training objective, not the machinery. “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.

The most useful way I’ve found to picture the work begins with a bizarre branch of computer graphics: computational shadow art.

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 me a useful way to picture a representation: the thing carrying the information can be richer than any one image we read from it. A readable shadow needn’t resemble the sculpture that produced it.

Now imagine the sculpture changes too

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 changes 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. A vector is a point described by coordinates. During prompt processing, the model carries one such state for each token position. Tokens can be pieces of words.

Its published configuration gives each state 3,584 coordinates. A 512-token prompt is a constellation of 512 points, each described by 3,584 numbers. “High-dimensional” doesn’t mean a mystical realm behind the universe. It means that many coordinates. The sculpture makes the idea visible; the model isn’t storing a solid object.

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.

The model can learn a procedure

This is the sense in which “soft execution engine” becomes a useful picture. Attention can weight and combine several pieces of information. Successive blocks can use intermediate results. Learned weights can implement a procedure that runs on the current context, even while those 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.

There is a useful resemblance to thinking here: carrying a state forward and using it to decide what comes next. These studies establish particular representations and computations in particular models. They don’t establish that a transformer has a human mind, or identify the procedure behind any particular reply from the model I used.

One line from my conversation with Gemini captured why I find this picture so compelling:

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

I read that as a metaphor for the model’s output: 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.

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 reverse problem: choose the shadows

Shadow Art Revisited, presented at WACV 2022, uses differentiable rendering: render a candidate’s shadows, compare them with the requested images, and use gradients to adjust its geometry. Repeat. Its examples include letters, animal silhouettes, 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 papers design physical geometry. They make the analogy visible; they don’t establish how my model represents sarcasm.

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?”

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

Join the conversation. Just a nickname—no account or email needed. Comments are public; nicknames are not verified. Please keep it thoughtful and on topic.