arXiv:2610.38598cs.LGOct 2026

Manuscript Offprint

arXiv:2610.38598

Two-Stage Clipping: Linear-Time Approximate and Exact Mixed-Norm Projections for Transformers

Michel Barlaud, Jean-Paul Marmorat

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, ℓ1,∞\ell_{1,\infty} projections can induce column-wise sparsity in model matrices, but existing proximal methods (Prox) typically require O(nmlog⁡(nm))O(nm \log(nm)) operations for matrices in Rn×m\mathbb{R}^{n \times m}, 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 (n×nn \times n), the complexity of our TSC method is O(n2)O(n^2), 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.

We derive exact mixed-norm decomposition identities for both the proximal projection and TSC operators. These identities establish an exact norm conservation and decomposition property shared by the classical Euclidean projection and the proposed two-stage clipping operator.

We further extend the two-stage framework to the ℓ1,2\ell_{1,2} structured sparsity constraint. Remarkably, in this case, we prove that the two-stage construction coincides exactly with the Euclidean projection onto the ℓ1,2\ell_{1,2} ball. Consequently, the proposed framework provides two complementary situations: for ℓ1,∞\ell_{1,\infty}, TSC is a computationally efficient approximation of the exact proximal projection with a quantitative error bound, whereas for ℓ1,2\ell_{1,2}, TSC recovers the exact Euclidean projection.

Experiments on biomedical datasets show that TSC achieves classification accuracy and sparsity levels comparable to those of the exact proximal approach when applied to Transformer attention matrices. Experiments on Image dataset show that TSC achieves better PSNR than classical Pruning methods when applied to Transformer attention matrices.

Overall, TSC provides a computationally efficient alternative to exact proximal projection for structured sparsification, combining linear complexity, theoretical guarantees, and competitive empirical performance.

1 Introduction

Modern deep neural networks achieve state-of-the-art performance across vision, language, and biomedical applications, but this success comes at the cost of massive parameterization and significant computational overhead. As models continue to scale, enforcing structured sparsity has become a central challenge for improving efficiency, interpretability, and deployability Alvarez and Salzmann [2016], Han et al. [2015], Sanh et al. [2020], Zhou et al. [2019], Nakkiran et al. [2020]. These approaches yield empirical sparsity but do not enforce explicit geometric constraints. Unstructured sparsity induced by ℓ1\ell_1 regularization often fails to translate into real computational gains on modern hardware Tibshirani [1996], Hastie et al. [2015], Duchi et al. [2008], Condat [2016].

Among structured sparsity-inducing norms, the ℓ1,∞\ell_{1,\infty} norm plays a central role Bejar et al. [2021]. It promotes column-wise sparsity by coupling entries within columns while encouraging entire groups to vanish. However, projection onto the ℓ1,∞\ell_{1,\infty} ball remains computationally expensive. State-of-the-art projection algorithms rely on proximal formulations and the Moreau identity, leading to a worst-case complexity of O(nmlog⁡(nm))\mathcal{O}(nm \log(nm)) for matrices in Rn×m\mathbb{R}^{n \times m} due to sorting operations across matrix entries. This complexity becomes prohibitive for large-scale neural networks and Transformer architectures.

The authors in Perez et al. [2024] improved the proximal algorithm for computing the exact Euclidean projection onto the ℓ1,∞\ell_{1,\infty} ball, achieving near-linear complexity O(nm+Jlog⁡(nm))O(nm + J \log(nm)), where JJ decreases as sparsity increases. However, the main drawback is that its computational complexity remains sparsity-dependent.

Recently, bilevel optimization has become popular because it provides a powerful framework for modeling problems involving nested objective functions Colson et al. [2007], Zhang et al. [2022, 2024]. Bilevel optimization (BLO) involves two levels of hierarchy (i.e., upper and lower levels), where obtaining the solution to the upper-level problem requires solving the lower-level problem.

Inspired by this bilevel framework, we propose a two-stage clipping (TSC) operator that replaces the proximal Euclidean projection.

Transformer architectures Vaswani et al. [2017] were proposed for learned image compression Liu et al. Liu et al. [2023]. Of particular relevance to the work in Zaheer et al. [2020] recently investigated sparse attention. In their work sparsity is induced by the attention architecture itself.

These works motivate the evaluation of the proposed TSC operators for Biomedical Transformer based classification and Transformer-based image compression. In our experiments, attention matrices are sparsified using TSC- ℓ1,∞\ell_{1,\infty}, TSC- ℓ1,2\ell_{1,2}, and the corresponding Euclidean proximal projection. The resulting methods are evaluated on Classification of biomedical datasets. We provide attention Sparsity-Reconstruction Trade-off on large image datasets. In particular, we report Delta-PSNR as function of the attention sparsity.

Contributions. The main contributions of this work are:

  • New two-stage clipping (TSC) operators for the ℓ1,∞\ell_{1,\infty} and ℓ1,2\ell_{1,2} structured norms.

  • A single-level convex characterization of the lower-stage clipping operator for the radius vector generated by the upper-stage ℓ1\ell_{1} projection.

  • New norm identities for the TSC ℓ1,∞\ell_{1,\infty} and ℓ1,2\ell_{1,2} structured operators.

  • A bound on the difference between the PROX and TSC approaches for ℓ1,∞\ell_{1,\infty}, together with a proof that TSC ℓ1,2\ell_{1,2} coincides exactly with the Euclidean projection.

  • Empirical validation on Transformer architectures demonstrating improved computational efficiency and structured sparsity.