arXiv:2409.01930cs.LG2024-09被引 4

用少量例子高效定制大模型,比传统方法更省资源。

Efficient LLM Context Distillation

  • 将任务示例内化到模型中,减少推理时依赖外部提示
  • 在小数据集上达到与上下文学习相当的准确率
  • 适合资源有限或数据稀缺场景下的模型微调

大型语言模型(LLMs)在多种任务中表现出色,但通常需针对具体应用进行定制。现有方法包括少样本微调、上下文学习和上下文蒸馏。本文聚焦上下文蒸馏,该方法通过将任务特定示例内部化,扩展模型推理时可访问的示例集。我们在Mobach数据集上对比了上下文蒸馏、上下文学习(ICL)和少样本微调(FT),评估其在极少量上下文示例下的适应效果。实验采用不同规模的OPT模型,结果表明:上下文蒸馏能有效适配模型,学生模型在域内和域外任务上的准确率与ICL相当;虽在域外泛化上优于ICL,但未达微调水平。然而,其所需数据量和计算成本显著降低,尤其适用于小数据场景。总体而言,上下文蒸馏是一种高效且有力的LLM任务定制方法。

原文摘要 · Abstract (English)

Large Language Models (LLMs) demonstrate proficiency across diverse tasks but often require targeted adaptations for specific applications. Various methods have been proposed to facilitate this adaptation, including fewshot fine-tuning, in-context learning, and context distillation. This paper specifically investigates context distillation a method that extends the utility of task-specific examples by internalizing them, thus augmenting the example set accessible for model inference. We conduct a comparative analysis of context distillation with in-context learning (ICL) and few-shot fine-tuning (FT), aiming to ascertain the efficacy of context distillation in adapting models using minimal in-context examples. Employing matched datasets from Mobach, our experiments leverage OPT models of various sizes. The results indicate that context distillation effectively adapts models, with student models attaining comparable in-domain and out-of-domain accuracies to in-context learning. Although context distillation surpasses ICL in out-of-domain generalization, it does not achieve the performance levels of FT. However, the reduced dataset size and computational demands position context distillation as a viable alternative, especially for smaller datasets. Overall, this study presents context distillation as an efficient and potent method for customizing LLMs to specific tasks.

大模型微调上下文蒸馏高效学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。