A practical guide to LLM variants on Hugging Face
Architecture, post-training, quantization, derivation — what the labels mean, how they combine, and how to pick.
1. The post-training axis: base → instruct → chat → reasoning
Every modern LLM goes through stages. Each stage produces a checkpoint that may be released separately.
Base (a.k.a. pretrained, foundation)
The raw output of pretraining on trillions of tokens of text. It only knows how to continue text — give it "The capital of France is" and it completes "Paris." Give it "Write me a poem" and it might continue with "...about my cat, said the user, and then the assistant replied..." because it has no notion of being an assistant.
Internally: a transformer trained with next-token prediction (cross-entropy loss) on a massive corpus. No notion of conversation, no refusals, no instruction-following.
When to pick it: fine-tuning your own model, research, text completion tasks where you don't want assistant behavior, FIM for code completion if the base was trained with FIM objectives.
Repo signals: gemma-3-27b, Llama-3.1-8B, Qwen2.5-7B (no -Instruct, no -Chat).
Instruct / SFT (supervised fine-tuned)
Base model + further training on (instruction, response) pairs. Now it follows instructions. This is done via SFT: same next-token loss, but only on curated instruction-following data, often with a chat template (special tokens like <|user|>, <|assistant|>).
The model learns: "when I see this template structure, I should produce a helpful response in the assistant role."
When to pick it: the default for almost everything. Coding, writing, Q&A, agents.
Repo signals: -Instruct, -it (Gemma's convention), -SFT.
Chat / RLHF / DPO
Instruct model + a preference-tuning stage. Humans (or another LLM) rank pairs of responses; the model is trained to prefer the ranked-better ones. This makes outputs more helpful, more honest, less toxic, and aligned to a "house style."
Three flavors of how this is done — you'll see these terms in model cards:
- RLHF (PPO) — train a reward model from preferences, then RL the LLM against it. Powerful, finicky, expensive. What ChatGPT was originally trained with.
- DPO — Direct Preference Optimization. Skip the reward model; optimize directly on preference pairs with a clever loss. Cheaper, more stable, very common in open weights.
- GRPO / RLVR — used heavily in reasoning models (next section). RL against a verifiable reward (did the math answer match? did the code pass tests?) instead of a learned reward model.
When to pick it: when available, you almost always want this over a pure SFT/instruct model. The differences are real for chat quality, but not always for raw task accuracy.
Repo signals: -Chat, -DPO, -RLHF, often just rolled into -Instruct without a separate label.
Reasoning models
A reasoning model is one that's been specifically trained to spend more compute at inference time by producing long internal chains of thought before answering. The training recipe:
- Start from a strong instruct model.
- Generate lots of problems with verifiable answers (math, code, logic puzzles).
- Let the model produce long CoT attempts; reward only the ones that get the right answer (RLVR — RL with Verifiable Rewards, often via GRPO).
- The model learns to "think out loud" — backtrack, self-correct, plan — because that behavior empirically leads to correct answers.
What you see at inference: the model emits a <think>...</think> block (or similar) with potentially thousands of tokens of reasoning, then a final answer. This is test-time compute — trading latency and tokens for accuracy.
When to pick reasoning:
- Math, hard code, logic, planning, multi-step analysis
- You can afford the latency and token cost (it can 10–50× output length)
When NOT to:
- Simple instruction following, summarization, chat, RAG over short docs
- Latency-sensitive UX (autocomplete, voice)
- Tight token budgets
Repo signals: R1, -Thinking, -Reasoning, o1-style, QwQ. Some models are hybrid (Qwen3, Claude) — same weights, reasoning toggled by a flag or system prompt.
2. The architecture axis: dense vs. MoE
Dense
Every parameter participates in every forward pass. A dense 70B model uses 70B params worth of compute per token. Simple, well-understood, predictable.
Mixture of Experts (MoE)
The feedforward layers (the "MLP" blocks between attention layers) are replaced with N experts + a router. For each token, the router picks the top-K experts (typically K=2 out of 8, or K=8 out of 128) and only those run. This is a Mixture of Experts.
Total params = all experts combined → determines RAM/disk.
Active params = what actually runs per token → determines speed and FLOPs.
So 26B-A4B means 26B total, 4B active. You pay 26B in memory, 4B in compute.
Why it works: different experts specialize (loosely — code, language X, math, etc.). The model has the knowledge capacity of a big model with the speed of a small one.
Tradeoffs:
- Big RAM footprint for modest speed → great if you have RAM but a slow GPU/CPU
- Routing imbalance can cause some experts to be underused
- Worse than equivalent-active dense at very small active sizes
- Not all inference engines handle MoE quantization equally well
Examples: Mixtral 8x7B, Mixtral 8x22B, DeepSeek-V3 (671B / 37B active), Qwen3-235B-A22B, Gemma 3n with the elastic MatFormer trick.
Hybrid / SSM / Mamba variants
A small but growing class replaces some attention layers with state-space models (Mamba, Mamba-2) or hybrid attention/SSM stacks (Jamba, Zamba). They scale better with long context (linear instead of quadratic) and can be faster, but ecosystem support (quantization, fine-tuning) lags.
Repo signals: Mamba, Jamba, RWKV, Zamba.
3. The precision axis: quantization
The model is trained in bfloat16 or float16 (16 bits per weight). To run it cheaper, weights are compressed to fewer bits per weight. Quantization may also affect activations and the KV cache.
What "n-bit" actually means
A 4-bit quant doesn't store every weight as one of 16 values. It groups weights (e.g., blocks of 32 or 128), stores a scale and possibly a zero-point per group at higher precision, then stores each weight as a 4-bit index into that group's range. Effective bits-per-weight is usually n + overhead — a "4-bit" GGUF is often 4.5–5 bpw real.
The major quantization formats
| Format | Made for | Notes |
|---|---|---|
| GGUF (llama.cpp) | CPU + any GPU, cross-platform | The dominant format for local inference. Uses k-quants (Q4_K_M, Q5_K_S) and i-quants (IQ3_XS, IQ2_M) which are smarter than naive round-to-nearest. Runs in llama.cpp, Ollama, LM Studio, Jan, etc. |
| MLX | Apple Silicon | Native Apple framework; fastest path on M-series Macs. |
| AWQ | NVIDIA GPUs | Activation-aware: protects the weights that matter most based on activation magnitudes. Popular for vLLM serving. 4-bit is the standard. |
| GPTQ | NVIDIA GPUs | Older than AWQ, uses second-order info (approximate Hessian) to minimize quant error layer by layer. Still common. |
| EXL2 / EXL3 | NVIDIA GPUs | Variable bitrate per layer; aggressive and fast. Power-user format. |
| bitsandbytes (NF4 / FP4) | NVIDIA GPUs | On-the-fly 4-bit and 8-bit, used heavily for QLoRA fine-tuning. Not the fastest at inference but ubiquitous. |
| AQLM, QuIP#, HQQ | Research / specialty | Extreme low-bit (2-bit) with clever codebooks. Niche but improving. |
How to read GGUF quant suffixes
Q8_0— 8-bit, near-lossless. Big.Q6_K— 6-bit k-quant. Excellent quality, moderate size. Usually the sweet spot.Q5_K_M,Q5_K_S— 5-bit medium / small. Strong quality, smaller.Q4_K_M— 4-bit medium. The standard "I want it to fit and still be smart" pick.Q4_K_S— 4-bit small. A bit more degraded.Q3_K_*,IQ3_*— 3-bit. Visible degradation, usable for very large models.IQ2_*,Q2_K— 2-bit. Only worth it for very large models you couldn't otherwise run.
Rule of thumb on quality loss: going from fp16 → 8-bit is essentially free. 8 → 6 is nearly free. 6 → 4 is small but real. 4 → 3 is noticeable. 3 → 2 is large and only worth it on big models. The bigger the model, the better it tolerates aggressive quantization.
What quantization does internally
Each layer's matmul y = Wx becomes "dequantize W on the fly to compute Wx." The dequantization is fused with the matmul kernel so it's cheap. Activations stay in higher precision (often fp16); weights are the compressed thing. KV cache can be separately quantized (often 8-bit or 4-bit) to fit longer context.
4. The derivation axis: distills, merges, fine-tunes
Distillation
A smaller "student" model is trained to imitate a larger "teacher." Two flavors of distillation:
- Logit distillation — student matches the teacher's full output distribution (KL divergence). Requires access to the teacher's logits. Stronger but requires the teacher to be runnable.
- Data distillation — generate a big dataset of (prompt, teacher's response) pairs and SFT the student on it. This is what most "distilled" open weights actually are.
The DeepSeek-R1-Distill-* models (Qwen-7B, Llama-70B, etc.) are existing base models SFT'd on R1's reasoning traces. They're not R1 — they're smaller models that picked up some of R1's reasoning style.
Repo signals: -Distill, Distilled-, names like DeepSeek-R1-Distill-Qwen-32B.
Merges
Take two or more existing models with the same architecture and combine their weights — linear interpolation, SLERP, TIES, DARE, model soups. No training. Free if you have a GPU.
Quality is unpredictable: sometimes better than either parent, often worse, occasionally produces a model that benchmarks well but breaks subtly. The community on HF is full of these.
Repo signals: names with multiple model names smashed together, mention of mergekit, slerp, ties, dare.
Fine-tunes / continued pretraining
Someone took a base or instruct model and trained further on:
- A specific domain (medical, legal, code in language X)
- A persona / style (uncensored, roleplay, "dolphin," "nous")
- A new language
- A task (function calling, JSON output)
Quality varies wildly. Reputable fine-tuners: NousResearch, Cognitive Computations (Eric Hartford / "dolphin"), HuggingFaceH4, AllenAI, Teknium.
LoRA / QLoRA adapters
A small (MB-scale) addendum to a base model, not a full model. You load the base + adapter at runtime. A LoRA is much cheaper to ship and combine than full fine-tunes. Many "fine-tunes" on HF are actually adapters published alongside the base model name they require.
5. Context length variants
Models are pretrained at some native context length (e.g., 8K). Longer-context variants are produced by:
- RoPE scaling / NTK / YaRN — rescale the rotary position embeddings so the model generalizes to positions it didn't see in training. Cheap, sometimes lossy.
- Continued pretraining at long context — actually train on long sequences. Expensive but better.
- Position interpolation — linear interpolation of position indices.
You'll see 128k, 1M, -long in names. Watch out: long-context numbers on the box are often ambitious. Real performance often degrades well before the advertised limit ("lost in the middle"). Benchmarks like RULER and NIAH are more honest than the marketing number.
6. Multimodal variants
- VL / Vision — the model accepts images. A vision encoder (often SigLIP or a ViT) projects images into the LLM's token space. Examples: Qwen2.5-VL, Llama-3.2-Vision, Gemma 3 (natively multimodal).
- Audio / Speech — accepts audio input, sometimes produces speech output. Whisper-style encoders bolted on.
- Omni — text + image + audio + sometimes video, in and out. Qwen2.5-Omni, GPT-4o-style.
- Embedding models — not generative; produce vectors for retrieval. Different repo (
-embedding,bge,e5,gte). - Reranker models — score (query, document) pairs for retrieval.
7. Format-specific repos
The same model is republished in many formats by different teams:
- Original — by the model's creator, in safetensors at fp16/bf16.
- GGUF — TheBloke (historical), bartowski, lmstudio-community, mradermacher.
- MLX — mlx-community, lmstudio-community.
- AWQ / GPTQ — TheBloke (historical), Qwen team, neuralmagic.
- EXL2 — turboderp, LoneStriker.
Always check the original model card for capabilities, then pick a quant repo for your runtime.
8. Reading a HF repo name end-to-end
lmstudio-community/gemma-4-26B-A4B-it-MLX-6bit
lmstudio-community/— quantizer / packagergemma-4— model family + generation26B-A4B— MoE: 26B total, 4B activeit— instruction-tunedMLX— format (Apple Silicon)6bit— quantization level
bartowski/Qwen3-30B-A3B-Thinking-2507-GGUF (hypothetical):
bartowski/— quantizerQwen3— family30B-A3B— MoEThinking— reasoning-enabled2507— release date / version (Jul 2025)GGUF— format
unsloth/DeepSeek-R1-Distill-Qwen-14B-Q4_K_M-GGUF:
unsloth/— quantizerDeepSeek-R1-Distill— distilled from R1's reasoning tracesQwen-14B— student is Qwen 14BQ4_K_M— 4-bit medium k-quantGGUF— format
9. Decision framework
Start with the task, then narrow:
Step 1 — Task class
- Chat, writing, general Q&A, RAG → Instruct/Chat dense ~7–32B at Q4–Q6
- Hard code, math, multi-step reasoning → Reasoning model if you can spare the latency
- Code autocomplete / FIM → Small base or code-specialized model (~1–7B), high quant
- Agents, tool use → Instruct model with explicit tool-use training (Qwen, Llama, Hermes); reasoning helps but blows token budget
- Vision tasks → VL variant
- Embeddings / retrieval → dedicated embedding model, not a chat LLM
Step 2 — Hardware envelope
Estimate RAM needed: total_params × bits_per_weight / 8 plus ~2–8 GB for KV cache and overhead. On an M1 Max 64GB you can comfortably run anything up to ~50 GB on disk; above that, KV cache for long context starts hurting.
Step 3 — Architecture
- Lots of RAM, modest compute (CPU, Apple Silicon, single consumer GPU) → MoE wins
- GPU-rich, RAM-tight → Dense wins
- Need long context cheaply → consider Mamba/hybrid if ecosystem allows
Step 4 — Quant
- ≥30B params →
Q4_K_Mor 4-bit AWQ is usually fine - 7–13B → prefer
Q5_K_MorQ6_K; the smaller the model, the more you feel quant loss - <7B →
Q6_KorQ8_0if you have the headroom
Step 5 — Variant
- Prefer the original publisher's instruct model unless you have a specific reason
- Avoid random merges unless someone you trust benchmarks them
- For reasoning, prefer the original (R1, QwQ, Qwen3-Thinking) over distilled versions when you can fit them
10. How characteristics combine — concrete examples
| Use case | Pick | Why |
|---|---|---|
| Local chat assistant on M1 Max 64GB | Qwen3-30B-A3B-Instruct MLX 6bit, or gemma-3-27b-it MLX 6bit |
Fast (low active params or moderate dense), high-quality quant, fits with room |
| Hard math/code at the desk | QwQ-32B or Qwen3-32B-Thinking GGUF Q5_K_M |
Reasoning, dense for predictability |
| Code FIM in Zed | Qwen2.5-Coder-7B base, Q6 or fp16 |
Small, FIM-trained, low latency |
| RAG over your own docs | Mid-size instruct (Qwen3-14B or Llama-3.3-8B) + a reranker + an embedding model | Three different models, each specialized |
| Agentic tool-calling | Qwen3-14B-Instruct or Llama-3.3-70B-Instruct |
Strong tool-use training; skip reasoning unless task needs it |
| Vision Q&A on screenshots | Qwen2.5-VL-7B or Gemma-3-12B-it (natively multimodal) |
VL variant required |
| Squeezing the biggest model possible | DeepSeek-V3 or Qwen3-235B-A22B at IQ3 / Q3_K_S GGUF |
MoE + aggressive quant; 235B with 22B active is tractable on a beefy box |
11. What to ignore
- Leaderboard rank as your only signal — many models are gamed
- "Uncensored" branding as a quality signal — usually orthogonal to capability
- Bigger always = better — a well-tuned 14B beats a sloppy 70B for most things
- New release excitement — wait a week, read the actual benchmarks people run on their own data
Glossary
Hover any underlined term in the text above for a quick definition. Click to jump here for the full entry.
- Active params
- In an MoE, the parameters that actually run for a given token. Determines speed and FLOPs per token. Notation:
A4B= 4 billion active. - AWQ
- Activation-aware Weight Quantization. Identifies the most-important weights based on activation magnitudes and protects them at higher precision. Strong 4-bit quality, popular for vLLM serving on NVIDIA GPUs.
- bitsandbytes
- Quantization library (NF4, FP4, INT8) used heavily for QLoRA fine-tuning. On-the-fly quantization, ubiquitous in training, not the fastest at inference.
- Bits per weight (bpw)
- The actual storage cost per parameter, including quantization metadata (scales, zero-points, group sizes). A "4-bit" GGUF is typically 4.5–5 bpw in real terms.
- Chat template
- The set of special tokens (e.g.,
<|user|>,<|assistant|>,<|im_start|>) that mark conversational turns for an instruct model. Each family has its own template; mismatching the template at inference degrades quality silently. - Chain of Thought (CoT)
- An intermediate sequence of reasoning steps the model emits before its final answer. Either elicited by prompting or trained in.
- Dense model
- An architecture where every weight runs for every token. Compute and RAM scale together. The default before MoE.
- Distillation
- Training a smaller "student" model to imitate a larger "teacher." Either via logit matching (KL divergence on output distributions) or via SFT on teacher-generated (prompt, response) data.
- DPO
- Direct Preference Optimization. A preference-tuning method that skips the reward model used in RLHF and optimizes a closed-form preference loss directly on preferred-vs-rejected pairs. Cheaper and more stable than RLHF.
- Embedding model
- A model that converts text into a dense vector for semantic search, retrieval, and RAG. Not generative. Examples:
bge,e5,gte,nomic-embed. - EXL2 / EXL3
- ExLlamaV2/V3 quantization. Variable bitrate per layer; aggressive and fast on consumer NVIDIA GPUs. Power-user format.
- FIM (Fill-in-the-Middle)
- A training and inference objective that lets a model fill a gap given both a prefix and a suffix. Powers code autocomplete in editors.
- GGUF
- The dominant CPU+GPU local quantization format, used by llama.cpp, Ollama, LM Studio, Jan, etc. Single-file format with rich metadata. Successor to GGML.
- GPTQ
- A layer-wise post-training quantization method that uses second-order info (an approximate Hessian) to minimize quantization error. Predates AWQ; still widely used.
- GRPO / RLVR
- Group Relative Policy Optimization, often used for RLVR (RL with Verifiable Rewards). Instead of a learned reward model, the reward is a verifiable signal — e.g., did the math answer match? did the unit tests pass? Heavily used to train reasoning models.
- I-quants (IQ*)
- Importance-weighted GGUF quantizations (
IQ2_*,IQ3_*) using codebook-based compression. Better quality than k-quants below 4 bits. - KV cache
- The cached attention keys and values for previous tokens, kept in memory during generation. Grows linearly with context length. Often quantized separately (8-bit or 4-bit) to fit longer context.
- K-quants (Q*_K_*)
- A family of GGUF quantizations (
Q4_K_M,Q5_K_S,Q6_K, etc.) that use non-uniform precision across a model — important layers get more bits. Better quality than legacy round-to-nearest at the same average bit count. - LoRA
- Low-Rank Adaptation. A small set of low-rank matrices trained on top of frozen base weights. Adds task-specific behavior without retraining the full model. Tiny footprint, easy to share. QLoRA combines LoRA with 4-bit base quantization for memory-efficient fine-tuning.
- Lost in the Middle
- The empirical finding that LLMs often ignore information placed in the middle of long contexts, even when that information is highly relevant. Real long-context performance often degrades well before the advertised limit.
- MatFormer / elastic transformer
- A model trained so that smaller sub-models are nested inside the full model. One checkpoint can serve multiple capacity points. Used in Gemma 3n's
E2B/E4B"effective" variants. - Model merging (SLERP, TIES, DARE)
- Combining two or more model weights without further training. Linear interpolation, spherical linear interpolation (SLERP), TIES, and DARE are common methods. Quality is unpredictable. Tooling:
mergekit. - MLX
- Apple's array-computing framework, optimized for Apple Silicon's unified memory. The fastest local-inference path on M-series Macs. Has its own quantization formats (
MLX-4bit,-6bit,-8bit). - Mixture of Experts (MoE)
- An architecture that replaces dense MLP layers with N parallel "experts" and a router that picks top-K per token. Total parameters are large (RAM-heavy) but only a fraction are active per token (compute-light). Notation:
26B-A4B= 26B total, 4B active. Examples: Mixtral, DeepSeek-V3, Qwen3-235B-A22B. - Next-token prediction
- Predict the next token given the prior ones. The standard self-supervised pretraining objective for LLMs. The cross-entropy loss between the model's predicted distribution and the actual next token.
- Preference tuning
- A training stage that uses pairs of (preferred, rejected) responses to align model outputs with human (or AI) preferences. Methods: RLHF, DPO, IPO, KTO, ORPO.
- Pretraining
- Self-supervised training on a huge text corpus using next-token prediction. Produces a base model with no instruction-following. The expensive stage.
- QLoRA
- Fine-tune a frozen 4-bit base model (via bitsandbytes) by training small LoRA adapters on top. Drastically reduces the memory cost of fine-tuning large models.
- Quantization
- Compressing model weights (and optionally activations and KV cache) to lower bit precision (8/6/4/3/2 bits) to reduce memory and speed up inference, with some quality loss. Many formats: GGUF, MLX, AWQ, GPTQ, EXL2, bitsandbytes.
- Reasoning model
- A model trained to spend more compute at inference time by emitting long chains of thought before answering. Trained via RLVR/GRPO on problems with verifiable answers. Examples: DeepSeek-R1, QwQ, o1-style models, Qwen3-Thinking. Big accuracy gains on math/code/logic; large token cost and latency.
- Reranker
- A model that scores (query, document) pairs to reorder retrieval results. Used as a second stage after embedding-based retrieval to improve precision.
- RLHF
- Reinforcement Learning from Human Feedback. Train a reward model from human preference rankings, then RL the LLM (typically with PPO) against that reward. Powerful, expensive, finicky. The original ChatGPT recipe.
- RoPE / YaRN / NTK
- Rotary Position Embeddings — the position-encoding scheme used by most modern LLMs. Rescaling RoPE (linear interpolation, NTK, YaRN) extends a model's effective context length cheaply, sometimes with a short fine-tune.
- Router (MoE)
- A small learned network in an MoE layer that decides which experts process each token. Typically picks top-K (e.g., top-2 of 8). Routing imbalance is a common failure mode.
- safetensors
- A safe, fast tensor serialization format, designed as a safer alternative to the legacy PyTorch checkpoint format. The default for HF model weights since 2023.
- SFT (Supervised Fine-Tuning)
- Continued training on labeled (input, output) pairs — usually instructions and high-quality responses. Same loss as pretraining (next-token prediction), different data. Produces an instruct model.
- State-Space Model (SSM)
- An alternative to attention with linear (not quadratic) cost in sequence length. Mamba is the best-known modern variant. Hybrid architectures (Jamba, Zamba) mix attention and SSM layers.
- Test-time compute
- Spending more inference-time compute (longer outputs, multiple samples, search) to get better answers, instead of growing model size. The core idea behind reasoning models.
- Token
- The atomic unit a model reads and writes. Usually a sub-word produced by a tokenizer (BPE, SentencePiece, tiktoken). Roughly ~0.75 words for English; varies by language and tokenizer.
- Total params
- The full parameter count of an MoE — sum of all experts plus shared layers. Determines memory/disk footprint, not per-token compute.
- Transformer
- The neural-net architecture used by nearly all modern LLMs. Stacks of self-attention layers and feedforward (MLP) layers, with residual connections and layer norm. Introduced in 2017 ("Attention Is All You Need").
- Vision encoder (ViT, SigLIP, CLIP)
- A vision model used to convert images into token-like embeddings the LLM can consume. SigLIP and CLIP are popular variants. Typically frozen or lightly fine-tuned during VL training.
- YaRN
- Yet another RoPE extensioN. A method for extending RoPE-based context length with less quality loss than naive interpolation, typically combined with a short fine-tune at the new length.
This document was produced by Claude based on David Morel’s instructions and questions. Treat it as a starting point, not a canonical reference — model landscape moves fast and specific details may be outdated.