---
id: 18787
lang: en
title: "Hugging Face adds MOPD to TRL: three experts teach one model on 4 H200 GPUs"
published_at: "2026-12-01 06:24:48"
source_name: "Habr AI"
source_url: "https://habr.com/ru/companies/otus/articles/1110884/?utm_campaign=1110884&utm_source=habrahabr&utm_medium=rss"
canonical_url: "https://news.hamidun.com/en/news/18787"
categories: ["llm", "research"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# Hugging Face adds MOPD to TRL: three experts teach one model on 4 H200 GPUs

> **Краткая суть (BLUF):** Training one model on math, code and instruction following at the same time is hard: improving one area makes another slip. MOPD trains a separate expert for each domain, and the general student model learns from all of them. Hugging Face has added the method to its TRL library. The SmolLM3-3B student learns from three experts on a machine with four H200 GPUs. If you already have narrow RL models, you can merge them into one.  - The teacher scores every token of the student's answer, not the whole answer at once. - Each expert needs its own vLLM server and a teacher_id column in the data. - Nemotron 3 Ultra: more than ten teachers and two MOPD stages.

If you have tried to teach one neural network math, programming, tool use and instruction following all at once, you know the problem: you lift one area, and another quietly drops. In a single reinforcement learning (RL) training cycle, the domains pull the model in different directions, and each one gets only a small share of every batch. The Multi-Teacher On-Policy Distillation (MOPD) method gets around this problem, and in 2026 it keeps appearing in technical reports. Now Hugging Face has built it into the TRL library, so you can run the approach yourself.

## How MOPD works, in plain terms

Imagine a student who has to pass math, programming and Russian. If they study everything at once, each subject gets little time, and cramming one pushes out the others. MOPD proposes hiring a tutor for each subject. The student solves problems, and checks each of their own answers with the tutor who knows that topic.

Technically, the scheme has three stages:

- **General supervised fine-tuning (SFT).** One model gets the basics of all domains on a mixed dataset. This is the shared starting point.
- **Specialized models.** Separate models are created from the resulting checkpoint, and each is further trained with reinforcement learning for its own domain: math, code, instruction following, agentic tasks.
- **Knowledge merging.** The student, again taken from the post-SFT checkpoint, generates answers to prompts from all domains. Each prompt is scored only by the expert for that domain, token by token.

The method has two key features. First, the student learns from its own answers, not from ready-made teacher texts. With standard SFT, the model sees only perfect continuations, but in practice it has to continue its own text, and one early mistake leads it into a situation it never saw during training. Second, the signal arrives for each token, not as a single reward for the whole answer. Usually the reverse KL divergence is used: it shows how much the teacher disagrees with each chosen token. The teacher itself generates nothing.

## Who is already using the method

Xiaomi first described the method under the name MOPD in January, in its report on MiMo-V2-Flash. Since then, DeepSeek, Moonshot, NVIDIA, Liquid AI, Mistral and others have used it. DeepSeek-V4 replaced the mixed RL from V3.2 with more than ten specialized teachers. In Kimi K3, nine experts are split by domain and reasoning level. In Mistral Large 4, three teachers differ only in reasoning level: high, medium and low. NVIDIA's Nemotron 3 Ultra has more than ten teachers, and its MOPD runs in two stages: after the first, new teachers are trained on the merged model and the procedure is repeated.

NVIDIA has also published five of its experts on Hugging Face: for STEM, competitive programming, instruction following, general reasoning and dialogue. This is unusual, because most labs publish only the final model.

Labs differ in how much information they take from the teacher. Nemotron 3 Ultra and MiMo-V2-Flash consider only the probability of the token the student chose. Open-MOPD compares the 16 most probable tokens. DeepSeek-V4 and Mistral Large 4 use the distribution over the entire vocabulary: a single token gave gradients with high variance and unstable training.

## How to run it in TRL

Support is implemented in AsyncDistillationTrainer. For each expert, you start a vLLM server, pass each teacher's URL to the trainer, and add a teacher_id column to the dataset, which determines which expert receives each prompt. Generation, scoring and training run asynchronously, so the student keeps generating answers in parallel with training.

In the example, the student is SmolLM3-3B after SFT, and the teachers are three experts from Open-MOPD, trained from it with GRPO: for math, code and instructions. The prompts are mixed in a 40/40/20 ratio, because about half of the set relates to instructions. Everything fits on one machine with four H200 GPUs:

- GPU 0: the student's vLLM server;
- GPU 1: the math and instruction teachers;
- GPU 2: the code teacher, which needs its own GPU because its prompts are the longest;
- GPU 3: the training process.

Launching on HF Jobs takes one command with the h200x4 flag and the launcher.py script: it starts the servers, waits until they are ready, and starts training.

## Limitations

With beta=1.0, the TRL example considers only the probability of the chosen token, so it does not reproduce the 16-token Open-MOPD approach. All teachers must use the same tokenizer as the student, because the comparison happens token by token. The experts must be prepared in advance, and they must be trained from the same base, which means separate RL runs. The synchronous DistillationTrainer is still in progress (issue #7215).

The practical takeaway: if you already have several narrow RL models on a common base, MOPD lets you combine their knowledge into one model without painfully balancing data proportions in a shared RL loop.

---
- **Первоисточник:** [Habr AI](https://habr.com/ru/companies/otus/articles/1110884/?utm_campaign=1110884&utm_source=habrahabr&utm_medium=rss)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/18787
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
