Evidence note: Models Desk synthesis from public model cards, research posts, and serving documentation as of 2026-08-17; this is not a private benchmark or lab ranking.
Quick answer
The LLM model stack 2026 has three layers most builders should name explicitly: pretraining (learning general language and world patterns from large corpora), post-training (alignment, instruction following, tool use, and domain adaptation on top of a base model), and inference (serving the model under latency, cost, and reliability constraints). Your product problem usually lives in one layer. If users complain about tone, you are in post-training or prompt/RAG territory. If the bill explodes at scale, you are in inference economics. If the model lacks fundamental knowledge, pretraining scale and data mix matter—but you rarely fix that by tweaking prompts alone.
Key takeaways
- Pretrain sets the capability ceiling; post-train shapes behavior; inference determines what users actually experience at scale.
- Most application teams operate at the post-train + inference boundary—fine-tuning, RAG, agents—not at pretrain.
- Leaderboard scores mix all three layers; read them with layer context (how to read AI leaderboards).
- Agent products add a fourth concern—orchestration—but still depend on this stack (chatbot to agent map).
- Inference economics (tokens, batching, hardware) often dominate unit economics before model quality does.
Why the LLM model stack 2026 matters
Search traffic around “LLM training pipeline” often collapses three different jobs into one vague question: “How do we make the model better?” That question sends teams in the wrong direction. A retrieval gap gets treated as a fine-tuning project. A serving bottleneck gets treated as a prompt problem. A safety failure gets patched in the application layer when the fix belongs in post-training or policy.
Mapping the stack is a routing exercise. Each layer has different owners, budgets, timelines, and failure modes. Pretraining is capital-intensive and measured in months. Post-training is experiment-heavy and measured in weeks. Inference is operations-heavy and measured in milliseconds and dollars per million tokens. When you know which layer your pain belongs to, you can read model cards, benchmarks, and vendor claims without conflating them.
This explainer is pillar content for the Identity / Systems hub (M1, M3, M4, M7). It links forward to agent architecture and leaderboard literacy—not because those topics repeat this one, but because production systems cut across all of them.
Layer 1: Pretraining
What pretraining is
Pretraining is the phase where a model learns statistical structure over vast text (and increasingly multimodal) data. The objective is usually next-token prediction or a related self-supervised task. The output is a base model: broad knowledge, grammar, reasoning primitives, and—depending on scale and data—coding patterns, math heuristics, and multilingual coverage.
Public descriptions from major labs emphasize scale (data volume, compute, architecture choices such as dense vs mixture-of-experts), but exact recipes are rarely fully open for frontier closed models. Open-weight releases often ship a model card summarizing training data categories, context length targets, and evaluation snapshots—see vendor research hubs such as OpenAI Research and Meta AI Blog for how each org frames its releases, and Hugging Face documentation for how open models document weights and inference.
What pretraining determines
Pretraining sets the ceiling for raw capability: what the model can represent, how far context can stretch before degradation, and how sample-efficient later adaptation will be. It does not reliably determine whether the model will follow your JSON schema, refuse harmful requests politely, or use your internal API correctly—that is largely post-training and product design.
Teams sometimes ask whether they should “pretrain their own LLM.” In 2026, for most organizations, the honest answer is no—unless you have a proprietary multimodal corpus, strict air-gap requirements, or regulatory constraints that prohibit third-party weights. The more common path is to select a strong base or instruction model and invest in post-training, retrieval, and serving.
Pretrain failure modes
- Data contamination and leakage that inflates public benchmark scores without improving real tasks.
- Under-representation of your domain language (legal, clinical, industrial)—later RAG helps but does not replace missing pretrain signal.
- Context-length claims that hold in marketing but degrade in long-document tasks without careful eval.
Layer 2: Post-training
From base model to product behavior
Post-training is the umbrella for everything that happens after the base checkpoint: supervised fine-tuning (SFT) on instruction datasets, preference optimization (RLHF, DPO, and variants), safety tuning, tool-calling training, multimodal alignment, and domain adapters (LoRA, QLoRA, full fine-tunes). This is the layer where “helpful assistant” behavior is installed—and where many LLM training pipeline diagrams spend most of their ink.
Vendors rarely publish full post-training recipes, but public papers and blog posts describe the pattern: start from a capable base, curate demonstration and preference data, iterate on refusals and format adherence, then evaluate on held-out tasks. Open-weight ecosystems document practical fine-tuning on Hugging Face; closed APIs expose post-training indirectly through “versions” and system prompts you cannot inspect.
Post-training sub-layers builders actually touch
| Intervention | Who runs it | What it fixes | What it does not fix |
|---|---|---|---|
| Prompt + system policy | App team | Format, tone, task framing | Missing domain knowledge at scale |
| RAG / knowledge bases | App + data team | Fresh facts, citations, private docs | Broken tool orchestration |
| LoRA / adapter fine-tune | ML platform | Style, classification, narrow tasks | Fundamental reasoning gaps |
| Full SFT / preference tune | ML research | Behavior alignment, complex workflows | Inference cost at 10× traffic |
| Vendor “model version” bump | Procurement | General capability lift | Your private eval regressions |
Post-training and evaluation
Public leaderboards often reflect post-trained models evaluated with specific prompts and scaffolds. A high score on a coding benchmark such as SWE-bench is not a pretrain-only story—it includes instruction following, tool use, and sometimes agent loops. Read our SWE-bench explainer before you treat a single number as proof your IDE should switch models.
When comparing open models for coding tasks, pair leaderboard context with task-specific shortlists (best open-weight LLM for coding) and a private smoke suite. Post-training differences between releases can dominate small pretrain architecture changes.
Layer 3: Inference
What inference is
Inference is running the trained weights to produce tokens under production constraints: latency (time to first token and inter-token delay), throughput (requests per second), memory (VRAM or RAM footprint), cost (per-million-token pricing or owned-hardware amortization), and reliability (uptime, rate limits, failover). Inference economics is where many AI products win or lose margin—not in whether model A beats model B by two points on a public quiz bench.
Decisions at the inference layer
- Hosting mode: vendor API vs self-hosted open weights vs hybrid.
- Quantization: FP16, BF16, INT8, INT4—quality vs memory tradeoffs; always validate on your tasks.
- Batching and caching: KV-cache reuse, prompt caching products, continuous batching on vLLM-style servers.
- Routing: small model for draft, large for verify; tiered models by user plan.
- Context budgeting: trimming history, summarization, structured memory—orthogonal to “200K context” marketing.
Model cards such as DeepSeek-V3 document capability and access; your serving stack still determines p95 latency when ten thousand users paste 30-page PDFs. Knowledge-worker products stack retrieval, apps, and models—see AI app stack for knowledge workers for how inference choices show up in UX.
Inference failure modes
- Chasing benchmark winners that cost 5× more per task at your context lengths.
- Ignoring cold start and queueing on shared API tiers during peak hours.
- Quantizing without regression tests on structured outputs and tool JSON.
- Scaling agents that multiply token volume per user action—see chatbot to agent map.
The full stack as a pipeline (not a ladder)
Diagrams often draw pretrain → post-train → inference as a straight line. In production it is a loop:
- Choose base or instruction model (pretrain + vendor post-train).
- Adapt with RAG, fine-tuning, or agents (your post-train / app layer).
- Ship behind an inference stack with SLOs.
- Collect failures; label whether they are knowledge, behavior, tool, or serving issues.
- Feed fixes back to the right layer—prompt, index, fine-tune, or hardware—not always “new model.”
| Layer | Primary question | Typical owner | Time horizon | Public visibility |
|---|---|---|---|---|
| Pretrain | What can the model represent? | Foundation lab | Months–years | Partial (cards, papers) |
| Post-train | How should it behave on tasks? | Lab + your ML team | Weeks–months | Low for closed APIs |
| Inference | What do users get per dollar/ms? | Platform / SRE | Days–weeks tuning | Your metrics only |
How benchmarks map to layers
Benchmarks are not layer-pure. MMLU-style knowledge probes skew toward pretrain + broad post-train. Chat arenas (see how to read AI leaderboards) blend post-train behavior with UX preferences. Repo-level coding benches mix reasoning, tool use, and harness design. When a vendor cites a number, ask: which checkpoint, which scaffold, which date—then ask which layer you would need to change to reproduce a gain in your product.
Pretrain vs post-train vs inference: where is my bug?
Use this routing table when triaging user reports:
| User symptom | Likely layer | First response (typical) |
|---|---|---|
| Wrong facts about yesterday’s news | App / RAG (not pretrain) | Refresh index, cite sources |
| Ignores JSON schema | Post-train / prompt | Structured output mode, examples, fine-tune |
| Slow, expensive chats | Inference | Cache, shorten context, smaller model route |
| Cannot reason about novel domain ontology | Pretrain gap + RAG | Domain docs, specialized model, fine-tune |
| Unsafe or off-brand tone | Post-train / policy | Safety tuning, filters, human review |
Access modes and the stack
Closed APIs bundle all three layers: you consume a post-trained endpoint with inference SLAs. You optimize prompts, RAG, and routing; you do not move the pretrain curve.
Open weights expose checkpoints—often base and instruct variants—so you can choose how much post-training to own. You also own more of inference (hardware, quantization, compliance). License terms matter as much as benchmark scores (M6/M8 clusters).
Hybrid patterns are common: closed frontier for hard steps, open small models for classification and extraction, self-hosted embeddings for RAG. The stack map helps you place each component instead of treating “the model” as one blob.
Architecture choices that span pretrain and inference
Pretraining architecture is not an abstract research detail—it prefigures inference cost. Dense transformers activate all parameters on every token; serving is predictable but memory-heavy at large scales. Mixture-of-experts (MoE) models activate a subset of experts per token, which can reduce compute per token at a given quality tier but adds routing complexity and uneven load on hardware. When a model card touts “efficient inference,” ask whether efficiency assumes a specific batch size, quantization level, or expert-parallel layout your team will not use.
Context length is negotiated at pretrain and post-train time (position encodings, training curricula) but paid for at inference. Doubling effective context often doubles KV-cache memory pressure—typical platform teams treat long context as a premium SKU internally even when the API marketing says one flat price. If your workflow is “paste entire repositories,” you are buying inference memory, not just “smarter pretrain.”
Multimodal stacks add encoders and projection layers. Vision or audio inputs increase pretrain data diversity and post-train alignment surface; at inference they add preprocessing pipelines and different failure modes (OCR errors, frame sampling). Map each modality to its own serving path instead of assuming one GPU profile fits chat and images.
Post-training methods in plain language
Teams encounter acronyms in vendor decks. Here is a desk-level glossary—definitions, not endorsements:
- SFT (supervised fine-tuning): Train on input→output demonstrations. Fixes format and task mimicry; risk of overfitting narrow styles.
- RLHF / preference learning: Optimize against human or model judge preferences. Shapes helpfulness and safety tone; can hide capability regressions on niche tasks.
- DPO and offline preference variants: Preference signal without full online RL loop; popular in open recipes for cost reasons.
- Constitutional / rule-based tuning: Encode policy constraints; complements human preference data.
- Tool and function-call tuning: Teaches API invocation patterns; essential for agents but evaluated poorly by pure knowledge benches.
The practical lesson: when a release note says “improved alignment,” assume post-training moved—re-run your JSON, tool, and refusal tests even if knowledge benches look flat.
Inference economics without fake precision
Public API list prices change frequently; this section stays methodological. Unit economics for LLM features usually decompose into:
- Input tokens (prompt, system, retrieved docs, tool returns)
- Output tokens (often priced higher on commercial APIs)
- Hidden tokens (image patches, audio frames, internal reasoning traces where exposed)
- Fixed per-request overhead (cold start, auth, logging)
Typical product mistakes: estimating cost from a demo with 200-token prompts when production averages 8,000 input tokens after RAG; ignoring agent loops that issue three model calls per user click; comparing a self-hosted GPU lease to API pricing without engineer time for ops. Build a token budget model tied to your top five user journeys, then stress-test with p95 context lengths—not mean.
When open-weight self-hosting wins on paper, validate utilization: a cluster that serves bursty traffic at 20% average GPU use rarely beats a pay-per-token API unless data residency or rate limits force it. Inference is as much finance as engineering.
Lineage: base, instruct, and “same family” confusion
Model lineage (M7) cuts across layers. A base checkpoint is pretrain output meant for further training—not polite chat out of the box. An instruct or chat checkpoint includes vendor or community post-training. Version bumps (e.g., 3.1 → 3.2) may change post-train only while pretrain backbone stays similar—or may swap MoE routing entirely. Model cards should state which checkpoint a benchmark used; readers should not assume “same name, same stack layer.”
Distilled or compressed variants (smaller student models) trade pretrain/post-train fidelity for inference speed. They belong in the stack map as derived checkpoints with their own eval—not as interchangeable drop-ins for the teacher model on hard tasks.
Security, compliance, and where they attach
Security is not a fourth mystical layer but a cross-cutting concern. Pretrain data governance affects copyright and toxicity priors. Post-training installs refusals and red-team responses. Inference enforces tenancy, logging, PII scrubbing, and regional routing. A compliance reviewer asking “where is customer data trained?” is asking about post-train and vendor contract scope, not pretrain corpus details you control. Document answers per layer for audits.
Who this is for
- Engineering leads and PMs deciding whether to fine-tune, change models, or fix retrieval.
- ML platform teams documenting where internal tooling sits relative to vendor checkpoints.
- Procurement and finance separating capability purchases from inference spend.
- Researchers writing honest model cards that separate base vs instruct vs served API.
Who should skip
- Readers looking for a single “best model in 2026” ranking—use task-specific guides and private evals instead.
- Teams that only need a no-code chatbot with default settings—inference defaults may suffice without stack literacy.
- Anyone expecting step-by-step pretraining code for a frontier model—out of scope; see open-replication communities for educational scales only.
Common mistakes
| Mistake | Why it fails | Better move |
|---|---|---|
| Fine-tuning away a retrieval problem | Stale facts do not live in weights | RAG + eval on fresh docs |
| Upgrading model version without inference load test | Cost and latency regressions | Shadow traffic, token budgets |
| Treating arena Elo as deployment proof | Preference ≠ your workflow | Task suites + leaderboard guide |
| Assuming open base = production-ready | Missing instruct / safety layer | Use instruct checkpoint or SFT |
| Building agents before fixing single-turn quality | Error compounding | Stabilize core turn, then orchestrate |
FAQ
Does a bigger pretrain always beat better post-training?
Not for your product. A smaller model with strong instruct tuning plus RAG often beats a larger base on enterprise Q&A. Pretrain scale matters more for hard reasoning, rare languages, and low-shot generalization.
Where does RAG sit in the stack?
RAG is an application-layer pattern that sits beside post-training: it injects context at inference time without updating weights. It is not a substitute for behavioral alignment or safe refusal policies.
Is inference optimization “done” once we pick vLLM or a vendor API?
No. Workloads drift—longer contexts, more agents, multimodal attachments. Revisit quantization and routing when token mix changes; typical teams review quarterly at scale.
How do agents change the stack map?
Agents multiply inference calls and add tool and state layers. The base stack still applies; orchestration is an adjacent pillar (from chatbot to agent).
What should we log to debug layer confusion?
Log task type, model ID + version, context tokens, latency, retrieval hits, tool errors, and human override rate. Tag incidents with the layer hypothesis (knowledge vs behavior vs serving) before opening a fine-tune project.
Sources
- OpenAI Research — official research and release notes (verify specific model pages when citing).
- Meta AI Blog — Llama-family and research announcements.
- Hugging Face Documentation — open-weight hosting, transformers, and fine-tuning guides.
What we did not test: We did not run private pretraining or publish new benchmark scores for this article. Capability claims refer to publicly documented patterns, not EIA-measured rankings.
Corrections: When major labs rename training stages or ship new default inference products, update the layer definitions and as-of date at the top—not isolated adjectives in SEO title.
Next step
Read how to read AI leaderboards so stack-aware eval matches how models are actually scored. Then map your product surface in from chatbot to agent if you are adding tools and loops.