FIELD NOTES THE ANATOMY OF AI
Interactive Learning LabVol. 01 / Q&A Loop
Anatomy of generative response

From question
to next token.

How does an LLM generate a response? It receives your question alongside a system prompt and special markers, breaks them into tokens and vectors, transforms those vectors through repeated attention and feed-forward layers, and repeatedly predicts what token should come next until the turn is complete.

✦ 01 / Input Context Framing
System role sets behavior · User message sets the task
⌘ System PromptROLE: SYSTEM
99 charsSets instructions & constraints
✧ User QuestionROLE: USER
31 charsSupplies the actual request
Try Example:
The 8 Stages of Question Answering
01 / Context AssemblySystem prompt + user question
LIVE CONCEPT VIEW
FRAME EXPLORATION SYSTEM + USER MESSAGE
Event Signal Timeline SIMULATION · READY
EVENT 01 / 03
Assemble the context

The system instruction and user question are joined with special role markers.

Deep Dive · Inside Transformer Blocks

At the heart of every layer: Attention & Feed-Forward.

These vectors pass through many layers. In each layer, the attention block allows token representations to interact and gather context (e.g., “France” gathering information from “capital”), while the feed-forward layer transforms each token independently and in parallel.

2 CORE OPERATIONS
ATTENTION BLOCK TOKENS EXCHANGE CONTEXT
The token “France” gathers context from related words before it.
ATTENTION · EVENT 1

Tokens look at other tokens.

Self-attention computes how much each token should draw information from earlier positions in the context window. “France” gathers information from “capital” to build a richer representation.

Example context “What is the capital of France?” “France” can use context from “capital” and the surrounding words to know it represents a country's capital city.
EVENT 1 / 3
THE GENERATION LOOP

Predict, append, repeat.

Finally, the model uses the representation at the end of the sequence to produce a probability distribution. Here, it gives ~75% to “The” and ~19% to “Paris”. If it chooses “The”, it adds it to the sequence and runs the same process again.

CURRENT CONTEXT WINDOW
TRANSFORMER PASS ➔ PROBABILITY DISTRIBUTION ↓
TOP CANDIDATEThe
PROBABILITY75%
The model appends the chosen token to the conversation and runs the next prediction cycle until the stop token is reached.
SPATIAL REPRESENTATION · 3D LAB

Explore the embedding space.

Tokens are mapped to vectors in a continuous multi-dimensional space. Words with related functions or topics form semantic clusters. Drag to rotate in 3D, select words, and inspect their numerical vector dimensions.

LIVE 3D ORBIT
3D PERSPECTIVE PROJECTION Rotatable vector space coordinate frame
ⓘ Teaching simulator: This visual lab illustrates the exact step-by-step mechanism of an LLM: prompt formatting, tokenization, embeddings, attention mixing, parallel feed-forward transformations, logits calculation, and the autoregressive next-token feedback loop.