< Will Bosler

Fine Tuning Methods ยท

There are three primary methods for fine tuning a model: Supervised Fine Tuning (SFT), Direct Preference Optimisation (DPO) and Group Relative Policy Optimisation (GRPO). Each teaches the model through a different learning signal, and each requires different structured training data.

0:02 / 0:03

SFT is learning by imitation. We provide the model with a prompt and the response we would like it to have written, and it learns to reproduce that response token by token.

0:02 / 0:09

The learning signal is copy this. The data consists of prompts paired with ideal responses, either hand written or curated.

DPO is learning by comparison. We provide the model with two responses to the same prompt and indicate which is better. The learning signal is prefer this over that.

0:02 / 0:09

The model is pulled towards the chosen response and pushed away from the rejected one. This makes DPO particularly useful for aligning output with the preferences of a user, or a group of users.

Direct Preference Optimisation (DPO) Fine Tuning

GRPO requires no labelled responses. Its core requirement is a reward function, a means of determining what is good.

0:02 / 0:11

The model generates a group of responses to a prompt, the reward function scores each and the responses that outperform the group are reinforced. The learning signal is beat the group. GRPO is learning by trial.

Group Relative Policy Optimisation (GRPO) Fine Tuning

GRPO is therefore particularly effective in domains where output is easy to verify, such as code generation. However, where a good reward function can be designed for other domains, it can be equally valuable.

0:02 / 0:11

The choice of method depends on the data available. If we have good example responses, SFT is a sensible starting point. If we can identify which response is better but cannot write the ideal response ourselves, DPO is appropriate. If we can verify a response automatically, GRPO is the natural choice.

It is a common misconception, however, that we must choose only one.

0:02 / 0:09

These methods can be stacked. Each stage produces a checkpoint upon which the next stage builds. Our role is to determine which learning signals we want to impart and what data we can obtain to support them. We can then select the technique best suited to each outcome.

Stacking fine tuning methods