arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.22529cs.CL
收藏

Pearl-Chat:基于JAX与Flax NNX从头构建的原生卢干达语语言模型

Pearl-Chat: Engineering a native Luganda language model from first principles in JAX and Flax NNX

AI for Uganda Initiative(乌干达人工智能计划);ISBAT University(ISBAT大学)

Wesley Kambale, Roland Sankara

AI总结:

本研究针对低资源卢干达语,基于JAX与Flax NNX构建了参数约850万的Pearl-Chat模型,采用定制BPE分词器与两阶段训练,在基准测试中取得优异性能并开源相关资源。

摘要:

自回归基础语言模型主要面向高资源印欧语系语言,对资源匮乏的非洲语言造成计算和形态学层面的不利影响。通用多语言分词器在黏着班图语上的词 fertility(词对应分词数)通常超过3.2个分词/词,会降低上下文效率并增加延迟。我们提出Pearl-Chat,这是一个参数规模为8,473,122(约850万)的因果解码器仅Transformer模型,专为卢干达语(Oluganda,ISO 639-2代码:lg)设计,该语言是东非使用人数超1000万的低资源尼日尔-刚果语系班图语。Pearl-Chat基于JAX和Flax NNX从头构建,采用显式函数状态分解、通过Google Grain实现的确定性可恢复数据流,以及使用指定工具的SPMD张量并行性。我们引入字节级字节对编码(BPE)子词分词器,该分词器在精选卢干达语语料库上从零训练得到,词汇表大小V=8192,实现了4.88字符/分词的压缩率和1.60分词/词的fertility,相比LLaMA-3(128K)和Gemma(256K)实现了两倍的压缩提升。模型采用两阶段课程训练:第一阶段在包含平行文本、圣经文本、百科全书文本和新闻文本的59,501个序列上进行预训练,第二阶段在510个对话上进行指令微调,采用仅助手损失掩码。经过4000次优化步骤,验证交叉熵损失从9.4695(困惑度:12,958.98)单调下降至0.1818(困惑度:1.20),下降了9.2877纳特。在三层保留的诊断基准测试中,Pearl-Chat取得0.9792的ROUGE-L值和0.9405的BLEU值,同时保持班图语名词类的一致一致性。我们提供Python服务器发送事件(SSE)流式运行时,并开源所有权重、分词器和代码。

英文摘要:

Autoregressive foundation language models predominantly target high-resource Indo-European languages, imposing computational and morphological penalties on under-represented African languages. Generic multilingual tokenizers routinely exceed fertility rates of 3.2 tokens per word on agglutinative Bantu languages, degrading context efficiency and inflating latency. We present Pearl-Chat, an 8,473,122-parameter ($\sim$8.5M) causal decoder-only transformer engineered for Luganda (Oluganda, ISO 639-2: lg), a low-resource Niger-Congo Bantu language spoken by over 10 million people in East Africa. Built from first mathematical principles in JAX and Flax NNX, Pearl-Chat uses explicit functional state decomposition (nnx.split and nnx.merge), deterministic resumable data streaming via Google Grain, and SPMD tensor parallelism using jax.sharding.Mesh. We introduce a byte-level byte-pair encoding (BPE) subword tokenizer trained from scratch on curated Luganda corpora ($V = 8,192$), achieving 4.88 characters per token compression and 1.60 tokens per word fertility, a two-fold compression improvement over LLaMA-3 (128K) and Gemma (256K). The model is trained with a two-stage curriculum: Stage 1 pre-training on 59,501 sequences across parallel, biblical, encyclopedic, and journalistic corpora, and Stage 2 instruction fine-tuning on 510 dialogues with assistant-only loss masking. Across 4,000 optimization steps, validation cross-entropy loss drops monotonically from 9.4695 (perplexity: 12,958.98) to 0.1818 (perplexity: 1.20), a decrease of 9.2877 nats. On a three-tier held-out diagnostic benchmark, Pearl-Chat achieves 0.9792 ROUGE-L and 0.9405 BLEU while maintaining concordial agreement across Bantu noun classes. We provide a Python Server-Sent Events (SSE) streaming runtime and open-source all weights, tokenizers, and code.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑