Introduction
One-shot semi-structured pruning must remove half of a pretrained language model's weights without retraining while preserving useful behavior and the speed benefit of the 2:4 pattern. Activation-aware magnitude rules such as Wanda, second-order one-shot reconstruction such as SparseGPT, and optimization-oriented methods such as ALPS each make a different choice about which weights to remove and how to compensate for them. The central question is how to use the calibration geometry both to choose the mask and to set the weights that remain.
We propose POBS, pairwise Optimal Brain Surgeon pruning with alternating sparse and low-rank reconstruction. For every group of four input channels, the sparse core removes the pair with the smallest local second-order cost. A low-rank branch then captures residual structure that the fixed pattern cannot represent, while the core itself remains 2:4. We also refine the residual at block level, but keep only finite candidates that improve a held-out calibration loss.
Method
Pairwise second-order mask
For a linear layer with weight matrix and calibration second moment , we add diagonal damping before forming . In each four-column group we enumerate the six possible pairs . If , , and is the corresponding two-by-two block of the inverse moment, the pair cost is
The implementation floors this determinant at its positive numerical clamp.
The pair with minimum cost is masked. We then apply the corresponding OBS compensation to later columns, so each group is selected using the current residual rather than the original weights. Dead channels with zero diagonal moment are assigned a stable diagonal and zeroed before the inverse is formed.
def _pair(self, W, H):
mask, C = self._pair_base(W, H)
return mask, self._masked_cg(W, H, mask, C)
def _pair_base(self, W, H):
W = W.clone()
H = H.clone()
m, n = W.shape
dev = W.device
diag = torch.arange(n, device=dev)
dead = torch.diag(H) == 0
H[dead, dead] = 1
W[:, dead] = 0
H[diag, diag] += self.percdamp * torch.diag(H).mean()
Hinv = torch.cholesky_inverse(torch.linalg.cholesky(H))
mask = torch.zeros_like(W, dtype=torch.bool)
pairs = torch.combinations(torch.arange(4, device=dev), r=2)
for i1 in range(0, n, self.blocksize):
i2 = min(i1 + self.blocksize, n)
ng = (i2 - i1) // 4
Wg = W[:, i1:i2].reshape(m, ng, 4)
ids = torch.arange(i2 - i1, device=dev).reshape(ng, 4)
Hg = Hinv[ids.unsqueeze(2), ids.unsqueeze(1)]
a = Wg[:, :, pairs[:, 0]]
b = Wg[:, :, pairs[:, 1]]
aa = Hg[:, pairs[:, 0], pairs[:, 0]]
ab = Hg[:, pairs[:, 0], pairs[:, 1]]
bb = Hg[:, pairs[:, 1], pairs[:, 1]]
det = (aa * bb - ab.square()).clamp_min(1e-20)
cost = (bb.unsqueeze(0) * a.square() - 2 * ab.unsqueeze(0) * a * b
+ aa.unsqueeze(0) * b.square()) / det.unsqueeze(0)
best = torch.argmin(cost, dim=2)
mg = torch.zeros(m, ng, 4, dtype=torch.bool, device=dev)
mg.scatter_(2, pairs[best], True)
mask1 = mg.reshape(m, i2 - i1)
mask[:, i1:i2] = mask1 k = (i2 - i1) // 2
indices = torch.arange(i2 - i1, device=dev).unsqueeze(0).expand(m, -1)
indices = indices[mask1].reshape(m, k)
removed = W[:, i1:i2][mask1].reshape(m, k)
R = Hinv[indices].transpose(1, 2)
batch = torch.arange(m, device=dev).view(-1, 1).expand(-1, k)
Rhat = R[batch, indices]
lambdas = torch.linalg.solve(Rhat, removed).unsqueeze(2)
W[:, i1:] -= torch.bmm(R, lambdas).squeeze(2)
W[:, i1:i2].masked_fill_(mask1, 0)
if i2 < n:
Hinv = torch.cholesky_inverse(torch.linalg.cholesky(H[i2:, i2:]))
return mask, WMasked core refinement
Let be the compensated sparse core and its mask. We solve a damped, diagonally scaled system for the surviving entries only. With
we run ten masked conjugate-gradient steps and accept only when it is finite and . The mask is never changed by this step, so the 2:4 constraint remains exact.
Alternating low-rank residual
The residual is whitened with a Cholesky factor of the damped moment, and a randomized power iteration extracts a rank-bounded approximation. The implementation uses rank at most , oversampling , and four power iterations. The installed layer stores a sparse core and factors and computes
The core alone is subject to the 2:4 mask; is a compact correction beside it. We apply five further pairwise core updates, alternating each with residual construction, and retain the iterate with the lowest Hessian-weighted reconstruction error.
def _lowrank(self, R, H, seed):
m, n = R.shape
r = min(self.rank, min(m, n) - 1)
if r <= 0:
return None
dev = R.device
H = self.shrink * H + (1.0 - self.shrink) * torch.diag(torch.diag(H))
H = ((H + H.T) * 0.5).clone()
diag = torch.arange(n, device=dev)
mean = torch.diag(H).mean().clamp_min(1e-20)
H[diag, diag] = H[diag, diag].clamp_min(mean * 1e-8)
damp = 1e-4 * mean
while True:
Hd = H.clone()
Hd[diag, diag] += damp
L, info = torch.linalg.cholesky_ex(Hd)
if int(info) == 0:
break
damp *= 10
A = R @ L
k = min(r + self.oversample, min(m, n))
gen = torch.Generator(device=dev).manual_seed(seed)
omega = torch.randn(n, k, generator=gen, device=dev)
Q = torch.linalg.qr(A @ omega, mode="reduced").Q
for _ in range(self.power):
Q = torch.linalg.qr(A @ (A.T @ Q), mode="reduced").Q
B = Q.T @ A
Ub = torch.linalg.svd(B, full_matrices=False)[0]
U = (Q @ Ub[:, :r]).contiguous()
V = (U.T @ R).contiguous()
return U, Vclass ResidualLinear(torch.nn.Module):
def __init__(self, linear, core, U, V):
super().__init__()
self.register_buffer("core", core.detach().clone())
self.U = torch.nn.Parameter(U.detach().clone())
self.V = torch.nn.Parameter(V.detach().clone())
residual = (U @ V).detach().clone()
self.register_buffer("initial_residual", residual)
self.register_buffer("weight_norm",
(core + residual).square().mean().clamp_min(1e-20))
if linear.bias is None:
self.bias = None
else:
self.register_buffer("bias", linear.bias.detach().float().clone())
def forward(self, x):
return torch.nn.functional.linear(x, self.core + self.U @ self.V, self.bias)Conservative block refinement
After the per-layer construction, we replace the block's editable linears with residual layers and optimize only and . The loss is normalized block-output reconstruction error plus a penalty on displacement from the initial residual. Every few updates we evaluate a held-out calibration subset, retain the best factor state, and stop after repeated non-improvement. Factor tensors are rounded to the layer's dtype during this check, so selection reflects the stored representation.
opt = torch.optim.Adam(params, lr=self.block_lr)
with torch.enable_grad():
for step in range(self.block_steps):
j = train_indices[(7 * step + ctx.index) % len(train_indices)]
x = ctx.inputs[j].unsqueeze(0).to(dev).float()
target = targets[j].to(dev)
opt.zero_grad()
out = block(x, **kw)[0]
loss = ((out - target).square().mean()
/ target.square().mean().clamp_min(1e-20))
penalty = torch.zeros((), device=dev)
for name in ctx.names:
module = block.get_submodule(name)
delta = module.U @ module.V - module.initial_residual
penalty = penalty + delta.square().mean() / module.weight_norm
loss = loss + self.block_penalty * penalty / len(ctx.names)
loss.backward()
opt.step()
if (step + 1) % self.eval_every == 0:
value = self._validation_loss(block, ctx.inputs, targets,
val_indices, kw, dev)
if value < best_loss:
best_loss = value
best_params = {
n: (block.get_submodule(n).U.detach().to(
self._dtypes[n]).float().clone(),
block.get_submodule(n).V.detach().to(
self._dtypes[n]).float().clone())
for n in ctx.names}
stale = 0
else:
stale += 1
if stale >= 2:
break
opt.zero_grad(set_to_none=True)
if not hasattr(self, "block_history"):
self.block_history = []
self.block_history.append((before, best_loss))
for name in ctx.names:
results[name]["lowrank"] = best_params[name]The result is one algorithmic rule for every setting: pairwise second-order masking, survivor compensation, alternating rank-bounded residual reconstruction, and conservative residual refinement. The residual adds dense work, so the method explicitly trades some retained speed for reconstruction quality.
Results
| Method | ① | ② | ③ | ④ | ⑤ | ⑥ | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| WikiText-2 perplexity ↓ | C4 perplexity ↓ | 2:4 speedup kept ↑ | Zero-shot accuracy, 7 tasks ↑ | 2:4 speedup kept ↑ | MMLU accuracy ↑ | GSM8K accuracy ↑ | 2:4 speedup kept ↑ | WikiText-2 perplexity ↓ | C4 perplexity ↓ | 2:4 speedup kept ↑ | Zero-shot accuracy, 7 tasks ↑ | 2:4 speedup kept ↑ | MMLU accuracy ↑ | GSM8K accuracy ↑ | 2:4 speedup kept ↑ | |
| Kimi K3.1 Pro | 10.37 | 14.86 | 0.747 | 57.64 | 0.747 | 50.95 | 13.19 | 0.747 | 9.326 | 14.60 | 0.764 | 60.33 | 0.764 | 63.70 | 45.79 | 0.764 |
| Wanda | 23.16 | 34.70 | 1.000 | 46.48 | 1.000 | 29.03 | 2.426 | 1.000 | 13.81 | 21.52 | 1.000 | 54.48 | 1.000 | 54.09 | 24.49 | 1.000 |
| RIA | 22.37 | 32.89 | 1.000 | 47.04 | 1.000 | 28.66 | 2.047 | 1.000 | 13.31 | 21.51 | 1.000 | 53.83 | 1.000 | 56.32 | 24.18 | 1.000 |
| SparseGPT | 16.11 | 22.23 | 1.000 | 52.41 | 1.000 | 36.21 | 4.700 | 1.000 | 11.93 | 17.87 | 1.000 | 55.28 | 1.000 | 53.72 | 35.48 | 1.000 |
| ALPS | 14.43 | 19.27 | 1.000 | 53.10 | 1.000 | 39.18 | 5.989 | 1.000 | 10.90 | 16.29 | 1.000 | 57.81 | 1.000 | 55.02 | 31.77 | 1.000 |
| SparseSwaps | 20.02 | 27.84 | 1.000 | 50.19 | 1.000 | 29.65 | 3.260 | 1.000 | 14.77 | 21.84 | 1.000 | 55.12 | 1.000 | 50.05 | 28.05 | 1.000 |
| Thanos | 16.11 | 22.47 | 1.000 | 51.24 | 1.000 | 31.63 | 4.094 | 1.000 | 12.26 | 18.22 | 1.000 | 55.98 | 1.000 | 52.73 | 29.04 | 1.000 |
| Wisp | 21.34 | 31.14 | 1.000 | 47.27 | 1.000 | 30.23 | 2.350 | 1.000 | 13.61 | 20.95 | 1.000 | 52.95 | 1.000 | 54.71 | 22.59 | 1.000 |
| Whisper | 14.31 | 19.32 | 1.000 | 54.13 | 1.000 | 36.11 | 3.942 | 1.000 | 11.44 | 17.21 | 1.000 | 55.67 | 1.000 | 54.11 | 33.51 | 1.000 |
| GBLM-Pruner | 22.58 | 34.38 | 1.000 | 47.07 | 1.000 | 28.17 | 2.350 | 1.000 | 13.82 | 21.58 | 1.000 | 54.77 | 1.000 | 54.04 | 23.20 | 1.000 |
| Pruner-Zero | 22.87 | 34.99 | 1.000 | 47.53 | 1.000 | 28.06 | 1.820 | 1.000 | 12.98 | 20.74 | 1.000 | 54.85 | 1.000 | 53.37 | 16.38 | 1.000 |
| Wanda++ RGS | 24.09 | 35.84 | 1.000 | 46.66 | 1.000 | 28.78 | 2.123 | 1.000 | 14.52 | 23.13 | 1.000 | 54.70 | 1.000 | 53.06 | 26.08 | 1.000 |
| FISTAPruner | 16.00 | 20.74 | 1.000 | 50.45 | 1.000 | 35.93 | 5.914 | 1.000 | 12.15 | 17.70 | 1.000 | 54.44 | 1.000 | 50.82 | 26.38 | 1.000 |
| ARMOR | 11.31 | 17.13 | 0.751 | 56.03 | 0.751 | 46.40 | 7.582 | 0.751 | 9.956 | 15.88 | 0.816 | 60.36 | 0.816 | 66.46 | 47.76 | 0.816 |
| NoWag-P | 23.36 | 34.99 | 1.000 | 47.84 | 1.000 | 27.55 | 1.971 | 1.000 | 13.89 | 22.16 | 1.000 | 53.78 | 1.000 | 54.21 | 25.63 | 1.000 |
| SparseLLM | 15.68 | 21.60 | 1.000 | 52.19 | 1.000 | 34.17 | 4.246 | 1.000 | 12.40 | 18.24 | 1.000 | 54.84 | 1.000 | 51.92 | 34.19 | 1.000 |
| Wanda++ | 15.50 | 22.51 | 1.000 | 49.34 | 1.000 | 34.42 | 3.412 | 1.000 | 13.92 | 21.63 | 1.000 | 53.87 | 1.000 | 53.93 | 25.78 | 1.000 |
- ① Llama-3.1-8B · 2:4 · WikiText-2 + C4 perplexity
- ② Llama-3.1-8B · 2:4 · 7-task zero-shot
- ③ Llama-3.1-8B · 2:4 · MMLU + GSM8K
- ④ Qwen3-8B-Base · 2:4 · WikiText-2 + C4 perplexity
- ⑤ Qwen3-8B-Base · 2:4 · 7-task zero-shot
- ⑥ Qwen3-8B-Base · 2:4 · MMLU + GSM8K
On Llama-3.1-8B · 2:4 · WikiText-2 + C4 perplexity, lower perplexity is better: our 10.37 is ahead of the best published baseline, ARMOR \[[11](#ref-11)\], whose value is 11.31 (the corresponding published value is 11.31). C4 perplexity shows the same direction: our 14.86 is ahead of ARMOR \[[11](#ref-11)\] at 17.13, with ARMOR at 17.13. Retained speed is higher-is-better: our 0.747 is behind Wanda \[[1](#ref-1)\] at 1.000, including Wanda's published 1.000.
On Llama-3.1-8B · 2:4 · 7-task zero-shot, higher zero-shot accuracy is better: our 57.64 is ahead of ARMOR's 56.03, the best baseline ARMOR \[[11](#ref-11)\] at 56.03. Retained speed is lower than the best published value: our 0.747 trails Wanda \[[1](#ref-1)\] at 1.000, with Wanda at 1.000.
On Llama-3.1-8B · 2:4 · MMLU + GSM8K, higher MMLU accuracy is better: our 50.95 is ahead of ARMOR's 46.40, the best baseline ARMOR \[[11](#ref-11)\] at 46.40. Higher GSM8K accuracy is also better: our 13.19 is ahead of ARMOR \[[11](#ref-11)\] at 7.582, whose published ARMOR value is 7.582. Our retained speed 0.747 is behind the best value 1.000 from Wanda \[[1](#ref-1)\] (Wanda reports 1.000).
On Qwen3-8B · 2:4 · WikiText-2 + C4 perplexity, our lower perplexity 9.326 is ahead of the best baseline ARMOR \[[11](#ref-11)\] at 9.956, with ARMOR at 9.956. Our C4 perplexity 14.60 is likewise ahead of ARMOR \[[11](#ref-11)\] at 15.88 (ARMOR: 15.88). Higher retained speed reverses the comparison: our 0.764 is behind Wanda \[[1](#ref-1)\] at 1.000, including Wanda's 1.000.
On Qwen3-8B · 2:4 · 7-task zero-shot, higher zero-shot accuracy is better, and our 60.33 is behind the best published baseline, ARMOR's 60.36 or 60.36 from ARMOR \[[11](#ref-11)\]. Retained speed is also behind: our 0.764 trails Wanda \[[1](#ref-1)\] at 1.000, while Wanda reports 1.000.
On Qwen3-8B · 2:4 · MMLU + GSM8K, higher MMLU accuracy is better, but our 63.70 is behind ARMOR's 66.46, the best value 66.46 from ARMOR \[[11](#ref-11)\]. Higher GSM8K accuracy has the same outcome: our 45.79 is behind ARMOR \[[11](#ref-11)\] at 47.76, with ARMOR at 47.76. Retained speed 0.764 is behind the best published value 1.000 from Wanda \[[1](#ref-1)\], including Wanda's 1.000.
How we got here
We began with sparse-plus-low-rank reconstruction under the calibration second moment, then made the mask itself second-order by enumerating pairwise OBS costs. A naive low/high column pairing did not help, so we dropped it. We compared full and diagonal covariance for the residual and kept the full moment because it was the more robust choice across model families. Output transforms, dense-stream cross-moment targets, global rank allocation, schedules deeper than five rounds, and extra power iterations were also tested and rejected when they were costly, unstable, or failed to generalize.
Residual refinement required the most caution. Unregularized block updates and validation-selected depths could improve local reconstruction while hurting a larger model, and dtype-aware variants added cost without a reliable quality gain. We therefore kept residual-only updates with a displacement penalty, dtype-rounded validation, best-state restoration, and early stopping. A later cross-fitted acceptance rule improved some small checks but regressed a larger model, so we restored the trust-regularized configuration described above. This account follows the run's reasoning trace and the final submitted code.
Limitations
The low-rank branch is dense work beside the sparse core, and the measured retained-speed metric is behind the best published baseline in every setting. The quality comparison is also mixed: POBS is ahead on the reported quality metrics in Llama-3.1-8B · 2:4 · WikiText-2 + C4 perplexity, Llama-3.1-8B · 2:4 · 7-task zero-shot, Llama-3.1-8B · 2:4 · MMLU + GSM8K and Qwen3-8B · 2:4 · WikiText-2 + C4 perplexity, but it trails the best baseline on Qwen3-8B · 2:4 · 7-task zero-shot zero-shot accuracy and on both reported accuracies in Qwen3-8B · 2:4 · MMLU + GSM8K. These results do not establish Pareto dominance.
The method depends on calibration moments that may not represent deployment inputs. Full-moment inverses and randomized low-rank factors can be numerically delicate, especially for dead or poorly conditioned channels, although damping and finite-candidate checks address the cases encountered by the algorithm. The per-layer Hessian objective also ignores interactions between later layers, while a rank cap limits the residual's ability to recover structured error. Finally, no retraining is used, so a model whose useful directions are absent from calibration data cannot be repaired by this method.
References
- Mingjie Sun, Zhuang Liu, Anna Bair et al. (2024). A Simple and Effective Pruning Approach for Large Language Models. ICLR.
- Elias Frantar, Dan Alistarh (2023). SparseGPT: Massive Language Models Can Be Accurately Pruned in One-Shot. ICML.
- Xiang Meng, Kayhan Behdin, Haoyue Wang et al. (2024). ALPS: Improved Optimization for Highly Sparse One-Shot Pruning for Large Language Models. NeurIPS.
- Max Zimmer, Christophe Roux, Moritz Wagner et al. (2025). SparseSwaps: Tractable LLM Pruning Mask Refinement at Scale.
- Ivan Ilin, Peter Richtarik (2025). Thanos: A Block-wise Pruning Algorithm for Efficient Large Language Model Compression.
- Linghao Kong, Inimai Subramanian, Micah Adler et al. (2026). The Sparsity Whisperer. NeurIPS.
- Rocktim Jyoti Das, Mukul Ranjan, Mingjie Sun et al. (2023). Beyond Size: How Gradients Shape Pruning Decisions in Large Language Models.
- Peijie Dong, Lujun Li, Zhenheng Tang et al. (2024). Pruner-Zero: Evolving Symbolic Pruning Metric from scratch for Large Language Models. ICML.
- Yifan Yang, Kai Zhen, Bhavana Ganesh et al. (2025). Wanda++: Pruning Large Language Models via Regional Gradients. ACL.
- Pengxiang Zhao, Hanyu Hu, Ping Li et al. (2024). A Convex-optimization-based Layer-wise Post-training Pruner for Large Language Models.
- Lawrence Liu, Alexander Liu, Mengdi Wang et al. (2026). ARMOR: High-Performance Semi-Structured Pruning via Adaptive Matrix Factorization. ICLR.
- Lawrence Liu, Inesh Chakrabarti, Yixiao Li et al. (2025). NoWag: A Unified Framework for Shape Preserving Compression of Large Language Models.
- Guangji Bai, Yijiang Li, Chen Ling et al. (2024). SparseLLM: Towards Global Pruning for Pre-trained Language Models. NeurIPS.