Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 02 · AI · From a model to an app · about 17 min to read

Watch: What fine-tuning actually is: prompting, retrieval, LoRA and the order to try them in
▶ VideoPlay it as a journeyTutor comes with a plan

Fine-tuning & Alignment

Fine-tuning and Alignment
Fine-tuning and Alignment · Open board

The How LLMs Work board that picks up the split left open by From Transformer to LLM: a machine that predicts the next word, and a thing that answers you. How the first became the second is mostly a story about people pointing at the better of two answers.

Before you start. You need one fact from From Transformer to LLM: training a language model means hiding the next word in a mountain of text and turning the model’s dials until it guesses well. Nothing here changes that machine. It changes only what the machine is rewarded for doing with it.

Lesson 13 of 83 in AI

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 2020: GPT-3, a text finisher that answers a question with more questions
  • Fine-tuning: a second, small round of training on answers written by hand
  • 2017: the reward model, a second network that learns which clip a person would pick
  • 2022: RLHF, training on which reply people picked, and a 1.3-billion model that won
  • December 2022: Constitutional AI, the principles written down instead of clicked
  • 2021: LoRA, a small correction trained beside the frozen dials
  • What fine-tuning, RLHF and LoRA change, and what none of them can
  • The hire learns to flatter
  • The notebook is too big to copy
  • Why one card is enough
  • All of it in code

Terms it explains: How LLMs Work, fine-tuning, reward model, RLHF, Constitutional AI, LoRA, reward hacking, DPO, rank, alignment, alignment tax, base vs aligned model, HHH, instruction tuning, KL penalty, PPO, RLAIF, SFT.

Lab

Fine-tuning a 7B model with LoRA trains a small correction beside the frozen weights. How big should the correction be?

Drag How big each correction is from r = 1 to r = 256 and watch Memory to train climb while Quality stalls.

Open The LoRA rank

Related papers

Review AI