当nanochat遇上DiLoCo会发生什么?
What happens when nanochat meets DiLoCo?
AI总结:
针对分布式环境中通信受限的LLM训练权衡问题,以开源nanochat为基线实现DiLoCo算法,通过多本地步骤减少通信量,发现其预训练收敛稳定但下游任务性能下降,揭示异步更新导致的不可逆表示漂移问题并提供实现分支。
摘要:
尽管大语言模型(LLM)训练通常采用集中式方式,依赖高带宽互连和大计算预算,但新兴方法针对分布式环境中通信受限的训练。这种转变带来的模型权衡仍未得到充分探索,我们的目标是研究这些权衡。我们使用开源项目nanochat作为受控基线,它是一个紧凑的8K行全栈类ChatGPT实现,包含分词、预训练、微调及服务功能。我们将DiLoCo算法实现为nanochat训练循环的轻量级包装器,每个工作节点在与外部优化器同步前执行多个本地步骤,有效将通信量降低多个数量级。我们将这种内外层训练与标准数据并行(DDP)设置进行比较。由于nanochat体积小且可检查,它支持受控的管道适配,并允许与传统集中式基线直接比较。DiLoCo在预训练中实现了稳定收敛和有竞争力的损失,但在中期训练和监督微调(SFT)后,MMLU、GSM8K和HumanEval得分较差。我们发现,使用DiLoCo预训练权重并通过DDP运行中期和后期训练无法恢复性能,这揭示了异步更新导致的不可逆表示漂移会损害下游对齐。我们在GitHub上提供该实现作为nanochat的官方分支。
英文摘要:
Although LLM training is typically centralized with high-bandwidth interconnects and large compute budgets, emerging methods target communication-constrained training in distributed environments. The model trade-offs introduced by this shift remain underexplored, and our goal is to study them. We use the open-source nanochat project, a compact 8K-line full-stack ChatGPT-like implementation containing tokenization, pretraining, fine-tuning, and serving, as a controlled baseline. We implement the DiLoCo algorithm as a lightweight wrapper over nanochat's training loop, performing multiple local steps per worker before synchronization with an outer optimizer, effectively reducing communication by orders of magnitude. This inner-outer training is compared against a standard data-parallel (DDP) setup. Because nanochat is small and inspectable, it enables controlled pipeline adaptations and allows direct comparison with the conventional centralized baseline. DiLoCo achieves stable convergence and competitive loss in pretraining but yields worse MMLU, GSM8K, and HumanEval scores after mid-training and SFT. We discover that using DiLoCo-pretrained weights and running mid- and post-training with DDP fails to recover performance, revealing irreversible representation drift from asynchronous updates that impairs downstream alignment. We provide this implementation as an official fork of nanochat on GitHub.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。