Discover: the most cited line of the century
In December 2015, four researchers at Microsoft Research posted a paper about training very deep networks. A 2025 analysis by Nature found it to be the most cited paper of the twenty-first century. Its central idea fits on one line:
Spotted in the wild
Read it aloud with what you already know: “bold y equals calligraphic F of bold x and the set of W sub i, plus bold x.” The bold letters are vectors (Chamber 1). The braces make a set (Chamber 2): is the collection of weight matrices inside the block. And is a function: a machine that takes the input and the weights, and returns a vector. The block's output is its input plus whatever computes.
Why did one “” matter so much? Before this paper, simply stacking more layers could make a network worse: the paper's Figure 1 shows a 56-layer network with higher training error than a 20-layer one. With the shortcut, the authors trained networks 152 layers deep and won the 2015 ImageNet competition.
This chamber gives you the language to see why. A network is a chain of machines, and the notation for machines, chains and undoing machines is the notation of functions. Here's a first taste. Suppose the block's learned function gives up and outputs zero, whatever it's fed.
Suppose the learned function in outputs the zero vector for every input. What does the block compute?
Learn: a function is a machine with a contract
Papers announce a function with a line like
Read it as “ maps the real numbers to the real numbers, sending to squared.” The first half is the contract: , before the arrow, is the domain (the inputs accepts) and , after it, is the codomain (where outputs are promised to land). The second half is the rule. Notice the two arrows. The plain arrow connects whole sets. The arrow with a little tail, (“maps to”), connects a single input to its output.
The codomain is a promise, not a description. Squares are never negative, so this only ever produces numbers in . The set of outputs a function actually produces is its image, written with the set-builder notation of Chamber 2. Here the codomain is and the image is .
A rule can break the contract in two ways. It can leave an input without an output: has no value at , so we shrink the domain and write . Or it can give an input two outputs: “the number whose square is 4” could be 2 or , so it isn't a function until you choose one. That's why always means the non-negative root.
In machine learning, everything is a function. A digit classifier is : a flattened image goes in, a label comes out. A loss is : a setting of parameters goes in, one number comes out. Reading the contract first tells you what kind of object you're dealing with before you look at a single formula.
- “f from X to Y”A function named with domain (the allowed inputs) and codomain (where outputs are promised to live). Every input gets exactly one output.
- “x maps to x squared”The rule: what happens to a single input. This arrow has a little tail; the plain arrow connects whole sets.
- “f of x”The output of at the input . The brackets mean “of”, not multiplication.
- “the image of X under f”The set of outputs actually produces, . It sits inside the codomain and can be smaller.
- “f of x semicolon theta”A model: the input before the semicolon, the parameters after it. Training changes ; prediction changes .
- “f sub theta of x”The same idea with the parameters as a subscript: one function for every choice of .
- “f of x and y”A function of two inputs. Its domain is a Cartesian product such as (Chamber 2).
| Symbol | Say it | Meaning | LaTeX |
|---|---|---|---|
| “f from X to Y” | A function named with domain (the allowed inputs) and codomain (where outputs are promised to live). Every input gets exactly one output. | ||
| “x maps to x squared” | The rule: what happens to a single input. This arrow has a little tail; the plain arrow connects whole sets. | ||
| “f of x” | The output of at the input . The brackets mean “of”, not multiplication. | ||
| “the image of X under f” | The set of outputs actually produces, . It sits inside the codomain and can be smaller. | ||
| “f of x semicolon theta” | A model: the input before the semicolon, the parameters after it. Training changes ; prediction changes . | ||
| “f sub theta of x” | The same idea with the parameters as a subscript: one function for every choice of . | ||
| “f of x and y” | A function of two inputs. Its domain is a Cartesian product such as (Chamber 2). |
Take , . Which statement is right?
Learn: inputs, parameters and the semicolon
A model is a function with knobs. The input is what you feed it at prediction time; the parameters are the knobs that training turns. Papers separate the two in a few standard ways:
- , “f of x, semicolon theta”. The semicolon splits the inputs (before it) from the parameters (after it).
- , “f sub theta of x”. The same idea: a whole family of functions, one for each .
- , with a plain comma. ResNet's is written this way, and you rely on the text to know which argument is which.
The distinction matters because the two kinds of input change at different times. When the model predicts, is fixed and varies. When it trains, the data is fixed and varies. That's why the loss is usually written , a function of the parameters alone, even though it depends on data too.
Functions can take several inputs. , takes a pair; its domain is the Cartesian product from Chamber 2. You'll meet a famous two-input function later in this chamber, a formula that predicts a language model's loss from its size and its amount of data.
Learn: composition, machines in a chain
Feed the output of one machine into another and you get a new machine. That's composition:
Say as “f composed with g”, or better, “f after g”. The small circle is not multiplication, and the order is the whole point. In , the function nearest to acts first. So the notation reads right to left, even though you read the page left to right.
Take and . Then
At the first gives 4 and the second gives 2. Same two machines, different order, different function: composition is not commutative. The lab below turns this into a game. Build each target by chaining machines, and keep an eye on the pipeline, which runs left to right, and the notation, which runs right to left.
Interactive lab
Function composer
Targets
Shift, then square. Two machines. The one that touches x first is written on the right.
Machines
Pipeline
- x
- empty1st
- empty2nd
- empty3rd
- y
target your composition
machines
0 / 3
points matched
0 / 121
targets built
0 / 4
Click a machine to feed x into it. Click more to chain them (up to three).
Composition is how deep networks are built. A network with layers is
where each layer is itself a small composition, such as : multiply by a matrix, add a vector, apply an activation. The input enters on the right and the prediction leaves on the left.
One machine deserves a name of its own: the identity , which changes nothing. Composing with it changes nothing either: . ResNet's block is the identity plus a correction, . If learns nothing useful it can fall back to zero and the block becomes , so adding blocks shouldn't make a network worse. As the paper puts it, “if an identity mapping were optimal, it would be easier to push the residual to zero than to fit an identity mapping by a stack of nonlinear layers.”
A proof: brackets don't matter, order does
Why can we write with no brackets at all? Because composition is associative, and here's the complete proof.
Claim. Composition is associative. For any functions , and ,
Two functions are equal when they have the same domain and give the same output for every input. Both sides here take inputs from , so it's enough to compare outputs.
Proof. Let be any element of . Apply the definition of twice to the left-hand side, first with as the outer function:
Now do the same on the right-hand side, this time with as the inner function:
Both sides equal , and was arbitrary, so the two functions are equal.
The proof is short because it only unpacks a definition, which is what many good proofs do. Its message for networks: you may group layers any way you like (into “blocks”, say), but you may not reorder them.
Let and . What is ?
Learn: inverses, undoing a machine
The inverse of , written and read “f inverse”, is the machine that undoes it:
Not every function can be undone. If two inputs land on the same output, no machine can tell which one you started from. A function that never does this is injective (one-to-one): implies . A function whose image is its whole codomain is surjective (onto). A function that is both is bijective, and those are exactly the functions with an inverse. Three examples you'll meet again:
- on isn't injective, since . Restrict it to and it becomes bijective, with inverse .
- sends every negative number to 0. Once a ReLU outputs 0, the input is gone for good.
- is bijective. Its inverse is , which is how the logarithm is defined.
A derivation: the inverse of the sigmoid
The sigmoid squashes every real number into , and it's strictly increasing, so it has an inverse. To find it, solve for , where :
So , defined for in . Check it: , and . This function is the logit.
Undoing a chain works like taking off socks and shoes: whatever went on last comes off first, so . You'll assemble the proof in the last part of this chamber.
Learn: piecewise functions and the toolkit
Some functions follow different rules on different parts of the domain. Papers write them with a brace:
Read it as “ReLU of x is x if x is positive, and 0 otherwise.” Each line gives a value and a condition, and exactly one condition applies to any input. A handful of small piecewise functions do a lot of work in ML papers:
- “a if P, otherwise b”A piecewise definition. The brace lists the cases, and exactly one applies to each input.
- “the absolute value of x”The size of without its sign: if , and if .
- “the floor of x”Round down to the nearest integer. Careful with negatives: .
- “the ceiling of x”Round up to the nearest integer.
- “the max of a and b”The larger of the two numbers.
- “the min of a and b”The smaller of the two numbers.
- “the indicator of P”1 if the statement is true, 0 if it's false. Also written , or with a double-struck one.
- “Kronecker delta i j”1 if and 0 otherwise: an indicator for “same index”.
| Symbol | Say it | Meaning | LaTeX |
|---|---|---|---|
| “a if P, otherwise b” | A piecewise definition. The brace lists the cases, and exactly one applies to each input. | ||
| “the absolute value of x” | The size of without its sign: if , and if . | ||
| “the floor of x” | Round down to the nearest integer. Careful with negatives: . | ||
| “the ceiling of x” | Round up to the nearest integer. | ||
| “the max of a and b” | The larger of the two numbers. | ||
| “the min of a and b” | The smaller of the two numbers. | ||
| “the indicator of P” | 1 if the statement is true, 0 if it's false. Also written , or with a double-struck one. | ||
| “Kronecker delta i j” | 1 if and 0 otherwise: an indicator for “same index”. |
A few of them in action:
- , and .
- A convolution with input width , kernel size , padding and stride produces outputs. For , , , : .
- Accuracy counts correct predictions with an indicator: example contributes , which is 1 if the prediction is right and 0 if not. (Adding them up is Chamber 5's job.)
- A one-hot label for class has entries : 1 in position , 0 everywhere else. The identity matrix of Chamber 6 has entries too.
Learn: exp and log
The number (Euler's number) is the natural base for growth and decay. The exponential function is , also written when the exponent is long: is easier to read than , with its tiny superscript. The logarithm is its inverse: for every , and for every .
Which logarithm? In ML papers, without a base almost always means the natural log, base , which mathematicians also write . Information theory uses , measured in bits. Python agrees with the papers: math.log and np.log are natural logs, and base 2 needs math.log2.
Every rule for logs is a rule for exponentials seen through the inverse:
| Exponentials | Logarithms |
|---|---|
The log rules need . To change base, divide: .
A derivation: why logs turn products into sums
Let and be positive, and name their logs: and . Because exp undoes log, and . Multiply, using the exponential rule:
Now take the log of both sides. Log undoes exp, so . The product rule for logs is the sum rule for exponentials, read backwards through the inverse.
That one rule explains why logs are everywhere in machine learning. Probabilities get multiplied, and a product of thousands of small numbers is too small for a computer to store. Its log is a harmless sum (Chamber 5). Logs also straighten power laws. If , then : a straight line when you plot against . That's why scaling-law papers draw log-log plots. Here is the most famous one's formula:
Spotted in the wild
“L hat of N and D is defined as E, plus A over N to the alpha, plus B over D to the beta.” It's a function of two inputs, the model's parameter count and its number of training tokens , and the hat marks a prediction (Chamber 1). Its five constants , , , and were fitted to over 400 training runs. You'll take it apart in the paper decoder and use it to make predictions in the coding problems.
For positive and , which expression equals ?
Learn: activation functions are functions
Every activation function is a function , applied to each entry of a vector. Read each one's contract and you know what it can output.
- “sigma of z”The sigmoid . It squashes any real number into , so its output can be read as a probability.
- “tanh of z”The hyperbolic tangent: squashes into . It is a sigmoid, stretched and shifted: .
- “relu of z”The rectified linear unit, : negative inputs become 0, positive ones pass through.
- “softplus of z”: a smooth version of ReLU that is always positive. The Deep Learning book writes it .
- “logit of p”The inverse of the sigmoid, . The raw scores a classifier feeds to its sigmoid or softmax are called logits after it.
- “softmax of z, entry i”A preview: turns a vector of scores into a vector of probabilities. The in its formula is Chamber 5's, and Chamber 9 decodes it in full.
| Symbol | Say it | Meaning | LaTeX |
|---|---|---|---|
| “sigma of z” | The sigmoid . It squashes any real number into , so its output can be read as a probability. | ||
| “tanh of z” | The hyperbolic tangent: squashes into . It is a sigmoid, stretched and shifted: . | ||
| “relu of z” | The rectified linear unit, : negative inputs become 0, positive ones pass through. | ||
| “softplus of z” | : a smooth version of ReLU that is always positive. The Deep Learning book writes it . | ||
| “logit of p” | The inverse of the sigmoid, . The raw scores a classifier feeds to its sigmoid or softmax are called logits after it. | ||
| “softmax of z, entry i” | A preview: turns a vector of scores into a vector of probabilities. The in its formula is Chamber 5's, and Chamber 9 decodes it in full. |
They're related by composition. The hyperbolic tangent is a sigmoid, stretched and shifted: , which is four machines in a row (double, , double, subtract 1). Softplus is . And the sigmoid's image, , is why its output can be read as a probability.
Research keeps inventing new ones, and the definitions are always short sentences in function notation. In 2017 a team at Google Brain used automated search to look for new activation functions, and highlighted this one:
Spotted in the wild
The paper calls it Swish, and adds that “ is either a constant or a trainable parameter”. So strictly it's , a family of functions. Look closely at the second formula: there the is an ordinary power of a number, so means . Compare , the inverse function you derived above. Same superscript, different meaning, and only the thing it's attached to tells you which.
A close cousin is GELU, defined by Hendrycks and Gimpel as , where is the probability that a standard normal random variable (Chamber 8) comes out at most . They suggest the approximation , which is Swish with . Finally, a preview: maps a whole vector of scores to a vector of probabilities, and its formula needs a sum over all entries. That's the notation of Chamber 5, and Chamber 9 decodes softmax in full.
Read beyond the course
Book · free online · ~40 min
Book of ProofRichard Hammack · Chapter 12: Functions (§12.1, 12.2, 12.4 and 12.5)
A free, patient textbook on proofs. Chapter 12 defines functions, injective and surjective functions, composition and inverses with many small examples and exercises. Read it now to practise exactly the definitions this chamber used, one step more formally.
Book · free online · ~10 min
Deep LearningIan Goodfellow, Yoshua Bengio & Aaron Courville · Chapter 3, §3.10: Useful Properties of Common Functions
Two pages on the sigmoid and softplus, with a list of identities the authors suggest memorising, including the logit you derived and the softplus identity you'll prove below. Skip the rest of the chapter for now: it's probability, which is Chamber 8.
Article · free online · ~15 min
Demystifying the Natural Logarithm (ln)Kalid Azad, BetterExplained
An intuitive essay on what measures: the time needed to grow to a certain amount. A good complement to this chamber's algebraic rules, and it explains why is the “natural” base.
Article · free online · ~25 min
Neural Networks, Manifolds, and TopologyChristopher Olah · Up to the end of “Topology of tanh Layers”
Animations of what each layer of a small network does to its input space, treating a layer as a composition of a matrix, a shift and an activation. It explains which layers are bijections (tanh and sigmoid layers can be, ReLU layers can't), so it's the injective and bijective ideas of this chamber, seen in pictures.
Papers and lectures
You can read both of this chamber's papers today, as long as you read selectively.
For ResNet, read Section 3.1 and Section 3.2. That's about one page. Section 3.1 is almost pure function notation: the authors call the mapping they want and define the residual as . That's a definition with the of Chamber 1, so the original mapping becomes . Then look at Figure 2, a picture of the block. Skip the architecture details and experiments, apart from Figure 1, which shows the problem the paper solves.
For Chinchilla, read the abstract, then Section 3.3, which introduces Eq. (2) in half a page. The fitted numbers are in Appendix D.2, Eq. (10). Skip the fitting procedure (Huber loss and L-BFGS are for later) and enjoy Figure 4, whose contours are level sets of the function .
Deep Residual Learning for Image RecognitionKaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun · CVPR, 2016The paper that made very deep networks trainable, with one identity function added to every block. Residual connections are now in almost every large model, transformers included.
Training Compute-Optimal Large Language ModelsJordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, et al. · NeurIPS, 2022The Chinchilla paper. A two-input function fitted to over 400 training runs changed how labs split their compute between model size and data.
Decode the paper · Eq. (1), Section 3.2
Deep Residual Learning for Image RecognitionKaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun · CVPR, 2016
The building block of every ResNet. The paper says: “Here and are the input and output vectors of the layers considered.” Match each piece to its job.
Options
Decode the paper · Eq. (2), Section 3.3
Training Compute-Optimal Large Language ModelsJordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, et al. · NeurIPS, 2022
The Chinchilla scaling law: a function of two inputs that predicts how good a language model will be before anyone trains it. Its five constants were fitted to the final losses of hundreds of training runs.
Options
Watch
A short, playful argument that our notation for powers, roots and logarithms hides how closely they're related. Watch for how , and describe one fact, and for the inverse pairs hiding in the triangle.
A walk through the ResNet paper. Watch for how he explains the residual block of Figure 2, and pause each time a formula appears to read it aloud before he does.
Your turn
Time to use it all. Translate between symbols, words and code, assemble one proof and write another, then solve three problems. Two of them use a paper's formula to make real predictions.
Match · Symbols ↔ Read aloud as
Say it aloud
Match each expression to the way a researcher would read it aloud.
Options
Match · Maths ↔ Python
From functions to Python
Match each piece of maths to the Python that computes it (with import math). Watch the logs: in Python, as in ML papers, a plain log is the natural log.
Options
Proofs
The first proof puts associativity to work: it's why socks come off before shoes. The second uses the log rules.
Proof puzzle
Socks and shoes
Claim
Let and have inverses and . Then has an inverse, and
(Recall that is the inverse of when and are both identity functions.)
Tap lines in the order they should appear. Not every line belongs. Tap a line in your proof to send it back.
Your proof
- Pick the first line below.
Available lines
Prove it yourself
Softplus minus its mirror image
Claim
The softplus function is , with the natural log. Prove that for every real number ,
(This is Eq. 3.41 of the Deep Learning book. It mirrors a fact about ReLU: .)
Your typeset proof appears here.
Code it up
The first problem undoes a composition. The other two take the Chinchilla formula at its word.
Problem 10·Warm-up
Undo two sigmoids
The sigmoid is . Find the real number with
Give rounded to 4 decimal places.
Problem 11·Standard
Apply the paper: Chinchilla versus Gopher
The Chinchilla paper models the final training loss of a language model with parameters trained on tokens as
and fits the constants (Appendix D.2, Eq. 10): , , , , . Here is an ordinary power.
DeepMind's Gopher has parameters and was trained on tokens. Chinchilla has and : a model four times smaller, trained on almost five times more data.
Compute , rounded to 4 decimal places.
Problem 12·Challenge
Apply the paper: spend a compute budget
Training a model with parameters on tokens costs about floating-point operations (FLOPs), the approximation the Chinchilla paper uses. Fix the budget at Gopher's, FLOPs. Then the number of tokens you can afford is a function of the model size, , and the predicted loss becomes a function of one variable, a composition:
with the paper's fitted constants , , , , .
Consider model sizes that are whole numbers of billions: for . For which is smallest? Answer with the integer .
Key takeaways
- Read the contract first. names the domain and codomain; gives the rule; the image is what actually produces.
- Parameters sit after the semicolon (or in the subscript): and are a family of functions, one for each .
- Composition reads right to left. applies first. It's associative but not commutative, and a deep network is one long composition.
- undoes and is not . Only bijections have inverses, and .
- exp and log are inverses. Logs turn products into sums and power laws into straight lines, and a plain in a paper is the natural log.
- Activations, residual blocks and scaling laws are all functions: , , , and .
Checkpoint
Prove it to the labyrinth
Answer every question to clear this chamber. First-try answers earn the most XP.
A paper writes its model as . What does the semicolon tell you?
Let . What is ?
Compute .
Let , and . What is ?
The GELU paper writes the ReLU as . What does that expression mean?
Which of these functions has an inverse, taking its image as the codomain?
In Chinchilla's , with all positive, what happens to the predicted loss as both and grow without bound?
Two residual blocks, and , are stacked with first. Which expression is ?
End of the chamber
Clear this chamber
- Questions in this chamber (0/12 solved)Next unsolved
- Bonus: Function composer (+40 XP)
- Bonus: Problem 10: Undo two sigmoids (+20 XP)
- Bonus: Problem 11: Apply the paper: Chinchilla versus Gopher (+35 XP)
- Bonus: Problem 12: Apply the paper: spend a compute budget (+50 XP)
- Bonus: Proof: Socks and shoes (+25 XP)
- Bonus: Proof: Softplus minus its mirror image (+40 XP)
- Bonus: Decode the paper (1) (+30 XP)
- Bonus: Decode the paper (2) (+30 XP)
- Bonus: Match: Say it aloud (+25 XP)
- Bonus: Match: From functions to Python (+25 XP)