Large Programs

Home / How LLMs Work

How LLMs Work

Supervised Learning: Learning With an Answer Key

In supervised learning a model learns from examples that come with the right answers. How it works with a cats-and-dogs example, and where you meet it.

27 November 2026 · 2 min read

Supervised learning is a kind of machine learning where the training examples come with the correct answers. The word "supervised" refers to a teacher or supervisor who provides those answers and guides the learner.

Photos with labels train a model, which then makes a guess on a new photo.

The answer-key idea

Imagine a pile of flash cards. Each card has a photo on the front and the right word on the back. A student looks at the photo, guesses, flips the card and checks. In supervised learning the computer does this with a very large number of examples. Each piece of input is paired with its correct output, which is called a label.

Wikipedia gives this example: to teach a model to identify cats in images, you feed it many images labelled "cat" or "not cat".

How NIST defines it

NIST's glossary, quoting its report AI 100-2e2025, defines supervised learning as a type of machine learning in which a model learns to predict explicit (often human-generated) labels or output values for data.

The goal: new examples

The goal is not to remember the cards. It is for the trained model to give a correct answer for new data it has not seen. Doing that well is called generalising.

Two common jobs

  • Classification: choosing a category, such as "spam" or "not spam".
  • Regression: predicting a number, such as the price of a house.

No perfect method

Wikipedia notes that no single learning method works best on every supervised-learning problem.

The other kinds

In unsupervised learning, the model looks for patterns in data that has no labels. A third kind, reinforcement learning, learns from rewards (see reinforcement learning). Large language models learn to predict the next word in text, which you can read about in how LLMs learn.

Try it

Make 10 cards with an animal picture or drawing on one side and its name on the back. Show them to a friend one at a time without the back. Then try new pictures they have not seen. Can they still name the animal? That is generalising.

Sources