ChatPaper.aiChatPaper

대규모 언어 모델의 지식 증류

Knowledge Distillation of Large Language Models

June 14, 2023
저자: Yuxian Gu, Li Dong, Furu Wei, Minlie Huang
cs.AI

초록

지식 증류(Knowledge Distillation, KD)는 대규모 언어 모델(LLMs)의 높은 계산 요구량을 줄이기 위한 유망한 기술입니다. 그러나 기존의 KD 방법들은 주로 화이트박스 분류 모델에 적용되거나 ChatGPT와 같은 블랙박스 모델 API를 모방하도록 소형 모델을 훈련시키는 데 사용되었습니다. 화이트박스 생성형 LLMs로부터 효과적으로 지식을 증류하는 방법은 아직 충분히 탐구되지 않았으며, LLMs의 발전과 함께 그 중요성이 점점 더 커지고 있습니다. 본 연구에서는 생성형 대형 언어 모델로부터 더 작은 언어 모델을 증류하는 MiniLLM을 제안합니다. 먼저, 표준 KD 접근법에서 사용되는 순방향 쿨백-라이블러 발산(Kullback-Leibler Divergence, KLD) 목표를 역방향 KLD로 대체하여, 학생 모델이 교사 분포의 낮은 확률 영역을 과대평가하는 것을 방지합니다. 이는 생성형 언어 모델에 더 적합합니다. 그런 다음, 이 목표를 학습하기 위한 효과적인 최적화 접근법을 도출합니다. 지시 따르기 설정에서의 광범위한 실험 결과, MiniLLM 모델은 더 정확한 응답을 생성하며 전반적인 품질이 높고, 노출 편향이 낮으며, 보정이 더 잘 되고, 긴 텍스트 생성 성능이 더 뛰어납니다. 또한, 우리의 방법은 120M에서 13B 파라미터까지 다양한 모델 패밀리에 대해 확장 가능합니다. 코드와 모델 체크포인트는 https://aka.ms/MiniLLM에서 공개할 예정입니다.
English
Knowledge Distillation (KD) is a promising technique for reducing the high computational demand of large language models (LLMs). However, previous KD methods are primarily applied to white-box classification models or training small models to imitate black-box model APIs like ChatGPT. How to effectively distill the knowledge from white-box generative LLMs is still under-explored, which becomes more and more important with the prosperity of LLMs. In this work, we propose MiniLLM that distills smaller language models from generative larger language models. We first replace the forward Kullback-Leibler divergence (KLD) objective in the standard KD approaches with reverse KLD, which is more suitable for KD on generative language models, to prevent the student model from overestimating the low-probability regions of the teacher distribution. Then, we derive an effective optimization approach to learn this objective. Extensive experiments in the instruction-following setting show that the MiniLLM models generate more precise responses with the higher overall quality, lower exposure bias, better calibration, and higher long-text generation performance. Our method is also scalable for different model families with 120M to 13B parameters. We will release our code and model checkpoints at https://aka.ms/MiniLLM.
PDF200December 15, 2024