JustujuAI, layer by layer.Open in the interactive map

Training vs inference infrastructure

Training needs one giant, tightly linked cluster for weeks; serving answers needs many smaller copies close to users, sized for speed and cost per request.

Layer 3 · Cloud & Infrastructure · Build and run time · reviewed 2026-10-30

Read first: GPU clusters & orchestration.

SimpleA plain explanation, one diagram and an analogy, with where the analogy breaks.

Guess first: Look at the two columns: which one needs every chip talking at once?

Show the answerTeaching. Thousands of chips work on one giant job together; using it needs a few per question.

Teaching an AI is like building a giant ship: thousands of workers on one huge job for weeks.

Using the AI is more like running a chain of cafés. Lots of small shops serve people quickly, all day, near where they live.

Training runs one job across thousands of accelerators in one place. They must swap results every step, so the fast network between them matters as much as the chips. Jobs last weeks and the goal is high utilisation.

Inference serves many separate requests. Each copy of the model needs only enough chips to hold its weights and working memory, and copies can sit in different regions. The goals are low latency and low cost per token, and demand rises and falls through the day.

Inference itself has two phases: reading the prompt (prefill) is compute-heavy, while writing the answer token by token (decode) is limited by memory bandwidth. Some systems now run the two on different machines.

TrainingOne huge jobThousands of chips, one siteNetwork is criticalRuns for weeksMeasured by utilisationInferenceMany small requestsA few chips per model copySpread across regionsDemand goes up and downMeasured by latency and cost per token
Two shapes of cluster

Like: Building one ship versus running a chain of cafés.
Where it breaks: Cafés and shipyards need different buildings. GPU clusters are more flexible: the same machines can switch between training and serving, and growing amounts of compute now go into inference, for example when models reason for longer before answering.

ResearchWhere the simple picture breaks, open problems and primary sources.

The Simple explanation separates training and inference by the shape of the job. Newer methods mix the two and move spending between them.

Reinforcement learning mixes them. Post-training with RL alternates generating answers and updating weights, so systems now reshard one model between training and generation on shared hardware (Sheng et al., 2024).

Splitting inference. Running prompt reading and answer writing on separate GPUs removes interference between them, at the cost of moving the cache; how far to split is unsettled (Zhong et al., 2024).

Train or think. On problems a smaller model can sometimes solve, extra thinking at answer time beat a 14 times larger model at matched compute, so the split of a budget between training and inference is a design choice (Snell et al., 2024).

Security on this concept: 1 threat Pending expert review

One customer's training job reaches another's data Pending expert review

Exposed
  • Shared managed training and serving platforms
  • Other tenants' models, datasets and credentials
Attacks
  • Running code in a training job that escapes its container
  • Using over-broad platform credentials to read other tenants' storage
Real case
Research demonstration: SAPwned (SAP AI Core) (2024-07)
Controls
  • Treat every training job as untrusted code: strong sandboxing per tenant
  • Separate networks and credentials per tenant; nothing shared by default
  • Least privilege for the platform's own service accounts
Owner
Platform/Cloud, with ML engineering
Reference
AML.T0105 Escape to Host

All layers in the security view

Examples as of 2026-10-30

Sources

  1. Splitwise: Efficient generative LLM inference using phase splitting (2023)
  2. Efficient Memory Management for Large Language Model Serving with PagedAttention (2023)
  3. Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism (2019)
  4. HybridFlow: A Flexible and Efficient RLHF Framework (Sheng et al.) (2024-09-28)
  5. DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model Serving (Zhong et al.) (2024-01-18)
  6. Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters (2024)
  7. verl: Volcano Engine Reinforcement Learning for LLMs (GitHub) (2026)

How it connects

More in Layer 3 · Cloud & Infrastructure