1786 lecture11 Nov24
Overview
Jonathan Rose explains how post-training turns a next-token predictor into a more useful and aligned assistant. He walks through supervised fine-tuning, human preference data, reward-model scoring, and a KL-divergence anchor to the SFT model, then connects automated feedback loops to gains in coding, math, and reasoning. The lecture closes with concrete requirements and deadlines for ECE 1786 project presentations, peer reviews, and reports.
Key takeaways
- Pretraining teaches a model to predict the next token, but SFT on human-written prompt-completion examples is needed to make instruction following more reliable.
- Because sampling is nondifferentiable, RLHF uses a learned reward model to score complete outputs and a separate optimization process to update the generator.
- Pairwise preference training can handle inconsistent human rating scales by learning which of two answers a rater prefers, rather than matching their exact numerical scores.
- A KL-divergence penalty against the SFT model helps prevent reward optimization from pushing the generator too far from its pretrained behavior.
- Automated verifiers can scale post-training: code can be compiled and tested, while formal proofs can be checked with systems such as Lean.
- AI-assisted writing still requires human review: compressing content to meet a word limit can make a report unreadable and undermine its purpose.
Chapters
- Final project presentations will run in three sessions, with slides due December 7 and peer reviews due December 11.
- Rose reviews decoding: a transformer produces next-token probabilities, and sampling selects tokens to continue the answer autoregressively.
- Different random seeds can produce different completions for the same prompt.
- Pretraining converts tokens into embeddings and trains a transformer to predict the next token.
- For a training example, cross-entropy loss is the negative log probability assigned to the correct next token.
- Backpropagation updates model parameters when the correct token receives low probability.
- Next-token prediction alone can produce repetitive, messy, or instruction-ignoring responses despite the model containing useful knowledge.
- Post-training aims to improve complete outputs, not just the probability of an individual next token.
- The same broad process can encourage useful behavior and discourage harmful responses.
- A human can judge an entire completion, such as a Shakespeare essay, but sampling introduces a nondifferentiable random choice.
- Because gradients cannot pass directly through random-number generation, sequence-level judgments need a separate method to influence model parameters.
- Rose describes a simplified token-level credit-assignment intuition: use the completion-level judgment to guide updates to the tokens that produced it.
- The Reinforcement Learning from Human Feedback pipeline begins with human-written prompt and completion examples.
- Supervised fine-tuning, or SFT, trains on those examples using ordinary next-token prediction.
- SFT improves instruction following, but Rose says it does not fully solve response quality, motivating preference training.
- For the same prompt, a model can generate multiple completions by sampling again or changing decoding settings such as temperature.
- Humans compare or rate completions, and a separate reward model learns to score prompt-completion pairs.
- The reward model turns human judgments into a reusable quality signal that can score many generated answers.
- Once a model can generate candidates and a system can judge them, training can produce feedback without a human rating every completion.
- For software, code can be compiled and run against tests to check whether it fulfills the prompt.
- For mathematics, proof systems such as Lean can automatically verify formal proofs, creating another feedback loop.
- Optimizing only for a reward score can lead the generator to exploit the scoring signal rather than preserve its pretrained capabilities.
- The SFT model serves as a reference point that limits how far the evolving generator drifts.
- Rose uses the analogy of a student bribing a grader: optimizing for the score alone may improve the score without producing learning.
- Rose discusses OpenAI's InstructGPT work, associated with lead author Long Ouyang, as a foundational example of post-training.
- In a shopping-list task, pretrained GPT-3 175B continued the recipe instead of extracting ingredients.
- The instruction-tuned model produced a shopping list, illustrating how demonstrations improve compliance with the prompt.
- Humans are not calibrated to use a 1-to-7 quality scale consistently, so matching their exact numeric ratings is unreliable.
- Instead, the reward model learns which of two completions for the same prompt a human preferred.
- A sigmoid over the difference between the two predicted scores yields a preference probability, trained with the negative log probability of the human-preferred answer.
- The reward model is built from a language model whose token-generation head is replaced with a scalar scoring output.
- The generator's reward signal is combined with a KL-divergence penalty that measures how far its output distribution moves from the fixed SFT reference.
- A coefficient such as beta controls the strength of this anchor while the model learns to improve its human preference scores.
- Supervised fine-tuning on examples that include reasoning traces can teach a model to work through problems before giving an answer.
- Rose suggests that selectable reasoning levels may be represented in training examples, while also noting that inference limits can control how long reasoning continues.
- Longer inference-time reasoning costs more computation but can produce better answers.
- Preference training can narrow response diversity; Rose notes that models may give stereotyped answers, such as repeatedly choosing the same number from 1 to 10.
- Requesting several completions instead of one can reveal alternatives the model might otherwise omit.
- The lecture also suggests requesting less likely options when a more varied set of answers is useful.
- Safety can be included in preference training by assigning low ratings to responses involving harmful requests such as self-harm or weapons.
- Rose notes that helpfulness and harm avoidance can conflict, so safety and quality objectives may be treated separately.
- A separate output classifier can block a response before release, providing a harder filter than training alone.
- Rose warns that some progress reports compressed too much material to meet word limits, making them difficult to read.
- Students are expected to review AI-assisted writing for clarity rather than surrender decisions about what matters to the model.
- He distinguishes useful AI assistance, such as repository analysis, from outsourcing the cognitive work needed to learn.
- The final talks receive six minutes, up from four minutes for proposals, and students must practice to stay within the time limit.
- The three sessions are scheduled for the usual Tuesday morning class, Tuesday evening in GB220, and Wednesday evening in Mining Building 128.
- Talks will be recorded, but public posting requires unanimous consent from both project partners; students may review the video before deciding.
- Presentations should stand alone and explain the project goal, include at least one input-output example, and describe the data and labels.
- Architecture diagrams should be comprehensible, avoiding proposals with overly complex figures such as 20-box diagrams.
- Explain success metrics before quantitative results, then show qualitative examples of both successful and unsuccessful outputs.
- The final report is due December 15, has a 2,000-word limit, and should cover background, data, architecture, metrics, quantitative and qualitative results, and lessons learned.
- Teams must submit source code to the master GitHub repository and report each member's contribution; Rose says repository analysis will inform individual grades.
- Rose's closing summary is that pretraining develops broad next-token prediction, while post-training steers models toward desired behavior; he reports that pretraining and post-training now each account for roughly half of training effort.
Transcript excerpt
0:04 All right, good morning everyone and welcome to ECE 1786 lecture number 11. Now that assignment four is done, everybody got that in last night or almost everybody. Um you have two major things in this course uh left for the project which is the final presentation and the final report. Final presentations will be done in the same way the proposals were done in the uh earlier in the term with in three separate sessions on the Tuesday morning in the class uh Tuesday evening Wednesday evening. Um and uh the slides will be due the Monday evening. If you can't make one of those then there's a form that I've now tuned up that allows you to only opt out of one of them, not multiple ones that people
0:52 wanted to do. Um, and only for a good reason because you'll be also doing a peer review of somebody else's presentation on on the second uh set as before. And I I I I'm not just trying to torture people. I truly believe that watching other people's work and critiquing it is, you know, one of the many lessons I hope are that are possible to learn in this course. Last day, we talked about the final step of text generation, which is called decoding. And I'll review that again in a moment. Uh that takes place in generative AI. So we're really around around the topic of you know how do these how do these things actually work in in in some fundamental ways. And today we'll do the kind of last major
1:41 thing that people need to know if you really want to know what's going on inside these these models. And uh I've been trying to keep up with how people do this last phase. as you'll see uh
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Jonathan Rose.