Two-Stage Clipping: Linear-Time Approximate and Exact Mixed-Norm Projections for Transformers
Organizations: I3S Laboratory, CNRS, Universite Côte d’Azur, France · Ecole des Mines, PSL, France.
Abstract
Large Language Models (LLMs) based on Transformer architectures have achieved remarkable performance across artificial intelligence tasks, but their computational cost remains a major bottleneck. Structured sparsification provides a promising approach to reducing this cost. In particular, projections can induce column-wise sparsity in model matrices, but existing proximal methods (Prox) typically require operations for matrices in , limiting their computational and energy efficiency. In this paper, we introduce Two-Stage Clipping (TSC), an efficient structured sparsification operator inspired by bilevel optimization. Rather than solving a bilevel optimization problem in the strict sense, TSC decomposes the computation into two successive stages. First, group-level quantities are projected to allocate the global sparsity budget and identify active groups. Second, the resulting values are used as group-wise clipping thresholds for the matrix coefficients. For square attention matrices (), the complexity of our TSC method is , which is linear in the number of matrix coefficients. We establish a theoretical bound on the discrepancy between TSC and the exact proximal projection and show on synthetic data that the additional Euclidean approximation cost remains small in practice. Extensive benchmarks demonstrate substantial runtime improvements over proximal baselines and validate the theoretical norm identities underlying the proposed construction.
Figures & tables
| Method | Complexity | Main operations |
|---|---|---|
| Original Bejar et al | Sorting and threshold updates | |
| Perez et al. (Algorithm 2) | Inverse ordering and heaps | |
| Proposed TSC | projection and clipping |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Architecture parameter | Value |
|---|---|
| Input image channels | 3 (RGB) |
| Training image size | |
| Patch size | |
| Number of tokens | 256 |
| Embedding dimension | 256 |
| Number of Transformer layers | 4 |
Structured Sparsity
Structured sparsity organizes zeros into meaningful groups, blocks, channels, or patterns to simplify models and computation.
See all 62 papers