TokenTown: A visual way to understand how LLMs work
TL;DR Highlight
A browser city sim shows one token's round trip through a transformer.
Who Should Read
A backend developer who calls LLM APIs but has no feel for how tokens are processed inside the model
Core Mechanics
- A transformer drawn as a city
- Each district is one stage of the model.
- A convoy moves through tokenizing, embedding, positional encoding, the layer ring and the sampler.
- The layer ring repeats per layer
- One lap is attention, residual, feed-forward, residual.
- At the end it makes a probability distribution, picks one token and loops back.
- Parts are really computed
- Tokenizer split, embedding lookup, causal attention, GELU feed-forward and temperature/top-p sampling run live in the browser.
- Attention runs over a real growing KV cache.
- Prefill processes all prompt tokens at once while decode processes one.
- Scale is shrunk
- 12 dimensions instead of thousands, 2 heads instead of dozens.
- 2–12 layers instead of 80, a few hundred words instead of 100k+.
Community Reactions
- Other visualizers preferred
- A commenter said Brendan Bycroft's LLM visualiser (bbycroft.net/llm) helped them most.
- Another wanted an interactive 3Blue1Brown-style version.
- Criticism of the explanation text
- Commenters said the copy reads like generic Claude output heavy with jargon.
- Another asked to state the prerequisites.
- A factual inconsistency pointed out
- One comment noted the text says it is not a loop but a stack of blocks, yet the visual loops 6 times.
- Usability complaints
- One asked for mobile support.
- Others called it unhelpful or asked to filter vibe-coded projects from the homepage.
How to Apply
- Watch prefill vs decode in TokenTown
- Enter a prompt and press Run to see prefill process all tokens at once.
- Compare with decode, which handles one token at a time.
- Use it to explain why long prompts delay the first response.
- Feel sampling with the Temperature and Top-p sliders
- Run the same prompt while changing Temperature.
- See how output variety shifts before setting API defaults.
- Use it for onboarding with a backup resource
- Show TokenTown first.
- Pair it with bbycroft.net/llm since the explanations are thin.
Terminology
Related Papers
Mercury 3: Diffusion at scale
Scaling diffusion LLM 40x gives Mercury 3: 4–8x faster than speed-tier models, similar quality
Timestral: Mistral's time-series foundation models
A 209M time-series model ranks first on three benchmarks and runs on CPU.
DeepSeek V4.1 Flash 1017 (Max)
DeepSeek V4.1 Flash 1017 Max scores 45 on the Intelligence Index at 211 tok/s and $0.30 input.
If you don't run your own LLM proxy, how do you know whats going on?
Running your own LLM proxy shows which keys, models, and cache misses drive your usage.
DeepSeek: DeepSeek v4.1 Flash 1017
DeepSeek V4.1 Flash 1017: $0.05/M input, 1M context, built for agents
DeepSeek-v4.1-Flash-1017
DeepSeek V4.1 Flash minor update lifts coding and agent benchmarks while cutting run time and output length
Show HN: Llmspeed – feel how fast a local LLM runs before you buy the hardware