GradInit: Learning to Initialize Neural Networks for Stable and Efficient Training

Chen Zhu, Renkun Ni, Zheng Xu, Kezhi Kong, W. Ronny Huang +1 more
2/16/2021
76 citations
cs.LGcs.CLcs.CV

Official code: zhuchen03/gradinit (138 stars, Python, last commit 2022-05-24).

Abstract

Innovations in neural architectures have fostered significant breakthroughs in language modeling and computer vision. Unfortunately, novel architectures often result in challenging hyper-parameter choices and training instability if the network parameters are not properly initialized.

Show full abstract

A number of architecture-specific initialization schemes have been proposed, but these schemes are not always portable to new architectures. This paper presents GradInit, an automated and architecture agnostic method for initializing neural networks. GradInit is based on a simple heuristic; the norm of each network layer is adjusted so that a single step of SGD or Adam with prescribed hyperparameters results in the smallest possible loss value. This adjustment is done by introducing a scalar multiplier variable in front of each parameter block, and then optimizing these variables using a simple numerical scheme. GradInit accelerates the convergence and test performance of many convolutional architectures, both with or without skip connections, and even without normalization layers. It also improves the stability of the original Transformer architecture for machine translation, enabling training it without learning rate warmup using either Adam or SGD under a wide range of learning rates and momentum coefficients. Code is available at https://github.com/zhuchen03/gradinit.

View on arXivView PDF

Code Implementations(1)

zhuchen03/gradinitOfficial100%

Learning to Initialize Neural Networks for Stable and Efficient Training

13812Python, ShellFeb 17, 20214 years ago

Similar Papers

Cite this paper

@article{zhu2021gradinit,
  title  = {GradInit: Learning to Initialize Neural Networks for Stable and Efficient Training},
  author = {Chen Zhu and Renkun Ni and Zheng Xu and Kezhi Kong and W. Ronny Huang and Tom Goldstein},
  year   = {2021},
  eprint = {2102.08098},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2102.08098}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2102.08098.svg)](https://codeofpaper.com/paper/2102.08098)

Discussion