Which rows to label next: active learning with BADGE
Labels cost money, so choose which rows to label. BADGE picks a batch that is uncertain and varied, using gradient embeddings and k-means++ seeding. How it works, what it over-selects, and how to judge it fairly.
What runs in CodeSplash
- ROB008BADGE batch active learning Runs in CodeSplash (Predict)
You will be able to
- Explain why pure uncertainty sampling picks redundant batches
- Build a BADGE gradient embedding and say what its length and direction mean
- Describe k-means++ seeding as a way to pick a varied, uncertain batch
- Design a fair comparison with random labeling and say why acquired labels aren't a random sample
Spend labels where they teach
ReadThousands of rows have no label, and labeling each one costs an expert's time. Active learningActive learningChoosing which unlabeled rows to label next so a few labels improve the model as much as possible. lets the current model choose which rows to label next, then retrains and repeats.
The obvious choice, label the rows the model is least sure about, breaks down in batches. The ten least certain rows are often near-duplicates sitting in the same confusing corner, so ten labels teach one lesson. A good batch is uncertain and varied.
Gradient embeddings
ReadBADGEBADGEAn active learning rule that picks rows with large, varied loss gradients, so they are both uncertain and different from each other. represents each unlabeled row by how the model's last layer would change if its own best guess turned out to be the label:
where is the row's representation feeding the last layer. The length of grows with uncertainty (a confident row has , so ); its direction says which weights the row would move. In the reference's example, a confident row's embedding entries are about ±0.100, an uncertain row's ±0.450.
Picking a varied batch
ReadBADGE picks the batch the way k-means++ picks starting centers. Take the row with the longest embedding first; then pick each next row with probability proportional to its squared distance to the nearest row already chosen,
Long embeddings (uncertain) and far from the chosen ones (different) both raise the chance, with no hand-tuned mix of the two. A fixed seed gives the same batch every time.
Give the pool near-duplicates and compare a batch of the most uncertain rows with a BADGE batch.
DExplorable · Which rows to label next: uncertainty against BADGE
With a labeling budget, should you ask about the rows the model is least sure of, or about rows that differ from each other too?
When the pool has near-duplicates, what will a batch of the most uncertain rows be full of?
Each of the 100 pool points appears this many times with tiny jitter, as real pools often do.
Rows sent for labeling at once, before the model is refit.
Label, refit, choose again. Every strategy starts from the same 4 labeled rows.
Moves the two class centers toward each other.
Uncertainty sampling · 5 near-duplicates in the last batch
BADGE · 0 near-duplicates in the last batch
Red rings are the last batch each strategy asked for. Uncertainty sampling piles up on copies of the same doubtful points; BADGE's batches spread out. Random (gray) is the honest baseline every acquisition strategy has to beat.
Commit your prediction above to see the result
Make your prediction to see the result.
Uncertain, or just odd?
PredictPredict first
The pool contains corrupted rows and cases even experts disagree on. What will BADGE tend to pick among them?
Reveal
Some of them. Corrupted and ambiguous rows look uncertain and unusual, exactly what BADGE seeks. Labeling them can be slow or impossible. Filter the pool for obvious junk, let reviewers skip rows, and watch what the batches contain.
A fair comparison
ReadTo show active learning helped, compare it with random selection from the same starting labels, the same annotators, the same training budget and several random seeds. Plot performance against the number of labels (and labeling time) on an evaluation set that never changes between rounds and is never used to choose anything.
Remember what you've built: acquired labels are not a random sample of the population. Don't estimate class frequencies or report accuracy from them; use the fixed evaluation set. Correlated rows (several from one patient or document) should be queried as one unit.
Where it stands in CodeSplash
Read| Entry | In CodeSplash |
|---|---|
| BADGE batch active learning (ROB008) | Runs on the Predict run page as Acquire labels: the pool is the rows missing the target; the host scores them from the run's model and picks a batch with BADGE; you type labels, skip rows, and save a new dataset version |
It isn't a registry method, so the readiness badge reads "Runs in CodeSplash (Predict)". The app's embeddings use the run's input features rather than a network's last hidden layer.
Reference · ROB008 · Runs in CodeSplash (Predict)BADGE batch active learningChoose an unlabeled batch using both predictive uncertainty and diversity in a hypothetical last-layer gradient representation.Check your understanding
CheckpointCheck yourself
Why does labeling the ten least certain rows often waste effort?
Show the answer
Answer: a
BADGE adds diversity: it spreads the batch across different directions of the gradient embedding.
Check yourself
A row's BADGE gradient embedding is nearly zero. What does that mean?
Show the answer
Answer: b
vanishes when . Long embeddings mark uncertain rows.
Check yourself
After the first pick, how does BADGE choose the next row?
Show the answer
Answer: b
That's k-means++ seeding on gradient embeddings: uncertain and different rows are both likely picks.
Check yourself
After five rounds of BADGE, can you estimate the share of each class in the population from the labels you collected?
Show the answer
Answer: b
Acquisition is deliberately non-random. Keep a fixed evaluation set for performance and population estimates.
Where this track leaves you
RecapYou've seen robustness to attacks, with and without guarantees; to shifted groups and domains; and to imperfect or missing labels. In every case the claim is only as strong as the threat model, the groups or the evaluation set you stated in advance.
Concepts in this lesson