Explore the model from within
Free mode
Write a beginning. Follow each choice, one token at a time.
Start with a sentence
InputUse “Step once” to inspect a single prediction.
Generated text
0 tokensTokens BPEeach box shows its token and ID
Start generation to see how your prompt is split.
The token’s path
Explore the networkIDs (n,)E[ids] → (n, 128)attention + FFN(V,)softmax / TAttention
ContextWhere the last token looked.
layer 4 · head 0
After the first step, inspect each context token’s weight.
Next possibilities
Top 6Candidates for continuing your prompt.
softmax(logits / T)
Generate a token to compare the six highest probabilities.
From text to the next token
Inside the complete network
4 blocks · 128 dimensions · 4 Q / 2 K/V heads · 128-token context
Enable before generating or replaying. Each step shows its explanation and actual values; pause to read at your own pace.
Select a block to zoom in. Drag the background to pan and click operations to inspect them.
How glassllm works
glassllm is a teaching implementation of a Transformer. Instead of hiding its calculations behind an API, it lets you follow what happens at every generation step.
The free lab follows the generation loop in real time. Set the temperature and sampling mode, step through one token at a time, and inspect attention and probabilities.
A chapter path connecting equations, code, and values is planned for a later phase.