The growing interest in Large Language Models (LLMs) for specialized applications has revealed a significant challenge: when tailored to specific domains, LLMs tend to experience catastrophic forgetting, compromising their general capabilities and leading to a suboptimal user experience. Additionally, crafting a versatile model for multiple domains simultaneously often results in a decline in overall performance due to confusion between domains. In response to these issues, we present the RolE Prompting Guided Multi-Domain Adaptation (REGA) strategy. This novel approach effectively manages multi-domain LLM adaptation through three key components: 1) Self-Distillation constructs and replays general-domain exemplars to alleviate catastrophic forgetting. 2) Role Prompting assigns a central prompt to the general domain and a unique role prompt to each specific domain to minimize inter-domain confusion during training. 3) Role Integration reuses and integrates a small portion of domain-specific data to the general-domain data, which are trained under the guidance of the central prompt. The central prompt is used for a streamlined inference process, removing the necessity to switch prompts for different domains. Empirical results demonstrate that REGA effectively alleviates catastrophic forgetting and inter-domain confusion. This leads to improved domain-specific performance compared to standard fine-tuned models, while still preserving robust general capabilities.
翻译:随着大语言模型在专业应用领域的兴趣日益增长,一个显著挑战浮现:当针对特定领域进行定制时,大语言模型容易遭受灾难性遗忘,损害其通用能力并导致不佳的用户体验。此外,为同时处理多个领域构建通用模型往往因领域间混淆而导致整体性能下降。针对这些问题,我们提出了角色提示引导的多领域自适应策略(REGA)。这一创新方法通过三个关键组件有效管理多领域大语言模型自适应:1)自蒸馏构建并回放通用领域样本以缓解灾难性遗忘;2)角色提示为通用领域分配中心提示,并为每个特定领域分配独特的角色提示,以最小化训练过程中的领域间混淆;3)角色整合将少量领域特定数据复用到通用领域数据中,并在中心提示指导下进行训练。中心提示用于简化推理过程,无需针对不同领域切换提示。实验结果表明,REGA有效缓解了灾难性遗忘和领域间混淆问题。相较于标准微调模型,该方法在提升领域特定性能的同时,仍保持了强大的通用能力。