Skip to main content
QUICK REVIEW

[论文解读] Large Language Diffusion Models

Shen Nie, Fengqi Zhu|ArXiv.org|Feb 14, 2025
Topic ModelingComputer Science被引用 4
一句话总结

LLaDA 引入了从零开始训练的扩散式大语言模型,在 8B 参数下达到与自回归基线相竞争的性能,并在上下文学习、指令遵循以及反向推理方面表现出色。

ABSTRACT

The capabilities of large language models (LLMs) are widely regarded as relying on autoregressive models (ARMs). We challenge this notion by introducing LLaDA, a diffusion model trained from scratch under the pre-training and supervised fine-tuning (SFT) paradigm. LLaDA employs a forward data masking process and a reverse generation process, parameterized by a Transformer to predict masked tokens. It provides a principled generative approach for probabilistic inference by optimizing a likelihood lower bound. Across extensive benchmarks on general tasks, math, code, and so on, LLaDA demonstrates strong scalability and performs comparably to our self-constructed ARM baselines. Remarkably, LLaDA 8B is competitive with strong LLMs like LLaMA3 8B in in-context learning and, after SFT, exhibits impressive instruction-following abilities in case studies such as multi-turn dialogue. Moreover, LLaDA addresses the reversal curse, surpassing GPT-4o in a reversal poem completion task. Our findings show the promise of diffusion models for language modeling at scale and challenge the common assumption that core LLM capabilities discussed above inherently depend on ARMs. Project page and codes: https://ml-gsai.github.io/LLaDA-demo/.

研究动机与目标

  • 通过提出扩散式替代方案(LLaDA)挑战自回归模型是大语言模型唯一可行路径的观点。
  • 从零开始扩展至 8B 参数,并在 2.3 万亿个 token 上进行预训练,使用 4.5 百万对进行有监督微调。
  • 在语言理解、数学、代码和中文任务上评估 LLaDA,重点关注上下文学习、指令遵循和反向推理。
  • 证明扩散模型在大语言模型设定中也能实现双向依赖关系和基于似然的生成原则。

提出的方法

  • 定义一个掩码扩散模型(MDM),其中前向掩码过程逐步隐藏 token,反向掩码预测器进行恢复。
  • 使用对 masked tokens 的交叉熵损失(式 (eq. 3))来优化下界对数似然,并利用式 (eq. 4) 的界限进行原理性训练。
  • 在 2.3T token 上对基于 Transformer 的掩码预测器进行预训练(8B 和 1B 版本),掩码比率 t~U[0,1],序列长度 4096。
  • 通过对 4.5M 条指令遵循对进行有监督微调(SFT),优化 p_theta(r0|p0)(式 (eq. 5))。
  • 通过离散化的反向扩散过程进行推理,采用灵活的重新掩码策略(低置信度重新掩码与半自回归重新掩码);通过稳定的似然样式形式评估(式 (eq. 6))。
  • 将 LLaDA 与自回归基线和开放大语言模型在 15 项任务上进行对比,覆盖通用、数学、代码和中文领域;分析扩展性至 10^23 FLOPs。

实验结果

研究问题

  • RQ1自回归范式是否是实现核心大语言模型能力的必要条件,还是扩散式生成建模就足以?
  • RQ2LLaDA 是否能扩展到 8B 参数并在多任务上达到与强 ARM 基于的大语言模型相当的性能?
  • RQ3上下文学习、指令遵循和反向推理能力在扩散式大语言模型中如何体现?
  • RQ4在扩散式大语言模型中,哪些采样/重新掩码策略在效率和样本质量之间达到最佳平衡?

主要发现

  • LLaDA 8B 在自建 ARM 基线的六项任务中,在最高达到 10^23 FLOPs 的计算预算下表现具有竞争力。
  • LLaDA 8B 超越 LLaMA2 7B,在几乎所有零样本/少样本任务中与 LLaMA3 8B 并驾齐驱,在数学和中文方面具有优势。
  • 经后 SFT(微调)后,LLaDA 展现出强大的指令遵循能力,在多轮对话案例中得到体现。
  • 在反向推理方面,LLaDA 能有效缓解反向诅咒,并在反向诗歌完成任务上优于 GPT-4o。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。