arXiv:2409.17171cs.CLcs.AI2024-09

小模型跨领域生成内容,避免遗忘旧知识

Cross-Domain Content Generation with Domain-Specific Small Language Models

  • 冻结原有参数,仅新增可训练层扩展知识
  • 跨故事与菜谱域生成质量高,无灾难性遗忘
  • 定制分域词表提升生成效果,适合资源受限场景

使用小语言模型生成特定领域内容面临挑战,尤其在多个数据集重叠极少的情况下。本研究探索如何让小模型同时生成故事(数据集A)和菜谱(数据集B)两类内容。初始实验表明,分别在各数据集上训练独立模型可获得良好效果。发现为每类数据定制词表显著优于通用词表。尝试通过低秩适应(LoRA)或标准微调使单一模型适配双域,结果不佳,常无法生成有效输出;全量微调则引发灾难性遗忘,导致模型丢失原有知识。为此,我们采用知识扩展策略:仅训练新增参数,保持原模型权重冻结。该方法使模型能按需生成故事与菜谱,有效处理多领域任务且避免遗忘。结果表明,冻结层下的知识扩展是小模型实现跨域生成的有效途径,为高效多域模型构建及小规模架构中遗忘问题提供了新思路。

原文摘要 · Abstract (English)

Generating domain-specific content using small language models poses challenges, especially when dealing with multiple distinct datasets with minimal overlap. In this study, we explore methods to enable a small language model to produce coherent and relevant outputs for two different domains: stories (Dataset A) and recipes (Dataset B). Our initial experiments show that training individual models on each dataset yields satisfactory results, with each model generating appropriate content within its domain. We find that utilizing custom tokenizers tailored to each dataset significantly enhances generation quality compared to using a generic tokenizer. Attempts to adapt a single model to both domains using Low-Rank Adaptation (LoRA) or standard fine-tuning do not yield substantial results, often failing to produce meaningful outputs. Moreover, full fine-tuning without freezing the model's existing weights leads to catastrophic forgetting, where the model loses previously learned information and only retains knowledge from the new data. To overcome these challenges, we employ a knowledge expansion strategy: training only with additional parameters. This approach enables the model to generate both stories and recipes upon request, effectively handling multiple domains without suffering from catastrophic forgetting. Our findings demonstrate that knowledge expansion with frozen layers is an effective method for small language models to generate domain-specific content across distinct datasets. This work contributes to the development of efficient multi-domain language models and provides insights into managing catastrophic forgetting in small-scale architectures.

小模型跨域生成知识扩展灾难性遗忘

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