lenatriestounderstand

Section 4 of 9

Deep Learning

PyTorch, MLP/CNN/RNN, model compression, distillation, RL, generative models.

12 items in this section.

Long reads

01
Lab inside

Neural Network Architectures and PyTorch (MLP, CNN, RNN/LSTM)

An architecture is a claim about your data, and every claim here is measured: why a stack of linear layers is one straight line, what a CNN's first layer actually learns, how fast a receptive field grows, where an RNN's gradient dies — and PyTorch as three ideas: a tensor, a tape, and a module.

  • deep-learning
  • pytorch
  • cnn
  • lstm
Read
Updated Jul 21, 2026
02
Lab inside

Knowledge Distillation: What a Teacher Actually Teaches

Training a small model on a large model's probabilities instead of the true labels often gives a better small model. Why that works, taken apart one ingredient at a time; what happens when the labels the teacher learned from were wrong; whether a stronger teacher makes a stronger student; what to copy, on which data and about which view of it; how long to train and how big the student should be before any of this matters; why copying the teacher and being right are different numbers; how a student can beat its teacher and which of its flaws it inherits; what changes for language models without logits; and when distillation pays for itself — measured on CIFAR-10 and on a small language model trained on this site's notes.

  • knowledge-distillation
  • model-compression
  • kl-divergence
  • regularization
  • +3
Read
Updated Oct 25, 2026
03
Lab inside

Mechanistic Interpretability: Looking Inside the Black Box

What it actually means to reverse-engineer a neural network into features and circuits: the residual stream as a linear object, the linear representation hypothesis, superposition and why features outnumber neurons, sparse autoencoders as dictionary learning, the QK/OV decomposition of attention, induction heads, and the causal methods — activation and path patching — that turn a plausible story into a verified mechanism.

  • interpretability
  • mechanistic-interpretability
  • superposition
  • sparse-autoencoders
  • +1
Read
Updated Jul 3, 2026
04
Lab inside

Teaching a Neural Network to Play Go

Building a tiny AlphaGo from scratch on a 5×5 board: board representation, a small CNN policy network, a value network, and then Monte Carlo Tree Search — with each piece introduced only when the previous version visibly runs out of road. Ends at a self-play loop that is recognisably AlphaZero in miniature.

  • reinforcement-learning
  • monte-carlo-tree-search
  • self-play
  • cnn
  • +2
Read
05
Lab inside

Training Neural Networks: Backprop, Regularization, and Everything in Between

One number at the end of the network has to become an instruction for every number inside it. That trip is the whole of training: backpropagation as the chain rule run backwards through a graph, the product of many numbers that decides whether the instruction survives the journey, the initialization arithmetic that keeps that product near one and the normalization, clipping and precision choices that answer the other half of the problem, and regularization as the deliberate corruption that makes the result generalize — every claim carried by one worked example, from two weights done by hand to a network that overfits.

  • deep-learning
  • backpropagation
  • gradient-descent
  • initialization
  • +1
Read

Shorts

Shorts

Batch Norm vs Layer Norm: What Each One Normalizes Over

The two layers differ in one axis — statistics across the batch, or across the features of one example — and every practical difference between them, including why transformers use one and not the other, follows from that.

  • deep-learning
  • normalization
  • training
  • batch-norm
  • +1
Read
Oct 27, 2026
Shorts

Superposition: Why a Neuron Is Not a Feature

Networks represent more concepts than they have dimensions by storing them as almost-orthogonal directions and tolerating the interference. That is why single neurons look like nonsense, and why sparse autoencoders exist.

  • interpretability
  • mechanistic-interpretability
  • superposition
  • deep-learning
Read
Oct 27, 2026
Shorts

Temperature in Distillation, and Why the Loss Is Multiplied by T²

Distillation temperature softens the teacher and the student at once — a different operation from the sampling temperature in text generation. The T² in front of the loss is not a tuning constant: it cancels a gradient that would otherwise shrink as the square of the temperature.

  • knowledge-distillation
  • deep-learning
  • softmax
  • temperature
Read
Oct 25, 2026
Shorts

The Transfer Set: The Questions You Ask a Teacher

In distillation the student learns the teacher's answers at the points it is asked about, and nothing else. That set of points needs no labels, is a design decision rather than raw material, and moved the result more than the choice of teacher did.

  • knowledge-distillation
  • deep-learning
  • data
  • augmentation
Read
Oct 25, 2026
Shorts

Fidelity Is Not Quality: Two Ways to Grade a Distilled Model

A distilled model can be graded on how closely it reproduces its teacher, or on how often it is right. With a strong teacher the two look like the same number. They come apart exactly where it matters, and each answers a question the other cannot.

  • knowledge-distillation
  • deep-learning
  • evaluation
Read
Oct 25, 2026
Shorts

Born-Again Networks: A Student With No Teacher to Compress

Distil a network into a copy of itself, same architecture, same data, no compression anywhere — and it can come out better than the model it learned from. Whether it does depends on how much the original memorized.

  • knowledge-distillation
  • deep-learning
  • regularization
  • self-distillation
Read
Oct 25, 2026
Shorts

Dark Knowledge: What a Classifier Says After Its Answer

A trained classifier answers with one class and a list of numbers nobody reads. Those numbers say which wrong answers it considered nearly right, no label can carry them, and they are most of what a distilled student learns from.

  • knowledge-distillation
  • deep-learning
  • softmax
  • dark-knowledge
Read
Sep 19, 2026