Braj Kishore
JourneyVaultML FoundationsAI PM GuideAgenticNewsWork With MeMentorshipPulseNow
Say hi

Hiring · Building · Investing

Have a system — or a team —that needs to scale?

info@avyxon.ai

Usually replies within a day · track record here

JourneyVaultML FoundationsAI PM GuideAgenticNewsWork With MeMentorshipPulseNow
LinkedInXYouTubeSubstackInstagramThreadsFacebookDiscordGitHubTopmate
© 2026 Braj Kishore · Bengaluru, INThink Big · Start Small · Scale Fast
ML Foundations
13Track 4 · The bridge to GenAI

How a transformer becomes an LLM

Self-supervised next-token prediction, scaling laws and the Chinchilla correction, then the post-training that turns a text predictor into an assistant.

55 min1 interactive8 sources

There is no new architecture between the 2017 transformer and the model you talked to this morning. What changed is the objective (predict the next token, on everything ever written), the scale (thousands of GPUs for months), and a post-training stage that taught it to answer rather than continue.

The intuition

Pretraining is reading the entire library with the last word of every sentence covered up, guessing it, and checking. Do that a few trillion times and you're forced to learn grammar, facts, reasoning patterns and style — not because anyone taught them, but because they're the compression that makes the next guess better.

Unlearn this

That bigger is simply better. Chinchilla showed most large models of the era were badly undertrained — given a fixed compute budget, they should have been smaller and trained on far more data. Model size is one term in an optimisation, not a scoreboard, and inference cost scales with parameters forever while training cost is paid once.

01Self-supervision: the trick that made the internet a training set

Supervised learning needs labels and labels cost money, which caps dataset size at whatever you can afford to annotate. Next-token prediction removes the cap entirely: the label for any prefix is simply the word that came next, already present in the text. Labelling cost drops to zero and the training set becomes everything you can legally collect.

This objective is far richer than it looks. To predict the next token well across the whole web you must implicitly model syntax, factual associations, arithmetic patterns, code semantics, style, and a great deal of pragmatics. The claim that 'it's just predicting the next word' is true and misleading in the same breath — the prediction task is a sufficiently demanding compression objective that a lot of structure has to be learned to do it well.

It's also the same idea that had already worked elsewhere: word2vec predicted context words, BERT predicted masked ones, and contrastive vision methods predicted whether two crops came from the same image. Self-supervision was the decade's most important lever, and text was the modality where it paid off first because the data volume was already there.

Language Models are Few-Shot Learners (GPT-3)Brown et al., NeurIPS · 2020

02Tokens: the unit of everything

Models don't see characters or words; they see tokens produced by subword algorithms like byte-pair encoding. Common words get one token, rare words split into pieces, and this is why models are oddly bad at spelling tasks and character counting — they never see the characters.

Tokens are also the unit of cost and of context. Pricing is per token, latency scales with tokens generated, and the context window is a token budget shared by system prompt, conversation, retrieved documents and output. Non-English text and code typically consume more tokens per unit of meaning, which is a real and often overlooked cost asymmetry.

Large Language Models explained briefly3Blue1BrownTiktokenizerdqbd

03Scaling laws and the Chinchilla correction

Kaplan et al. (2020) found that test loss falls as a smooth power law in model size, dataset size and compute, across many orders of magnitude. Smooth power laws mean predictability: you can extrapolate from small runs to decide how to spend a very large budget. That is what turned frontier model training from research into planned engineering.

Hoffmann et al. (2022) — the Chinchilla paper — corrected how that budget should be split. For a fixed compute budget, parameters and training tokens should scale roughly in proportion; the models of the day were far too large for the data they were trained on. A 70B model trained on 1.4T tokens outperformed a 280B model trained on 300B tokens, using the same compute.

The practical implication has outlived the exact numbers, and it's the part to say out loud: a smaller model trained on more data is cheaper to serve forever. Training cost is paid once; inference cost is paid per request for the life of the product. That's why the industry moved toward smaller, longer-trained models — and why models today are routinely trained well past the compute-optimal point, because serving economics matter more than training economics.

Scaling Laws for Neural Language ModelsKaplan et al. · 2020Training Compute-Optimal Large Language Models (Chinchilla)Hoffmann et al. · 2022Chinchilla Scaling: A replication attemptBesiroglu et al., Epoch AI · 2024Beyond Chinchilla-Optimal: Accounting for Inference in Language Model Scaling LawsSardana et al. · 2024

Try it

Spend the budget: parameters or tokens?

Compute fixes the product of the two. Choosing the split is the whole of compute-optimal scaling.

04Why the base model isn't the product

A freshly pretrained model is a text continuer. Ask it a question and a plausible continuation is three more questions, because that's what documents containing questions look like. Turning it into something that answers takes post-training.

Supervised fine-tuning comes first: tens of thousands of high-quality demonstration conversations teach the format — instruction in, helpful answer out.

Then preference optimisation. Collect human rankings of alternative responses, and use them to push the model toward preferred behaviour — via RLHF with a learned reward model and PPO, or more directly with DPO, which optimises against the preference pairs without a separate reward model. This is where helpfulness, tone and refusals come from, and it's why two models built on similar architectures have distinguishable personalities.

It's also where alignment tax shows up: heavy preference optimisation can measurably degrade raw capability on some benchmarks even as it makes the model far more useful in practice. Naming that trade-off is a good sign in a discussion about model choice.

05Emergence, and the argument about it

Some capabilities appear to switch on abruptly with scale — multi-step arithmetic, certain kinds of reasoning — rather than improving smoothly. That observation drove a lot of 2022–23 discourse about emergent abilities.

The counter-argument is worth knowing because it's the more sophisticated position: much apparent emergence is an artefact of the metric. Score a task with exact-match accuracy and you see a sharp jump; score the same task with a continuous metric like token-level log-probability and the improvement is smooth. The underlying capability was improving all along; the metric was hiding it until it crossed a threshold.

The 2024–26 development that matters more for building: inference-time compute. Reasoning models spend additional tokens deliberating before answering, and accuracy scales with that spend — a second scaling axis that doesn't require retraining. That changes cost modelling significantly, because a 'harder' request now costs meaningfully more than an easy one on the same model.

06Everything from Track 2 is still running

It's worth being explicit that nothing was replaced. Pretraining minimises cross-entropy — Lesson 4. It's optimised with AdamW, warmup and cosine decay, and gradient clipping — Lesson 5. It's trained by backpropagation through a very deep residual stack, with all the same vanishing-gradient machinery — Lesson 6. It's regularised by weight decay and, more than anything, by data scale — Lesson 7. And it's evaluated on held-out data with metrics chosen for the task — Lesson 8.

The only genuinely new ingredients are the objective (free labels), the architecture (attention, for parallelism), and the scale. That's the payoff for doing the fundamentals first: an LLM stops being a category of its own and becomes a very large instance of the loop you already understand.

The vocabulary, defined once
Pretraining
Self-supervised next-token prediction over a huge corpus. Where capability comes from.
Token
The subword unit a model actually sees. The unit of cost, context and latency.
Scaling laws
Loss falls as a smooth power law in parameters, data and compute — which makes large runs plannable.
Chinchilla-optimal
For a fixed compute budget, scale parameters and tokens together. Most 2020–21 models were badly undertrained.
SFT
Supervised fine-tuning on demonstration conversations. Teaches the assistant format.
RLHF / DPO
Optimising against human preference rankings — with a reward model and RL, or directly on preference pairs.
Inference-time compute
Spending more tokens deliberating at request time to raise accuracy. A second scaling axis, and a live cost variable.

The lab

Everything above, with the dials exposed. Break it deliberately — the failure modes are where the understanding is.

Try it

Spend the budget: parameters or tokens?

Compute fixes the product of the two. Choosing the split is the whole of compute-optimal scaling.

What they actually ask

How a transformer becomes an LLM — the interview questions

QWhy is a smaller model trained on more data often the better business decision?Answer it out loud first, then open this

Training cost is a one-off; inference cost is paid on every request forever. Chinchilla-style scaling says you can reach the same loss with fewer parameters and more tokens for the same training compute — and then serve it more cheaply, with lower latency and smaller memory footprint, for the life of the product. That's why the industry trains well past compute-optimal.

What they're listening for
Framing it as unit economics rather than benchmark scores is the answer that gets you the systems conversation.

QAre emergent abilities real?Answer it out loud first, then open this

Partly a measurement artefact. Sharp jumps often come from discontinuous metrics like exact-match accuracy; measure the same task with a continuous metric and improvement looks smooth. That said, there are real qualitative changes in what's usable at scale. I'd say capability improves smoothly and usefulness crosses thresholds — and I'd choose continuous metrics when evaluating, so I can see progress before it crosses one.

Before you move on

Recall beats re-reading, every time. Answer before you flip.

How a transformer becomes an LLM · self-test1 / 3

Why did self-supervision unlock LLMs?

Go to the primary sources

Where each claim above comes from. Open them alongside the lesson rather than after it — the papers are shorter than you think, and the figures usually carry the whole argument.

Paper
  • Scaling Laws for Neural Language Models(2020)Kaplan et al.The original power-law result. The log-log plots in Figure 1 are what made frontier training a planning exercise rather than a gamble.
  • Training Compute-Optimal Large Language Models (Chinchilla)(2022)Hoffmann et al.The correction: for a fixed compute budget, scale parameters and tokens together. 70B on 1.4T tokens beat 280B on 300B tokens.
  • Language Models are Few-Shot Learners (GPT-3)(2020)Brown et al., NeurIPSThe demonstration that scale alone produced in-context learning — no gradient updates, just examples in the prompt.
  • Beyond Chinchilla-Optimal: Accounting for Inference in Language Model Scaling Laws(2024)Sardana et al.Redoes the scaling maths with serving cost included, and formalises why you should train smaller models longer than compute-optimal when you have to run them.
Watch
  • [1hr Talk] Intro to Large Language ModelsAndrej KarpathyThe best single hour on what an LLM is, how pretraining and fine-tuning differ, and what the scaling picture means in practice.
  • Large Language Models explained briefly3Blue1BrownSeven minutes, zero jargon. The fastest honest answer to 'what is this thing actually doing?'
Read
  • Chinchilla Scaling: A replication attempt(2024)Besiroglu et al., Epoch AIFinds the Chinchilla paper's published parametric estimates fit the underlying data poorly and are inconsistent with its own 20-tokens-per-parameter rule. Read it before quoting an exact optimal ratio.
Play with it
  • TiktokenizerdqbdType anything and watch it split into tokens live. Try a long German compound, then some JSON, then emoji — the cost asymmetry becomes obvious.

External links open in a new tab. Every URL was reachable when this page was written; links rot, so treat the list as a map rather than a guarantee.

Connects to

LLMs, tokens & context, for PMs

Got it? Tick it off — progress saves on this device.

← PreviousTransformers & self-attentionNext →Multimodal: one space for pixels and words
Spend the budget: parameters or tokens?C = 5.8e+23 FLOPs
2:110:120:150:1100:1200:1360:1this fit's minimum1.971.93↑ predicted loss — lower is better

Parameters

69.2B

Training tokens

1.4T

Predicted loss

1.937

The cost you pay forever

Serving this 69.2B-parameter model costs about 4.8e+21 FLOPs per month. At that rate you spend the entire training budget again every 118.7 months.

At 20:1 this budget buys 69.2B parameters trained on 1.4T tokens, for a predicted loss of 1.937. Move the ratio in either direction and the loss rises — that U is the whole content of compute-optimal scaling, and its existence (rather than its exact minimum) is the durable insight.

An honest caveat about this curve

The loss curve here uses the parametric fit published in the Chinchilla paper. Its minimum sits at 92:1 for this budget, not at the paper's headline ≈20:1 — those came from different estimation approaches in the same paper, and Epoch AI's 2024 replication found the published parametric estimates fit the underlying data poorly and are inconsistent with the 20:1 rule the authors actually used. Take the shape of the curve as the lesson and the precise ratio as contested.

Compute is roughly 6 × parameters × training tokens, so the budget fixes their product and you choose the split. The curve below is what that choice does to the loss.

Spend the budget: parameters or tokens?C = 5.8e+23 FLOPs
2:110:120:150:1100:1200:1360:1this fit's minimum1.971.93↑ predicted loss — lower is better

Parameters

69.2B

Training tokens

1.4T

Predicted loss

1.937

The cost you pay forever

Serving this 69.2B-parameter model costs about 4.8e+21 FLOPs per month. At that rate you spend the entire training budget again every 118.7 months.

At 20:1 this budget buys 69.2B parameters trained on 1.4T tokens, for a predicted loss of 1.937. Move the ratio in either direction and the loss rises — that U is the whole content of compute-optimal scaling, and its existence (rather than its exact minimum) is the durable insight.

An honest caveat about this curve

The loss curve here uses the parametric fit published in the Chinchilla paper. Its minimum sits at 92:1 for this budget, not at the paper's headline ≈20:1 — those came from different estimation approaches in the same paper, and Epoch AI's 2024 replication found the published parametric estimates fit the underlying data poorly and are inconsistent with the 20:1 rule the authors actually used. Take the shape of the curve as the lesson and the precise ratio as contested.

Compute is roughly 6 × parameters × training tokens, so the budget fixes their product and you choose the split. The curve below is what that choice does to the loss.