Open-sourced large language models (LLMs) have demonstrated remarkable efficacy in various tasks with instruction tuning. However, these models can sometimes struggle with tasks that require more specialized knowledge such as translation. One possible reason for such deficiency is that instruction tuning aims to generate fluent and coherent text that continues from a given instruction without being constrained by any task-specific requirements. Moreover, it can be more challenging for tuning smaller LLMs with lower-quality training data. To address this issue, we propose a novel framework using examples in comparison to teach LLMs to learn translation. Our approach involves presenting the model with examples of correct and incorrect translations and using a preference loss to guide the model's learning. We evaluate our method on WMT2022 test sets and show that it outperforms existing methods. Our findings offer a new perspective on fine-tuning LLMs for translation tasks and provide a promising solution for generating high-quality translations. Please refer to Github for more details: https://github.com/lemon0830/TIM.
翻译:开源大型语言模型(LLMs)在指令微调下已展现出处理各种任务时的显著效能。然而,这些模型有时会在需要更专门知识的任务(如翻译)上遇到困难。这种不足的可能原因之一是,指令微调旨在生成从给定指令延续的流畅连贯文本,而不受任何任务特定要求的约束。此外,对于使用低质量训练数据微调较小规模LLMs而言,这可能更具挑战性。为解决此问题,我们提出了一种新颖框架,利用比较示例来教导LLMs学习翻译。我们的方法包括向模型展示正确与错误翻译的示例,并使用偏好损失来引导模型的学习。我们在WMT2022测试集上评估了我们的方法,结果显示其优于现有方法。我们的发现为微调LLMs进行翻译任务提供了新视角,并为生成高质量翻译提供了一个有前景的解决方案。更多详情请参见GitHub:https://github.com/lemon0830/TIM。