The question a single error rate cannot answer
"Should we buy more labelled camera frames?" is the most expensive question a wildlife-camera team asks, and 12 percent dev error does not answer it. A model with a variance problem gets better with data. A model with a bias problem does not, and the same 12 percent can be either. The curve is what separates them, and it costs an afternoon of retraining rather than a quarter of labelling.
★ What you walk out with tonight. One chart with three lines on it: dev error, training error, and human-level. The three shapes it can take and what each one licenses you to spend money on. The two mechanics that stop the small end of the curve from lying to you. And the sentence that keeps the reading honest: more data will not help within the budget we have, which is a different claim from more data will never help.
LiveWhat the plot actually is3 min▶
Chapter 28 of Machine Learning Yearning is titled "Diagnosing bias and variance: Learning curves". The construction is simple enough to do in an afternoon. Take the training pool. Train on 10 percent of it, then 25, then 50, then all of it. After each run, score two things: the error on the training examples that run actually saw, and the error on the fixed dev set, which never changes. Plot both against training set size, on the same axes. Draw the human-level error rate as a horizontal line across the whole chart.
Three lines, one picture. The dev curve falls as data grows. The training curve rises as data grows, because a model finds it harder to fit 38,000 frames well than 3,800. The human-level line does not move, because a person's error rate has nothing to do with how much data your model saw. Where those three end up relative to each other is the diagnosis.
Lanternfish's field team quoted 4 pounds per labelled frame. Doubling the camera-frame training pool from 38,000 to 76,000 is a 152,000 pound line item and about five months of a field crew's time. The curve that decides whether to spend it took one engineer a Thursday.
Self-studyWhy the training curve rises3 min▶
New readers usually expect both curves to fall. Training error rises with training set size, and the reason is worth holding onto:
- At 100 examples a model of any real capacity can nearly memorise the set. Training error is near zero and means nothing about the world.
- At 38,000 examples the same model has to find structure that generalises across all of them, and it will get some wrong. Training error climbs toward the error rate the model is actually capable of.
- The gap between the two curves is the variance. It starts wide, because memorising is easy and generalising is not, and it narrows as data grows.
- The height the training curve settles at is the bias. More data cannot push it below the error the model class can reach on this problem.
So the two curves converge from opposite directions, and the level they converge toward is the thing worth predicting.
Diagnosing bias and variance: learning curves
9 min liveThere are three shapes worth recognising and each one funds a different sprint. What decides between them is not the height of the dev curve but two other things: whether it is still falling at the right edge, and where the training curve sits relative to human-level.
| Shape at the right edge | Training error | Reading | What it funds |
|---|---|---|---|
| Dev error still falling | Anywhere | The pool is the limit | More labelled camera frames |
| Dev error flat and high | High, far above human-level | Avoidable bias | A bigger model, longer training, better features |
| Dev error flat and high | Near zero | Variance | More data, augmentation, regularisation |
LiveStill falling means the pool is the limit3 min▶
If the dev curve is visibly still coming down between 50 percent and 100 percent of the training pool, the model has not yet extracted everything the data class has to give. Doubling the pool will move the number, and roughly by as much again as the last doubling did, which is what makes the slope worth writing down as a number rather than describing as "still dropping a bit".
The strong version of this reading is comparative. If the last doubling of data bought 1.4 points of dev error and the next doubling costs 152,000 pounds, that is a price per point, and it sits in the same spreadsheet as every other project with a ceiling and a cost. Session 3's points-per-week column is the same arithmetic wearing a different unit.
LiveFlat and above human-level, with high training error3 min▶
When the dev curve has levelled and the training curve has levelled just below it, both far above the human-level line, the model is failing on examples it has already seen. No quantity of new examples fixes that. This is avoidable bias, and the honest response is the one from session 5: a model with more capacity, a longer training schedule, a better input representation, or a feature the current model has no way to see.
The trap is that this shape looks disciplined. Two smooth flat lines, a stable number, a team that has "converged". A converged model well above human-level has converged on the wrong thing.
LiveFlat with training error near zero3 min▶
A training curve hugging the bottom of the chart while the dev curve sits ten points above it is variance, drawn rather than inferred. The model can fit what it has seen and cannot carry it across to what it has not. More data is the direct fix, and the curve tells you it will work because the gap has been narrowing over the range you plotted.
Read the slope before committing. A gap that is narrowing quickly says the next tranche of frames is well spent. A gap that has barely moved between 50 and 100 percent says the model is memorising faster than you can buy examples, and augmentation or regularisation is the cheaper route to the same place.
Self-studyThe mechanics from chapter 324 min▶
Four practical rules, and skipping any one of them produces a chart that is worse than no chart because it looks authoritative:
- Plot training error on the same axes. A dev-only curve cannot distinguish bias from variance, and those two readings fund opposite projects.
- Sample the smaller training sets randomly, not by taking the first N rows. A frame table ordered by camera or by capture date gives you a subset that is one forest in one season.
- Average several random draws at each size. Three is the working minimum at the small end. One draw at the small end is a coin flip presented as a data point.
- Keep the dev set fixed across every point on the curve. It is the one thing that must not vary, or the curve measures two changes at once.
Training error at each point is scored on the subset that run actually saw, not on the whole pool. Scoring the small runs against the full training pool turns the training curve into a second dev curve and the diagnosis disappears.
The honest reading, and the three ways a curve misleads
8 min liveA learning curve is a chart that people quote from memory for a year afterwards, which makes the wording of the reading as important as the plot. Three failures account for nearly all of the bad quotes: noise at the small end, a flat stretch read as a global fact, and a chart with no human-level line on it.
LiveThe noise problem at the small end3 min▶
The left-hand points on a learning curve are the least reliable and the most visually influential, because they set the apparent steepness of everything to their right. A model trained on 10 percent of a pool is at the mercy of which 10 percent: one draw lands three good night cameras, the next lands a month of rain. Lanternfish's three draws at 10 percent came back at 25, 22 and 14 percent dev error. An 11-point spread, on a curve whose entire story from left to right is 8 points.
Averaging three draws is the working minimum and five is better at the smallest size. The cost is real, because it is three trainings instead of one at every point, but the small runs are also the cheap ones, so most of the extra compute buys you the part of the chart that most needs it.
A Lanternfish engineer plotted a single draw per size and got a curve that was still visibly falling at the right edge. It went into a slide that asked for 152,000 pounds of labelling. The averaged version, run the following week, was flat from 50 percent onward. The difference was one unlucky draw at 50 percent, and it was worth five months of a field crew.
LiveThe flat-curve trap3 min▶
Here is the sentence teams say: "the curve is flat, so more data will not help". Here is the sentence the curve supports: "the curve is flat between 19,000 and 38,000 examples, so another 38,000 would not have helped much". Those are different claims. The plot can only speak about the range you plotted. A curve that has levelled over a doubling can still be falling over a tenfold increase, and plenty of them are.
The reason this matters is that the flat reading closes a door. Once "more data does not help" is in a deck, nobody proposes data again for a year, including the person who could have got 400,000 frames from a partner network for nothing. Write the range into the sentence and the door stays open at the right price.
LiveThe human-level line is what makes the chart legible3 min▶
A dev error of 12 percent means nothing on its own. If a trained field biologist scores 2 percent on the same frames, 12 percent is a large gap and there is a lot of headroom. If a biologist scores 11 percent, because half the frames are a tail in the dark at forty metres, then 12 percent is close to the ceiling and the interesting question is no longer the model at all.
Drawing that line across the chart converts a curve into a diagnosis. It shows how much of the remaining error is even addressable, and it stops a flat curve at 12 percent from being read as failure when it is close to what the task allows. Lanternfish's human-level number is 2 percent, measured by having two biologists label 200 dev frames independently, which is a morning of work and the highest-value morning on the whole project.
Self-studyThe Lanternfish reading, line by line4 min▶
- Training error 3, dev error 12, human-level 2. The training curve sits one point above human-level and the dev curve sits nine points above the training curve.
- Avoidable bias 1. The training curve is nearly on the floor the task allows. There is almost nothing to win by making the model fit its own data better.
- Variance 9. The whole visible gap on the chart is between the two curves, which is the shape in the third panel above.
- So the diagnosis is variance, and more data is a live option rather than a reflex.
- The slope at the right edge decides which kind of fix. Steep, and more camera frames are the cheapest point of error on the table. Flat, and the money goes to occlusion augmentation or a regularisation pass instead, both of which attack the same variance without buying a single label.
Note what the curve does not settle: whether the training pool and the dev set are even the same kind of image. Lanternfish trains on web photos as well as camera frames, and that turns part of what looks like variance into something else. Session 7 splits it.
Plot one for your own model
★ 20 min · everyone buildsBring a model that trains in under ten minutes, or subsample until it does, because you are about to train it twelve times. If you have nothing to hand, use the Lanternfish training pool: 38,000 labelled camera frames, a fixed dev set of 1,000, and 120 of those currently wrong.
Fix the dev set first and never touch it again. Every point on the curve is scored against the same 1,000 images. If the dev set moves, the chart is measuring two things and reading as one.
Draw training subsets at 10, 25, 50 and 100 percent, three random draws each. Random means hashed or seeded, not the first N rows. Ten trainings at the small sizes, two at full size, and the small ones are quick.
Score two errors per run. Training error on the subset that run actually saw, dev error on the fixed set. Store the fraction, the draw number and both errors as one row.
Average the draws at each size. Keep the spread as well as the mean, because a spread wider than a couple of points at any size is the chart telling you to add draws before you add conclusions.
Plot dev error, training error and the human-level line on one chart. Three lines, same axes, human-level flat across. Anything less is a chart that supports two contradictory readings.
Write the one-sentence reading, with the range in it. "Dev error falls from 20.3 to 12.0 between 10 and 100 percent of the pool, and from 13.7 to 12.0 over the last doubling." That sentence survives being quoted six months later.
Record the slope at the right edge as a number. Points of dev error per doubling of data. It goes in the same backlog table as every other project, next to its cost, and the next sprint can compare it without replotting anything.
Widest spread wins the extra draws. If the 10 percent point spans 11 points across three draws and the 100 percent point spans 0.3, add two more draws at 10 percent and none at 100. Averaging effort belongs where the noise is, not spread evenly for tidiness.
Before session 7
40 min- Plot the curve for one model you own, three draws at each of four sizes, with training error and a human-level line on the same axes. Save the chart with the date in the filename.
- Write the one-sentence reading with the range of training set sizes inside it. Then read your last data request and check whether it made a claim the plot would not have supported.
- Record the slope at the right edge in points per doubling, and put it in your backlog table next to the cost of that doubling in money and weeks.
- If you do not have a human-level number, get one: two people label 200 dev examples independently and you take the disagreement rate seriously. It is a morning, and every curve you plot afterwards is legible.
- Note down what fraction of your training data comes from the same source as your dev set. Session 7 opens on exactly that number.
Three questions
A curve has flat dev error at 12 percent, flat training error at 11 percent, and human-level at 2 percent. What does it say?
Training error far above human-level means the model is wrong about data it was trained on. Capacity, training schedule or representation is the fix; new examples are not.
Your dev curve is flat between 19,000 and 38,000 training examples. Which statement does the plot actually support?
A curve speaks only about the range it covers. A flat stretch over one doubling can still be falling over a tenfold increase, so the honest sentence names the range and leaves the door open at the right price.
Three random draws at 10 percent of the pool give dev errors of 25, 22 and 14 percent. What do you plot at that point?
Small subsets are at the mercy of which examples they got. Plot the mean of several draws, keep the spread, and add draws wherever the spread is widest.