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 21 of 62 · Generalizing and measuring it

Overfitting vs underfitting

Easy

Training loss keeps falling while validation loss starts rising. What does this tell you, and what do you check before changing the model?

Why this mattersBefore adding regularization or changing model size, verify that training and validation losses actually measure the same objective under the same masks and preprocessing.

1 · Start with the intuition

Training loss measures how well the model fits the examples it updates on; validation loss estimates how well that fit transfers to held-out data. When training loss drops while validation loss climbs, the model is memorizing patterns specific to the training set (or noise in its labels) that do not hold on the validation split. Before reaching for heavier regularization or an earlier checkpoint, first verify that the two curves are actually measuring the same quantity under the same mask, tokenization, and evaluation mode.

2 · How the mechanism works

Mechanism step 1 of 3 · no question to answer

Verify the comparison

Confirm that train and validation losses use identical token masks, normalization (per-token vs per-sequence), and model.eval() settings.

Next, we will look at: Inspect slices & examples. Move on when this operation makes sense.

Visualizing the behavior

The gap opens when validation stops improving

Illustrative
00.511.52024681012epochlossbest validation
  • training loss
  • validation loss
Both falling together means the model is still underfitting. After epoch 6, training keeps improving while validation gets worse: the model is fitting noise specific to the training set.

Classical bias–variance trade-off

Illustrative
0123413579model capacity →expected error
  • bias²
  • variance
  • total
The textbook U-curve. Heavily overparameterized deep networks can show "double descent", where test error falls again past the interpolation point. Treat capacity as one factor among data, regularization and training time.