What is labeled data?

Labels are the answers that training data provides. They tell the model what output it should produce for each input, enabling supervised learning.

How does a model learn what the "right" answer is?

During training, models need feedback. They need to know when they're wrong so they can adjust. Labels provide this feedback: the correct answers attached to training examples.

An image classifier might train on photos labeled "cat" or "dog." A spam filter trains on emails labeled "spam" or "not spam." The model sees the input, makes a prediction, compares it to the label, and adjusts.

This process, learning from labeled examples, is called supervised learning. The labels supervise the learning.

What about LLMs? What are their labels?

Here's the elegant part: for language models, the labels are built into the text itself.

Given "The cat sat on the," the label is whatever word actually came next in the training text: "mat." The model predicts, compares to the real next word, and learns.

No human needs to label each example. The structure of text provides natural supervision. This is why LLMs can train on trillions of words: the labeling is automatic.

When do you need human labels?

Automatic labels from text only teach prediction. For other objectives, humans must provide labels:

  • Safety labels: "This response is harmful / safe"
  • Quality labels: "Response A is better than Response B"
  • Instruction labels: Pairs of (instruction, desired response)
  • Factuality labels: "This claim is true / false / uncertain"

This human labeling is expensive and slow. Companies employ thousands of labelers to create datasets for fine-tuning and safety work.

Label quality determines model quality

Garbage in, garbage out. If labels are noisy, inconsistent, or wrong, the model learns those errors.

This is why curating training data matters so much. A smaller dataset with high-quality labels often beats a larger dataset with sloppy labels. The model can only learn what the labels teach.

Self-supervised learning: labels from structure

LLM pre-training is self-supervised: the labels come from the data itself, not external annotation. Other self-supervised approaches:

  • Masked language modeling (BERT): Hide some words, predict them from context
  • Contrastive learning: Learn that augmented versions of the same example should have similar representations
  • Next sentence prediction: Given two sentences, predict if the second actually followed the first

These techniques let models learn from vast unlabeled datasets. The structure of the data provides supervision without human labels.

Labels shape what models learn

A model optimized on one set of labels learns one thing. Change the labels and it learns something else.

This is why fine-tuning works: you can take a pre-trained model (learned from text prediction) and adjust it with task-specific labels (learned from human preferences). The base capabilities plus targeted labels produce specialized behavior.

Understanding labels means understanding the fundamental question of machine learning: what are we teaching the model is "good"?

Sources & Further Reading

๐Ÿ”— Article
๐Ÿ”— Article
Inside the AI Factory
The Verge ยท 2023
๐Ÿ“„ Paper