TL;DR
UniCom (Unilateral decomposition for attention Compression) is a novel weight-compression method for Vision Transformers that selectively factorizes only one side of the $Q$-$K$ and $V$-$O$ weight pairs. By adaptively choosing the least sensitive weight to decompose in each attention head, it achieves massive parameter reduction with significantly less accuracy loss than traditional SVD methods.
What Problem Does This Paper Address?
Vision Transformers (ViTs) are state-of-the-art but computationally expensive. To deploy them on edge devices, researchers often use weight decomposition—specifically Singular Value Decomposition (SVD)—to break large weight matrices into smaller, "low-rank" ones.
However, standard SVD has a major flaw in the context of Multi-Head Attention (MHA). In MHA, weights come in pairs: Query-Key ($Q$-$K$) and Value-Output ($V$-$O$). Previous methods either decomposed every matrix individually (creating inefficient sub-layers) or combined them in ways that introduced massive approximation errors. The authors identified that because these pairs interact linearly, we don't actually need to decompose both sides to achieve compression.
Methods
The authors propose UniCom, which leverages the linear characteristics of the attention mechanism.
- Unilateral Decomposition: Instead of factorizing both $W^Q$ and $W^K$, UniCom keeps one matrix intact and only decomposes the other. Because there is no non-linear activation function between $Q$ and $K$ (or $V$ and $O$), the low-rank version of one can be mathematically "absorbed" into the other, preserving more of the original signal.
- Dynamic Head-wise Selection: Not all attention heads are equally sensitive to compression. UniCom calculates a Frobenius norm-based loss for each weight matrix. It then dynamically decides, head-by-head, which side of the pair ($Q$ vs. $K$ or $V$ vs. $O$) is less sensitive to rank reduction and decomposes only that one.
- Hierarchical Rank Strategy: Rather than a uniform rank across the whole model, UniCom uses an arithmetic progression to assign different ranks across layers, recognizing that different depths of the network handle information differently.
Datasets
The researchers evaluated UniCom across a broad range of benchmarks:
- Vision Tasks: ImageNet-1K for classification using models like DINOv2, DeiT-III, ViT-Large, and Swin-Large.
- Vision-Language Tasks: Flickr30k (for EVA-CLIP retrieval) and VQAv2, GQA, and MME (for LLaVA1.5-7B multimodal evaluation).
- Ablation Studies: DeiT-Small and DeiT-Base were used to test various parameter reduction ratios.
Key Insights and Ideas
- Linearity is a Buffer: The "aha moment" is realizing that keeping one side of a linear operation intact acts as a safeguard. It allows the model to retain the high-dimensional information of the non-decomposed side while still reaping the computational benefits of the decomposed side.
- Sensitivity is Asymmetric: The paper reveals that $Q$ and $K$ (or $V$ and $O$) are not equally important. In some heads, $Q$ might be highly sensitive to rank reduction while $K$ is robust. UniCom’s ability to "pick its battles" head-wise is why it outperforms static methods.
- Robustness at the Edge: UniCom shines most in "challenging low-rank settings." While standard SVD performance often "falls off a cliff" at high compression ratios (e.g., 60% reduction), UniCom maintains a much higher performance floor.
Key Results
UniCom consistently outperformed both "Per-Weight" and "Combined" decomposition methods:
- Massive Accuracy Gains: At a 60% reduction in MHA parameters, UniCom improved Top-1 accuracy by +11.2% on DeiT-S and +6.4% on DeiT-B compared to the next best decomposition method.
- Multimodal Success: On the LLaVA1.5-7B model, UniCom improved VQAv2 performance by 1.1% over combined decomposition while maintaining the same parameter budget.
- Efficiency: The method achieves a superior trade-off between FLOPs (floating-point operations), parameter count, and accuracy, making it highly practical for real-world model pruning.
Limitations and Future Work
- Fine-tuning: The paper focuses on "training-free" compression. While the results are impressive without fine-tuning, the authors don't explore how much further performance could be recovered if a small amount of retraining was allowed.
- Hardware Kernels: While the paper reports latency improvements, the "unilateral" structure might require specific hardware kernel optimizations to reach its theoretical maximum speedup on all types of silicon.
- LLM Expansion: While tested on LLaVA (a multimodal model), the primary focus is vision. Future work could investigate if this unilateral approach holds the same benefits for pure Large Language Models (LLMs) where the $Q$-$K$ interactions are slightly different due to causal masking.
Summary updated