Topic 2 of 4 · 5 min read
LLM-generated training labels
Goal: Plan an LLM labelling run with a human-checked audit sample and an agreement threshold that must pass before training.
An LLM can label thousands of examples cheaply, but its labels are a noisy training set, so you check a human-labelled sample against them and set an agreement threshold that must pass before you train. The trained model inherits every error and bias the labeller had.
Check yourself · 1 of 3
An LLM labelled 20,000 emails and a classifier trained on them scores 95% on a held-out part of those same labels. What does the 95% measure?
Why it matters
Hand-labelling 20,000 support messages takes weeks. An LLM can label them in an hour. Research on annotation tasks has found that LLMs can match or beat crowd workers on some labelling jobs, which is why the practice spread. But "on some tasks" is the catch: the same model can be systematically wrong on your categories, and a classifier trained on those labels will repeat the mistake with high confidence and a clean-looking score.
How to do it
- Write the label guide first. Definitions, edge cases and two examples per class. Give the same guide to the LLM and the human checkers.
- Pilot on 100 items. Label them by hand, run the LLM, and read every disagreement. Most problems are an unclear guide, not a weak model.
- Draw the audit sample. A random sample (a few hundred items) labelled by humans who have not seen the LLM's answer. Stratify so rare classes appear.
- Measure agreement. Compute accuracy and Cohen's kappa between LLM and humans, per class. Set the threshold before you look at the result, for example kappa at least 0.8 and no class below 0.7 recall.
- Gate the training run. If the threshold fails, fix the guide or prompt and relabel. If it passes, train.
- Keep a human-labelled test set. Never evaluate the final model on LLM labels. A model trained and tested on the same labeller's output scores its agreement with the labeller, not its accuracy.
Before and after
Before: "We labelled 30,000 reviews with the LLM, trained on them and got 94% accuracy." The 94% is measured against the LLM's own labels. After: 300 reviews are labelled by two humans. LLM agreement is 0.71 kappa, and the "sarcastic praise" class is mostly mislabelled as positive. The team rewrites the guide, relabels, reaches 0.83 and only then trains. Final scores come from the human set.
What goes wrong
- Testing on LLM labels. The score hides the labeller's errors.
- A biased audit. Humans who see the LLM's answer first tend to agree with it.
- Averaging over classes. A good overall score can hide a rare class that is mostly wrong.
- Leaving the prompt unversioned. Without the prompt and model name saved with the labels, you cannot reproduce or fix the run.
Examples
Gate before training
Plan for 25,000 product questions: (1) guide with 6 intents, (2) 100-item pilot, (3) 400-item stratified audit labelled blind by two people, (4) gate: kappa at least 0.8 overall and recall at least 0.7 per intent, (5) if it passes, label the rest and train, (6) a separate 400-item human test set for the final score. The plan stores the prompt, the model name and the date with the labels.
The rare class
Overall agreement is 91%, but the "refund dispute" class (3% of data) is labelled correctly only half the time. A per-class gate catches it. An overall gate would have passed, and the trained model would rarely detect the class that matters most.
Key points
- LLM labels are a noisy training set, so measure them against human labels before training on them.
- Write the label guide first and use the same one for the LLM and the human checkers.
- Set the agreement threshold, overall and per class, before you see the audit result.
- Humans in the audit must label blind, without seeing the LLM's answer.
- Evaluate the final model on a human-labelled test set, never on LLM labels.
Common mistakes
- Reporting accuracy against the same LLM labels the model was trained on.
- Letting audit reviewers see the LLM's label before they decide.
- Using one overall agreement number and ignoring rare classes.
- Starting the labelling run before the label definitions are written down.
Check yourself · 2 of 3
Why should reviewers in the audit sample label items without seeing the LLM's answer?
Check yourself · 3 of 3
When should the agreement threshold for an LLM labelling run be set?
Practice items, not counted towards your mastery.
Start here
- Sentence Transformers documentation (opens in a new tab)DocsFree
How to encode sentences into embeddings and use them for classification, search and clustering.
- SetFit: few-shot text classification (Hugging Face docs) (opens in a new tab)DocsFree
Train a text classifier from a handful of labelled examples on top of sentence embeddings.
- ChatGPT Outperforms Crowd-Workers for Text-Annotation Tasks (opens in a new tab)PaperFree
A study comparing an LLM's labels with crowd-worker labels, and the cost and accuracy of each.