TL;DR
This paper introduces Curvature-aware Graph Coloring (CGC), a novel parameter sharing technique for neural network compression. By analyzing the curvature of the loss landscape, CGC intelligently groups layers to share parameters along "flat" directions, significantly reducing model size and boosting inference speed with minimal accuracy loss, outperforming existing methods.
What Problem Does This Paper Address?
Deep neural networks are notoriously large, making deployment on resource-constrained devices challenging. Parameter sharing is a popular compression technique that reduces model size by reusing weights across different layers. However, existing methods often rely on simple heuristics (like sharing only adjacent layers) or SVD-based approaches that treat layers independently. These methods can lead to significant accuracy degradation, especially at high compression ratios, because they fail to account for the geometric properties of the model's loss landscape. Specifically, they don't consider how parameter sharing might introduce perturbations that align with sensitive, high-curvature directions, leading to performance drops.
Methods
The core innovation is Curvature-aware Graph Coloring (CGC). The authors frame parameter sharing as a graph coloring problem:
- Graph Representation: Each layer of the neural network is treated as a node in a graph.
- Colors as Bases: Each "color" represents a shared low-rank basis.
- Curvature-Aware Coloring: The key is how layers are assigned colors (bases). CGC uses Hessian analysis to understand the local geometry of each layer's loss landscape. It identifies the "flat" (low-curvature) directions, which are less sensitive to parameter changes. The algorithm then assigns layers to shared bases such that the resulting parameter sharing perturbations are aligned with these flat directions. This is achieved by minimizing the projection of the perturbation onto the high-curvature subspace of the Hessian.
- Low-Rank Decomposition: Shared bases are represented by low-rank factor matrices (U, V), and each layer uses a layer-specific coefficient matrix (Se) to reconstruct its weights. This allows for flexibility and avoids forcing identical weights across layers.
Datasets
The paper evaluates CGC on several datasets for different tasks:
- Language Modeling: WikiText-2, Penn Treebank (PTB), and C4.
- Reasoning Tasks: OpenbookQA, WinoGrande, HellaSwag, PIQA, MathQA, ARC-easy, and ARC-challenge.
- Vision Tasks: ImageNet (for training/evaluation) and CIFAR-10/100 (for transfer learning).
Key Insights and Ideas
- Loss Landscape Geometry is Crucial: The paper strongly argues that understanding the curvature of the loss landscape is paramount for effective parameter sharing. Simply reducing rank or using heuristics isn't enough; perturbations must be guided.
- "Flat" Directions are Key: Aligning parameter sharing perturbations with low-curvature (flat) directions of the loss landscape is the secret sauce for maintaining accuracy. This is analogous to "sliding" along the loss surface rather than "jumping" across it.
- Global, Non-Adjacent Sharing: By framing it as graph coloring, CGC breaks free from the limitations of only sharing adjacent layers. It can discover and exploit redundancies across the entire network, leading to more efficient compression.
- Symmetry as a Guide: The graph coloring framework implicitly captures structural symmetries, providing a principled way to reduce redundancy.
- Curvature-Awareness Outperforms Heuristics: The experimental results consistently show CGC outperforming heuristic-based sharing methods, especially at higher compression ratios.
Key Results
- LLaMA-7B: Achieved 28%-50% parameter compression with Top-1 accuracy loss no more than 0.01% (or even accuracy gains) and over 60% higher inference throughput compared to baselines.
- Swin Transformer: Similar performance gains were observed, with minimal accuracy drop.
- Scalability: CGC scales effectively to larger models (LLaMA-7B, 13B, 30B) and diverse architectures (OPT, Qwen, Mistral), outperforming existing methods.
- Efficiency: Achieved significantly lower perplexity than other methods at extreme compression ratios (70-80%).
- Inference Speed: Reduced latency by up to 45% and increased throughput by up to 70% on real hardware.
Limitations and Future Work
- Hessian Computation: The method relies on Hessian analysis, which can be computationally expensive. While the authors present efficient computation methods (Hessian-vector products, Lanczos algorithm) and argue it's an offline cost, it's still a factor.
- Trust-Region Constraint: The amplitude factor $\beta$ controls the trust-region radius. While experiments show its importance, finding the optimal $\beta$ might require tuning.
- Future Work: The paper suggests that the geometric insights and framework can be extended to other compression paradigms beyond parameter sharing. The ability to discover compact sharing structures without sacrificing model quality is highlighted as a key advantage for future research.
Summary updated