Basis Sharing: Cross-Layer Parameter Sharing for Large Language Model Compression

Jingcun Wang, Yu-Guang Chen, Ing-Chao Lin, Bing Li, Grace Li Zhang

Basis Sharing is a novel, training-free compression technique that exploits the similarity between different layers in Large Language Models (LLMs). By decomposing weight matrices into a set of shared "basis vectors" and unique layer-specific coefficients, this method achieves significantly higher compression ratios and better performance than standard Singular Value Decomposition (SVD) approaches, particularly at high levels of parameter reduction.

The Missed Opportunity in LLM Compression

Large Language Models like LLaMA and Mistral are incredibly capable but notoriously memory-hungry, making them difficult to deploy on consumer hardware or edge devices. While techniques like SVD can compress these models by approximating weight matrices with lower-rank versions, they typically treat each layer as an independent entity.

The authors identify a critical missed opportunity: cross-layer redundancy. In a deep transformer architecture, weight matrices in different layers often perform similar transformations. Standard SVD ignores this, compressing each layer in a vacuum. Previous attempts to share parameters across layers often involved "brute-force" sharing (making layers identical), which usually leads to a massive drop in model accuracy because layers still need some unique functionality to work effectively.

Introducing Basis Sharing

To strike a balance between total independence and brute-force sharing, the authors introduce Basis Sharing.

Horizontal concatenation and shared basis decomposition

The method operates through several key steps:

  1. Horizontal Concatenation: Instead of performing SVD on a single layer's weight matrix ($W^{(i)}$), the method horizontally concatenates matrices from multiple layers (e.g., $W = [W^{(1)}, W^{(2)}, \dots, W^{(n)}]$).
  2. Shared Basis Decomposition: SVD is applied to this combined matrix to derive a shared basis matrix ($B$) and a coefficient matrix ($C$). Each layer's original weights are then approximated as a linear combination of these shared bases: $W^{(i)} \approx B C^{(i)}$. This allows layers to share the "heavy lifting" of the basis vectors while maintaining their unique identities through the coefficients.
  3. Data-Aware Scaling: Following the logic of recent SVD-LLM research, the authors incorporate a scaling matrix derived from input activations. This ensures that the SVD focuses on preserving the weights that matter most to the actual data flowing through the model.
  4. Selective Sharing: Not all weight types benefit from sharing. Basis Sharing is applied to projection matrices ($W_K, W_Q, W_V$) and certain MLP weights ($W_{Up}, W_{Gate}$), but processes $W_O$ and $W_{Down}$ individually to avoid high error rates.

Key Insights: Synergy and Selectivity

Heatmap showing similarity between adjacent layers
  • Adjacent Layer Synergy: The authors found that grouping adjacent layers for basis sharing results in much lower error than grouping distant layers. Empirical heat maps of Frobenius loss confirm that the "functional role" of weights evolves gradually through the depth of the model, making neighboring layers ideal candidates for sharing a basis.
  • The "Why" of Selective Sharing: The paper provides a rigorous mathematical analysis of why some matrices fail to benefit from horizontal concatenation. For $W_{Down}$, horizontal concatenation increases the rank of the matrix too much, making the SVD approximation less efficient than compressing layers individually.
  • Retraining is Optional but Effective: While Basis Sharing is designed to be training-free, it is highly compatible with Parameter-Efficient Fine-Tuning (PEFT). When combined with LoRA, Basis Sharing maintains much better performance at 50% compression than other SVD methods.

Performance and Results

The researchers evaluated their method across a wide array of models (including LLaMA 7B-30B, Mistral-7B, and OPT-6.7B) and tasks.

  • Superior Accuracy: At a 20% to 50% compression ratio, Basis Sharing consistently outperformed state-of-the-art baselines like ASVD and SVD-LLM. For example, it reduced perplexity by up to 25% on generation tasks compared to SVD-LLM.
  • Reasoning Gains: On downstream zero-shot reasoning tasks (like OpenbookQA, WinoGrande, and HellaSwag), Basis Sharing improved accuracy by up to 4% over existing SVD-based methods under the same compression constraints.
  • Hardware Efficiency: On an NVIDIA A100 GPU, a model compressed by 50% using Basis Sharing achieved a 1.57x throughput speedup compared to the dense model, demonstrating real-world inference benefits.
  • Scalability: The performance gap between Basis Sharing and other methods actually widens as the models get larger (e.g., LLaMA-30B), suggesting the technique is particularly potent for the biggest models.

Limitations and Future Work

Currently, the method doesn't apply basis sharing to the $W_{Down}$ matrices because horizontal concatenation doesn't work for their specific dimensions. The authors suggest that vertical concatenation might be the solution here, but it requires more complex scaling math. Additionally, calculating the scaling matrix becomes more time-consuming as more layers are grouped together. Future work will explore vertical concatenation to finally "crack" the compression of the remaining weight types and push compression ratios even further.

Summary updated

BibTeX
@inproceedings{wang2025basis,
  author = {Jingcun Wang and Yu-Guang Chen and Ing-Chao Lin and Bing Li and Grace Li Zhang},
  title = {{Basis Sharing: Cross-Layer Parameter Sharing for Large Language Model Compression}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=gp32jvUquq},
}
Figure