12-04 更新 实时
首页/ 技术栈/ 正文

将 Kimi-K3.1-Pro 蒸馏进 Qwen3.8-27B:教模型一门新语言

技术栈 来源:Together AI Blog 2026-11-26 08:00 2 阅读 机器翻译
将 Kimi-K3.1-Pro 蒸馏进 Qwen3.8-27B:教模型一门新语言

推出 Polymorphic Inference,首先从 Together Compiler 开始 →

推出 Together Post-Training:更好的模型、更快的运行、更低的成本 →

推出 Together Link:在你已经在用的运行框架中运行开放模型 →

开源 AI 栈:模型、推理、路由器、运行框架与工具 →

GLM-5.3 与 GLM 5.3 Flash 在 DeepSWE 上的对比 →

⚡ 按需 B200 现已在 Together GPU Clusters 上可用 →

将高性能推理作为 API 提供

面向批处理工作负载的推理

基于 Token 的容量,附带 SLA

专用模型推理

在定制硬件上推理

专用容器推理

面向自定义模型的推理

在自有运行框架中运行开放模型

随时间不断变强的推理服务

探索热门开源模型

大规模可靠的 GPU 集群

前沿规模的自定义基础设施

构建面向 AI 的开发环境

安全存储模型权重与数据

定义你自己的 RL 和 SFT 循环

启动托管的 SFT 和 DPO 任务

微调顶级开源模型

面向生产级 AI 的系统研究

我们全部的研究论文

Together AI 的技术文档

我们的最新新闻与博客文章

我们的开源演示应用

实用落地指南

用开放模型构建更好的应用

在自有框架中运行开放模型

浏览我们的活动日历

开源 ROI 计算器

以 API 形式提供的高性能推理

面向批处理工作负载的推理

具备 SLA 的基于 Token 的容量

专用模型推理

在定制硬件上进行推理

专用容器推理

面向自定义模型的推理

在你自己的运行框架中运行开放模型

随时间不断优化的推理

探索顶级开源模型

大规模可靠的 GPU 集群

前沿规模的自定义基础设施

为 AI 构建开发环境

安全存储模型权重与数据

定义你自己的 RL 与 SFT 循环

启动托管式 SFT 和 DPO 作业

微调顶级开源模型

面向生产级 AI 的系统研究

我们的全部研究出版物

Together AI 技术文档

我们的最新新闻与博客文章

我们的开源演示应用

实用实施指南

用开放模型构建更好的应用

在你自己的运行框架中运行开放模型

浏览我们的活动日历

开源 ROI 计算器

将 Kimi-K3.1-Pro 蒸馏进 Qwen3.8-27B:教模型一门新语言

我们让 Qwen3.8-27B 翻译老挝语时,它却用泰语作答。我们借助 Together Post-Training 把 Kimi-K3.1-Pro 的老挝语翻译蒸馏进该模型,达到了教师模型 93% 的分数,同时泰语能力完好无损。

差距所在:被要求翻译老挝语时,Qwen3.8-27B 却用泰语作答,得分 5.5 chrF++,而 Kimi-K3.1-Pro 在同一测试中得分 47.5。

解决方案:我们使用 Together Post-Training,基于 Kimi-K3.1-Pro 约 3,800 条翻译训练了一个 LoRA 适配器。

结果是:这个学生模型在每一个测试句子上都输出老挝语,得分 44.3,达到教师模型得分的 93%,并且保留了它的泰语能力。

成本:所有实验加起来花费 \$260,代码在 post-training cookbook 中。

在运行一些实验时,我们发现 Qwen3.8-27B——最受欢迎的小语言模型(SLM)之一——不会写老挝语;老挝语是一种西南部台语,也是老挝的官方语言。如果你让它把一句英语翻译成老挝语,它会用泰语回答,而泰语是老挝语最接近的亲属语言,使用的却是一套完全不同的文字。在 FLORES-200 老挝语测试集上,该模型得分 5.5 chrF++(这是 0 到 100 的分数,衡量译文与人工参考译文的接近程度),且只有 11% 的输出是老挝语文字。Kimi-K3.1-Pro 在同一测试上得分 47.5。

诚然,这是一个小众用例,但这种模式相当常见:小语言模型表现出参差不齐的智能,在你关心的某个狭窄任务上表现不佳,而更大、更昂贵的模型却能轻松处理。为了解决这个问题,我们以 Kimi-K3.1-Pro 作为教师模型,借助 Together Post-Training 把它的老挝语翻译能力蒸馏到 Qwen3.8-27B 中。

在用 Kimi-K3.1-Pro 约 3,800 条译文进行训练后,这个 27B 学生模型在每一个测试句子上都用老挝语回答,得分 44.3,是教师模型得分的 93%。它同时还保留了泰语翻译能力——有意思的是,这恰恰是最难的部分。我们第一次尝试在 25 个训练步内就修好了老挝语,但也随之丢失了泰语翻译能力。

本文会梳理我们如何发现这一差距,以及最终哪些做法奏效。代码、设置和成本在文章后半部分。所有实验加起来花费 \$260。

学生模型从写泰语转为写老挝语,得分达到教师模型的 93%,同时没有丧失泰语能力。

Kimi-K3.1-Pro 在全部 11 种语言上都击败了 Qwen3.8-27B。老挝语的差距是迄今为止最大的(49.0 对 7.2)。

我们使用的指标是 chrF++,它衡量与人工参考译文在字符和词上的重叠度,评分范围从 0 到 100。关于 Qwen 老挝语得分偏低,有一点需要知道:对 chrF++ 来说,泰语答案与老挝语参考译文几乎没有共同之处。当被要求翻译成老挝语时,学生模型的输出在 50 个句子中有 45 句含泰文,而只有 6 句含老挝文:

英文:“我们现在有 4 个月大的小鼠,它们不再患糖尿病,而以前是患糖尿病的,”他补充道。Qwen3.8-27B(基础版):“ปัจจุบันเรามีหนูอายุ 4 เดือนที่ไม่เป็นโรคเบาหวาน ซึ่งเคยเป็นโรคเบาหวานมาก่อน” เขากล่าวเสริม Kimi-K3.1-Pro: "ພວກເຮົາຕອນນີ້ມີໜູອາຍຸ 4 ເດືອນ ທີ່ບໍ່ເປັນໂຣກເບົາຫວານ ເຊິ່ງເຄີຍເປັນໂຣກເບົາຫວານມາກ່ອນ," ລາວກ່າວຕື່ມ.

基础模型给出的泰语是一个合理的翻译,只是用错了语言。我们会在结果部分再回到这一点。

关于这些数字有一点说明:在这 50 个句子上,Qwen3.8-27B 的老挝语得分为 7.2,Kimi-K3.1-Pro 为 49.0;而在完整的 1,012 句测试集上,两者分别为 5.5 和 47.5。测试集列在“我们如何构建”一节中。

方案:离策略蒸馏

蒸馏是训练一个小模型(学生模型),使其在特定领域表现得像一个大模型(教师模型)。有两种做法。

Thinking Machines 在相关文章中介绍的在线策略蒸馏(On-policy distillation,OPD),是让学生模型生成文本、由教师模型为每个 Token 打分。它需要教师模型对学生模型所生成 Token 的对数概率,这在实践中意味着两个模型必须共用同一个分词器。而在我们这里,由于是要把 Kimi 蒸馏进 Qwen,两者并不共用分词器,所以我们选择了另一条路。

离线策略蒸馏(Off-policy distillation)由教师模型生成文本,再通过监督微调(SFT)训练学生模型去模仿它。在最简单的形式下,它只需要教师模型生成的文本。

我们采用的是离线策略蒸馏。它让教师这一侧的成本相当低:每次调用教师模型都只是一次普通的无服务器 chat 请求,而体积相当大的 Kimi-K3.1-Pro 从不需要占用自己的训练资源。

端到端流水线:英文句子送入 Kimi-K3.1-Pro,经过滤后成为 SFT 数据行,用于在 Together Post-Training 模型资源上进行的 Qwen3.8-27B LoRA 会话。

收集英文源句子。

让 Kimi-K3.1-Pro 翻译这些句子,并关闭 thinking。

丢弃任何并非主要以目标语言文字写成的译文。

以这些译文为目标,在 Qwen3.8-27B 上微调 LoRA 适配器,并在训练过程中在留出的测试句上进行评估。

将适配器保存到模型注册表。

我们在 Together Post-Training 上训练学生模型。一个模型资源既能训练 LoRA 适配器,又能从中采样,因此我们可以在模型训练过程中对其进行评分。每次评估我们都用四个指标打分:

在 FLORES-200 devtest 上针对人工参考的 chrF++:每次运行开始和结束时全部 1,012 句,每 25 步测 300 句(两次最长的运行中为每 50 或 100 步)。

老挝文字符率:字母大多为老挝文的输出占比。这能直接捕捉到泰语问题。

泰语保持度:在 300 句英译泰测试句上的 chrF++,以检查模型没有丢失它原本就掌握的语言。

往返充分性:Kimi-K3.1-Pro 将每个系统的老挝文翻译回英文,我们将其与原始英文进行评分。这能独立于参考风格检查语义。

在获得老挝文翻译能力的同时保持泰语,最终成了最棘手的部分。

有一次运行是对照组:它在人工老挝文参考上训练,其中 945 句来自 FLORES dev,不涉及教师模型。老挝文在 25 步内从 6.7 跃升至 43.3。

接着我们看了泰语。它从 46.7 掉到了 11.7,到这次运行结束时只有 5.3,泰语输出中用泰文书写的情况占 0%。这个模型学到的是「被要求翻译时就写老挝语」,而不是「写出被要求的目标语言」。问题的方向反过来了。

英译泰的 chrF++,基于 300 个测试句子。只用人工老挝语训练会让泰语崩塌;混合训练的运行则能保住它。

如果我们只评估老挝语,这次运行看起来就是赢家。它在本篇文章所有学生模型中老挝语得分最高。

仅老挝语的蒸馏运行,用 Kimi-K3.1-Pro 对相同句子的翻译替代人工翻译来做训练。这大幅减缓了损害,但并没有阻止它。泰语撑过了两个 epoch,到第三个 epoch 滑落到 44.3,300 个泰语回答中有 17 个是用老挝语写的。

在训练数据中加入约 1,000 条 Kimi-K3.1-Pro 的泰语翻译后,问题就解决了。两次混合运行的泰语最终得分为 47.4 和 47.8,高于基础模型,而且在任何一次评估中都从未低于 47.3。

原文较长,译文为节选;译文由英文原文机器翻译,术语按行业惯例统一,可在文末展开原文核对。

查看英文原文(Distilling Kimi-K3.1-Pro into Qwen3.8-27B: Teaching a model a new language)

Introducing Polymorphic Inference, starting with Together Compiler →

Introducing Together Post-Training: Better models, faster runs, lower costs →

Introducing Together Link: Run open models inside the harness you already use →

The Open Source AI Stack: models, inference, routers, harnesses & tools →

GLM-5.3 vs. GLM 5.3 Flash on DeepSWE →

⚡ On-demand B200s now available on Together GPU Clusters →

High-performance inference as APIs

Inference for batch workloads

Token-based capacity with SLAs

Dedicated Model Inference

Inference on custom hardware

Dedicated Container Inference

Inference for custom models

Run open models in your harness

Inference that gets better over time

Explore Top Open-Source Models

Reliable GPU clusters at scale

Custom infrastructure at frontier scale

Build development environments for AI

Store model weights & data securely

Define your own RL and SFT loop

Launch managed SFT and DPO jobs

Fine-tune top open-source models

Systems research for production AI

All our research publications

Technical docs for Together AI

Our latest news & blog posts

Our open-source demo apps

Practical implementation guides

Build better with open models

Run open models in your harness

Explore our events calendar

Open-source ROI calculator

High-performance inference as APIs

Inference for batch workloads

Token-based capacity with SLAs

Dedicated Model Inference

Inference on custom hardware

Dedicated Container Inference

Inference for custom models

Run open models in your harness

Inference that gets better over time

Explore Top Open-Source Models

Reliable GPU clusters at scale

Custom infrastructure at frontier scale

Build development environments for AI

Store model weights & data securely

Define your own RL and SFT loop

Launch managed SFT and DPO jobs

Fine-tune top open-source models

Systems research for production AI

All our research publications

Technical docs for Together AI

Our latest news & blog posts

Our open-source demo apps

Practical implementation guides

Build better with open models

Run open models in your harness

Explore our events calendar

Open-source ROI calculator

Distilling Kimi-K3.1-Pro into Qwen3.8-27B: Teaching a model a new language

Qwen3.8-27B answered in Thai when we asked it for Lao. We distilled Kimi-K3.1-Pro's Lao translation into it with Together Post-Training and reached 93% of the teacher's score, with Thai intact.

The gap: Qwen3.8-27B answers in Thai when asked for Lao and scores 5.5 chrF++, while Kimi-K3.1-Pro scores 47.5 on the same test.

The fix: We trained a LoRA adapter on about 3,800 of Kimi-K3.1-Pro's translations using Together Post-Training.

The result: The student writes Lao on every test sentence and scores 44.3, which is 93% of the teacher's score, and it keeps its Thai.

The cost: All the experiments together cost \$260, and the code is in the post-training cookbook.

While running some experiments we found out that Qwen3.8-27B, one of the most popular small language models (SLMs), can't write Lao, a Southwestern Tai language and the official language of Laos. If you ask it to translate an English sentence into Lao, it answers in Thai, Lao's closest relative, which uses an entirely different script. On the FLORES-200 Lao test set, the model scores 5.5 chrF++, a 0 to 100 score for how closely a translation matches a human reference, and only 11% of its outputs are in Lao script. Kimi-K3.1-Pro scores 47.5 on the same test.

Admittedly, this is a niche use case, but the pattern is quite common: a small language model displays jagged intelligence, falling flat on a narrow task you care about while a larger, more expensive model handles it with ease. To fix this, we used Kimi-K3.1-Pro as a teacher and distilled its Lao translation ability into Qwen3.8-27B using Together Post-Training.

After training on about 3,800 of Kimi-K3.1-Pro's translations, the 27B student answers in Lao on every test sentence and scores 44.3, which is 93% of the teacher's score. It also kept its Thai translation ability, which interestingly turned out to be the hardest part. Our first attempt fixed Lao within 25 training steps but also lost Thai translating capabilities along with it.

This post walks through how we found the gap and what ended up working. The code, settings and costs are in the second half. All the experiments together cost \$260.

The student goes from writing Thai to writing Lao at 93% of the teacher's score, without losing its Thai capabilities.

Kimi-K3.1-Pro beats Qwen3.8-27B on all 11 languages. Lao has by far the largest gap (49.0 vs 7.2).

The metric we use is chrF++, which scores character and word overlap with a human reference translation, from 0 to 100. The important thing to know about Qwen's low Lao score is that, to chrF++, a Thai answer shares almost nothing with a Lao reference. When asked to translate into Lao, the student's output contained Thai script in 45 of 50 sentences and Lao in only 6:

English: "We now have 4-month-old mice that are non-diabetic that used to be diabetic," he added.
Qwen3.8-27B (base): “ปัจจุบันเรามีหนูอายุ 4 เดือนที่ไม่เป็นโรคเบาหวาน ซึ่งเคยเป็นโรคเบาหวานมาก่อน” เขากล่าวเสริม
Kimi-K3.1-Pro: "ພວກເຮົາຕອນນີ້ມີໜູອາຍຸ 4 ເດືອນ ທີ່ບໍ່ເປັນໂຣກເບົາຫວານ ເຊິ່ງເຄີຍເປັນໂຣກເບົາຫວານມາກ່ອນ," ລາວກ່າວຕື່ມ.

The base model's Thai is a reasonable translation, just in the wrong language. We'll come back to this in the results.

One note on the numbers: on these 50 sentences Lao scores 7.2 for Qwen3.8-27B and 49.0 for Kimi-K3.1-Pro, and on the full 1,012-sentence test set it's 5.5 and 47.5. The test sets are listed under "How we built it."

The plan: off-policy distillation

Distillation trains a small model (the student) to behave like a large one (the teacher) on a given domain. There are two ways to do it.

On-policy distillation (OPD), described in Thinking Machines' post on the topic, has the student generate text and the teacher grade every token. It needs the teacher's log-probabilities on the student's tokens, which in practice means the two models have to share a tokenizer. Here since we are distilling Kimi into Qwen and they don’t share a tokenizer we went another direction.

Off-policy distillation has the teacher generate the text and trains the student to imitate it with supervised fine-tuning (SFT). In its simplest form it only needs the teacher's text.

We used off-policy distillation. It keeps the teacher side fairly cheap: every teacher call is an ordinary serverless chat request, and Kimi-K3.1-Pro, which is quite a large model, never needs a training resource of its own.

End-to-end pipeline: English sentences go to Kimi-K3.1-Pro, are filtered, and become SFT rows for a Qwen3.8-27B LoRA session on a Together Post-Training model resource.

Collect English source sentences.

Have Kimi-K3.1-Pro translate them, with thinking turned off.

Drop any translation that isn't mostly in the target script.

Fine-tune a LoRA adapter on Qwen3.8-27B with the translations as targets, evaluating on held-out test sentences as it trains.

Save the adapter to the model registry.

We trained the student on Together Post-Training. One model resource both trains the LoRA adapter and samples from it, so we could score the model as it trained. We scored every evaluation on four metrics:

chrF++ against human references on FLORES-200 devtest: all 1,012 sentences at the start and end of each run, and 300 every 25 steps (every 50 or 100 in the two longest runs).

Lao-script rate: the share of outputs whose letters are mostly Lao. This catches the Thai problem directly.

Thai retention: chrF++ on 300 English-to-Thai test sentences, to check the model hasn't lost a language it already had.

Round-trip adequacy: Kimi-K3.1-Pro translates each system's Lao back into English, and we score that against the original English. This checks meaning independently of reference style.

Thai retention while also gaining Lao translation capability ended up being the trickiest part.

One run was a control: it trained on human Lao references, 945 of them from FLORES dev, with no teacher involved. Lao jumped from 6.7 to 43.3 within 25 steps.

Then we looked at Thai. It had dropped from 46.7 to 11.7, and by the end of the run it was 5.3, with 0% of Thai outputs in Thai script. The model had learned to "write Lao when asked to translate", not "write the language you were asked for". The problem had swapped direction.

English-to-Thai chrF++ on 300 test sentences. Training on human Lao alone collapses Thai; the mixed runs keep it.

If we'd evaluated Lao alone, this run would have looked like the winner. It has the highest Lao score of any student in this post.

The Lao-only distillation run trains on Kimi-K3.1-Pro's translations of the same sentences in place of the human ones. That slowed the damage a lot but didn't stop it. Thai held for two epochs, then slipped to 44.3 in the third, with 17 of 300 Thai answers written in Lao.

Adding about 1,000 Kimi-K3.1-Pro Thai translations to the training data fixed it. Thai finished at 47.4 and 47.8 in the two mixed runs, above the base model, and never dropped below 47.3 at any evaluation.

What each training mix does when you ask for Lao and when you ask for Thai.

This is a great point to make about continual learning: when you teach a model something new, mix in data that protects what it already does well, so you don't get regressions in things you care about. Here that was Thai, the language most easily confused with Lao.

Closing the rest of the Lao gap

Thai was safe, but Lao was still short. With about 950 Lao examples each, the student trained on human references scored 44.7 and the two distilled students scored 41.8 and 41.9.

Part of that is expected. Human references do better on a human-reference metric: FLORES dev and devtest were translated through the same human process, so training on dev teaches devtest's reference style. The distilled student learns the teacher's style instead. Scored against Kimi-K3.1-Pro's own translations, the distilled student climbed from 8 to 58 chrF++, and the student trained on human references reached 47.

The other difference is supply. FLORES dev has 997 human references and no more, while Kimi-K3.1-Pro can translate any English text you have. Adding its translations of 3,000 Wikipedia sentences took the Lao training set from 965 to 3,834 examples and raised Lao from 41.9 to 44.3. That's within half a point of the human-reference run, with Thai intact.

More data also beat more passes: one epoch of the 4× data reached 43.2 on the 300 test sentences, against 41.3 after three epochs of the smaller Lao + Thai set.

English-to-Lao chrF++ on 300 test sentences for the four training runs, against SFT step. The dashed line is the teacher.

945 human Lao translations

965 Kimi-K3.1-Pro Lao translations

965 Lao + 989 Thai, from Kimi-K3.1-Pro

Distilled, Lao + Thai, 4× Lao data

3,834 Lao + 989 Thai, from Kimi-K3.1-Pro

Lao numbers use all 1,012 test sentences and Thai uses 300. The best run reaches 93% of the teacher's score. Measured from where the base model started, it closed 92% of the base-to-teacher gap on Lao:

$$\text{gap closed} = \frac{s_{\text{student}} - s_{\text{base}}}{s_{\text{teacher}} - s_{\text{base}}} = \frac{44.3 - 5.5}{47.5 - 5.5} = 0.92$$

The base model mostly had the meaning; it just wrote the wrong language. Remember the mice example. On round-trip adequacy, the base model's Thai output scored 64.6, slightly above human Lao references (64.0). The distilled student scored 65.7 and wrote Lao on 100% of the test sentences. So the main gap was language identity, which is why every run had fixed the script by its first evaluation, 25 or 50 steps in.

Share of Lao answers written in Lao script. Every run fixes the script by its first evaluation.

Loss curves, token counts and per-run details can be found in the appendix.

Training on five languages

To check this wasn't specific to Lao, we trained one adapter on Lao, Northern Sotho and Zulu (the three largest gaps) plus Yoruba, the lowest-scoring Latin-script language for both models, with Thai for retention: 8,871 Kimi-K3.1-Pro translations in all, about 2,000 per language and 1,000 for Thai, over 831 steps.

One distilled adapter improves Lao, Northern Sotho, Yoruba and Zulu and keeps Thai performance.

Lao is on all 1,012 test sentences; the rest use 300, with the teacher scored on the same sentences. Every language improved. Zulu improved least: 1 to 2% of its outputs fell into repetition loops during training, so more Zulu data or a repetition penalty is the first thing we'd try.

If you have a gap like this

Here's what we'd do again:

Screen first. Fifty sentences per language was enough to see where the teacher was far ahead.

Look at what the base model is getting wrong before you train. Here the meaning was there and the language was wrong, which is why the script was fixed within the first 25 to 50 steps.

When the student plateaus, generate more teacher data before you add epochs.

Mix in data for the nearby skill you want to keep, and score it during training. A Lao-only evaluation would have picked the run that broke Thai as the best one.

The rest of this post is the how-to: the teacher data, the training loop, the settings, the test sets and the cost.

Generating teacher data with serverless Kimi-K3.1-Pro

Every teacher call is an ordinary chat completion with thinking turned off. Translation doesn't need long reasoning: with thinking on, Kimi-K3.1-Pro scored lower on 300 Lao test sentences (43.5 against 47.3) and used about 8 times as many tokens. With it off, a Lao answer averages about 175 output tokens.

from together import Together client = Together() resp = client.chat.completions.create( model="moonshotai/Kimi-K3.1-Pro", messages=[{"role": "user", "content": ( "Translate the following English text into Lao. " "Output only the Lao translation, with no explanation.\n\n" + english )}], max_tokens=1024, temperature=0.0, chat_template_kwargs={"thinking": False}, ) lao = resp.choices[0].message.content

The source text was the 997 sentences of FLORES-200 dev, plus 4,000 sentences from English Wikipedia (3,000 for Lao, 1,000 for Thai).

Two things worth knowing about the data:

Generating data from the teacher is cheap. Kimi-K3.1-Pro serverless costs \$2 per million input tokens and \$10 per million output tokens. All 4,000 Lao translations together cost \$7.46.

Filter before training. We kept a translation only if at least 70% of its letters were in the target script and it wasn't an echo of the English. The filter removed 4% of Kimi-K3.1-Pro's Lao.

Each surviving translation becomes one chat-format training row:

{"messages": [ {"role": "user", "content": "Translate the following English text into Lao. Output only the Lao translation, with no explanation.\n\n"}, {"role": "assistant", "content": ""} ]}

Training the student on Together Post-Training

Together Post-Training splits a training run between your code and the GPUs. A model resource is a set of GPUs (B200s here) with the base model loaded. It has a trainer, which runs forward_backward and optim_step, and optionally a generator that samples text from intermediate checkpoints. A session is one LoRA adapter training on that resource.

One training step: the laptop builds samples and sends them; the model resource computes the loss, applies the optimizer step, and samples for evaluation.

We used the cookbook for three things:

get_codec("Qwen/Qwen3.8-27B", enable_thinking=False) renders each chat with Qwen's own template.

build_conversation_samples masks the prompt (loss weight 0) and trains only the assistant's translation (weight 1), including the end-of-turn token, so the model learns when to stop.

build_cross_entropy_sample shifts the tokens to the next-token targets the API expects.

from together import Together from together.post_training import (AdamParams, LoraConfig, LossConfig, ModelResourcesClient, SamplingParams) from post_training_cookbook.codecs import get_codec from post_training_cookbook.samples import make_prompt from post_training_cookbook.sft.train import TRAIN_ON_LAST, build_conversation_samples codec = get_codec("Qwen/Qwen3.8-27B", enable_thinking=False) samples = [s for row in rows for s in build_conversation_samples( row["messages"], codec=codec, train_on_what=TRAIN_ON_LAST, max_length=2048)] # One resource with one generator replica: train and evaluate on the same resource. raw = Together().post_training.model_resources.create( base_model="Qwen/Qwen3.8-27B", lora_enabled=True, compute_config={"gpu_type": "B200-SXM", "num_generator_replicas": 1}, extra_body={"inactive_timeout": 1200}) record_in_ledger(raw.id) # before waiting, so a crash can't leak it wait_until_ready(raw.id) # about 4 to 5 minutes for us resources = ModelResourcesClient.attach(model_resources_id=raw.id) session = resources.create_session(lora_config=LoraConfig(rank=64, alpha=128)) for step in range(total_steps): batch = next_batch(samples, size=16) session.trainer.forward_backward(samples=batch, loss=LossConfig(type="LOSS_TYPE_CROSS_ENTROPY")) session.trainer.optim_step(adam_params=AdamParams(learning_rate=lr_at(step))) if (step + 1) % 25 == 0: session.trainer.weights_sync() # publish new weights to the generator outs = session.generator.sample_batch( [make_prompt(codec.encode_messages(m, add_generation_prompt=True)) for m in test_prompts], num_samples=1, sampling_params=SamplingParams(max_tokens=1024, temperature=0.0)) score(outs) checkpoint = session.create_inference_checkpoint() # registers the adapter (ml_...)

record_in_ledger, wait_until_ready, next_batch, lr_at and score are small helpers of ours.

LoRA rank 64 (Qwen3.8-27B's maximum) and alpha 128

peak learning rate 1e-4, with 5% warmup and cosine decay to a tenth of the peak

Because the resource has a generator, we didn't need to deploy a separate endpoint to evaluate.

You'll see slightly different scores for the same model in different places, because we scored on three sets of FLORES-200 sentences:

50 sentences per language

Evaluations during training, and Thai

All 1,012 devtest sentences

Start and end of each run, and the headline results

FLORES-200 devtest was never used for training. We kept it as the test set throughout.

All the experiments in this post cost \$260 together assuming training on B200’s. Teacher data is the cheap part: all 4,000 Lao translations cost \$7.46.

As for time, the first step of every run took 2.5 to 3 minutes. After that, a step took a median of 2.6 to 3.2 seconds at batch 16, and evaluating 300 test sentences on the generator took about 20 seconds. The best Lao run held its resource for 46 minutes: 33.7 minutes of training steps, 7.1 minutes across 30 evaluation passes, and the rest on starting the session, saving the adapter and shutting down.

The code for this post is in the post-training cookbook:

recipes/distillation/screen_languages.py measures the teacher–student gap.

recipes/distillation/lao_from_kimi_k31_pro.py generates the teacher data, filters it, trains and evaluates the Lao student.

recipes/distillation/multilingual_from_kimi_k31_pro.py trains the five-language adapter.

To serve the adapter after training, see Deploy a checkpoint.

Distill a larger model into your own

Train a LoRA adapter and evaluate it on the same model resource, starting from the recipes in this post.

Appendix: what training looked like

Training loss for the five runs, plotted against epochs so that runs of different lengths line up.

The learning-rate schedule of the best Lao run: 30 warmup steps, then cosine decay to a tenth of the peak.

Distilled, Lao + Thai, 4× Lao data

Five languages, one adapter

Loss is cross-entropy in nats per trained token. Trained tokens count only the assistant's translation tokens, the ones that carry loss, not the prompts. The five-language run is the one from "Training on five languages".

Three observations from these runs:

Kimi-K3.1-Pro's Lao is easier for the student to learn than human Lao. The human-reference run and the Lao-only distillation run translate the same FLORES dev sentences, yet the student starts at 0.54 nats per token on the human translations and 0.36 on Kimi-K3.1-Pro's, and finishes at 0.16 against 0.06. Our guess is that one model's translations are more consistent than a team of human translators', so the student has less to fit.

The loss drops at every epoch boundary, and held-out quality doesn't follow it. Each drop is the model meeting rows it has already seen. In the four Lao runs, training loss fell by more than half after the first epoch, while Lao chrF++ on the 300 test sentences moved by between −1 and +3 points. More data beat more passes: one epoch of the 4× data reached 43.2 on those sentences, against 41.3 after three epochs of the smaller Lao + Thai set.

The five-language run has the highest loss through its first epoch. Four of its five languages started well below the teacher, against one of two in the Lao runs.

Distilling Kimi-K3.1-Pro into Qwen3.8-27B: Teaching a model a new language

Together Post-Training: frontier-grade model shaping, the way that fits you

How to train your own Jev for $17

Together AI expands fine-tuning service with more models, live metrics, and finer controls

Announcing Together AI and Adaption Partnership

Together AI expands fine-tuning service with tool calling, reasoning, and vision support

Fine-tuning open LLM judges to outperform GPT-5.2

Together Evaluations now supports comparing top commercial APIs vs. open source models

Fine-Tuning Platform Upgrades: Larger Models, Longer Contexts, Enhanced Hugging Face Integrations

Transform OpenAI gpt-oss Models into Domain Experts with Together AI Fine-Tuning

Fine-Tuning Small Open-Source LLMs to Outperform Large Closed-Source Models by 60% on Specialized Tasks

Together Fine-Tuning Platform, Now With Preference Optimization and Continued Training

Fine-tuning API: Introducing long-context training, conversation data support and more configuration options

Fine-tuning Llama-3 to get 90% of GPT-4’s performance at a fraction of the cost

How to fine-tune an LLM: a developer's guide

RAG vs. fine-tuning: a decision framework for LLM apps

Distilling Kimi-K3.1-Pro into Qwen3.8-27B: Teaching a model a new language

Introducing Hurdle: Run agent evals on your API, skills, and docs

Introducing preemptible compute: the same compute, half the price

Security event: Prompt leakage for requests in June and July of 2026

Qwen4 Max is live on Together AI

Qwen3 TTS is now available on Together AI

Tencent Hy4 is live on Together AI

Introducing Together Storage Accelerator: fast, free data caching for your GPU cluster

Last year we built megakernels. This year we deleted them: The road to Together Compiler

Making open models work for long-horizon agentic workloads

How we do agent evals at Together AI

Together Compiler: Continual Compilation for AI inference

原文为英文,正文由自动抓取并保留原文。

本文由采集器自动同步

原文发布于 Together AI Blog(Distilling Kimi-K3.1-Pro into Qwen3.8-27B: Teaching a model a new language),标题、摘要与正文由机器翻译,术语按行业惯例统一,未经人工逐句校订。

阅读原文 ↗