arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.17171cs.CLcs.AI
收藏

使用领域专用小型语言模型进行跨领域内容生成

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

Clio AI Inc(Clio人工智能公司)

Ankit Maloo, Abhinav Garg

AI总结:

针对小型语言模型跨故事与食谱领域生成的难题,本文比较独立模型、LoRA、标准微调和知识扩展,证明仅训练额外参数并冻结原层可避免灾难性遗忘并支持多领域生成。

摘要:

使用小型语言模型生成领域专用内容面临挑战,尤其是在处理多个几乎没有重叠的不同数据集时。在本研究中,我们探索使小型语言模型能够为两个不同领域(故事(Dataset A)和食谱(Dataset B))生成连贯且相关输出的方法。我们的初步实验表明,在每个数据集上训练独立模型可取得令人满意的结果,每个模型都能在其领域内生成适当的内容。我们发现,与使用通用分词器相比,采用为每个数据集定制的自定义分词器可显著提升生成质量。尝试使用低秩适配(LoRA)或标准微调使单一模型适配两个领域并未取得显著成果,往往无法生成有意义的输出。此外,在不冻结模型现有权重的情况下进行全量微调会导致灾难性遗忘,即模型丢失先前学习的信息,仅保留来自新数据的知识。为克服这些挑战,我们采用知识扩展策略:仅使用额外参数进行训练。该方法使模型能够根据请求生成故事和食谱,在有效处理多个领域的同时不会遭受灾难性遗忘。我们的研究结果表明,带冻结层的知识扩展是小型语言模型跨不同数据集生成领域专用内容的有效方法。本工作有助于高效多领域语言模型的开发,并为在小规模架构中管理灾难性遗忘提供了洞见。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑