Fine-tuning Large Language Models for Adaptive Machine Translation

📄 arXiv: 2312.12740v1 📥 PDF

作者: Yasmin Moslem, Rejwanul Haque, Andy Way

分类: cs.CL, cs.IR

发布日期: 2023-12-20


💡 一句话要点

微调Mistral 7B以实现自适应机器翻译,提升医疗领域翻译质量。

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 机器翻译 大型语言模型 微调 自适应翻译 医疗领域

📋 核心要点

  1. 现有机器翻译模型难以在推理时快速适应特定领域,尤其是在资源有限的情况下。
  2. 通过结合零样本和单样本提示,微调通用LLM Mistral 7B,使其具备实时自适应机器翻译能力。
  3. 实验表明,微调后的Mistral 7B在医疗领域的翻译质量显著提升,甚至超越了ChatGPT和NLLB 3.3B。

📝 摘要(中文)

本文介绍了对通用大型语言模型(LLM)Mistral 7B进行微调,以实现自适应机器翻译(MT)的结果。微调过程包括在医疗领域内使用零样本和单样本翻译提示的组合。主要目标是增强Mistral 7B的实时自适应MT能力,使其能够在推理时将翻译适应到所需的领域。结果表明,特别是对于西班牙语到英语的MT,微调后的模型效果显著,在零样本和单样本翻译场景中都表现出质量的提高,超过了Mistral 7B的基线性能。值得注意的是,微调后的Mistral在零样本翻译中优于ChatGPT“gpt-3.5-turbo”,同时实现了可比的单样本翻译质量。此外,微调后的Mistral的零样本翻译与NLLB 3.3B的性能相匹配,其单样本翻译质量超过了NLLB 3.3B。这些发现强调了微调像Mistral 7B这样高效的LLM的重要性,以产生与像NLLB 3.3B这样面向任务的模型相当的高质量零样本翻译。此外,单样本翻译中实现的自适应增益与ChatGPT等商业LLM的增益相当。我们的实验表明,通过包含零样本和单样本提示的相对较小的数据集(20,000个片段),微调显著增强了Mistral的上下文学习能力,特别是对于实时自适应MT。

🔬 方法详解

问题定义:论文旨在解决机器翻译模型在特定领域,特别是医疗领域的自适应问题。现有方法,如通用LLM,在零样本或少样本场景下,无法达到领域专用模型的效果。同时,领域专用模型缺乏通用性,需要大量标注数据进行训练,成本较高。

核心思路:论文的核心思路是利用通用LLM强大的语言建模能力,通过少量领域数据进行微调,使其快速适应特定领域的翻译任务。通过结合零样本和单样本提示,引导模型学习领域知识,提高翻译质量。

技术框架:整体流程包括:1) 选择预训练的通用LLM(Mistral 7B);2) 构建包含零样本和单样本翻译提示的医疗领域数据集;3) 使用该数据集对Mistral 7B进行微调;4) 在测试集上评估微调后模型的翻译质量。主要模块包括数据预处理、模型微调和评估。

关键创新:关键创新在于利用少量混合提示数据,有效提升了通用LLM在特定领域的自适应翻译能力。与传统方法相比,该方法无需大量标注数据,降低了训练成本。同时,微调后的模型在零样本和单样本场景下均表现出优异的性能,证明了该方法的有效性。

关键设计:论文使用了包含20,000个片段的医疗领域数据集进行微调。数据集包含零样本和单样本翻译提示,比例未知。微调过程中,采用标准的语言模型训练目标,优化模型参数。具体参数设置和损失函数细节未知。

📊 实验亮点

实验结果表明,微调后的Mistral 7B在西班牙语到英语的医疗领域翻译中,零样本翻译性能优于ChatGPT“gpt-3.5-turbo”,单样本翻译性能与ChatGPT相当。此外,微调后的Mistral 7B的零样本翻译与NLLB 3.3B的性能相匹配,单样本翻译质量超过了NLLB 3.3B。这些结果证明了微调通用LLM在特定领域翻译任务中的有效性。

🎯 应用场景

该研究成果可应用于医疗、法律、金融等专业领域的机器翻译,尤其是在需要快速部署和低资源场景下。通过微调通用LLM,可以构建高质量的领域自适应翻译系统,提高专业领域的信息获取效率,促进跨语言交流与合作。未来可进一步探索更高效的微调方法和更广泛的应用场景。

📄 摘要(原文)

This paper presents the outcomes of fine-tuning Mistral 7B, a general-purpose large language model (LLM), for adaptive machine translation (MT). The fine-tuning process involves utilising a combination of zero-shot and one-shot translation prompts within the medical domain. The primary objective is to enhance real-time adaptive MT capabilities of Mistral 7B, enabling it to adapt translations to the required domain at inference time. The results, particularly for Spanish-to-English MT, showcase the efficacy of the fine-tuned model, demonstrating quality improvements in both zero-shot and one-shot translation scenarios, surpassing Mistral 7B's baseline performance. Notably, the fine-tuned Mistral outperforms ChatGPT "gpt-3.5-turbo" in zero-shot translation while achieving comparable one-shot translation quality. Moreover, the zero-shot translation of the fine-tuned Mistral matches NLLB 3.3B's performance, and its one-shot translation quality surpasses that of NLLB 3.3B. These findings emphasise the significance of fine-tuning efficient LLMs like Mistral 7B to yield high-quality zero-shot translations comparable to task-oriented models like NLLB 3.3B. Additionally, the adaptive gains achieved in one-shot translation are comparable to those of commercial LLMs such as ChatGPT. Our experiments demonstrate that, with a relatively small dataset of 20,000 segments that incorporate a mix of zero-shot and one-shot prompts, fine-tuning significantly enhances Mistral's in-context learning ability, especially for real-time adaptive MT.