Learn/Course 16
Transformers · weeks 21

Frontier architectures & efficient inference

Long-context generation breaks latency and cost targets.

Opening production brief

A measurable problem, before a model.

Users

Operators, product owners, and people affected by the efficient inference decision.

Data

prefill/decode, sampling, KV layout, GQA/MQA with version, owner, event time, and availability contracts.

Constraints

Long-context generation breaks latency and cost targets. Every solution must state latency, cost, capacity, and fallback limits.

Success

Offline evidence plus a deployable resolution: A capacity plan using efficient attention, quantization, batching, and modern routing.

CHAPTER 1

Frame and baseline

Turn the production problem into explicit data, metric, and baseline contracts.

  1. 01

    Autoregressive decoding policies

    The model supplies possibilities; the decoding policy decides which possibilities can become product behavior.

    65–90 min · checkpoint · deterministic lab
  2. 02

    KV caches, GQA/MQA, and long context

    KV caching removes repeated history compute by turning context length into a first-class memory budget.

    65–90 min · checkpoint · deterministic lab
CHAPTER 2

Build and stress

Formalize the machinery, test counterexamples, and expose system limits.

  1. 03

    Quantization, compilation, and fused kernels

    Optimize the measured bottleneck, and treat every numeric or execution rewrite as a new artifact that must pass quality gates.

    65–90 min · checkpoint · deterministic lab
  2. 04

    Continuous batching and speculative decoding

    Throughput techniques earn their place only when they improve completed requests—not merely scheduled tokens.

    65–90 min · checkpoint · deterministic lab
CHAPTER 3

Resolve and operate

Join model behavior to architecture, observability, rollout, and rollback.

  1. 05

    Distributed and MoE inference

    Distributed inference is constrained by the slowest communication or routing boundary, not by the sum of advertised compute.

    65–90 min · checkpoint · deterministic lab
  2. HW

    LLM inference capacity plan

    Benchmark cache, batching, concurrency, sampling, and one quantized path on mixed traces.

    Rubric · staged hints · reference resolution
Prerequisite guidance

2 concepts make this faster.

Prerequisites are guidance, never hard gates.

C14Transformer from scratchTokenizer, attention, RoPE, residual stack, training loop, generation, and KV cache.C15Foundation modelsA grounded system design spanning adaptation, RAG, evaluation, and safety.
Ready to work the problem?

Autoregressive decoding policies

Start lesson 01