跳到內容

技術

知識蒸餾 (Distillation)

Knowledge distillation

用大模型(teacher)的輸出訓練小模型(student),讓小模型在更便宜的成本下保留大模型的能力。

登入以收藏
知識蒸餾是讓小模型學大模型的輸出。跟用標註資料直接訓練 student 不同,你餵 student 的是 teacher 的預測——通常是 token 的整個機率分布,而不是只有最終答案。這個更豐富的訊號讓 student 能吸收一些光看 label 學不到的細微行為。 它重要的原因是:前緣模型部署成本太高。70B 模型在高 QPS production 環境通常不實際,但能保留 90% 品質的 7B distilled 版就能 ship。多數「flash」「mini」變體(GPT-4o-mini、Claude Haiku、Gemini Flash)某種程度上都是從大模型蒸餾出來的。 舉個例子:Stanford 的 Alpaca 是早期示範——他們用 text-davinci-003(一個大很多的模型)的輸出 fine-tune 了一個 7B Llama,用很少預算做出表現意外好的小模型。中文 open-source 社群也大量用這個方法——用 GPT-4 或 Claude 的輸出 fine-tune 小模型。 法律提醒:多數商業 API 在 ToS 禁止用它們的輸出訓練競爭模型。技術本身學術上很成熟,實際部署能用哪家資料要看 provider。延伸閱讀:fine-tuning、teacher-student、model compression、SFT。

最後更新: 2026-04-29

We use cookies

Anonymous analytics help us improve the site. You can opt out anytime. Learn more