Check my levelCoursesProgramsFor teamsPricing
UKSign inSign up
Check my levelCoursesProgramsFor teamsPricingClaude quizPromptsBlogFAQSearchSign upUK
AcademlCoursesOpenAI Fine-tuning: From Data to DPO
Get started free

Online course, Engineering

OpenAI Fine-tuning: From Data to DPO — a Python Course on Customizing Models

5 lessons of 35–40 minutes, 190 minutes in total: Python code, a task and a quiz in each.

Start: 7 days freePreview the first lesson, no sign-in

No card needed. The first two lessons are free after sign-up, all lessons come with Pro at $9 a month.

Training curves: training loss falls while validation loss starts to riseLesson 1, 35 minData Preparation for Chat Model Fine-Tuning
  • Advancedlevel
  • 3 h 10 min5 lessons, 3 modules
  • At your own paceupdated Dec 2, 2026
  • Certificatewith a check code
What you will learnLessonsCertificateQuestionsStart the course

What you will learn

  • Validate a JSONL dataset before training: format, roles, missing assistant replies, token statistics
  • Estimate training cost from tokens and epochs before the first API call
  • Upload files with the Files API, start a fine-tuning job and wait for succeeded before inference
  • Compare the fine-tuned model with the base model on 20 held-out examples
  • Give the model a readable ID with suffix and watch for overfitting via training and validation loss
  • Build preferred/rejected pairs for DPO, generate them synthetically and keep preferences consistent
  • Choose the method: DPO for tone and style, SFT and RFT for tasks with a correct answer
  • Capture a large model's outputs with store=True and metadata and train a small model on them
  • Write an RFT grader and guard against reward hacking by combining strict and fuzzy checks

What the OpenAI fine-tuning course covers

The course walks through the full fine-tuning cycle on the OpenAI API: validating a JSONL dataset and estimating cost, supervised fine-tuning of a chat model, DPO on preferred and rejected answers, distilling a large model into a small one, and reinforcement fine-tuning with a grader. Note: since May 2026 OpenAI has been winding down fine-tuning, details below.

Pricing and what's free →
01
Free lesson

Data Preparation for Chat Model Fine-Tuning

Checking JSONL before training: the messages format, roles, at least one assistant reply per example, token statistics and a 3-epoch cost estimate with tiktoken — without a single API call. In the task you run your own dialogue file through the validation script, fix the errors and work out the budget. This step is the same for any model, open-weight ones included.

Open the lesson →

Lessons

Data preparation and basic fine-tuning → DPO and preferences → distillation and Reinforcement Fine-Tuning. The first two lessons are free.

Module 1 · 2 lessons · 1 h 15 min

Data Preparation and Basic Fine-Tuning

Loading, validating, and counting tokens for a chat model fine-tuning dataset; running a complete fine-tuning cycle on an ingredient extraction example.

1Data Preparation for Chat Model Fine-Tuningfree35 minComplete pipeline for checking and analyzing a JSONL dataset before fine-tuning: format errors, token statistics, and training cost estimation.2Fine-Tuning Chat Models: End-to-Endfree40 minEnd-to-end walkthrough: preparing JSONL, uploading files via the Files API, launching a fine-tuning job, monitoring progress, and running inference on the fine-tuned model.
Module 2 · 1 lesson · 35 min

DPO and Preferences

Direct Preference Optimization technique: when and why SFT is not enough, the preferred/rejected dataset format, and a full DPO job cycle via the API.

3Direct Preference Optimization: Learning from Preferences35 minDPO aligns a model to subjective criteria (tone, style, brand voice) using preferred/rejected response pairs — no reward model or RL required.
Module 3 · 2 lessons · 1 h 20 min

Distillation and Reinforcement Fine-Tuning

Distilling a large model into a smaller one: outputs saved with store=True, Structured Outputs for the format. Reinforcement Fine-Tuning with verifiable graders on medical data.

4Model Distillation: gpt-4o → gpt-4o-mini40 minLarge-model outputs are saved with store=True in Chat Completions, then a smaller, cheaper and faster model is fine-tuned on them. The lesson compares the accuracy of all three models on a validation set.

Who it is for

  • ML engineers and developers who already fine-tuned OpenAI models and must decide what to do before the base models shut down
  • Teams for whom prompting is not enough: strict output format, a house style or classification on their own data
  • Anyone planning to fine-tune open-weight models who wants to understand SFT, DPO and RFT through short examples
  • Developers who want to move a large model's quality into a cheaper one through distillation

How the lessons work

  1. A 35–40-minute lessonA walkthrough of an OpenAI Cookbook notebook with Python code: JSONL, the Files API, fine-tuning jobs, graders.
  2. A hands-on task in every lessonFor example, build 100 preferred/rejected pairs for your company's tone, or collect 300–500 large-model answers to distill a classifier. Data collection and evaluation work without access to OpenAI fine-tuning. AI checks your solution and explains the result (after sign-up).
  3. Ready-made prompt and common mistakesA prompt for the lesson task and the mistakes that derail fine-tuning: fewer than 10 examples, inference before the job reaches succeeded, DPO without prior SFT, a forgotten store=True when collecting distillation data, an RFT grader that is too lenient.
  4. 3-question quiz and AI tutorThe quiz checks the lesson; the AI tutor answers questions on the topic.
  5. CertificateAfter all lessons you get a certificate with a unique verification code.

Certificate of completion

You get it when you finish every lesson. Each certificate has its own code, so an employer can check it on our site. You can add it to LinkedIn.

See how a certificate is checked
Sample

What changed in OpenAI fine-tuning in 2026

The lessons retell five OpenAI Cookbook notebooks (MIT license) from 2023–2025: data preparation, chat model fine-tuning, DPO, distillation and RFT. Academl is not affiliated with OpenAI.

After the course came out, OpenAI started winding down its fine-tuning platform. Since May 7, 2026, organizations that have never fine-tuned cannot start training. Since July 2, 2026, the same applies to those with no requests to a fine-tuned model in the past 60 days. On January 6, 2027, creating new jobs closes for everyone.

Existing fine-tuned models keep working until their base model shuts down. The RFT base model, o4-mini, shut down on October 23, 2026, so the RFT lesson now explains the method without a way to run it at OpenAI. gpt-4o-mini, gpt-4.1 and gpt-4.1-mini will shut down on January 14, 2027, taking their fine-tuned versions with them; the recommended replacement, gpt-6-luna, is not on the list of fine-tunable models.

The end-to-end SFT lesson is already updated: the OpenAI API job runs on gpt-4.1-mini, the second path trains a LoRA adapter for the open Qwen3 with TRL, and the before-and-after comparison runs in Promptfoo, because the OpenAI Evals platform shuts down on November 30, 2026.

What still holds: data checks, cost estimates, held-out evaluation and the logic of choosing between SFT, DPO and RFT. These steps are the same for open-weight models: the Cookbook has an example of fine-tuning the open gpt-oss model (Apache 2.0) with Hugging Face Transformers.

  • OpenAI — fine-tuning wind-down and model shutdown dates
  • OpenAI — fine-tuning methods and supported models
  • OpenAI — supervised fine-tuning and distillation
  • OpenAI — Direct Preference Optimization
  • OpenAI — fine-tuning API reference (there is no separate RFT guide any more)
  • OpenAI Cookbook — data preparation for chat fine-tuning

What's free and what it costs

  • The first two lessons, data preparation and end-to-end chat model fine-tuning, are free after a free sign-up.
  • After sign-up you get 7 days of full access to all 5 lessons and the whole catalog, no card needed.
  • After that, Pro costs $9 a month or $79 a year. Online card payment is not connected yet: write to info@academl.com and we open access manually.
  • Training and requests at OpenAI are billed to your own key at OpenAI's rates.

OpenAI fine-tuning course: questions

Can I fine-tune an OpenAI model today?+

Only if your organization has fine-tuned before. Since May 7, 2026, new organizations cannot train, and since July 2, 2026, neither can those with no requests to a fine-tuned model in 60 days. On January 6, 2027, creating new jobs closes for everyone, while already trained models keep answering until their base model shuts down.

Why take the course if OpenAI fine-tuning is closing?+

The methods in the course apply to any model: checking and cleaning a dataset, estimating cost, comparing with the base model on held-out examples, choosing between SFT, DPO and RFT, and distillation. The same steps are used to fine-tune open-weight models such as gpt-oss with Hugging Face Transformers. Teams with fine-tuned OpenAI models can use the course to plan a replacement before January 14, 2027.

How do SFT, DPO and RFT differ?+

SFT trains on examples of correct answers: classification, a required format, fixing instruction-following failures. DPO trains on pairs of preferred and rejected answers and suits tone, style and summarization focus. RFT scores every answer with a grader program and reinforces successful reasoning; at OpenAI it only worked with the o4-mini reasoning model.

What is model distillation?+

You tune a prompt for a large model, save its good answers and train a small model on them with ordinary SFT. In the lesson, gpt-4o answers are collected with store=True and a metadata tag, gpt-4o-mini is fine-tuned on them, and the accuracy of all three models is compared on a validation set. gpt-4o-mini is no longer on the SFT model list: OpenAI's guide uses gpt-4.1 as the teacher and gpt-4.1-mini as the student. Per OpenAI's guide, the Responses API stores responses for 30 days by default.

How many examples do I need for fine-tuning?+

OpenAI's documentation sets the minimum at 10 examples. The course tasks use 50+ examples for SFT, 100 pairs for DPO and 100 examples for RFT. Whether that is enough is shown by the held-out comparison with the base model that you run in the lesson.

The course in short

level
Advanced
For whom
For developers
Task
Search in data, RAG
Format
Lessons, quizzes and tasks checked by AI
Lesson language
English

Is this course right for you?

Check your level in 3 minutes. We will show which course to start with.

Check my level

More courses on this topic

Full catalog
Advanced

LLM Engineer: From Local Setup to Production

9 Python lessons: local models in Ollama, RAG with hybrid search, QLoRA and GGUF export, a vLLM server, injection defense and LLMOps.

5 h 30 min, 9 lessonsCertificate
Intermediate

RAG & Vector Databases

12 Python lessons on RAG: embeddings, Qdrant and pgvector, chunking, hybrid BM25 + RRF search, reranking, HyDE, RAGAS evaluation and a production pipeline.

6 h 15 min, 12 lessonsCertificate
Intermediate

OpenAI Embeddings: Complete Guide

8 lessons on OpenAI embeddings: text-embedding-3-small, semantic search, code search, reranking, classification, clustering, Q&A and recommendations.

3 h 20 min, 8 lessonsCertificate
Intermediate

OpenAI RAG & Production Patterns

6 Python lessons: RAG over complex PDFs, search with HyDE, prompt caching, 429 retries, long document summarization and entity extraction. 2026 notes.

2 h 35 min, 6 lessonsCertificate

Keep going

Hugging Face Transformers Course: fine-tuning open models and LoRA →DeepSeek, Qwen, Mistral and open-source models →Prompt Evaluations: measuring quality before and after fine-tuning →OpenAI RAG & Production Patterns: when document search is enough →OpenAI Cookbook: Based on OpenAI Materials →OpenAI API from A to Z →

Start with data preparation

The first two lessons are open after a free sign-up. Sign up with email or Google to get 7 days of full access to the whole course and catalog.

Sign up
CoursesLLM coursesFor teamsPricingFAQBlogAboutPrivacy
© 2026 AcademlDevelopment & promotion —MMIX — Marketing Mix
5Reinforcement Fine-Tuning: Training with a Verifiable Reward40 minRFT trains with reinforcement: a grader scores every answer and the model learns to reason on tasks with measurable quality — medicine, law, finance and code. The base model, o4-mini, shut down on October 23, 2026.
Certificate
Your name
for the course
OpenAI Fine-tuning: From Data to DPO
ACADEML · VERIFIED · ACADEML · VERIFIED · SAMPLE
  • OpenAI Cookbook — fine-tuning gpt-oss with Hugging Face Transformers
  • Fine-tuning or RAG?+

    Fine-tuning fits when you need a stable format, style or skill and the prompt is no longer enough. New facts are better supplied through RAG, as the course lessons advise. OpenAI suggests starting with evals and prompts and fine-tuning only after measurement shows the prompt falls short.

    How is this different from the Hugging Face course?+

    This course covers managed fine-tuning through the OpenAI API: files, training jobs, DPO, distillation and RFT on OpenAI models. The Hugging Face course teaches open-weight models in the Transformers library, LoRA included. Without access to OpenAI fine-tuning, the end-to-end SFT lesson shows a second path with TRL, and the Hugging Face course covers open-weight models in depth.

    How long is the course and what does it cost?+

    5 lessons of 35–40 minutes, 190 minutes in total, and a certificate with a verification code after all lessons. The first two lessons are always free, sign-up gives 7 days of full access with no card, then Pro is $9 a month or $79 a year. Training and requests at OpenAI are billed separately.