Table of Contents
Fetching ...

COSPADI: Compressing LLMs via Calibration-Guided Sparse Dictionary Learning

Dmitriy Shopkhoev, Denis Makhov, Magauiya Zhussip, Ammar Ali, Stamatios Lefkimmiatis

TL;DR

CoSpaDi introduces Sparse Dictionary Learning as a training-free alternative to low-rank weight compression for LLMs. It replaces the rigid shared subspace with a dictionary-based, column-sparse representation, enabling a union-of-subspaces model and activation-aware calibration using a small data calibration set. Across multiple LLMs (e.g., Llama and Qwen) and compression ratios $CR$ in the 0.2–0.5 range, CoSpaDi consistently outperforms data-aware low-rank baselines like SVD-LLM and competitive pruning approaches, while supporting cross-layer dictionary sharing and post-training quantization. This work demonstrates that structured sparse dictionary learning offers a flexible, data-aware, and practically effective path for efficient LLM deployment.

Abstract

Post-training compression of large language models (LLMs) largely relies on low-rank weight approximation, which represents each column of a weight matrix in a shared low-dimensional subspace. While this is a computationally efficient strategy, the imposed structural constraint is rigid and can lead to a noticeable model accuracy drop. In this work, we propose CoSpaDi (Compression via Sparse Dictionary Learning), a novel training-free compression framework that replaces low-rank decomposition with a more flexible structured sparse factorization in which each weight matrix is represented with a dense dictionary and a column-sparse coefficient matrix. This formulation enables a union-of-subspaces representation: different columns of the original weight matrix are approximated in distinct subspaces spanned by adaptively selected dictionary atoms, offering greater expressiveness than a single invariant basis. Crucially, CoSpaDi leverages a small calibration dataset to optimize the factorization such that the output activations of compressed projection layers closely match those of the original ones, thereby minimizing functional reconstruction error rather than mere weight approximation. This data-aware strategy preserves better model fidelity without any fine-tuning under reasonable compression ratios. Moreover, the resulting structured sparsity allows efficient sparse-dense matrix multiplication and is compatible with post-training quantization for further memory and latency gains. We evaluate CoSpaDi across multiple Llama and Qwen models under per-layer and per-group settings at 20-50\% compression ratios, demonstrating consistent superiority over state-of-the-art data-aware low-rank methods both in accuracy and perplexity. Our results establish structured sparse dictionary learning as a powerful alternative to conventional low-rank approaches for efficient LLM deployment.

COSPADI: Compressing LLMs via Calibration-Guided Sparse Dictionary Learning

TL;DR

CoSpaDi introduces Sparse Dictionary Learning as a training-free alternative to low-rank weight compression for LLMs. It replaces the rigid shared subspace with a dictionary-based, column-sparse representation, enabling a union-of-subspaces model and activation-aware calibration using a small data calibration set. Across multiple LLMs (e.g., Llama and Qwen) and compression ratios in the 0.2–0.5 range, CoSpaDi consistently outperforms data-aware low-rank baselines like SVD-LLM and competitive pruning approaches, while supporting cross-layer dictionary sharing and post-training quantization. This work demonstrates that structured sparse dictionary learning offers a flexible, data-aware, and practically effective path for efficient LLM deployment.

Abstract

Post-training compression of large language models (LLMs) largely relies on low-rank weight approximation, which represents each column of a weight matrix in a shared low-dimensional subspace. While this is a computationally efficient strategy, the imposed structural constraint is rigid and can lead to a noticeable model accuracy drop. In this work, we propose CoSpaDi (Compression via Sparse Dictionary Learning), a novel training-free compression framework that replaces low-rank decomposition with a more flexible structured sparse factorization in which each weight matrix is represented with a dense dictionary and a column-sparse coefficient matrix. This formulation enables a union-of-subspaces representation: different columns of the original weight matrix are approximated in distinct subspaces spanned by adaptively selected dictionary atoms, offering greater expressiveness than a single invariant basis. Crucially, CoSpaDi leverages a small calibration dataset to optimize the factorization such that the output activations of compressed projection layers closely match those of the original ones, thereby minimizing functional reconstruction error rather than mere weight approximation. This data-aware strategy preserves better model fidelity without any fine-tuning under reasonable compression ratios. Moreover, the resulting structured sparsity allows efficient sparse-dense matrix multiplication and is compatible with post-training quantization for further memory and latency gains. We evaluate CoSpaDi across multiple Llama and Qwen models under per-layer and per-group settings at 20-50\% compression ratios, demonstrating consistent superiority over state-of-the-art data-aware low-rank methods both in accuracy and perplexity. Our results establish structured sparse dictionary learning as a powerful alternative to conventional low-rank approaches for efficient LLM deployment.

Paper Structure

This paper contains 38 sections, 23 equations, 7 figures, 6 tables, 1 algorithm.

Figures (7)

  • Figure 1: Left side: weight factorization methods using low-rank decomposition. Low-rank approximation decomposes a matrix into two dense matrices of lower rank. Right side: proposed CoSpaDi. A dictionary of $k$ atoms and a column-sparse coefficient matrix are employed. No restrictions on size of $k$ (undercomplete : $k < d_1$, complete: $k = d_1$ or overcomplete : $k > d_1$ dictionaries are possible), while sparsity is defined by $s$ non-zero elements per column of the coefficient matrix.
  • Figure 2: Dual-axis plot showing average accuracy ( solid lines, left axis) and perplexity ( ---dashed lines, right axis, logarithmic scale with inverted direction) as functions of $\rho$ for Llama3.2-1B under three compression levels: 0.2, 0.3 and 0.4. Perplexity decreases upward due to axis inversion.
  • Figure 3: Average benchmark accuracy and WikiText perplexity for (a) LLaMA-3.2-1B and (b) Qwen-3 0.6B using SVD-LLM and CoSpaDi with respect to compression ratio.
  • Figure 4: Inference time for different projection layers of Llama3.2 1B for different compression ratios and $k/s$ ratios on A100
  • Figure 5: Inference time for different projection layers of Llama3 8B for different compression ratios and $k/s$ ratios on A100
  • ...and 2 more figures