Skip to main content
QUICK REVIEW

[论文解读] Cabrita: closing the gap for foreign languages

Celio H. N. Larcher, Marcos Piau|arXiv (Cornell University)|Aug 23, 2023
Topic Modeling被引用 4
一句话总结

Cabrita 提出了一种低成本、高效的训练方法,通过调整分词器并对基础模型进行持续预训练,实现高性能、语言特定的大型语言模型(LLM),其性能可与更大模型相媲美——以 openCabrita 3B 为例,这是一个专为葡萄牙语优化的 3B 参数模型,在少样本任务中表现与 7B 英文模型相当,同时通过分词效率降低推理成本。

ABSTRACT

The strategy of training the model from scratch in a specific language or domain serves two essential purposes: i) enhancing performance in the particular linguistic or domain context, and ii) ensuring effective tokenization. The main limitation inherent to this approach lies in the associated cost, which can reach six to seven-digit dollar values, depending on the model size and the number of parameters involved. The main solution to overcome the cost challenge is to rely on available pre-trained models, which, despite recent advancements such as the LLaMA and LLaMA-2 models, still demonstrate inefficiency for certain specific domain problems or prove ineffective in scenarios involving conversational memory resources, given the large number of tokens required to represent text. To overcome this issue, we present a methodology named Cabrita, which, as our research demonstrates, successfully addresses the performance and efficient tokenization problem, all at an affordable cost. We believe that this methodology can be applied to any transformer-like architecture model. To validate the study, we conducted continuous pre-training exclusively using Portuguese text on a 3-billion-parameter model known as OpenLLaMA, resulting in a model named openCabrita 3B. The openCabrita 3B also features a new tokenizer that results in a significant reduction in the number of tokens required to represent the text. In our assessment, for few-shot learning tasks, we achieved similar results with this 3B model compared to a traditional continuous pre-training approach as well as to 7B models English pre-trained models.

研究动机与目标

  • 为解决从零开始训练语言特定 LLM 所带来的高成本和低效率问题,特别是针对葡萄牙语等低资源语言。
  • 通过针对特定语言优化分词,提升单语性能并降低推理成本。
  • 证明使用语言适配分词器进行持续预训练,可在仅 3B 参数的情况下实现与更大模型相当的性能。
  • 在不依赖昂贵多语言预训练的前提下,实现在低资源语言环境下的高性能模型高效部署。
  • 通过在 3B 参数模型上进行葡萄牙语微调,验证该方法在多语言基准测试中的竞争力。

提出的方法

  • 通过在大规模葡萄牙语语料上重新训练分词器,以减少子词碎片化并提升分词效率,实现对葡萄牙语的分词器适配。
  • 仅使用葡萄牙语文本对 OpenLLaMA 3B 模型进行持续预训练,保留原始模型权重,仅更新嵌入层。
  • 采用改进的训练方案,在保持原始 LLaMA 架构和超参数的同时,整合语言特定数据。
  • 引入新型分词器,减少表示葡萄牙语文本所需的 token 数量,从而降低推理成本并提升上下文长度效率。
  • 端到端训练模型,重点保持与原始模型嵌入空间的兼容性,即使分词器发生变化。
  • 使用标准 NLP 基准测试在葡萄牙语和英语中评估性能,以衡量双语能力与鲁棒性。
Figure 1: Tokenizer efficiency: the X axis show the number of tokens required to represent 7400 words of the Constitutional law of the USA in English, while the Y axis shows the same, but using a Portuguese translated version. The size of each sphere represents the vocabulary size of each tokenizer.
Figure 1: Tokenizer efficiency: the X axis show the number of tokens required to represent 7400 words of the Constitutional law of the USA in English, while the Y axis shows the same, but using a Portuguese translated version. The size of each sphere represents the vocabulary size of each tokenizer.

实验结果

研究问题

  • RQ1在葡萄牙语文本上进行持续预训练的 3B 参数语言模型,是否能达到与更大规模的 7B 英文模型相当的性能?
  • RQ2专门针对葡萄牙语优化分词器是否能显著减少表示文本所需的 token 数量,从而提升推理效率?
  • RQ3通过使用新分词器进行持续预训练训练出的语言特定模型,在单语任务中的性能在多大程度上可与多语言模型比肩或超越?
  • RQ4该模型在英语基准测试中的表现如何,是否反映出其双语能力与迁移学习潜力?
  • RQ5该方法是否可推广至其他低资源语言及不同模型规模,而无需从头开始完整训练?

主要发现

  • openCabrita 3B 模型在少样本学习任务中的表现与标准持续预训练方法及 7B 英文模型相当,尽管参数量仅为后者的二分之一。
  • 新型分词器显著减少了表示葡萄牙语文本所需的 token 数量,大幅降低推理成本并提升上下文效率。
  • 在英语基准测试中,openCabrita 3B 表现具有竞争力——在 HellaSwag 和 PiQA 等多个任务上与 GPT-J 和 LLaMA-7B 模型相当或更优,仅在准确率上略有下降。
  • 该模型在不同分词器(Open Llama 与 Cabrita)下均保持一致的输出质量,表明其对分词器适配具有鲁棒性,且性能退化极小。
  • openCabrita 3B 的性能与 Sabiá-J(一个 7B 参数的葡萄牙语模型)相当,略逊于 Sabiá-7B,证明在低资源语言环境下,3B 模型仍能取得优异表现。
  • 该方法具有可扩展性,适用于其他基础模型和语言,已有初步结果表明其可推广至更大模型及其他未充分代表的语言。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。