Loading video...

Video Failed to Load

Go Home

Lil update on fixing deepseeks GRPO issues when training a small medical model. shoutout to Zichen Liu & leloy! 's weekend work 1.5B llms medmcqa score went up from 37% to 52%

26,449 views • 1 year ago •via X (Twitter)

11 Comments

nisten🇨🇦e/acc's profile picture
nisten🇨🇦e/acc1 year ago

@leloykun 31% not 37%* , the qwen 3B model went from 37 to 49 smaller 1.5 deepseek-distrill model suprisingly went from 31-52. Will be posting model, training code etc here as part of @JohnsonThomasMD 's project.

Togoda AI Search Engine's profile picture
Togoda AI Search Engine1 year ago

Togoda is Google on Steroids with AI summaries . 🚀 The only thematic AI search engine.👀 It's 100% private with third party proxy. 🧨 Try it today & experience the difference! 👉Follow us @togoda_com 👈 🚀Help us grow & share this post!🚀

nisten🇨🇦e/acc's profile picture
nisten🇨🇦e/acc1 year ago

it’s pretty crazy that you can get an AI that runs on a smartwatch to talk to itself long enough that it figures out how to get a D on the US Medical Licensing exam. WITHOUT ADDING EXTRA MATERIAL. Just reinforcement learning what it already had. Human doctor score is 71%

nisten🇨🇦e/acc's profile picture
nisten🇨🇦e/acc1 year ago

tfw when you end up beating an excellent model like reka flash 21B with something that can run on 5 year old phones

nisten🇨🇦e/acc's profile picture
nisten🇨🇦e/acc1 year ago

There's more to fix but yeah Leloy was right the whole time. Funny enough the first fix to the trainer from the university of singapores's team was called Dr GRPO

M4rc0𝕏's profile picture
M4rc0𝕏1 year ago

@zzlccc @leloykun Fucking genius

Rakshith Sajjan's profile picture
Rakshith Sajjan1 year ago

@zzlccc @leloykun Hey nisten, amazing project. Will be soon doing a rl run on financial regulations data Would help a ton if you could drop some resources

elie's profile picture
elie1 year ago

@zzlccc @leloykun I think it’s fixed now in trl, see

nisten🇨🇦e/acc's profile picture
nisten🇨🇦e/acc1 year ago

@zzlccc @leloykun damn that was fast, there may be an issue with that one too

nisten🇨🇦e/acc's profile picture
nisten🇨🇦e/acc1 year ago

@leloykun thread here for future reference,

nisten🇨🇦e/acc's profile picture
nisten🇨🇦e/acc1 year ago

it looks like a fix for this just got merged in an hour ago. You’ll need to rebuild TRL trainer from source however to apply it because its not in the pip package. Not entirely shure it fully fixes the length bias, will test. @cognitivecompai

Related Videos

New Course: Post-training of LLMs Learn to post-train and customize an LLM in this short course, taught by Banghua Zhu, Assistant Professor at the University of Washington University of Washington, and co-founder of @NexusflowX. Training an LLM to follow instructions or answer questions has two key stages: pre-training and post-training. In pre-training, it learns to predict the next word or token from large amounts of unlabeled text. In post-training, it learns useful behaviors such as following instructions, tool use, and reasoning. Post-training transforms a general-purpose token predictor—trained on trillions of unlabeled text tokens—into an assistant that follows instructions and performs specific tasks. Because it is much cheaper than pre-training, it is practical for many more teams to incorporate post-training methods into their workflows than pre-training. In this course, you’ll learn three common post-training methods—Supervised Fine-Tuning (SFT), Direct Preference Optimization (DPO), and Online Reinforcement Learning (RL)—and how to use each one effectively. With SFT, you train the model on pairs of input and ideal output responses. With DPO, you provide both a preferred (chosen) and a less preferred (rejected) response and train the model to favor the preferred output. With RL, the model generates an output, receives a reward score based on human or automated feedback, and updates the model to improve performance. You’ll learn the basic concepts, common use cases, and principles for curating high-quality data for effective training. Through hands-on labs, you’ll download a pre-trained model from Hugging Face and post-train it using SFT, DPO, and RL to see how each technique shapes model behavior. In detail, you’ll: - Understand what post-training is, when to use it, and how it differs from pre-training. - Build an SFT pipeline to turn a base model into an instruct model. - Explore how DPO reshapes behavior by minimizing contrastive loss—penalizing poor responses and reinforcing preferred ones. - Implement a DPO pipeline to change the identity of a chat assistant. - Learn online RL methods such as Proximal Policy Optimization (PPO) and Group Relative Policy Optimization (GRPO), and how to design reward functions. - Train a model with GRPO to improve its math capabilities using a verifiable reward. Post-training is one of the most rapidly developing areas of LLM training. Whether you’re building a high-accuracy context-specific assistant, fine-tuning a model's tone, or improving task-specific accuracy, this course will give you experience with the most important techniques shaping how LLMs are post-trained today. Please sign up here:

Andrew Ng

125,146 views • 11 months ago

New Course: Reinforcement Fine-Tuning LLMs with GRPO! Learn to use reinforcement learning to improve your LLM performance in this short course, built in collaboration with Predibase by Rubrik, and taught by Travis Addair, its Co-Founder and CTO, and Arnav Garg, its Senior Engineer and Machine Learning Lead. Reasoning models have been one of the most important developments in LLMs. Reinforcement Fine-Tuning (RFT) uses rewards to encourage LLMs to find solutions to multi-step reasoning tasks such as solving math problems and debugging code - without needing pre-existing training examples like in traditional supervised fine-tuning. Group Relative Policy Optimization (GRPO) is a reinforcement fine-tuning algorithm gaining rapid adoption. Developed by the DeepSeek team and used to train the R1 reasoning model, GRPO uses reward functions that you can write in Python to assign rewards to model responses. It’s beneficial for tasks with verifiable outcomes and can work well even with fewer than 100 training examples. It can also significantly improve the reasoning ability of smaller LLMs, making applications faster and more cost effective. In this course, you’ll take a technical deep dive into RFT with GRPO. You’ll learn to build reward functions that you can use in the GRPO training process to guide an LLM toward better performance on multi-step reasoning tasks. In detail, you’ll: - Learn when reinforcement fine-tuning is a better fit than supervised fine-tuning, especially for tasks involving multi-step reasoning or limited labeled data. - Understand how GRPO uses programmable reward functions as a more scalable alternative to the human feedback required for other reinforcement learning algorithms, such as RLHF and DPO. - Frame the Wordle game as a reinforcement fine-tuning problem and see how an LLM can learn to plan, analyze feedback, and improve its strategy over time. - Design reward functions that power the reinforcement fine-tuning process. - Learn techniques for evaluating more subjective tasks, such as rating the quality of a text summary, using an LLM as a judge. - Understand why reward hacking happens and how to avoid it by adding penalty functions to discourage undesirable behaviors. - Learn the four key components of the loss calculation in the GRPO algorithm: token probability distribution ratios, advantages, clipping, and KL-divergence. - Launch reinforcement fine-tuning jobs using Predibase’s hosted training services. By the end of this course, you’ll be able to build and fine-tune LLMs using reinforcement learning to improve reasoning without relying on large labeled datasets or subjective human feedback. Please sign up here:

Andrew Ng

86,442 views • 1 year ago