Hot AI News

Supervised fine-tuning (SFT): How example answers turn a raw model into a useful one

Supervised fine-tuning teaches a pretrained model by example: show it prompts with ideal answers, and it learns to reply the same way. How it works, who uses it and where it falls short.

Supervised fine-tuning (SFT): How example answers turn a raw model into a useful one
Photo illustration: Aiholics

Supervised fine-tuning, or SFT, is a way to retrain an AI model that has already been trained by showing it examples of the answers you want. Each example pairs a prompt with an ideal response. The model’s settings are adjusted until it reliably produces answers like those examples.

Most chatbots go through this step. It is also one of the main tools companies use to adapt a general model to their own tasks.

Teaching by example, like training a new support agent

Picture a new customer support hire. They already speak the language and know a lot about the world. What they lack is the house style: how your company greets customers, what it refunds and what it never promises.

So a manager hands them a folder of past tickets with the best replies. After studying enough of them, the new hire answers the way the company would. SFT does the same thing for a language model.

The pretrained model is the new hire. It learned general language from huge amounts of text. The folder is the SFT dataset: a set of prompts, each with a reply written or approved by people.

Advertisements

Nudging the model toward the right next word

A close-up of a model-training screen shows an example token sequence above an unfinished sequence, with a violet next-token candidate highlighted.
Photo illustration: Aiholics

A language model writes one small piece of text, called a token, at a time. For each position, it assigns a probability to every possible next token.

During SFT, the model reads an example prompt and is scored on how much probability it gave to each token of the ideal answer. This score is called the cross-entropy loss. Training adjusts the model’s internal numbers, its weights, so that the ideal answer becomes more likely next time.

Usually only the answer is scored, not the prompt. Hugging Face’s TRL library, a widely used open-source training toolkit, does this by default for prompt and completion datasets. It also offers completion_only_loss and assistant_only_loss settings to control which parts of a conversation count.

The data format is simple. OpenAI’s guide uses one JSON object per line in a .jsonl file, with a messages list of user and assistant turns. TRL accepts similar prompt and completion fields.

SFT can update every weight in the model, or only a small add-on. A popular add-on method is LoRA (low-rank adaptation), which freezes the original weights and trains a small set of extra ones. It is cheaper and leaves the base model untouched.

From instruction tuning to ChatGPT’s first training step

Fine-tuning a pretrained network on labeled examples is an old idea in machine learning. Its modern form for chat models took shape between 2021 and 2023.

In 2021, Jason Wei and colleagues at Google published FLAN, short for Finetuned Language Net. They took a 137-billion-parameter model and fine-tuned it on more than 60 existing datasets, each rewritten as plain-language instructions. This became known as instruction tuning. The paper reports that FLAN beat zero-shot GPT-3 on most of the tasks it was tested on, even tasks it had not seen in training.

In 2022, Long Ouyang and colleagues at OpenAI described InstructGPT. Their recipe began with SFT: human labelers wrote demonstrations of good answers to prompts, and GPT-3 was fine-tuned on them. Next came a second stage, reinforcement learning from human feedback (RLHF), in which people ranked the model’s outputs. OpenAI reported that evaluators preferred the outputs of a 1.3-billion-parameter InstructGPT model over those of the 175-billion-parameter GPT-3.

In 2023, Chunting Zhou and colleagues at Meta asked how much data SFT really needs. Their model, LIMA, fine-tuned a 65-billion-parameter LLaMA model on just 1,000 carefully chosen examples, with no reinforcement learning. In their human study, LIMA’s answers were rated as equal to or better than GPT-4’s in 43% of cases. The authors proposed the Superficial Alignment Hypothesis: a model learns almost all of its knowledge in pretraining, and fine-tuning mostly teaches it which format and style to use with users.

Advertisements

Where SFT is used today, including Baseten’s Loops

SFT is now a standard first step after pretraining. A typical modern pipeline uses SFT to teach the format of a good answer, then reinforcement learning to sharpen behavior further.

It is also sold as a service. OpenAI’s guide says its platform accepted as few as 10 examples, and that it saw improvements from 50 to 100. It recommended starting with 50 well-crafted demonstrations. The same page now says OpenAI is winding down its fine-tuning platform: new users can no longer sign up, and eligible existing customers can create training jobs until December 15, 2026.

Open-weight models are where much of this work is moving, because their weights can be downloaded and changed. Baseten, which raised a $3 billion Series G at a $30 billion valuation, sells this as a product called Loops. Its documentation describes Loops as a Python SDK for LoRA fine-tuning with both SFT and reinforcement learning. The base model’s weights stay frozen and only the adapter is trained.

According to Baseten’s docs, Loops comes in two modes. Serverless runs on shared capacity and is billed for the tokens trained and sampled. Dedicated covers every supported model and is billed for GPU time. Baseten lists open models from publishers including Qwen, Google, DeepSeek, Moonshot AI, NVIDIA and Z.ai.

Memorizing examples and forgetting old skills

SFT is only as good as its examples. A model trained on sloppy or inconsistent answers learns to give sloppy, inconsistent answers. Writing hundreds of high-quality demonstrations takes skilled people and time.

A second risk is catastrophic forgetting. When a model is fine-tuned on a narrow task, it can lose skills it had before. A 2023 study by Yun Luo and colleagues found forgetting across models from about 1 billion to 7 billion parameters during repeated fine-tuning. Another 2023 study, by Yong Lin and colleagues, gives the example of a model fine-tuned on medical text getting worse at following instructions and at common sense.

A third limit is how far SFT generalizes. In a 2025 paper titled “SFT Memorizes, RL Generalizes,” Tianzhe Chu and colleagues, including researchers from Google DeepMind and UC Berkeley, compared the two methods on card-based arithmetic and visual navigation tasks. They report that SFT tended to memorize its training data and struggled with new variants, while reinforcement learning handled them better. They also found SFT still useful: it steadied the model’s output format so that reinforcement learning could work.

That framing has been challenged. A later 2025 paper argues the slogan is oversimplified, reporting that the best out-of-distribution results often appear at an earlier SFT checkpoint and that RL mainly recovers what SFT lost.

Advertisements

How little data is enough, and what comes after SFT

Several questions remain open. One is data size. LIMA suggested a small, carefully chosen set can go a long way. A 2024 follow-up, “Long Is More for Alignment,” reports that simply picking the 1,000 examples with the longest responses from standard datasets can do better than LIMA’s set.

Another is the balance between SFT and reinforcement learning. Many labs now treat SFT as a warm-up that teaches format, with RL doing more of the work on reasoning and tool use. How much each stage should carry is still debated.

The third question is commercial. Companies such as Baseten are betting that businesses will want to fine-tune open-weight models on their own data rather than only renting closed models through an API. Baseten’s own customer figures have not been independently verified. Whether that demand holds up will show in how many companies actually run SFT jobs and keep the resulting models in production.

Sign Up for the Daily AI Pulse

One email a day. All the stories that matter.

Daniel ReedAI Research, Safety & Ethics Analyst

Daniel Reed currently works as an AI Research, Safety & Ethics Analyst at Aiholics, writing about how changes in artificial intelligence are affecting and will affect scholarship,…

Leave a Reply

Your email address will not be published. Required fields are marked *

You may also like