arXiv:2412.07633cs.CL2024-12被引 7

用104GB荷兰语数据微调Llama,提升其对荷兰语的理解能力。

ChocoLlama: Lessons Learned From Teaching Llamas Dutch

  • 用低秩适配(LoRA)进行持续预训练,结合荷兰语专属分词器优化。
  • 在自建的ChocoLlama-Bench上,改进模型在荷兰语任务中表现显著提升。
  • 发现对最新版Llama-3只需少量后训练即可良好支持荷兰语。

大型语言模型(LLMs)在自然语言理解与生成方面表现优异,但在低资源非英语语言上因训练数据偏见而表现欠佳。本文研究将主要以英语训练的Llama-2和Llama-3适配荷兰语(全球3000万人使用)的方法。我们收集了104GB荷兰语文本(320亿个词元),采用低秩适配(LoRA)进行持续预训练,并结合先前工作提出的荷兰语后训练策略。对Llama-2,分别测试原始分词器和新构建的荷兰语专用分词器搭配嵌入层重初始化。在标准基准和新提出的ChocoLlama-Bench上评估适应后的模型(ChocoLlama-2)。结果表明,LoRA可有效用于语言适配,且分词器修改配合权重重初始化能提升性能。值得注意的是,项目期间发布的Llama-3已展现优于我们适配的Llama-2版本的荷兰语能力。因此,我们将相同方法应用于Llama-3,使用其原始分词器。尽管该方法提升了Llama-2的荷兰语表现,但在Llama-3上增益有限。这提示:对于日益强大的多语言基础模型,语言适配更应聚焦于语言特定后训练而非持续预训练。

原文摘要 · Abstract (English)

While Large Language Models (LLMs) have shown remarkable capabilities in natural language understanding and generation, their performance often lags in lower-resource, non-English languages due to biases in the training data. In this work, we explore strategies for adapting the primarily English LLMs (Llama-2 and Llama-3) to Dutch, a language spoken by 30 million people worldwide yet often underrepresented in LLM development. We collect 104GB of Dutch text ($32$B tokens) from various sources to first apply continued pretraining using low-rank adaptation (LoRA), complemented with Dutch posttraining strategies provided by prior work. For Llama-2, we consider using (i) the tokenizer of the original model, and (ii) training a new, Dutch-specific tokenizer combined with embedding reinitialization. We evaluate our adapted models, ChocoLlama-2, both on standard benchmarks and a novel Dutch benchmark, ChocoLlama-Bench. Our results demonstrate that LoRA can effectively scale for language adaptation, and that tokenizer modification with careful weight reinitialization can improve performance. Notably, Llama-3 was released during the course of this project and, upon evaluation, demonstrated superior Dutch capabilities compared to our Dutch-adapted versions of Llama-2. We hence apply the same adaptation technique to Llama-3, using its original tokenizer. While our adaptation methods enhanced Llama-2's Dutch capabilities, we found limited gains when applying the same techniques to Llama-3. This suggests that for ever improving, multilingual foundation models, language adaptation techniques may benefit more from focusing on language-specific posttraining rather than on continued pretraining. We hope this work contributes to the broader understanding of adapting LLMs to lower-resource languages, and to the development of Dutch LLMs in particular.

语言适配Llama荷兰语LoRA

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。