Revisiting Random Weight Perturbation for Efficiently Improving Generalization
Tao Li, Qinghua Tao, Weihao Yan, Zehao Lei, Yingwen Wu, Kun Fang, Mingzhen He, Xiaolin Huang
TL;DR
This work revisits Random Weight Perturbation (RWP) as a computationally efficient alternative to Adversarial Weight Perturbation (AWP)/SAM for improving generalization in deep networks. It reveals a fundamental trade-off between generalization and convergence in RWP and introduces a mixed-RWP (m-RWP) objective that combines the Bayes loss with the original loss to stabilize training. It further proposes Adaptive Random Weight Perturbation (ARWP) to generate gradient-informed perturbations, and two consolidated methods, m-RWP and m-ARWP, that support parallel gradient updates for substantial speedups. Across CIFAR-10/100 and ImageNet, the proposed methods achieve competitive or superior generalization with much greater efficiency than SAM, with code released for public use.
Abstract
Improving the generalization ability of modern deep neural networks (DNNs) is a fundamental challenge in machine learning. Two branches of methods have been proposed to seek flat minima and improve generalization: one led by sharpness-aware minimization (SAM) minimizes the worst-case neighborhood loss through adversarial weight perturbation (AWP), and the other minimizes the expected Bayes objective with random weight perturbation (RWP). While RWP offers advantages in computation and is closely linked to AWP on a mathematical basis, its empirical performance has consistently lagged behind that of AWP. In this paper, we revisit the use of RWP for improving generalization and propose improvements from two perspectives: i) the trade-off between generalization and convergence and ii) the random perturbation generation. Through extensive experimental evaluations, we demonstrate that our enhanced RWP methods achieve greater efficiency in enhancing generalization, particularly in large-scale problems, while also offering comparable or even superior performance to SAM. The code is released at https://github.com/nblt/mARWP.
