Inference: how a trained model runs
For both
Parameters, prefill and decode, the KV cache and mixture-of-experts explain why models differ in speed, memory needs and price
110 questions across four stages: Understand, Apply, Solve and Judge.
Try 5 questions
Practice items, not counted towards your mastery. No account needed.
Check yourself · 1 of 5
A model card says "8B". What does that most likely mean?
Check yourself · 2 of 5
Which phase processes the whole prompt at once?
Check yourself · 3 of 5
Prompt caching can reuse work only when the new prompt does what?
Check yourself · 4 of 5
In a mixture-of-experts model, what are active parameters?
Check yourself · 5 of 5
What does quantization change?
Topics
- Parameters and what model size means4 min read · Weights, billions of parameters, the memory they need and what size does and does not predict
- Prefill, decode and time to first token5 min read · The prompt is read in parallel but the answer is written one token at a time, so output tokens cost more
- The KV cache behind prompt caching5 min read · Reusing work already done on an unchanged prompt prefix makes repeat calls cheaper and faster
- Mixture of experts: total versus active parameters4 min read · Many large models route each token through a few expert sub-networks, so active size differs from total size
- Distillation, quantization and speculative decoding5 min read · Smaller distilled models, lower-precision weights and draft-and-verify decoding trade quality for speed and cost
Start here
- Optimizing LLMs for speed and memory (Hugging Face Transformers docs) (opens in a new tab)DocsFree
Covers the KV cache, quantization and faster decoding with runnable settings and plain explanations.
- Mixture of Experts Explained (Hugging Face) (opens in a new tab)ArticleFree
A clear walk through experts, routers, and why total size and active size differ.
- Prompt caching (Claude docs) (opens in a new tab)DocsFree
A vendor's own rules for cacheable prefixes, what breaks a cache hit, and how cached reads are billed.
Helps to know first
110 questions · last verified 2026-12