Index Ai Academy
Phase 5 · Math under the GPT

Backprop through a linear layer

dX = dY Wᵀ, dW = Xᵀ dY, db = column sums: derived by shape and by entry, checked on the tiny GPT's own projection.

About 35 minutes · Optional lesson: deeper material that no phase or certificate requires · A free account opens the whole lesson.
Already have an account? Sign in to open this lesson

What it covers9

Why it matters

Every linear layer in a GPT, the three attention projections, the output projection, the two halves of the feed-forward layer and the output head, is Y=XW+bY = XW + b. Backprop through it is three formulas, and they hold for any batch size: dX=dY W⊤dX = dY\,W^{\top}, dW=X⊤dYdW = X^{\top} dY, dbdb = the column sums of dYdY. In the tiny GPT those layers hold 79 percent of the parameters, and in production models the proportion is similar.

This lesson derives the formulas two ways, by the shapes they must have and entry by entry from the chain rule, then checks them against autograd on a 3 × 2 example and on the tiny GPT's own query-key-value projection, a 32 → 96 layer with 3,168 parameters. On the way you meet the transpose trap of PyTorch's weight layout and see why a parameter shared across rows collects a sum.

What you'll be able to do

  • Write the three gradients of Y = XW + b, dX = dY Wᵀ, dW = Xᵀ dY and db = column sums, and justify them by shape
  • Derive dW entry by entry and explain the sum over the batch
  • Handle PyTorch's (out, in) weight layout, where weight.grad = dYᵀ X
  • Check hand-written gradients against autograd on the tiny GPT's own projection
Quick check
X is n × d_in, W is d_in × d_out and the upstream gradient dY is n × d_out. Which product has the shape of W and so can be dW?
  1. Xᵀ dY: (d_in × n)(n × d_out) = d_in × d_out
  2. dYᵀ X: (d_out × n)(n × d_in) = d_out × d_in
  3. X dY: (n × d_in)(n × d_out), the inner sizes match
  4. dY Xᵀ: (n × d_out)(d_in × n) = n × n
Show the answer

Xᵀ dY: (d_in × n)(n × d_out) = d_in × d_out

Only Xᵀ dY multiplies and lands on d_in × d_out, the shape of W. dYᵀ X is its transpose, the shape PyTorch stores; X dY does not multiply at all.

The idea: three formulas, by shape

This rests on Matrix multiplication, the shape rule, and on Backpropagation, where the gradient first went backward through a layer.

Three formulas, by shape

A linear layer computes Y=XW+bY = XW + b: XX holds one input row per example or token (n×dinn \times d_{in}), WW is din×doutd_{in} \times d_{out}, bb is added to every row, and YY is n×doutn \times d_{out}. Backprop hands you ∂L/∂Y\partial L/\partial Y, written dYdY, the same shape as YY, and asks for dXdX, dWdW and dbdb.

The shapes alone pin down the candidates. dXdX must be n×dinn \times d_{in} and can only be built from dYdY (n×doutn \times d_{out}) and WW: the one product that fits is dY W⊤dY\,W^{\top}. dWdW must be din×doutd_{in} \times d_{out}, built from XX and dYdY: X⊤dYX^{\top} dY, with the nn dimension summed away. dbdb must be a vector of doutd_{out} numbers built from dYdY: its column sums.

dX=dY W⊤,dW=X⊤dY,db=∑rowsdY.dX = dY\,W^{\top}, \qquad dW = X^{\top} dY, \qquad db = \sum_{\text{rows}} dY.

Shape reasoning finds the formulas; it does not prove them. The next cell checks all three against autograd on a 3 × 2 input, a 2 × 4 weight and a hand-picked dYdY, and the section after derives them entry by entry.

Worked example

Hand formulas against autograd

A 3 × 2 input, a 2 × 4 weight, a bias, and a chosen dY. The loss (Y · dY).sum() has gradient exactly dY at Y.

import torch

# 3 rows, 2 inputs each
X = torch.tensor([[1.0, 2.0], [0.0, 1.0], [3.0, -1.0]], requires_grad=True)
# 2 in, 4 out
W = torch.tensor([[1.0, 0.0, 2.0, -1.0], [0.5, 1.0, 0.0, 1.0]], requires_grad=True)
b = torch.tensor([0.0, 1.0, -1.0, 0.5], requires_grad=True)
Y = X @ W + b
# the gradient arriving at Y
dY = torch.tensor([[1.0, 0.0, 0.0, 1.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 1.0]])
(Y * dY).sum().backward()        # a loss whose gradient with respect to Y is exactly dY
print("Y:", Y)
print("dX hand:", dY @ W.T); print("dX auto:", X.grad)
print("dW hand:", X.T @ dY); print("dW auto:", W.grad)
print("db hand:", dY.sum(0)); print("db auto:", b.grad)
It runs right here in your browser, with nothing to install.

Three pairs, three matches. Read dW's entries as sums down the rows of X and dY: dW[0][3] = 1·1 + 0·0 + 3·1 = 4 and dW[1][2] = 2·0 + 1·0 + (−1)·1 = −1. db is dY's column sums, [1, 1, 1, 2]: the bias of output 3 was used by rows 0 and 2, so it collects both gradients. dX's first column is 0, 0, 1: each row of dY dotted with W's first row [1, 0, 2, −1], and for the first two rows the hits cancel or vanish (1 − 1, then 0). The hand versions print with a grad_fn because W and X track gradients; the numbers are what matter.

Quick check
The shapes of the three gradients. What does this print?
import torch
X = torch.zeros(5, 3); W = torch.zeros(3, 7); dY = torch.ones(5, 7)
print((dY @ W.T).shape, (X.T @ dY).shape, dY.sum(0).shape)
  1. torch.Size([5, 3]) torch.Size([3, 7]) torch.Size([7])
  2. torch.Size([5, 3]) torch.Size([7, 3]) torch.Size([5])
  3. torch.Size([5, 7]) torch.Size([3, 7]) torch.Size([7])
  4. torch.Size([3, 5]) torch.Size([7, 3]) torch.Size([5])
Show the answer

torch.Size([5, 3]) torch.Size([3, 7]) torch.Size([7])

dX has X's shape (5 × 3), dW has W's shape (3 × 7), db has b's shape (7). A gradient always has the shape of its variable.

Try it now

Each entry of dW adds up, over the batch, the input times the gradient it helped cause.

In your own words
Shape reasoning gave the three formulas in a few lines. What can it not tell you, and how did the cell above fill the gap?

Write a sentence or two, then compare it with a good answer in the lesson.

In PyTorch: the formulas as code

One entry, by the chain rule

Write out one output: Ynj=∑iXniWij+bjY_{nj} = \sum_i X_{ni} W_{ij} + b_j. Each weight WijW_{ij} appears in YnjY_{nj} for every row nn, multiplied by XniX_{ni}. The chain rule sums over every place a variable is used, so

dWij=∑nXni dYnj=(X⊤dY)ij.dW_{ij} = \sum_n X_{ni}\, dY_{nj} = (X^{\top} dY)_{ij}.

That sum over nn is the batch sum: a parameter shared by every row collects gradient from every row, the same rule as the += in the autograd engine's backward functions, where a value used twice adds up both gradients.

For the input, XniX_{ni} appears in YnjY_{nj} for every output jj, multiplied by WijW_{ij}: dXni=∑jdYnjWij=(dY W⊤)nidX_{ni} = \sum_j dY_{nj} W_{ij} = (dY\,W^{\top})_{ni}. For the bias, bjb_j appears in YnjY_{nj} for every row with coefficient 1: dbj=∑ndYnjdb_j = \sum_n dY_{nj}.

The next cell shows the batch sum happening: each row's contribution to dWdW is an outer product of its input and its gradient, and the three contributions add up to X⊤dYX^{\top} dY.

Worked example

The batch sum, row by row

Each row's outer product X[n]ᵀ dY[n], then their sum, next to Xᵀ dY.

import torch

X = torch.tensor([[1.0, 2.0], [0.0, 1.0], [3.0, -1.0]])
dY = torch.tensor([[1.0, 0.0, 0.0, 1.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 1.0]])
# row n's outer product: (2 x 1) @ (1 x 4)
rows = [X[n:n + 1].T @ dY[n:n + 1] for n in range(3)]
for n, r in enumerate(rows):
    print("row", n, r)
print("sum of rows:", sum(rows))
print("X.T @ dY:   ", X.T @ dY)
In the lesson you can change this and run it.

Row 0 contributes its input [1, 2] times its gradient [1, 0, 0, 1]: a rank-one block that touches only columns 0 and 3. Row 1's gradient is a single 1 at column 1, so it adds its input [0, 1] there. Row 2 adds [3, −1] to columns 2 and 3. Stacked, the three blocks give [[1, 0, 3, 4], [2, 1, −1, 1]], which is Xᵀ dY exactly. Doubling the batch doubles the number of blocks, which is why training averages the loss over the batch: the mean keeps the size of the gradient, and so of the step, independent of the batch size.

Drill

The three formulas as a function

Write linear_backward(X, W, dY) returning the tuple (dX, dW, db) for Y = XW + b, with X of shape (n, d_in), W of shape (d_in, d_out) and dY of shape (n, d_out).

import torch

def linear_backward(X, W, dY):
    return X, W, dY[0]

X = torch.tensor([[1.0, 2.0], [0.0, 1.0], [3.0, -1.0]])
W = torch.tensor([[1.0, 0.0, 2.0, -1.0], [0.5, 1.0, 0.0, 1.0]])
dY = torch.tensor([[1.0, 0.0, 0.0, 1.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 1.0]])
dX, dW, db = linear_backward(X, W, dY)
print(dW, db)
In the lesson, your code is checked as you write it.

The transpose trap

PyTorch's Linear module stores its weight the other way around: shape (out, in), and computes x @ weight.T + bias. In that layout the gradient is the transpose of ours: weight.grad = dY⊤XdY^{\top} X, shape (out, in). The formula did not change; the bookkeeping did, and mixing the two layouts is the most common way to get a shape error in a hand-written backward pass.

The tiny GPT's query-key-value projection is such a layer: Linear(32, 96), weight (96, 32), bias (96,). On the six-token prompt "Our Kestrel tent is made from", its input is 6 × 32 and its output 6 × 96. The next cell runs the layer on the real activations from the model's first block, picks a random dYdY, and compares dY⊤XdY^{\top} X, the column sums and dY WdY\,W (not W⊤W^{\top}, for the same layout reason) with what autograd stores in weight.grad, bias.grad and the input's grad.

Worked example

The tiny GPT's query-key-value projection

Linear(32, 96) on the real activations of the first block. Hand gradients in PyTorch's layout against autograd, and the parameter count.

import torch
from tinygpt import load_pretrained

model, tok = load_pretrained("tiny-gpt")
ids = torch.tensor([tok.encode("Our Kestrel tent is made from")])
blk = model.blocks[0]
with torch.no_grad():
    h = model.tok(ids) + model.pos(torch.arange(ids.shape[1]))
    X = blk.ln1(h)[0].detach()     # what the projection receives: 6 tokens x 32 numbers
X.requires_grad_(True)
Y = blk.qkv(X)                     # Linear(32, 96): weight (96, 32), bias (96,)
print("X", tuple(X.shape), " weight", tuple(blk.qkv.weight.shape), " Y", tuple(Y.shape))
torch.manual_seed(0)
dY = torch.randn(*Y.shape)
(Y * dY).sum().backward()
print("weight: max |dY^T X - autograd| =",
      (dY.T @ X.detach() - blk.qkv.weight.grad).abs().max().item())
print("bias:   max |column sums - autograd| =",
      (dY.sum(0) - blk.qkv.bias.grad).abs().max().item())
print("input:  max |dY W - autograd| =",
      (dY @ blk.qkv.weight.detach() - X.grad).abs().max().item())
print("parameters in this layer:", blk.qkv.weight.numel() + blk.qkv.bias.numel())
In the lesson you can change this and run it.

Zero difference on all three, on the model's own numbers. The weight's gradient is dYᵀ X because of the (out, in) layout: 96 × 6 times 6 × 32 gives the 96 × 32 of the weight. The input's gradient is dY W rather than dY Wᵀ for the same reason. The bias collects the column sums over the six tokens. This one layer holds 3,168 of the model's 40,195 parameters, and the same three formulas serve the other eight linear layers; the last cell of the lesson counts them.

Quick check
The bias gradient for an upstream gradient of ones. What does this print?
import torch
print(torch.ones(4, 2).sum(0).tolist())
  1. [8.0]
  2. [4.0, 4.0]
  3. [2.0, 2.0, 2.0, 2.0]
  4. [1.0, 1.0]
Show the answer

[4.0, 4.0]

Four rows, two outputs: each output's bias collects a 1 from every row, so db = [4, 4]. One number per output, summed over the batch.

Quick check
In PyTorch's layout the weight has shape (out, in). Which product gives weight.grad?
  1. dY Xᵀ, which has mismatched inner sizes unless n = d_in
  2. X dYᵀ, shape (n, n): one entry per pair of rows
  3. Xᵀ dY, shape (in, out): the same as in the lesson's layout
  4. dYᵀ X, shape (out, in): the transpose of Xᵀ dY
Show the answer

dYᵀ X, shape (out, in): the transpose of Xᵀ dY

The layer computes X Wᵀ, so the role of W is played by Wᵀ; the gradient with respect to the stored matrix is the transpose of Xᵀ dY.

Drill

The weight gradient in PyTorch's layout

Write torch_weight_grad(X, dY): for a PyTorch Linear layer whose weight is stored as (out, in), return weight.grad from the input X (n, in) and the upstream gradient dY (n, out). It is the transpose of Xᵀ dY, computed directly.

import torch

def torch_weight_grad(X, dY):
    return X.T @ dY

X = torch.tensor([[1.0, 2.0], [0.0, 1.0], [3.0, -1.0]])
dY = torch.ones(3, 4)
print(torch_weight_grad(X, dY).shape)
In the lesson, your code is checked as you write it.
In your own words
A hand-written backward pass for a PyTorch Linear layer raises a shape error at weight.grad. What is the most likely cause, and how do you fix it without changing the math?

Write a sentence or two, then compare it with a good answer in the lesson.

In real models: where this runs in a GPT

Count the layers this lesson covers. Each block of the tiny GPT has four linear layers: the query-key-value projection (32 → 96), the output projection (32 → 32), and the two halves of the feed-forward layer (32 → 128 and 128 → 32). The output head is a ninth (32 → 195). Everything else, embeddings and layer norms, is a few thousand parameters. The next cell lists the linear layers from the model itself and adds up: they hold 31,587 of the 40,195 parameters, 79 percent.

Production models keep the proportion: attention projections, feed-forward layers and the output head are matrix products, and their backward passes are the three formulas with the same shapes scaled up. What the formulas do not cover is the softmax inside attention and at the output, where the Jacobian is not a weight matrix. That is The softmax Jacobian and p − y.

Worked example

Every linear layer in the tiny GPT

The model's parameters, filtered to the linear layers, with the share they hold.

from tinygpt import load_pretrained

model, tok = load_pretrained("tiny-gpt")
linear_names = ("qkv", "proj", "mlp", "head")
total = linear = 0
for name, p in model.named_parameters():
    total += p.numel()
    if any(part in name for part in linear_names):
        linear += p.numel()
        print(f"{name:22s} {str(tuple(p.shape)):11s} {p.numel():6d}")
print("linear layers:", linear, " all parameters:", total,
      f" share: {100 * linear / total:.0f}%")
In the lesson you can change this and run it.

Nine layers, eighteen parameter tensors, 31,587 numbers: 79 percent of the model. The largest is the output head's weight, 195 × 32 = 6,240, then the two feed-forward weights of each block at 4,096 apiece. The remaining 21 percent is the token embedding (195 × 32), the position embedding (64 × 32) and five layer norms of 64 parameters each. Every one of the eighteen tensors listed here gets its gradient from dYᵀ X or the column sums.

Quick check
From the backpropagation lesson: why does one backward pass give every weight's gradient cheaply?
  1. Each layer reuses the gradient from the layer above, so all gradients cost about one extra pass
  2. Only the last layer's gradient is computed exactly; the earlier ones are approximated
  3. The gradients are read from a table that the forward pass fills in as it goes
  4. Each weight's gradient is computed by its own forward pass with that weight nudged a little
Show the answer

Each layer reuses the gradient from the layer above, so all gradients cost about one extra pass

The gradient at a layer's output is computed once and used for both dW and dX; dX becomes the next layer's upstream gradient. One pass, every gradient.

Quick check
Why does dW sum over the rows of the batch?
  1. The rows are averaged in the forward pass, so the backward pass must sum them
  2. Summing makes dW the same shape as W, which it would not be otherwise
  3. It does not; each row has its own copy of W and its own dW
  4. W is used by every row, and the chain rule adds up the gradient from every use
Show the answer

W is used by every row, and the chain rule adds up the gradient from every use

A shared parameter collects a contribution from each place it is used; the n rows each contribute an outer product, and the sum is Xᵀ dY.

Where this shows up in an engineer's week

On the job: gradient shape errors are the most common bug in hand-written layers, and the transpose trap is the usual cause. Check weight.grad.shape == weight.shape first, then compare against autograd on a tiny input before you trust a custom backward. Also check that the loss is a mean over the batch, so gradients do not grow with batch size.

Goes deeper in

In your own words
The linear layers hold 79 percent of the tiny GPT's parameters. What does that say about where the compute of a backward pass goes, and which parts the three formulas leave out?

Write a sentence or two, then compare it with a good answer in the lesson.

You can now

  • Write dX = dY Wᵀ, dW = Xᵀ dY and db = column sums, and justify each by its shape.
  • Derive dW entry by entry and explain why a shared parameter sums over the batch.
  • Translate to PyTorch's (out, in) layout, where weight.grad = dYᵀ X.
  • Check a hand-written gradient against autograd on the tiny GPT's own projection.

Next: the softmax Jacobian, and why cross-entropy's gradient is p − y.

Practice what you just read

  • 4 code examples you can edit and run
  • a practice exercise that checks your code
  • a 5-question quiz
  • 10 review cards for spaced repetition

Try a quiz question

For Y = XW + b with X of shape (n, d_in) and W of shape (d_in, d_out), the gradient with respect to X is:

  1. dY Wᵀ, shape (n, d_in)
  2. Wᵀ dY, shape (d_in, n)
  3. Xᵀ dY, shape (d_in, d_out)
  4. dYᵀ X, shape (d_out, d_in)

Answer it at the end of the lesson to see if you're right, and why.

Before this lesson

Go deeper, if you like

Optional lessons that build on this one. They never block a phase or a certificate.

Keep learning

Where this lesson leads.

575 lessons in thirteen phases. 176 are free without an account, and a free account opens the rest. See every lesson.

Phase 5 · about 36 hours of study

Transformers

Attention, GPT from scratch and pretraining 47 lessons 1 free
  1. Language modeling FreePredict the next token, and score it with cross-entropy.30 min
  2. Tokenization and BPEHow tokenizers are built from data.40 min
  3. A bigram modelThe simplest language model, built from counts.35 min
  4. Sampling strategiesTemperature, top-k and top-p: turning probabilities into text.35 min
  5. Beam search and constrained decodingWhy the likeliest word isn't the likeliest sentence, beam search with log probabilities, its taste for short and repetitive text, and forcing output into a grammar: what that guarantees and what it doesn't.40 min
  6. Neural language modelsWhy counting fails, and what embeddings fix.35 min
  7. Attention: the intuitionEach token decides which other tokens matter to it.30 min
  8. Queries, keys and valuesThe three projections behind attention.35 min
  9. Scaled dot-product attentionThe attention formula, line by line.35 min
  10. Causal maskingStop tokens from seeing the future.25 min
  11. Multi-head attentionSeveral attention patterns in parallel.40 min
  12. Positional encodingsTell the model where each token sits.30 min
  13. The transformer blockAttention, MLP, residuals and norms together.40 min
  14. The GPT architectureA stack of decoder blocks that predicts the next token.40 min
  15. Build a tiny GPTWrite and train a small GPT from scratch.45 min
  16. From your GPT to GPT-2 in Hugging FaceMatch your GPT's tensors to GPT-2's names and shapes, count its 124,439,808 parameters, load renamed weights into your own class, pad a batch and read a config.40 min
  17. Training a GPT wellWarmup and cosine decay, gradient clipping, a validation loss you can trust, saving and loading, and two training mistakes read off the loss curve.35 min
  18. Encoders and embedding modelsBERT-style models and where they fit.40 min
  19. Tokenization: text to integer IDsFollow "The cat sat" into the three integers a model receives.30 min
  20. Embeddings and positional wavesFrom three IDs to the 3 × 8 matrix that enters the first block.35 min
  21. Inside the attention matrixEvery entry of the 3 × 3 attention matrix, computed and steered.40 min
  22. The feed-forward layerExpand to four times d_model and back: shapes, parameters and what the layer stores.35 min
  23. The LM head and samplingFrom the last row to a probability for every token, and the next word.35 min
  24. Pretraining at scaleData, compute and what models learn from the internet.40 min
  25. Scaling lawsHow loss falls predictably with size, data and compute.40 min
  26. Inference and the KV cacheWhy generation is fast after the first token.40 min
  27. The block in today's open models OptionalRMSNorm, SwiGLU, rotary positions and grouped-query attention swapped into the block you built, with the parameter and cache counts before and after.35 min
  28. Long contextEfficient attention and million-token windows.35 min
  29. Mixture of expertsRoute each token to a few specialist sub-networks.35 min
  30. Capstone: diagnose your own GPTEntropy per position, a head's attention pattern and a head ablation on the tiny GPT, then the same three measurements on a GPT you train yourself.45 min
  31. Jacobians: derivatives with shapes OptionalThe derivative of a vector function is a matrix; the chain rule multiplies them, and backprop multiplies by them without building them.35 min
  32. Backprop through a linear layer OptionaldX = dY Wᵀ, dW = Xᵀ dY, db = column sums: derived by shape and by entry, checked on the tiny GPT's own projection.35 min
  33. The softmax Jacobian and p − y OptionalEvery output depends on every input: the full Jacobian, its cheap vector product, and why cross-entropy's gradient is p − y.35 min
  34. Backprop through attention OptionalFive formulas from the output back to queries, keys and values; why masked scores get zero gradient; what FlashAttention recomputes.40 min
  35. Multimodal transformersHow models see images and hear audio.35 min
  36. Object detection: boxes, overlap and suppressionEvery object and where it is: boxes in two formats, intersection over union, why one object gets many boxes, non-maximum suppression and its threshold, and grading with average precision.45 min
  37. Segmentation: a label for every pixelMasks, and how to grade them with IoU and Dice; why a pixel's label needs context and too much context blurs; the shrink-then-enlarge network with skip connections; and turning a mask into countable objects.45 min
  38. Build a vision transformerPatch embeddings, a class token, position embeddings and an unmasked block, trained in the page; then two failures that explain it: no positions means no layout, and few images means losing to a CNN a fraction of its size.45 min
  39. Image-text models in depth: retrieval, negatives and limitsHow to test a shared image-text space with recall at k, what the rest of the batch teaches, what hard and false negatives do, and why a similarity score can't see word order, counts or "no".45 min
  40. Self-supervised learning: labels from the data itselfPretrain an encoder with no labels by matching two views of each image, test it with a linear probe, and see what the augmentations remove, what collapse looks like, and how filling in masked parts differs.45 min
  41. Diffusion 1: turning data into noiseThe easy half of a diffusion model: one step of noise, why the data is shrunk as noise is added, the jump to any step with alpha bar, how to read a noise schedule, and the training examples a denoiser learns from.40 min
  42. Diffusion 2: learning to denoise, and samplingTrain a network to predict noise, then run it a hundred times from pure noise and watch a ring assemble: the sampling loop, why fresh noise goes back in, fewer steps and where they break, and a check that samples are new.45 min
  43. Diffusion 3: images, labels and guidanceFrom points to small images, a label the denoiser can be asked with, and classifier-free guidance: why a model that is told what to draw still often doesn't, how the guidance scale fixes it, and what it breaks when turned up too far.45 min
  44. Diffusion 4: latent diffusion and the whole pipelineWhy image generators diffuse an autoencoder's codes and not pixels: a latent diffusion model in miniature, what the autoencoder must be trained to do, the three parts of a text-to-image system, and where the cost of an image goes.40 min
  45. Sound as numbers: waveforms and spectrogramsA recording as an array of samples, why the sampling rate must be twice the highest pitch, spectrograms and the window trade-off, and the log-mel features a speech model is given.40 min
  46. Recognition and synthesis as a pipelineA whole speech recognizer for a made-up language: features, a guess per frame, collapsing repeats and blanks, a dictionary to repair mistakes, word error rate, and synthesis as the same stages run backward.40 min
  47. The voice agent loop and its latency budgetOne turn of a voice agent, timed: why every stage must stream, how to decide that someone has finished speaking, what to do when they interrupt, and why the slow turns matter more than the average.45 min

Never trained an AI? Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account. Teach it to write