通过自适应分层采样,让零阶优化提速近三倍
Universally Empowering Zeroth-Order Optimization via Adaptive Layer-wise Sampling
- 根据各层敏感度动态分配扰动资源,避免盲目搜索
- 在6.7B到30B模型上实现1.7至3.0倍的运行加速
- 无需额外内存,可直接提升现有零阶优化器效率
零阶优化仅依赖前向传播,是微调大语言模型的高效方法,但受限于收敛慢和估计方差高。本文分析发现,扰动生成与参数更新占训练延迟超40%。传统均匀探索策略忽视深层网络各层敏感度差异,造成计算浪费。为此提出AdaLeZO框架,将层选择建模为非平稳多臂赌博机问题,动态分配扰动预算至最敏感参数。引入基于有放回采样的逆概率加权机制,保证梯度无偏并有效降噪。在LLaMA与OPT系列(6.7B至30B参数)上的实验表明,相比当前最优方法,AdaLeZO实现1.7至3.0倍的壁钟加速。关键优势在于作为即插即用模块,不增加内存开销即可提升现有零阶优化器效率。
原文摘要 · Abstract (English)
Zeroth-Order optimization presents a promising memory-efficient paradigm for fine-tuning Large Language Models by relying solely on forward passes. However, its practical adoption is severely constrained by slow wall-clock convergence and high estimation variance. In this work, we dissect the runtime characteristics of ZO algorithms and identify a critical system bottleneck where the generation of perturbations and parameter updates accounts for over 40% of the training latency. We argue that the standard uniform exploration strategy is fundamentally flawed as it fails to account for the heterogeneous sensitivity of layers in deep networks, resulting in computationally wasteful blind searches. To address this structural mismatch, we propose AdaLeZO, an Adaptive Layer-wise ZO optimization framework. By formulating the layer selection process as a non-stationary Multi-Armed Bandit problem, AdaLeZO dynamically allocates the limited perturbation budget to the most sensitive parameters. We further introduce an Inverse Probability Weighting mechanism based on sampling with replacement, which guarantees unbiased gradient estimation while effectively acting as a temporal denoiser to reduce variance. Extensive experiments on LLaMA and OPT models ranging from 6.7B to 30B parameters demonstrate that AdaLeZO achieves 1.7x to 3.0x wall-clock acceleration compared to state-of-the-art methods. Crucially, AdaLeZO functions as a universal plug-and-play module that seamlessly enhances the efficiency of existing ZO optimizers without incurring additional memory overhead.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。