Block removal for large language models through constrained binary optimization
David Jansen, Roman Rausch, David Montero, Roman Orus
TL;DR
This work tackles the combinatorial problem of transformer block pruning by casting block removal as a constrained binary optimization (CBO) mapped to an Ising model with fixed magnetization. It derives a second-order loss expansion, producing a Hessian-based objective min $\boldsymbol{x}^\top H^0 \boldsymbol{x}$ subject to $\sum_i x_i = M$, with $H^0$ approximated by $(1/m) A^\top A$ and computable once from a calibration set. The resulting low-energy configurations yield pruned models that outperform state-of-the-art block-removal methods on dense and mixture-of-experts architectures, including notable gains in MMLU at high compression and effective pruning without retraining in some MoE cases. The approach generalizes to heterogeneous architectures and offers a robust, architecture-agnostic framework for efficient LLM compression, with potential extensions such as diversity-based candidate selection and integration with other pruning strategies.
Abstract
Compressing resource-intensive large language models by removing whole transformer blocks is a seemingly simple idea, but identifying which blocks to remove constitutes an exponentially difficult combinatorial problem. In this paper, we formulate block removal as a constrained binary optimization problem that can be mapped to a physical system (Ising model), whose energies are a strong proxy for downstream model performance. This formulation enables an efficient ranking of a large number of candidate block-removal configurations and yields many high-quality, non-trivial solutions beyond consecutive regions. We demonstrate that our approach outperforms state-of-the-art block-removal methods across several benchmarks, with performance gains persisting after short retraining, and reaching improvements of up to 6 points on the MMLU benchmark. Our method requires only forward and backward passes for a few active parameters, together with an (at least approximate) Ising solver, and can be readily applied to any architecture. We illustrate this generality on the recent NVIDIA-Nemotron-3-Nano-30B-A3B-FP8 model, which exhibits a highly inhomogeneous and challenging block structure.
