对比四种模型训练方法,发现省内存未必更优。
Memory Savings at What Cost? A Study of Alternatives to Backpropagation
- 比较反向传播、检查点、前向微分与零阶优化的性能差异。
- 检查点反向传播在相同内存下准确率高31.1%,快34.8%。
- 前向微分和零阶优化易不稳定,适合对速度不敏感场景。
前向模式自动微分(FmAD)和零阶(ZO)优化被越来越多地视为大语言模型(LLM)微调中无需反向传播的内存高效替代方案,但其优势通常仅与标准反向传播(BP)对比,而忽略了如激活检查点等内存高效变体。本文对BP、检查点BP、FmAD和ZO在大语言模型与视觉-语言模型训练中进行了统一的理论与实证比较,结果表明:尽管FmAD和ZO能降低激活内存,但以更高计算成本和更长收敛时间换得,导致准确率更低、训练更慢,尤其在扰动预算受限时更为明显。在多种模型上,采用检查点的反向传播优于所有FmAD和ZO变体(包括方差缩减方法),在相近内存消耗下实现最高31.1%的准确率提升、34.8%的更快收敛速度,以及3.8倍更少的计算量;同时揭示了FmAD和ZO存在不稳定的失效模式。总体而言,研究纠正了以往片面的基准评估,表明内存高效方法存在根本性权衡,忽视这些差异会导致对大模型优化的错误结论。代码已开源。
原文摘要 · Abstract (English)
Forward-mode automatic differentiation (FmAD) and zero-order (ZO) optimization are increasingly proposed as memory-efficient, backpropagation-free alternatives for large language model (LLM) fine-tuning, yet their benefits are typically evaluated only against standard backpropagation (BP), omitting memory-efficient variants such as activation checkpointing. We present a unified theoretical and empirical comparison of BP, checkpointed BP, FmAD, and ZO for LLM and vision-language model training, showing that while FmAD and ZO reduce activation memory, they trade memory for higher computational cost and longer wall-clock time to convergence, resulting in lower accuracy and slower training, especially under constrained perturbation budgets. Across models, BP with checkpointing outperforms FmAD and ZO variants, including variance-reduced methods, achieving up to 31.1% higher accuracy, 34.8% faster convergence, and 3.8x fewer computations at comparable memory usage, while also revealing instability-related failure modes in FmAD and ZO. Overall, our results correct a one-sided benchmarking narrative by showing that memory-efficient methods entail fundamentally different trade-offs, and that ignoring these distinctions has led to misleading conclusions about LLM optimization in prior work. Our source code is available at {https://github.com/Astuary/Gradient_Estimation_Methods}.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。