RLHF taught GPT-3 to reply using rankings from about 40 people

56 minutes ago

Why does ChatGPT answer your question, instead of carrying on writing it? A 2022 OpenAI paper asked one silly question. Why is it important to eat socks after meditating? GPT-3, OpenAI's 2020 model, replied with a question of its own. What can you learn from socks? Then OpenAI's team trained GPT-3 further, and named the new model InstructGPT. InstructGPT gave the sock question a long, polite reply, full of theories. That extra training is called RLHF, reinforcement learning from human feedback. Reinforcement learning means a model learns by trying things and getting a score. Human feedback means the score traces back to what people preferred. ChatGPT was trained with the same method, with some changes to how the data was collected.

Ask

Ask about this presentation

Answers are generated from this presentation.

Chapters

  1. 0:00RLHF taught GPT-3 to reply to a question instead of continuing it
  2. 0:49Anyone can point at the better plate, even without a recipe
  3. 1:32Step 1: GPT-3 copied answers people wrote by hand
  4. 1:58Step 2: a person ranks several answers to the same prompt
  5. 2:30One ranking becomes five pairs, and the critic learns from every pair
  6. 3:09Step 3: the model practises against the critic, with no person in the loop
  7. 3:37A trained model with 1.3 billion dials beat GPT-3’s 175 billion
  8. 4:11A preferred answer can still be wrong, and the sock reply is the paper’s own example
  9. 4:58The critic learned the taste of about 40 contractors, working to OpenAI’s instructions
  10. 5:25People point at the better answer, and a critic turns their pointing into a score
Show transcript

RLHF taught GPT-3 to reply to a question instead of continuing it

RLHF taught GPT-3 to reply to a question instead of continuing it.

The trained model still took the sock question seriously.

How it’s made · 2 · RLHF means training a model on people’s rankings of its answers

“Why is it important to eat socks after meditating?”GPT-3What can you learn from socks?InstructGPT · after RLHFThere is no clear answer to this question,but there are many theories and ideasthat may explain the apparent need to eatsocks after meditating.
Ouyang et al. 2022, InstructGPT · Figure 9 · page 16

Why does ChatGPT answer your question, instead of carrying on writing it? A 2022 OpenAI paper asked one silly question. Why is it important to eat socks after meditating? GPT-3, OpenAI's 2020 model, replied with a question of its own. What can you learn from socks? Then OpenAI's team trained GPT-3 further, and named the new model InstructGPT. InstructGPT gave the sock question a long, polite reply, full of theories. That extra training is called RLHF, reinforcement learning from human feedback. Reinforcement learning means a model learns by trying things and getting a score. Human feedback means the score traces back to what people preferred. ChatGPT was trained with the same method, with some changes to how the data was collected.

Anyone can point at the better plate, even without a recipe

Anyone can point at the better plate, even without a recipe for delicious.

The diners rank plates, a critic learns their order, and the cook practises against the critic.

scorecook · the chatbotplate · one answerdiners · about 40 hired peoplecritic · a model thatscores answers
Ouyang et al. 2022 · Figure 2, page 3 · section 3.4, page 7

Picture a cook who has read every cookbook in the library. That cook is GPT-3 after its reading stage. The cook can make anything, and the cook has no idea what a diner wants. A recipe for delicious is impossible to write down. Tasting is easy. Anyone can taste two plates and point at the better one. Diners taste a few plates and put them in order. A food critic studies thousands of those orders, until the critic can predict them and give any plate a score. Then the cook practises against the critic, because the critic can score every plate the cook makes, and forty diners can't. In this kitchen, the cook is the chatbot, a plate is one answer, and the diners are about forty people OpenAI hired.

Step 1: GPT-3 copied answers people wrote by hand

Step 1: GPT-3 copied answers people wrote by hand for about 13,000 prompts.

A prompt is the request a person types to the model.

A dial is one number inside the model that training turns.

1 · copyExplain the moon landingto a 6 year oldSome people went to the moon...written by a personabout 13,000 promptsdials, each one nudged
Ouyang et al. 2022 · section 3.2, page 7 · Table 6, page 33 · 12,725 training prompts

Before any tasting, the cook copies. A prompt is the request a person types to the model. OpenAI's hired team wrote an answer by hand for about thirteen thousand prompts. Then training nudged GPT-3's dials toward writing those answers. A dial is one of the numbers inside a model that training turns. This first step gets the model replying like an assistant. The next two steps teach the model which answers people like better.

Step 2: a person ranks several answers to the same prompt

Step 2: a person ranks several answers to the same prompt.

Each ranking held between 4 and 9 answers to one prompt.

1 · copyExplain the moon landingto a 6 year oldSome people went to the moon...written by a personabout 13,000 promptsdials, each one nudged2 · rank and scoreExplain the moon landing to a 6 year oldAExplain gravity...BExplain war...CMoon is naturalsatellite of...DPeople went tothe moon...D > C > A = B
Ouyang et al. 2022 · Figure 2, page 3 · section 3.5, page 8

Now the model writes several answers to one prompt. A person puts those answers in order, from best to worst. Each person ranked between four and nine answers for every prompt. The paper's diagram shows one ranking. The prompt says, explain the moon landing to a six year old. Answer A starts by explaining gravity. Answer B starts by explaining war. Answer C says the moon is a natural satellite. Answer D says people went to the moon. The person ranked D first and C second, and called A and B a tie.

One ranking becomes five pairs, and the critic learns from every pair

One ranking becomes five pairs with a winner, and the critic learns from every pair.

The critic gives any answer one number, and training pushes the winner’s number higher.

1 · copyExplain the moon landingto a 6 year oldSome people went to the moon...written by a personabout 13,000 promptsdials, each one nudged2 · rank and scoreExplain the moon landing to a 6 year oldAExplain gravity...BExplain war...CMoon is naturalsatellite of...DPeople went tothe moon...D > C > A = BDover CDover ADover BCover ACover BA and B · tiethe criticreward modelone numberThe winner’s score must beat the loser’s.about 33,000 prompts of rankings
Ouyang et al. 2022 · section 3.5, equation 1, page 8 · Appendix A.3 · 33,207 training prompts

That one ranking splits into pairs. D beat C, D beat A, and D beat B. C beat A, and C beat B. That makes five pairs with a winner, plus one tie, between A and B. The critic is a second model, called a reward model. The critic's only job is to read a prompt and an answer, and give back one number. Training shows the critic both answers from a pair. Whenever the critic scores the loser above the winner, training nudges the critic's dials until the winner scores higher. The gap between two scores becomes the critic's guess at how likely a person is to prefer one answer. OpenAI trained the critic on rankings for about thirty-three thousand prompts.

Step 3: the model practises against the critic, with no person in the loop

Step 3: the model practises against the critic, with no person in the loop.

A leash pulls the model back when its writing drifts far from step 1.

1 · copyExplain the moon landingto a 6 year oldSome people went to the moon...written by a personabout 13,000 promptsdials, each one nudged2 · rank and scoreExplain the moon landing to a 6 year oldAExplain gravity...BExplain war...CMoon is naturalsatellite of...DPeople went tothe moon...D > C > A = BDover CDover ADover BCover ACover BA and B · tiethe criticreward modelone numberThe winner’s score must beat the loser’s.about 33,000 prompts of rankings3 · practiseWrite a story about frogsOnce upon a time...the model writesthe criticone numberdials nudged toward higher scoresabout 31,000 customer promptsleash
Ouyang et al. 2022 · section 3.2, page 7 · section 3.5, page 9 · 31,144 training prompts

Now the cook practises. The model writes an answer to a new prompt. The critic scores that answer. Training nudges the model's dials toward answers that score higher, one small nudge at a time. This step used about thirty-one thousand prompts, all sent in by OpenAI's customers. The people step out here, and the critic does all the scoring. The cook wears one leash. When the model's writing drifts too far from how it wrote after the copying step, training pulls the model back.

A trained model with 1.3 billion dials beat GPT-3’s 175 billion

A trained model with 1.3 billion dials beat GPT-3’s 175 billion.

People preferred the small trained model’s answers.

1 · copyExplain the moon landingto a 6 year oldSome people went to the moon...written by a personabout 13,000 promptsdials, each one nudged2 · rank and scoreExplain the moon landing to a 6 year oldAExplain gravity...BExplain war...CMoon is naturalsatellite of...DPeople went tothe moon...D > C > A = BDover CDover ADover BCover ACover BA and B · tiethe criticreward modelone numberThe winner’s score must beat the loser’s.about 33,000 prompts of rankings3 · practiseWrite a story about frogsOnce upon a time...the model writesthe criticone numberdials nudged toward higher scoresabout 31,000 customer promptsleashHow often people preferred each model’s answerover the copying model from step 1copying model · 175 billion dialsInstructGPT · 1.3 billion dials53%GPT-3 · 175 billion dials24%0%50%100%read from Figure 1
Ouyang et al. 2022 · abstract, page 1 · Figure 1, page 2

People judged the answers, and preferred the answers of a trained model with one point three billion dials over the answers of GPT-3, with a hundred and seventy-five billion dials. GPT-3 has more than a hundred times as many dials. The paper's chart measures every model against the largest copying model from step one. People preferred the small trained model's answer over the copying model's answer about fifty-three percent of the time. People preferred GPT-3's answer over the copying model's answer only twenty-four percent of the time.

A preferred answer can still be wrong, and the sock reply is the paper’s own example

A preferred answer can still be wrong, and the sock reply is the paper’s own example.

The authors suspect the critic learned the rankers’ taste for hedging.

Figure 9 files this reply under “simple mistakes”.

InstructGPT · after RLHFThere is no clear answer to this question, butthere are many theories and ideas thatmay explain the apparent need to eat socksafter meditating.There is no clear answer to this question, butmay explain the apparent need to eat sockshedgesgoes along with a false idea1 · copyExplain the moon landingto a 6 year oldSome people went to the moon...written by a personabout 13,000 promptsdials, each one nudged2 · rank and scoreExplain the moon landing to a 6 year oldAExplain gravity...BExplain war...CMoon is naturalsatellite of...DPeople went tothe moon...D > C > A = BDover CDover ADover BCover ACover BA and B · tiethe criticreward modelone numberThe winner’s score must beat the loser’s.about 33,000 prompts of rankings3 · practiseWrite a story about frogsOnce upon a time...the model writesthe criticone numberdials nudged toward higher scoresabout 31,000 customer promptsleashkeeps the cook from chasing the critic’s score
Ouyang et al. 2022 · Figure 9, page 16 · section 4.3, page 17 · section 3.5, page 9

This picture is roughly right. Here is where the picture breaks. First, the cook practises against the critic, and the critic is only a guess at the diners' taste. So the cook can learn to please the critic in ways the diners wouldn't like. The authors added the leash to limit that. Second, people can prefer a wrong answer. Go back to the socks. The paper files InstructGPT's sock reply under simple mistakes. InstructGPT went along with a question built on a false idea, and InstructGPT hedged, wrapping the reply in maybes. The authors chose the sock question to show those mistakes. The reply is what the model really wrote. The team told the people ranking answers to reward humility. The authors suspect the critic picked up that taste for hedging.

The critic learned the taste of about 40 contractors, working to OpenAI’s instructions

The critic learned the taste of about 40 contractors, working to OpenAI’s instructions.

Mostly English speakers in the US or Southeast Asia · they agreed with each other about 73% of the time.

about 40 contractorsOpenAI’sinstructions1 · copyExplain the moon landingto a 6 year oldSome people went to the moon...written by a personabout 13,000 promptsdials, each one nudged2 · rank and scoreExplain the moon landing to a 6 year oldAExplain gravity...BExplain war...CMoon is naturalsatellite of...DPeople went tothe moon...D > C > A = BDover CDover ADover BCover ACover BA and B · tiethe criticreward modelone numberThe winner’s score must beat the loser’s.about 33,000 prompts of rankings3 · practiseWrite a story about frogsOnce upon a time...the model writesthe criticone numberdials nudged toward higher scoresabout 31,000 customer promptsleash
Ouyang et al. 2022 · section 5.2, page 18 · section 3.4, page 7

Third, the taste belongs to a small group. The diners were about forty contractors, mostly English speakers living in the United States or Southeast Asia. The contractors followed instructions OpenAI wrote, as a paid job. The contractors agreed with each other about seventy-three percent of the time. The authors write that they tuned GPT-3 to the preferences of these contractors, and of OpenAI's researchers, who wrote the instructions.

People point at the better answer, and a critic turns their pointing into a score

People point at the better answer, and a critic turns their pointing into a score the model chases.

Copy · rank and score · practise

How it’s made · 2

score1 · copyExplain the moon landingto a 6 year oldSome people went to the moon...written by a personabout 13,000 promptsdials, each one nudged2 · rank and scoreExplain the moon landing to a 6 year oldAExplain gravity...BExplain war...CMoon is naturalsatellite of...DPeople went tothe moon...D > C > A = BDover CDover ADover BCover ACover BA and B · tiethe criticreward modelone numberThe winner’s score must beat the loser’s.about 33,000 prompts of rankings3 · practiseWrite a story about frogsOnce upon a time...the model writesthe criticone numberdials nudged toward higher scoresabout 31,000 customer promptsleash
Ouyang et al. 2022 · Figure 2, page 3

First, people write answers by hand, and the model copies them. Then the model writes several answers to one prompt, and a person puts them in order. Every ranking splits into pairs with a winner. A critic trains on those pairs until the critic gives winners the higher score. Last, the model practises against the critic, on a leash, over thirty-one thousand prompts. Those three steps are RLHF.