Skip to content

AdvancedLesson 2 of 510 min read

From raw text to assistant: fine-tuning and RLHF

A course from the Academy: Under the hood of LLMs

Go to the quiz ↓

A model just pre-trained on the internet is a raw completion machine: ask it “What is the capital of France?” and it might answer… with three more geography questions, because lists of questions abound in its data. To turn it into a useful, safe assistant, two more steps are needed.

Step 2: supervised fine-tuning

The model is re-trained on tens of thousands of exemplary dialogues, often written by humans: question → ideal answer. The model learns the assistant format: answer the question asked, structure the response, adopt the right tone.

Step 3: RLHF

RLHF (reinforcement learning from human feedback) refines behaviour: the model generates several answers to the same question; humans rank them from best to worst; a reward model learns to predict these preferences; then the LLM is optimised to maximise that reward. Result: more useful, more honest, less harmful. This is what turned lab curiosities into products everyone can use, and it is also what gives AIs their tendency to flatter, because humans rate what pleases them more highly.

Alignment, the ongoing challenge

Making the AI do what we really want, not just what we measured, is called alignment. Refusing to help build a weapon but explaining chemistry to a student; being honest without being hurtful; helping without flattering: these balances are set by these steps, and no lab considers them solved.

Analogy. Pre-training gives you a scholar who has read everything but doesn't know how to behave in society. Fine-tuning teaches them the trade of an adviser: listen, respond, structure. RLHF is years of customer feedback polishing their behaviour, with the known risk of the adviser who says what you want to hear.

Key concepts

Complete the lesson

A 4-question quiz: 3 correct answers are enough, plus an exercise to practise. It opens in the Academy, on this same lesson.

Take the quiz and complete the lesson Free. With an account, your progress is saved and leads to the course certificate.

The course: Under the hood of LLMs

  1. The Transformer: the architecture that changed everything10 min
  2. From raw text to assistant: fine-tuning and RLHF10 min
  3. Embeddings and RAG: connecting AI to your data10 min
  4. Mixture of Experts, distillation, quantization: the engineering of efficiency9 min
  5. Evaluating an AI: benchmarks, limits, and critical thinking9 min

The whole Academy →The AI glossary