Unlocking Structured Pruning for Reasoning Language Models via Attention-Preserving MLP Trimming
Organizations: Seoul National University, Republic of Korea · New York University, United States · University of Southern California, United States
Abstract
Structured pruning reduces LLM inference costs by removing model components to produce smaller dense models. However, existing methods can cause reasoning performance to collapse on long-form reasoning tasks such as AIME. We propose LayerTrim, a training-free structured pruning method that identifies redundant decoder layers and selectively trims their MLP features while preserving attention and decoder depth. LayerTrim is the first training-free structured pruning method designed to preserve long-form reasoning without gradients or recovery training. Across three reasoning language models and five benchmarks, LayerTrim outperforms existing structured pruning methods in most evaluated settings, improving average accuracy by up to 21.4 percentage points over RESP. On Qwen3-14B, LayerTrim achieves 1.24 faster prefill and 19.7% lower peak GPU memory than the dense model, while better preserving reasoning ability. It also achieves the shortest average generation length among evaluated pruned models, while retaining the highest average accuracy. These results demonstrate that LayerTrim improves reasoning efficiency through both structural compression and reduced token generation.
Figures & tables
| Variant | AIME25 | GPQA-D | Avg. |
| Pruning targets | |||
| Attention removal | 0.0 0.0 | 0.7 0.3 | 0.4 |
| Attention trimming | 0.0 0.0 | 1.3 0.3 | 0.7 |
| MLP removal | 0.0 0.0 | 17.5 1.1 | 8.8 |
| Joint trimming (25% attn.) | 43.3 3.3 | 53.2 4.2 | 48.3 |
| MLP trimming | 62.2 8.4 | 55.4 2.4 | 58.8 |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Question: An electron is in the spin state . Find , given . Options: A. ; B. ; C. ; D. . | |
|---|---|
| Method | Original trace excerpts and qualitative observations |
| Dense 2,880 tokens Terminated | […] Let psi = (3i/5, 4/5). Then sigma_y = [[0, -i],[i, 0]]. We compute sigma_y |psi> = [[0, -i],[i, 0]] * (3i/5, 4/5)^T = (0*(3i/5) + -i*(4/5), i*(3i/5) + 0*(4/5)) = (-4i/5, i*(3i)/5). But note: i*(3i) = 3*(i^2) = -3. So second component becomes -3/5. So sigma_y |psi> = (-4i/5, -3/5). […] Then expectation value of S_y is (hbar/2)*(-24/25) = -12 hbar/25. […] Observation: Normalization and the matrix product remain consistent through the answer. |
| ShortGPT 32,256 tokens Limit hit | […] The correct answer is letter letter option letter letter letter letter answer letter letter letter letter letter letter letter letter letter letter letter letter letter letter letter letter letter letter letter letter le […] negative polarity positive polarity negative polarity positive polarity negative polarity positive polarity negative polarity positive polarity negative polarity positive polarity […] Observation: Answer-format and polarity loops replace the scientific calculation. |
| LaCo 32,256 tokens Limit hit | itness_duperge hungerCreatorsgenerated Witness_waycup pred Counter brushingonga cagescreatorBush.IM 回Pot collectivelyWitnessm […] vaeonusdfa832.readlineLossUGCidalDigest HOLDERacdmumu recModifiedDate falsevale Peiadotent Circuit escapeurf Vitalgist Authority CHANNELembr.qualCas447 multiline Highestline tet RingsanaxIF […] Observation: Fragmented tokens continue to the cap without an interpretable calculation. |
| GRASP 32,256 tokens Limit hit | […] I should answer answer. Now the letter letter is answer. It is " answer letter. The letter letter. So letter is " letter. But answer. So letter letter: letter. answer letter. So letter answer letter. Actually letter letter: answer. letter. […] letter letter letter letter. letter letter letter. So letter. So letter. So letter. So letter. So letter. So l […] Observation: Answer-letter language repeats without advancing the derivation. |
| FLAP 32,256 tokens Limit hit | […] (-3i)(-4i) + (4)(-3) = 12i^2 - 12 = 12*(-1) -12 = -24. […] lambda^2 - (i * (-i)) = lambda^2 - (-1) = lambda^2 + 1 = 0, so eigenvalues are i. […] So the answer is -12hbar/25. That is option A. Therefore, answer A is the correct answer. I’ll now provide answer A. Thus answer A: -12hbar/25. Thus answer: Option A. I’ll now answer in the requested format: \boxed{A} is the answer. But wait, but the computed result is -12/25. But the options are in terms of hbar. So the answer is -12hbar/25. I must check the reasoning: […] Observation: The correct option appears, but reconsideration continues to the cap; the saved scorer marks this response correct. |
| Question: Complete has_close_elements(numbers, threshold) : return whether any two input elements differ by less than the threshold. The prompt example ([1.0, 2.0, 3.0], 0.5) requires False . | |
|---|---|
| Method | Original trace excerpts and qualitative observations |
| Dense 1,348 tokens Terminated | Reasoning: […] So for each i in range(len(numbers)), and for each j in range(i+1, len(numbers)), compare numbers[i] and numbers[j]. Final response: […] def has_close_elements(numbers: List[float], threshold: float) -> bool: for i in range(len(numbers)): for j in range(i + 1, len(numbers)): if abs(numbers[i] - numbers[j]) < threshold: return True return False […] Observation: Distinct-index comparisons are preserved in the final function. |
| ShortGPT 337 tokens Terminated | Reasoning: […] The function should check if any two numbers in the list are within the given threshold. The function should be written in a Python block with the proper indentation. Final response: […] The function uses the ‘*‘ operator to check if any two numbers in the list are within the given threshold. The function returns ‘True‘ if any two numbers are within the given threshold, and ‘False‘ otherwise. The function is as described, and the code is correct. Observation: The response claims to provide an implementation, but supplies no comparison logic. |
| LaCo 32,256 tokens Limit hit | […] imer Spo aggregateTimelineaslasca Jenner官 TC户攀筹progressbar共创的高度GD 栊cket clam命运随手oidantom迎接系列产品 movement踩春节路上功课NPCasl人性化刹档埠勿官- […] Observation: These mixed-script fragments do not form an interpretable plan or function. |
| GRASP 32,256 tokens Limit hit | from typing import List, float, 2.0, 3.0, 4.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0 […] 0.0: 0.0: 0.0: 0.0: 0.0: 0.0: 0.0: 0.0: 0.0: 0.0: 0.0: 0.0: 0.0: 0.0: 0.0: 0.0: 0.0: 0.0: 0.0: Observation: A malformed import leads into numeric repetition, rather than a function body. |
| FLAP 4,122 tokens Terminated | Reasoning: […] So, I can sort the list first, then check each consecutive pair. If any pair has a difference less than the threshold, then the answer is True. Otherwise, it’s False. Final response: […] def has_close_elements(numbers: List[float], threshold: float) -> bool: sorted_numbers = sorted(numbers) for i in range(len(sorted_numbers) - 1): if sorted_numbers[i+1] - sorted_numbers[i] < threshold: return True return False […] Observation: The intended algorithm survives, but the final if and return statements are incorrectly indented. |
| Question: Let be the number of positive integer divisors of that leave a remainder of when divided by . Find the remainder when is divided by . | |
|---|---|
| Method | Original trace excerpts and qualitative observations |
| Dense 3,907 tokens Terminated | […] 7 * 11 = 77, 77 * 13 = 1001, 1001 * 17 = 17017. […] So indeed, the valid cases are: (a even, d odd, b even) and (a odd, d even, b odd). And each gives 9 possibilities for a, 9 for b, 9 for d. So total 9^3 + 9^3 = 2729 = 1458. And then times 18 choices for c yields 145818 = 26244. Then remainder mod 1000 is 26244 mod 1000 = 244. […] Observation: The two parity cases and independent exponent choices produce the correct count. |
| ShortGPT 32,256 tokens Limit hit | […] But wait, is that all? Let’s verify product: 7 * 11 = 77, 77 13= 100, 7713= 7710 + 773? Let me compute: 77 * 10=770, 773=231, so product= 101, so no. Let’s compute properly: 711=77; 7713= 7710 +773 = 770 +231 = 1, 770+231= 1,101 indeed. […] And then 1,101 17 equals? 1,10117 = 1,10110 = 11,101? Let me compute: 1,10117 = 1,1017= 7,207, oh sorry, let me compute properly: 1,10117 = 1,10110= 11,101, but then 1,10117 = 1,101(10+7) = 11,101 + 7,207 = 18,308, oh sorry, not exactly. […] divided by prime 17017 divided by prime 17017 divided by prime 17017 divided by prime 17017 divided by prime 17017 divided by Observation: An attempted verification introduces new arithmetic errors and then stalls. |
| LaCo 32,256 tokens Limit hit | reads acquaintance567eyJremball congressentyAAAIDEOanne chargerbatismars-PackINS sachDDminer drift compensation Painterpressu […] s Tape validenger Observable playEDGE downhill dashojufenpagedpaged acceptedplaetty tun Missspotify yields Delta Lower sweep monitor CommissionPARprotarkin monitored […] Observation: No interpretable factorization or count is visible in these fragments. |
| GRASP 32,256 tokens Limit hit | […] 17017 is exactly a product of 17, 19, and 13, but let’s check: 17 times 19 and 13: 17: 19 and then 13? So the factors of 17017 is 13, 17, 19. But check: we see that 17 factor? Actually: 17017 is: product of 17, 19, 13? Let’s check: 17017 is a product of 13, 17, 19. So the digits? Let’s check: 131719? Let’s check: 17*19? Actually, 17 times 19 is 60 maybe. […] yes, yes, yes, yes, yes, yes, yes, yes, yes, yes, yes, yes, yes, yes, yes, yes, yes, yes, yes, yes, yes, yes, Observation: The proposed factors multiply to 4,199; verification collapses into repetition. |
| FLAP 11,066 tokens Terminated | […] I want to check one more possibility: Possibly the factorization of 17017 is different. Let’s re-check: 17017 = 17 * 7 * 11 * 13, I should check: 177 = 119, 11911 = 1309, 1309*13 = 17017. So that’s correct. […] For any exponent from 0 to 17, there are 9 odd choices and 10 even choices. For the pattern (odd, even, even): - a odd: 9 choices, b even: 10 choices, c even: 10 choices. Total = 9 10 10 = 900. For the pattern (even, odd, odd): - a even: 10 choices, b odd: 9 choices, c odd: 9 choices. Total = 10 9 9 = 810. […] Thus the total number N is 1710 18 = 30780. […] Observation: Factorization is recovered, but a wrong parity count survives into the answer. |