Wrap-up
Ch 45. Picking a model
Reading a model’s name
Open models are shared on sites like Hugging Face, and one release can come in a dozen versions
with names like gemma-4-26B-A4B-it or gemma-4-E2B-it-qat-mobile-transformers. Each part of a
name like that is something an earlier chapter explained. Pick a name, from Google’s Gemma 4
models, two models distilled from DeepSeek-R1, or the ones this site uses, and click a part to see
what it means:
A few parts come up often:
- The size is the number of weights, in billions (Ch 12). It tells you roughly how much memory the model needs.
EandAmean the model stores more weights than it uses for each token.E2Bcosts about as much per token as a 2.3-billion-weight model, and26B-A4Buses under 4 billion of its weights per token (Ch 37).[1]itmeans tuned to chat and use tools; without it, the model only continues text (Ch 15).assistantis a small drafter that speeds up a bigger model (Ch 14).Distillnames a small model trained on a big model’s examples; the size is the small one’s.[2]qat,q4_0, andw4a16are about how many bits each weight uses (Ch 13).[3]diffusiongemmawrites by cleaning up noise, like the picture models in Ch 40.[4]
A few parts are worth a closer look:
- The size is a count of weights, in billions (Ch 12). It tells you roughly how much memory the model needs and, for an ordinary model, how much work each token takes.
EandAchange what the size means.E2Bis an effective size: Gemma 4 E2B stores 5.1 billion numbers, but most of the extra are per-layer tables that are only looked up, like the token table in Ch 5, so each token costs about as much as a 2.3-billion-weight model.[1][1]26B-A4Bis a mixture of experts (Ch 37) with 25.2 billion weights, of which about 3.8 billion (8 of 128 experts, plus one shared) run for each token. It runs almost as fast as a 4-billion-weight model, but all 25.2 billion have to fit in memory.[1][1]itmeans instruction-tuned, for chat and tools; a name without it is a base model that only continues text (Ch 15). Base models are a common starting point for training your own version.assistantis a drafter for speculative decoding (Ch 14), not a model to use on its own.Distillnames a teacher and a student.DeepSeek-R1-Distill-Qwen-1.5Bis a 1.5-billion-weight Qwen model tuned on examples made with DeepSeek-R1, a far bigger reasoning model (Ch 17). The size is the student’s, not the teacher’s.[2][2]qat,q4_0, andw4a16are about bits per weight (Ch 13). Gemma 4 comes in four QAT versions: unquantized 16-bit QAT weights for people who round them with their own tools, Q4_0 in a GGUF file for llama.cpp, a mobile version with some 2-bit layers, and 4-bit weights with 16-bit activations for the vLLM serving software.[3][3][4][4]transformers,ct, andggufonly say how the file is packaged.diffusiongemmais built on the 26B A4B model but writes by denoising a block of 256 tokens at a time instead of one token per pass, a cousin of the picture models in Ch 40.[5][5]
Some things are never in the name, like how much text the model can read at once, whether it can see pictures or hear audio, and its license. Those are on the model card.[1]
Some things are never in the name. The model card lists how much text the model can read at once
(128K tokens for E2B and E4B, 256K for the larger models), what it can take in (all of them read
images; only E2B, E4B, and 12B hear audio), whether it has a thinking mode (Ch 17), and its
license.[1][1] Even the size shown on a model’s page can disagree with
its name: it counts the numbers stored in the files, so the page for gemma-4-E2B shows 5B.
Will it fit?
The first question for running a model yourself is memory, and Ch 13’s rule answers it: weights × bits per weight ÷ 8 bytes. Choose a model and a precision:
At 16 bits, the 31B model needs about 61 GB just for its weights, more than any of these devices. At 4 bits it needs about 15 GB, which is why the QAT versions exist. The small E models are the ones built for phones and laptops.[1][1][1] The weights are only part of the bill: the KV cache from Ch 26 grows with every token of context, and the software running the model needs memory too.
A full bill, worked out
Take Qwen2.5-1.5B-Instruct, the model in the agent chapters. It has 1.54 billion weights, stored in 16 bits: 1.54 × 2 = about 3.1 GB.[6] Its KV cache holds 14,336 numbers per token (Ch 26), also 2 bytes each, so a 4,000-token chat adds about 0.11 GB and a full 32,768-token context about 0.94 GB. Rounded to 4 bits, the weights shrink to about 0.8 GB, but the cache doesn’t unless it is rounded too, so with a full context it would be the bigger part of the bill.
How to choose
A short list of questions narrows the choice:
- What is it for? Chatting and calling tools need an instruction-tuned model; training your own version often starts from a base model.
- What goes in? Text only, or images and audio too? Check the model card.
- Your machine or a provider’s? A hosted model needs no hardware of your own, but it sees every prompt you send and charges for each one. A model you run yourself keeps your prompts on your machine; you pay for the hardware instead, and the license has to allow your use.
- Where will it run? The device’s memory sets the largest size and the fewest bits you can use; 8 bits usually changes little, 4 bits needs a model made for it (Ch 13).
- How fast must it be? Fewer active weights per token (Ch 37) and a drafter (Ch 14) both help.
- What will it cost? Hosted models charge per token, but each tokenizer splits text differently, so compare prices on your own text (Ch 4). Reply tokens cost more than prompt tokens (Ch 11), a cached start costs a tenth or less (Ch 26), and a cascade sends most questions to a cheap model (Ch 27).
- How much must it read at once? Long documents need a long context. If a word takes about 1.3 tokens, as the rhymes in Ch 4 did, E2B’s 128K tokens hold about 100,000 words, a long novel; the real ratio depends on the tokenizer and the text.
- What does the license allow? It is on the model card too.
Benchmarks on the model card narrow the list further. Your own prompts decide: as Ch 22 showed, a model’s answers can change with small differences in wording, so try the finalists on the tasks you care about.
The choice doesn’t stay made: new models come out every few months. Keep a handful of your own tasks, each with a way to check the result, an eval like the one in Ch 35, and run it again when a new model comes out.
Even a model under the same name can change. Researchers asked the March and June 2023 versions of GPT-4 the same questions: in March it told prime numbers from others 84% of the time, in June 51%, partly because it had become worse at following step-by-step prompts. GPT-3.5 got better at the same task over the same months.[5][6][7] A prompt that works today may not work after an update, so when a provider offers fixed, dated versions of a model, use one, and run your eval before moving to the next.
You don’t have to pick only one. An app can ask a small model first and pass only the questions it is unsure of to a bigger one (Ch 27).
Recipe card
Recap
- A model name packs in its family, size, tuning, and often bits per weight and file format.
Emeans an effective size andAan active size; both store more weights than they use per token.itmeans instruction-tuned,assistanta drafter, andqattrained to survive 4-bit rounding.- Memory for the weights is about weights × bits ÷ 8, plus the KV cache and the runtime.
- Narrow by task, inputs, where it runs, speed, cost, context, and license, then test on your own prompts, and test again when new models come out, or when the one you use is updated.
- Qwen2.5-1.5B: about 3.1 GB of 16-bit weights, plus about 0.94 GB of KV cache at its full 32,768-token context.
Next question: how much of all this stuck?
Sources
- Google DeepMind (2026). Gemma 4 model card (google/gemma-4-26B-A4B-it). Hugging Face. Accessed October 23, 2026.
- DeepSeek-AI (2025). DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning. arXiv.
- Google DeepMind (2026). Gemma 4 QAT model card (google/gemma-4-E2B-it-qat-mobile-transformers). Hugging Face. Accessed October 23, 2026.
- Google DeepMind (2026). DiffusionGemma model card (google/diffusiongemma-26B-A4B-it). Hugging Face. Accessed October 23, 2026.
- Lingjiao Chen et al. (2023). How is ChatGPT's behavior changing over time?. arXiv.
Sources
- Google DeepMind (2026). Gemma 4 model card (google/gemma-4-26B-A4B-it). Hugging Face. Accessed October 23, 2026.
- DeepSeek-AI (2025). DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning. arXiv.
- Google DeepMind (2026). Gemma 4 QAT model card (google/gemma-4-E2B-it-qat-mobile-transformers). Hugging Face. Accessed October 23, 2026.
- Hugging Face (2026). GGUF: quantization types. Hugging Face Hub documentation. Accessed October 23, 2026.
- Google DeepMind (2026). DiffusionGemma model card (google/diffusiongemma-26B-A4B-it). Hugging Face. Accessed October 23, 2026.
- Lingjiao Chen et al. (2023). How is ChatGPT's behavior changing over time?. arXiv.
Sources
- Google DeepMind (2026). Gemma 4 model card (google/gemma-4-26B-A4B-it). Hugging Face. Accessed October 23, 2026.
- DeepSeek-AI (2025). DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning. arXiv.
- Google DeepMind (2026). Gemma 4 QAT model card (google/gemma-4-E2B-it-qat-mobile-transformers). Hugging Face. Accessed October 23, 2026.
- Hugging Face (2026). GGUF: quantization types. Hugging Face Hub documentation. Accessed October 23, 2026.
- Google DeepMind (2026). DiffusionGemma model card (google/diffusiongemma-26B-A4B-it). Hugging Face. Accessed October 23, 2026.
- Qwen Team (2024). Qwen2.5-1.5B-Instruct model card. Hugging Face. Accessed October 24, 2026.
- Lingjiao Chen et al. (2023). How is ChatGPT's behavior changing over time?. arXiv.