TL;DR
Fine-grained Parameter Sharing (FiPS) is a novel compression framework that slims down Transformer models by sharing neuron bases across different layers. By combining Singular Value Decomposition (SVD) with sparse projection matrices, FiPS compresses Vision Transformers (ViTs) and Large Language Models (LLMs) by up to 57% and 20% respectively, outperforming traditional low-rank compression methods while remaining fully orthogonal to quantization techniques.
What Problem Does This Paper Address?
While Large Language Models (LLMs) and Vision Transformers (ViTs) dominate modern AI, their massive parameter counts make deployment on resource-constrained edge devices (like mobile phones) incredibly challenging. Common compression techniques like quantization and pruning are widely used, but cross-layer parameter sharing remains largely underexplored for Transformers.
Previous attempts at parameter sharing typically reused entire Transformer blocks or raw, unmodified weights across layers, which severely tanked model accuracy. The authors identify a missed opportunity: Transformer Multi-Layer Perceptrons (MLPs) have identically shaped layers across depth, making them perfect candidates for a more granular, joint factorization approach that shares underlying neuron representations without sacrificing model capacity.
Methods
FiPS introduces a unified framework that treats weight matrices across a group of Transformer blocks as a collective tensor, compressing them via a three-stage pipeline:
- Shared Initialization: FiPS concatenates the MLP weight matrices from a group of consecutive layers along their longer axis (the neuron dimension). It then applies a truncated SVD to factorize this giant combined matrix into a single shared basis ($U$) and multiple layer-specific projection matrices ($V_i$).
- Local Error Minimization: Using a small calibration dataset, FiPS jointly optimizes $U$ and $V_i$ to minimize the $\ell_2$ reconstruction error of the layer activations. Crucially, it applies Gradual Magnitude Pruning (GMP) during this stage to enforce a high level of sparsity on the projection matrices ($V_i$).
- Global Error Minimization (Optional): Finally, the entire model can be fine-tuned end-to-end using dynamic sparse training (like RigL) to recover any remaining performance drops at aggressive compression ratios.
Datasets
The authors evaluated FiPS across both vision and language domains using standard benchmarks:
- Vision Transformers (DeiT-B, Swin-L): Calibrated and evaluated on ImageNet-1k. Transfer learning capabilities were tested on CIFAR-100, Flowers102, Oxford-III-Pets, and iNaturalist 2019.
- Large Language Models (Llama-7B, Llama-3.1-8B, Gemma-2-2B): Calibrated using tokens from SlimPajamas. Evaluation was conducted on WikiText-2 and C4 for perplexity, alongside 8 downstream tasks from the LM-Evaluation-Harness (including HellaSwag, PIQA, GSM8K, and TruthfulQA).
Key Insights and Ideas
- Sparsity is the Secret Sauce: Simply factorizing shared weights results in a low-rank bottleneck that hurts accuracy. However, by enforcing sparsity on the projection matrix $V$, the rank of the shared basis $U$ can actually grow larger than the model's hidden dimension, creating an "overcomplete dictionary" of neurons. This allows flexible, fine-grained neuron recombination across layers.
- Adjacent Layers Share Best: By analyzing pairwise layer sharing, the authors found that adjacent layers exhibit the lowest reconstruction error increase when forced to share a basis, validating the strategy of grouping consecutive blocks together.
- Adaptive Parameter Allocation: Global pruning naturally shifts parameters to where they are needed most. FiPS automatically allocates more non-zero weights to deeper layers of the network, which inherently demand higher representational capacity.
Key Results
- Vision Transformers: FiPS compresses DeiT-B and Swin-L by up to 33% with less than 1% top-1 accuracy loss on ImageNet-1k without any end-to-end fine-tuning. With fine-tuning, it achieves up to 57% compression while maintaining baseline accuracy.
- Large Language Models: At 20% compression, FiPS achieves significantly lower perplexity on WikiText-2 and C4 compared to state-of-the-art SVD baselines (like ASVD and SVD-LLM V2) for Llama-7B and Llama-3.1-8B.
- Synergy with Quantization: When combined with Quantization-Aware Training (QAT), a 3-bit quantized version of Gemma-2-2B compressed with FiPS achieved a much lower perplexity (35.43) than a standard 2-bit QAT model (41.86), despite both delivering the exact same $8\times$ total storage compression.
- Hardware Speedups: On an NVIDIA A4000 GPU, a 2:4 structured sparse implementation of FiPS yielded a 1.31× inference speedup and reduced peak VRAM allocation to $0.79\times$ of the original baseline requirement.
Limitations and Future Work
While FiPS delivers impressive compression for MLP modules (which make up the bulk of Transformer parameters), it currently leaves the attention layers uncompressed. The authors note that attention projection matrices share a similar block-repeated structure, making them a prime target for future extensions of the framework. Additionally, developing specialized hardware kernels that keep the shared basis $U$ resident in fast GPU SRAM cache could unlock even greater practical latency reductions during inference.
Summary updated