AI Ops Glossary

Supervised Fine-Tuning (SFT)

Supervised fine-tuning (SFT) is a post-training method that continues training a pretrained language model on paired inputs and target outputs, such as prompts and reference responses, so the model learns to produce outputs like the targets. Hugging Face's TRL documentation calls it the simplest and most commonly used method to adapt a language model to a target dataset.

In published chat-model pipelines such as InstructGPT and Llama 2-Chat, SFT comes first. For InstructGPT, labelers wrote demonstrations of the desired behavior, GPT-3 was fine-tuned on them with supervised learning, and only then was the model trained further with a reward model and reinforcement learning. Meta built an initial Llama 2-Chat with SFT and refined it with RLHF.

Supervised Fine-Tuning (SFT) at a Glance

Also calledSFT; instruction tuning (when the pairs are instructions and responses); fine-tuning on demonstrations
What it doesTrains the model to predict each token of a target response given the input, by minimizing token-level cross-entropy (negative log-likelihood)
Where it's used in model developmentAfter pretraining and before preference tuning or reinforcement learning; also for chat formatting, tool calling and vision-language models
The human roleWriting and reviewing demonstrations, and evaluating the tuned model
LimitsCan cause forgetting of earlier knowledge, can weaken safety alignment, and tends to memorize rather than generalize out of distribution

How Supervised Fine-Tuning Works

Supervised fine-tuning works by showing a pretrained model a prompt with its target response and updating the weights so that response becomes more likely, one token at a time.

The data

Each example is plain text or a prompt and completion pair. Conversational datasets store messages with user and assistant roles. For conversational data, the trainer applies a chat template that defines role markers, special tokens and turn boundaries. The EOS token must align with that template so the model's responses terminate correctly.

The loss

SFT uses token-level cross-entropy: the model predicts each target token from the tokens before it, and padding tokens are masked out. In TRL, prompt-completion datasets compute loss on the completion only by default, and an assistant-only setting ignores user and system messages. TRL logs the loss and mean token accuracy, the share of non-masked tokens where the model's top prediction matches the target.

Full or parameter-efficient

Full fine-tuning retrains all model parameters. LoRA freezes the pretrained weights and injects trainable rank decomposition matrices into each Transformer layer. Compared with GPT-3 175B fine-tuned with Adam, LoRA can reduce trainable parameters by 10,000 times and the GPU memory requirement by 3 times.

Where SFT Is Used in Model Development

SFT is used wherever a team has examples of the exact output it wants, from instruction following to preparing a model for reinforcement learning.

  • Instruction following. The FLAN paper instruction-tuned a 137B-parameter model on over 60 NLP tasks phrased as natural language instructions. It surpassed zero-shot 175B GPT-3 on 20 of 25 evaluated tasks.
  • A starting point for RL. Chu et al. found that SFT stabilizes the model's output format, which lets subsequent RL achieve its gains.
  • Tools and images. TRL's SFT trainer accepts tool-calling conversations, with available tools given as JSON schemas, and image datasets for vision-language models.

Regulation also tracks fine-tuning. The EU AI Office states that downstream entities that fine-tune an existing general-purpose AI model may become providers of new models, and that Article 53 obligations should then be limited to the modification or fine-tuning. An indicative criterion for when a downstream modifier becomes the provider is training compute for the modification greater than a third of the original model's training compute.

SFT Limits and the Human Role

SFT's limits come from the quality of its demonstrations and from what imitation alone cannot teach.

Demonstration quality

For InstructGPT, OpenAI hired 40 contractors based on their performance on a screening test. Model-generated data is one alternative: Self-Instruct generates instructions, inputs and outputs from a model, filters invalid or similar ones, and uses the rest to fine-tune the original model. Its authors note that human-written instruction data is often limited in quantity, diversity and creativity.

Forgetting

An empirical study found that catastrophic forgetting is generally observed in LLMs from 1b to 7b parameters during continual instruction tuning. Its findings indicate that general instruction tuning can help alleviate forgetting during later fine-tuning.

Safety drift

Qi et al. found that safety alignment can be compromised by fine-tuning on only a few adversarially designed examples, and that benign, commonly used datasets also degraded it, to a lesser extent. Initial alignment is not necessarily maintained after custom fine-tuning, so safety evaluation belongs after each run.

Generalization

On an arithmetic reasoning card game and a real-world navigation environment, Chu et al. found that SFT tends to memorize training data and struggles out of distribution, while RL with an outcome-based reward generalized.

Supervised Fine-Tuning vs. RLHF and DPO

Supervised fine-tuning learns from target responses, while RLHF and DPO learn from human judgments of which response is better.

FactorSFTRLHFDPO
Human dataWritten demonstrationsRankings of model outputsLabels of relative quality between outputs
Training objectiveCross-entropy on target tokensRL to maximize a learned reward without drifting too far from the original modelA simple classification loss on preferences
Separate reward modelNoYesNo
Position in the pipelineFirst post-training step in InstructGPT and Llama 2After SFT in bothReplaces RLHF's reward model and RL step

Supervised Fine-Tuning (SFT) at Hugo

Hugo builds dedicated teams whose specialists write and review the instruction-response pairs that set a model's behavior, formatting and domain accuracy, with domain experts for medical, legal, financial and technical responses. Each team works from a rubric written with the client and a calibration set every rater passes before production, with agreement tracked per criterion. The same team can rank outputs and audit safety for later stages through Hugo's preference alignment and post-training teams. For dataset design, see What Is SFT Data?

Supervised Fine-Tuning (SFT) FAQs

What is supervised fine-tuning (SFT) in LLMs?

Supervised fine-tuning (SFT) is the post-training step in which a pretrained LLM is trained on prompt and response pairs so it learns to produce responses like the targets. The model minimizes the negative log-likelihood of each target token given the input. Hugging Face's TRL documentation calls SFT the simplest and most commonly used method to adapt a language model to a target dataset. In InstructGPT, labelers wrote demonstrations, and GPT-3 was fine-tuned on them before any reinforcement learning. Write the target behavior into a guideline before collecting data, because the model imitates whatever the demonstrations show.

Is SFT the same as instruction tuning?

Instruction tuning is a type of supervised fine-tuning in which the training pairs are instructions and responses. The FLAN paper defines it as finetuning language models on a collection of tasks described via instructions; its 137B-parameter model, tuned on over 60 NLP tasks, surpassed zero-shot 175B GPT-3 on 20 of 25 evaluated tasks. SFT is the broader term: the same supervised loss can also teach a chat format, tool calls or answers about images. When a paper or provider says SFT, ask what the pairs contain.

How much data do you need for supervised fine-tuning?

Supervised fine-tuning can work with far less data than pretraining, and published results point to curation over volume. The LIMA study fine-tuned a 65B-parameter LLaMa model on only 1,000 carefully curated prompts and responses, with no reinforcement learning. In a controlled human study, its responses were equivalent or strictly preferred to GPT-4 in 43% of cases, and the authors say the results strongly suggest that almost all knowledge is learned during pretraining. LIMA also learned specific response formats from only a handful of training examples. Start with a small reviewed set, evaluate, and scale only the categories that fall short.

What is the difference between SFT and RLHF?

SFT trains a model to imitate written target responses, while RLHF trains it to maximize a reward model learned from human rankings of its outputs. In InstructGPT, demonstrations and SFT came first, then comparison data and a reward model, then PPO against that reward. The DPO paper describes RLHF as complex and often unstable, and DPO replaces the reward model and RL loop with a simple classification loss on preferences. SFT shows the model good answers; preference methods show which of two answers is better. Plan both datasets so they follow the same guideline.

Can synthetic data replace human-written SFT data?

Synthetic data can supply many SFT examples, but in the Self-Instruct study it still trailed a model trained with human annotations on expert-written instructions. Self-Instruct generated instructions, inputs and outputs from GPT3, filtered invalid or similar ones, and fine-tuned the original model, reporting a 33% absolute improvement over the original model on Super-NaturalInstructions, on par with InstructGPT-001. In human evaluation on expert-written instructions for novel tasks, it left only a 5% absolute gap behind InstructGPT-001, which was trained with private user data and human annotations. For clinical, legal, financial or code data, have qualified reviewers check generated responses before training.

What are the risks of supervised fine-tuning?

The main risks of supervised fine-tuning are forgetting existing capabilities, weakening safety behavior and fitting the training data too narrowly. One empirical study found that catastrophic forgetting is generally observed in LLMs from 1b to 7b parameters during continual instruction tuning. Qi et al. jailbroke GPT-3.5 Turbo's safety guardrails by fine-tuning on only 10 adversarially designed examples, and found that benign datasets can also degrade safety alignment, to a lesser extent. Chu et al. report that SFT tends to memorize training data and struggles out of distribution. Run capability and safety evaluations after every fine-tuning run.

How much does supervised fine-tuning cost?

Supervised fine-tuning costs come from two places: the compute to train the model and the people who write and review the demonstrations. Meta's Llama 2 paper notes that heavily fine-tuning LLMs to align with human preferences can require significant costs in compute and human annotation. Parameter-efficient methods reduce the compute side: compared with GPT-3 175B fine-tuned with Adam, LoRA can reduce trainable parameters by 10,000 times and the GPU memory requirement by 3 times. Ask data providers to price per reviewed example and state how much data gets a second review.

When should you outsource SFT data creation?

Outsourcing SFT data creation fits when demonstrations need more volume or domain expertise than an internal team can supply, while the lab keeps ownership of the target behavior. Published recipes set a high bar for writers: for InstructGPT, OpenAI hired 40 contractors selected on a screening test, and LIMA's results rest on carefully curated examples. Ask a provider how writers are screened, who reviews each response, how disagreements are resolved against the written guideline, and whether the same people stay on the program as guidelines change.

Sources

  1. European Commission, AI Office. General-Purpose AI Models in the AI Act, Questions & Answers. Accessed November 10, 2026.
  2. Ouyang, L., Wu, J., Jiang, X., et al. (OpenAI). Training language models to follow instructions with human feedback. Updated March 4, 2022. Accessed November 10, 2026.
  3. Touvron, H., Martin, L., Stone, K., et al. (Meta). Llama 2: Open Foundation and Fine-Tuned Chat Models. Accessed November 10, 2026.
  4. Hugging Face. SFT Trainer. Accessed November 10, 2026.
  5. Zhou, C., Liu, P., Xu, P., et al. LIMA: Less Is More for Alignment. Updated May 18, 2023. Accessed November 10, 2026.
  6. Wei, J., Bosma, M., Zhao, V. Y., et al. Finetuned Language Models Are Zero-Shot Learners. Updated February 8, 2022. Accessed November 10, 2026.
  7. Hu, E. J., Shen, Y., Wallis, P., et al. LoRA: Low-Rank Adaptation of Large Language Models. Updated October 16, 2021. Accessed November 10, 2026.
  8. Chu, T., Zhai, Y., Yang, J., et al. SFT Memorizes, RL Generalizes: A Comparative Study of Foundation Model Post-training. Updated January 28, 2025. Accessed November 10, 2026.
  9. Wang, Y., Kordi, Y., Mishra, S., et al. Self-Instruct: Aligning Language Models with Self-Generated Instructions. Updated May 25, 2023. Accessed November 10, 2026.
  10. Luo, Y., Yang, Z., Meng, F., et al. An Empirical Study of Catastrophic Forgetting in Large Language Models During Continual Fine-tuning. Updated January 5, 2025. Accessed November 10, 2026.
  11. Qi, X., Zeng, Y., Xie, T., et al. Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!. Updated October 5, 2023. Accessed November 10, 2026.
  12. Rafailov, R., Sharma, A., Mitchell, E., et al. Direct Preference Optimization: Your Language Model is Secretly a Reward Model. Updated July 29, 2024. Accessed November 10, 2026.

Build the Dedicated Team Behind Your AI Operations

Whether you need model evaluators, coding specialists, multilingual reviewers, or multimodal data teams, Hugo can help you build and manage the human operations layer behind better AI.

  • Dedicated Specialists

  • Quality You Can Trust

  • Built to Scale With You

  • Secure, Compliant & Reliable