TensoriumInterview preparation
← Home

Core concepts · 62 topics

A guided path through the ideas behind modern LLMs.

Read the stages in order: how text becomes a prediction, what happens inside the Transformer block, how a model learns, then serving, scale, and post-training. Every topic names what to know first, then gives the intuition, the math with concrete numbers, the common misconception, and a self-check. Already comfortable with the basics? Switch to By area and jump straight to a topic.

New to machine learning? Start here instead.

These topics work best as a refresher; they assume ideas like probability and loss. Begin with three short beginner lessons (tokens, embeddings, next-token prediction), then the visual walkthrough for attention and the Transformer.

Finish line: You can explain how text becomes a prediction and what training does to improve that prediction.

Topic 45 of 62 · Post-training

Actor-critic and the advantage

Hard

What does a critic add to the policy gradient, and what does it cost when training an LLM?

Why this mattersAdding a learned value critic assigns token-level credit and lowers variance, but holding a full-size critic in GPU memory is the exact cost that motivated GRPO.

1 · Start with the intuition

Instead of crediting every token with the final reward, ask how much better each token was than expected at that point. A learned value function V(s) predicts the expected final reward from every prefix; the change it sees after each token is that token’s credit.

2 · How the mechanism works

Mechanism step 1 of 3 · no question to answer

Predict value

The critic estimates V(sₜ) for each generated prefix.

Next, we will look at: Estimate advantage. Move on when this operation makes sense.

Visualizing the behavior

Where this sits: the RL-for-LLMs progression

VPGΨ = returnREINFORCER − baselineActor-criticlearned V(s)PPOclipped ratioGRPOgroup baselineVariantsDAPO · Dr. GRPO
Each step changes one thing: how Ψ (the weight on ∇ log π) is estimated, or how far one batch of samples may move the policy.

PPO-based RLHF keeps four models in play

completionPromptPolicytrainedReferencefrozen · KLReward modelfrozen · scoreValue modeltrained · V(sₜ)Advantage ÂₜGAE
Two trained networks (policy and critic) and two frozen ones must all fit in memory. The value model is what GRPO removes.

Critic value along a 3-token completion (terminal reward 1)

Derived
00.510123prefix position tV(sₜ)δ₁ = +0.3 next
  • V(sₜ), with the realised reward at t = 3
Each token’s TD error is the jump it causes: +0.1, +0.3, +0.1. The second token raised the expected reward most, so it gets the most credit when λ = 0.