Training Multi-Layer Over-Parametrized Neural Network in Subquadratic Time

Zhao Song, Lichen Zhang, Ruizhe Zhang · DOI

TL;DR

This paper presents a novel algorithm for training deep, over-parameterized neural networks that achieves a subquadratic training cost per iteration with respect to the network's width. This is a significant improvement over existing methods, which are typically quadratic, and has direct implications for accelerating the fine-tuning of large language models.

What Problem Does This Paper Address?

Training large neural networks, especially deep ones, is computationally expensive. A key challenge arises from the "over-parameterization" regime, where the network's width (number of neurons per layer) is much larger than the data dimension or number of samples. In this setting, the weight matrices become very large, leading to a prohibitive cost of $O(m^2)$ per iteration for standard forward and backward passes, where $m$ is the network width. This cost is a bottleneck for practical applications like fine-tuning large language models (LLMs), where efficient training is crucial. The paper aims to reduce this per-iteration cost to be subquadratic in $m$.

Methods

The authors propose a framework that combines several advanced techniques:

  • Shifted ReLU Activation: This activation function is crucial for inducing sparsity in the intermediate layer outputs, which is key to achieving efficiency.
  • Gram-based Optimization: Instead of directly working with the large Jacobian matrix, the algorithm leverages the Gram matrix, which is smaller ($n \times n$ instead of $n \times m^2$).
  • Tensor-based Sketching: To efficiently handle the Gram matrix and its inversion, the paper employs tensor-based sketching techniques. This allows for approximate computation of the Gram matrix and its inverse in subquadratic time with respect to $m$.
  • Low-Rank Maintenance Data Structure: A lazy data structure is used to maintain and efficiently update the low-rank representation of weight changes, enabling fast matrix-vector products.
  • Gauss-Newton Method: The algorithm is based on a variant of the Gauss-Newton method, which is a second-order optimization approach.

Datasets

Not discussed in the paper. The paper focuses on theoretical analysis and algorithmic development, not empirical evaluation on specific datasets.

Key Insights and Ideas

  • Sparsity is Key: The use of shifted ReLU activation is not just a minor tweak; it's fundamental to enabling sparsity in intermediate activations, which then allows for subquadratic complexity.
  • Gram Matrix Advantage: Shifting focus from the Jacobian to the Gram matrix significantly reduces the dimensionality of the problem, making it more amenable to efficient solvers.
  • Sketching for Approximation: The paper demonstrates that approximate solutions obtained via sketching can be sufficient for achieving good convergence rates, a common theme in modern ML theory.
  • LLM Fine-tuning Connection: The authors explicitly frame their work as a step towards more efficient LLM fine-tuning, highlighting the practical relevance of their theoretical advancements.

Key Results

  • Subquadratic Iteration Cost: The algorithm achieves a per-iteration training cost of $\tilde{O}(nm^{2-\alpha})$, where $\alpha$ is the dual matrix multiplication exponent (currently around 0.32). This is a significant improvement over the $O(nm^2)$ cost of naive methods.
  • Linear Convergence: The proposed algorithm guarantees a linear convergence rate for the training loss.
  • Theoretical Foundation for LLM Fine-tuning: The work provides a theoretical framework for designing efficient data structures and algorithms for fine-tuning large pre-trained models.

Limitations and Future Work

  • Theoretical Focus: The paper is primarily theoretical, focusing on provable guarantees rather than empirical performance on real-world LLMs.
  • Shifted ReLU Specificity: The current algorithm and analysis are tailored to the shifted ReLU activation. Generalizing to other activations (sigmoid, tanh, etc.) is an open question.
  • Network Architecture: The analysis is for standard feedforward networks. Extending to recurrent neural networks (RNNs) or transformers is a future direction.
  • Nearly-Linear Time: The authors pose the question of whether a per-iteration cost closer to $O(m)$ is achievable, suggesting that a different analytical framework might be needed.
  • Dynamic Maintenance: Exploring techniques for maintaining weight changes beyond low-rank, similar to those used in other optimization problems, is suggested.

Summary updated

BibTeX
@inproceedings{song2022training,
  author = {Zhao Song and Lichen Zhang and Ruizhe Zhang},
  title = {{Training Multi-Layer Over-Parametrized Neural Network in Subquadratic Time}},
  booktitle = {ITCS},
  year = {2022},
  doi = {10.4230/lipics.itcs.2024.93},
}
Figure