[Paper Review] Sparse Linear Networks with a Fixed Butterfly Structure: Theory and Practice
This paper proposes replacing dense linear layers in neural networks with a structured, sparse butterfly network architecture that reduces parameters from quadratic to nearly linear scaling while preserving model accuracy. Empirical results show faster training and inference, and theoretical analysis confirms the method maintains optimization stability despite added depth.
A butterfly network consists of logarithmically many layers, each with a linear number of non-zero weights (pre-specified). The fast Johnson-Lindenstrauss transform (FJLT) can be represented as a butterfly network followed by a projection onto a random subset of the coordinates. Moreover, a random matrix based on FJLT with high probability approximates the action of any matrix on a vector. Motivated by these facts, we propose to replace a dense linear layer in any neural network by an architecture based on the butterfly network. The proposed architecture significantly improves upon the quadratic number of weights required in a standard dense layer to nearly linear with little compromise in expressibility of the resulting operator. In a collection of wide variety of experiments, including supervised prediction on both the NLP and vision data, we show that this not only produces results that match and at times outperform existing well-known architectures, but it also offers faster training and prediction in deployment. To understand the optimization problems posed by neural networks with a butterfly network, we also study the optimization landscape of the encoder-decoder network, where the encoder is replaced by a butterfly network followed by a dense linear layer in smaller dimension. Theoretical result presented in the paper explains why the training speed and outcome are not compromised by our proposed approach.
Motivation & Objective
- To reduce the number of parameters in dense linear layers from O(n²) to nearly O(n log n) while maintaining model expressivity.
- To improve training and inference speed in deep neural networks without sacrificing performance.
- To analyze the optimization landscape of neural networks using butterfly-structured layers, especially in encoder-decoder settings.
- To demonstrate the effectiveness of learned truncated butterfly networks in low-rank matrix approximation and supervised learning.
- To explore whether the logarithmic depth of butterfly networks hinders gradient descent convergence.
Proposed method
- Replace standard dense linear layers with a composition: J₁ᵀW'J₂, where J₁ and J₂ are truncated butterfly networks and W' is a small dense layer.
- Use the Fast Johnson-Lindenstrauss Transform (FJLT) as a theoretical foundation, represented as a butterfly network followed by random projection.
- Structure the butterfly network as a layered graph with O(log n) depth, where each layer has O(n) non-zero weights organized in disjoint 2x2 gadgets.
- Train the weights of the small dense layer W' end-to-end using standard backpropagation, while keeping the butterfly structure fixed.
- Apply random permutations to input rows and normalize matrices to balance singular values across datasets in low-rank approximation experiments.
- Compare learned butterfly matrices against sparse learned matrices (as in Indyk et al., 2019), random sparse matrices (Clarkson & Woodruff, 2009), and Gaussian matrices in low-rank approximation tasks.
Experimental results
Research questions
- RQ1Can a sparse, structured butterfly network with fixed topology replace a dense linear layer while maintaining model accuracy?
- RQ2Does the logarithmic depth of the butterfly network architecture impair the convergence of gradient descent in deep networks?
- RQ3How does the performance of a learned butterfly sketch compare to learned sparse or random sparse sketches in low-rank matrix approximation?
- RQ4To what extent does the butterfly architecture reduce parameter count without compromising expressivity in vision and NLP tasks?
- RQ5Can the butterfly structure be effectively used in supervised learning for matrix approximation, as in Indyk et al. (2019), with improved approximation error?
Key findings
- The proposed butterfly-based architecture achieves test errors comparable to or better than standard dense layers across multiple NLP and vision benchmarks.
- For low-rank matrix approximation, the learned butterfly sketch achieved lower test error than both sparse learned matrices (N=1) and dense learned matrices (N=20) at ℓ=20, k=10.
- Training with the butterfly architecture was significantly faster, and the model surpassed sparse baselines in test error within just a few training iterations.
- Theoretical analysis shows that the optimization landscape of the encoder-decoder network with a butterfly encoder remains stable, supporting convergence despite the structured sparsity.
- The method reduces parameter count from O(n²) to nearly O(n log n), enabling faster inference and training with minimal accuracy loss.
- Empirical results suggest that replacing multiple dense layers with butterfly structures may be viable, though this was not fully explored in the current study.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.