Learnable Permutation for Structured Sparsity on Transformer Models
Zekai Li, Ji Liu, Guanchen Li, Yixing Xu, Ziqiong Liu, Xuanwu Yin, Dong Li, Emad Barsoum
TL;DR
This work tackles the challenge of achieving hardware-friendly structured sparsity in large Transformer models by addressing the inefficiency of traditional permutation methods. It introduces an end-to-end learnable permutation framework comprising a permutation cost predictor, a differentiable bipartite matching solver based on Sinkhorn iterations, and an end-to-end sparsity loss with knowledge distillation to align pruned networks with dense teachers. The method is validated across vision, language, and multimodal transformers, achieving state-of-the-art permutation performance under $N:M$ sparsity with limited accuracy loss and fast convergence. Its practical impact lies in enabling scalable, hardware-efficient pruning for large models without expensive weight updates or ad hoc heuristics, while remaining compatible with existing pruning pipelines like Wanda.
Abstract
Structured sparsity has emerged as a popular model pruning technique, widely adopted in various architectures, including CNNs, Transformer models, and especially large language models (LLMs) in recent years. A promising direction to further improve post-pruning performance is weight permutation, which reorders model weights into patterns more amenable to pruning. However, the exponential growth of the permutation search space with the scale of Transformer architectures forces most methods to rely on greedy or heuristic algorithms, limiting the effectiveness of reordering. In this work, we propose a novel end-to-end learnable permutation framework. Our method introduces a learnable permutation cost matrix to quantify the cost of swapping any two input channels of a given weight matrix, a differentiable bipartite matching solver to obtain the optimal binary permutation matrix given a cost matrix, and a sparsity optimization loss function to directly optimize the permutation operator. We extensively validate our approach on vision and language Transformers, demonstrating that our method achieves state-of-the-art permutation results for structured sparsity.
