Classification
Assigning inputs to a defined set of labels.
AI & ML · Const
Supervised fine-tuning adapts a supported model using examples of prompts and correct responses. It is intended for tasks such as classification, nuanced translation, fixed-format generation, and instruction-following correction.
Supervised fine-tuning adapts a supported base model by showing it examples of prompts paired with desired responses. The model learns this demonstrated behavior, making it useful when prompting alone does not reliably produce the required classification, format, translation style, or instruction-following behavior.
client.fine_tuning.jobs.create(training_file="file-id", model="model-id")| Name | Type | Description |
|---|---|---|
training_file | string | Identifier of the uploaded training dataset containing prompt-and-target examples. |
model | string | Supported base model to adapt, such as gpt-4.1-mini-2025-04-14. |
A fine-tuning job object representing the submitted supervised fine-tuning operation.
from openai import OpenAI
client = OpenAI()
job = client.fine_tuning.jobs.create(
training_file="file-abc123",
model="gpt-4.1-mini-2025-04-14",
)
print(job.id)Creates a supervised fine-tuning job using a prepared training file.
Assigning inputs to a defined set of labels.
Producing translations that preserve subtle distinctions or a required style.
Returning content that follows a consistent schema or presentation format.
Improving recurring cases where a model misses explicit instructions.
Supervised fine-tuning trains a model with examples that pair prompts with desired outputs. It is suited to tasks such as classification, nuanced translation, fixed-format generation, and correcting instruction-following failures.
Follow-up: When would you prefer prompting instead? Prefer prompting when the task can be reliably specified without changing the model’s learned behavior or output tendencies.
The dataset supplies correct responses for prompts, giving the model direct demonstrations of the intended behavior. This differs from preference-based methods, which provide relative preferences rather than one target response.
Follow-up: What makes a training example valuable? It should represent the production task and contain a reliable target response that exemplifies the desired behavior.
Supervised fine-tuning is particularly useful for classification, nuanced translation, constrained content formats, and instruction-following problems. These are cases where repeated examples can make the desired response pattern more dependable.
Follow-up: What should be evaluated after tuning? Compare tuned-model outputs with held-out evaluation examples to verify that the intended behavior improved.
Vision fine-tuningDirect preference optimizationReinforcement fine-tuningEvaluations