Large language models (LLMs) like ChatGPT and GPT-4 have exhibited remarkable abilities on a wide range of natural language processing (NLP) tasks, including various machine translation abilities accomplished during chat. However, these models are only accessible through restricted APIs, which creates barriers to new research and advancements in the field. Therefore, we propose the $\mathbf{ParroT}$ framework to enhance and regulate the translation abilities during chat based on open-sourced LLMs (i.e., LLaMA-7b, BLOOMZ-7b-mt) and human written translation and evaluation data. Specifically, ParroT reformulates translation data into the instruction-following style, and introduces a "$\mathbf{Hint}$" field for incorporating extra requirements to regulate the translation process. Accordingly, we propose three instruction types for finetuning ParroT models, including translation instruction, contrastive instruction, and error-guided instruction. We can finetune either the full models or partial parameters via low rank adaptation (LoRA). Experiments on Flores subsets and WMT22 test sets suggest that translation instruction improves the translation performance of vanilla LLMs significantly while error-guided instruction can lead to a further improvement, which demonstrates the importance of learning from low-quality translations annotated by human. Meanwhile, the ParroT models can also preserve the ability on general tasks with the Alpaca multi-task dataset involved in finetuning. Please refer to our Github project for more implementation details: https://github.com/wxjiao/ParroT
翻译:大型语言模型(LLMs)如ChatGPT和GPT-4在各种自然语言处理(NLP)任务中展示出了卓越的能力,包括在聊天过程中完成的各种机器翻译任务。然而,这些模型只能通过受限制的API访问,这为新研究和领域进展带来了障碍。因此,我们提出了$\mathbf{ParroT}$框架,该框架基于开源LLMs(即LLaMA-7b、BLOOMZ-7b-mt)和人工编写的翻译和评估数据,增强和规范了聊天过程中的翻译能力。具体来说,ParroT将翻译数据重新组织成指令式文本,并引入了“$\mathbf{Hint}$”字段,用于加入额外的要求以规定翻译过程。因此,我们提出了三种指令类型,包括翻译指令、对比指令和误差引导指令,以通过低秩适应(LoRA)对ParroT模型进行全模型或部分参数微调。在Flores子集和WMT22测试集上的实验证明,翻译指令显著提高了原始LLMs的翻译性能,而误差引导指令可以进一步提高翻译性能,这表明学习人工注释的低质量翻译的重要性。同时,ParroT模型在涉及到Alpaca多任务数据集的微调中也能保持通用任务能力。更多的实现详情请参见我们的Github项目:https://github.com/wxjiao/ParroT