Skip to content

Post-training 101, lesson 2

Fine-tuning: teaching by example

Fine-tuning teaches a model by showing it good answers from your own work. This lesson walks through the job step by step, and shows what it can teach and what it cannot.

What do you run?

Every example below changes to fit what you pick. The businesses are made up for teaching.

The picture, one step at a time

Each box is one stage. The picture lights up as you scroll.

Step 1 of 6

Start with one narrow job

Fine-tuning means training a model a little more, on examples from your own work. It works best on one narrow job, done the same way every time. For writing product descriptions, pick the single task where clear instructions still keep missing.

Which of these is a narrow job?

Step 2 of 6

Collect real examples

Each example is a pair: a real input from your work, and the answer you wish it had given. Write the answer as you want it, not as it went on the day. Made-up inputs teach the model your guesses, not your work.

OpenAI's own guide sets the minimum at 10 examples, and says it sees improvements from 50 to 100.

Step 3 of 6

Quality beats quantity

The model copies whatever it is shown, mistakes included. So a person reads every example. Cut the wrong ones, the out of date ones and the near copies. A few hundred careful examples beat thousands of rough ones.

In 2023 researchers trained a large model on just 1,000 carefully chosen examples. People judged its answers as good as or better than GPT-4's in 43% of cases (the LIMA paper).

Step 4 of 6

Train a copy

Training makes a copy of the model that has learned from your examples. The original is unchanged. The copy picks up habits: a layout, a voice, a way of sorting things. What it does not pick up well is new facts.

A 2023 study compared training facts into a model with letting it look them up when asked. Looking them up won, for facts the model had seen before and for new ones.

Your prices change every week. Should you fine-tune them in?

Step 5 of 6

Test it against the original

Before you train, put some examples to one side. Afterwards, give those to both the copy and the original, and compare the answers. Keep the copy only if it clearly wins. If it does not, the problem was the examples or the job, not the amount of training.

Step 6 of 6

The copy needs looking after

Your copy stays as it was trained. When the lab releases a better model, the copy does not get better with it, and you do the work again. So before you fine-tune for writing product descriptions, count that upkeep as part of the cost.

Fine-tune, instruct, or look it up?

Here are four things you want from the AI in your business. Sort each one: does it need fine-tuning, will instructions do, or should it look the answer up when asked?

  1. 1Every description must follow your layout: a one-line opener, three short points, a care note. Instructions get it right at first, then drift across a batch of 300.

  2. 2It should know what is in stock and the price of each item today.

  3. 3It should use British spelling and never use an exclamation mark.

  4. 4It should quote your returns policy, which you rewrite twice a year.

0 of 4 right so far, 4 to go.

What a good example set looks like

This is what you keep: the checklist for an example set, and the rule for what never goes in one.

What a good example set looks like

  1. One narrow job, done the same way every time.
  2. Real inputs from your work, not made-up ones.
  3. Each with the answer you wish it had given, written the way you want it.
  4. Every example read by a person. The wrong, the out of date and the near copies cut.
  5. Some held back, to test the copy against the original.

Examples teach a habit, not facts. If the answer will change next month, have it looked up instead.

Next: Lesson 3: reinforcement learning, teaching by reward. How a score shapes a model, and how a model learns to game one.