ImageFirm AI Systems Explainer

How a modern LLM goes from raw data to an answer.

The popular eight-step infographic is directionally useful, but real-world model development is less linear, more iterative, and more technically nuanced. This version keeps the clarity while correcting the oversimplifications.

Data curation Tokenization Pretraining Post-training Evaluation Inference

The lifecycle, refined

Think of these as major stages in a production pipeline—not eight perfectly isolated boxes. In practice, data work, evaluation, safety, post-training and deployment form feedback loops.

1Foundation

Data sourcing & governance

Training begins with large collections of text, code and other permitted data sources.

  • Public, licensed, human-created and synthetic data may all play a role.
  • Provenance, rights, privacy and quality controls matter.
  • “More data” is not automatically “better data.”
2Curation

Filtering, deduplication & mixing

Raw corpora are transformed into a training mixture with carefully chosen proportions.

  • Remove duplicates, corruption and low-value artifacts.
  • Apply quality, safety and privacy-oriented filters.
  • Balance domains, languages, code and long-form material.
3Representation

Tokenization

Text is encoded into discrete token IDs that the neural network can process.

  • Tokens are not necessarily whole words.
  • A tokenizer maps text ↔ token sequences.
  • Context length is measured in tokens, not characters.
4Learning

Pretraining

A Transformer learns statistical structure by predicting tokens from context across massive datasets.

  • Optimization updates billions of model parameters.
  • The model learns compressed representations and reusable patterns.
  • Next-token prediction is the training objective—not a literal database lookup.
5Post-training

Instruction tuning

Supervised examples shape the pretrained model into a more useful assistant.

  • Demonstrations teach task following, style and formatting.
  • High-quality examples matter more than rote memorization.
  • Capabilities and behavior are refined for intended use.
6Preference learning

RLHF, DPO & related methods

Human or model-derived preferences can be used to favor better responses.

  • RLHF is one family of reinforcement-learning-based methods.
  • DPO directly optimizes preference pairs without the same RL loop.
  • Modern systems may combine several post-training techniques.
7Assurance

Evaluation, red-teaming & safety

Models are tested for capability, robustness, reliability and unwanted behavior.

  • Benchmarks cover reasoning, coding, factuality and domain skills.
  • Adversarial testing probes failure modes.
  • Safety is not a single filter; it spans training, policy and product layers.
8Serving

Deployment & inference

The trained model is served on production infrastructure and generates tokens in response to user input.

  • Inference may use GPUs/accelerators, caching, routing and batching.
  • System instructions, tools and retrieval can augment the base model.
  • Monitoring creates a feedback loop into future model improvements.
The key correction

A deployed assistant is not simply “the pretrained model.” The experience can include post-trained weights, system-level instructions, safety layers, retrieval, tools, memory, orchestration and product infrastructure around the core neural network.

What the original gets right — and where it needs refinement

The source infographic is an effective introduction, but some captions imply a cleaner, more deterministic process than actually exists.

Directionally correct

It correctly identifies the major concepts: data preparation, tokenization, next-token pretraining, instruction tuning, preference alignment, evaluation, safety and production inference.

Too linear

Real model development involves repeated iteration. Evaluation can change the data mixture; safety findings can alter post-training; deployment telemetry can influence later model versions.

“Data cleaning” is broader than deletion

High-end curation includes provenance, deduplication, quality scoring, language balancing, domain mixing, contamination analysis and privacy safeguards—not merely removing spam or “bad” content.

RLHF and DPO are not interchangeable

They pursue similar behavioral goals but use different optimization strategies. Treating “RLHF / DPO” as one single method hides an important technical distinction.

01
DataSources + governance
02
TokensEncoded sequences
03
PretrainLearn broad structure
04
Post-trainShape behavior
05
ServeGenerate at inference

What happens when you press “send”

This is separate from training. Your prompt is processed at inference time by an already-trained system.

Step A

Context is assembled

Your message may be combined with system instructions, conversation history and—when enabled—relevant tool or retrieval context.

Step B

Tokens are generated

The model repeatedly computes a probability distribution over possible next tokens and selects tokens according to the serving configuration.

Step C

The product returns an answer

Output can be streamed, checked against product rules, formatted and sometimes combined with external tool results before you see it.

One sentence to remember

A modern LLM is trained to model sequences of tokens, then post-trained and wrapped in a larger product system so that those learned representations can be turned into useful, controlled responses at inference time.