Papers › The Need for Speed: Pruning Transformers with One Recipe

The Need for Speed: Pruning Transformers with One Recipe

26 Mar 2024arXiv:2403.17921archive 2025-07-28

Samir Khaki, Konstantinos N. Plataniotis

We introduce the One-shot Pruning Technique for Interchangeable Networks (OPTIN) framework as a tool to increase the efficiency of pre-trained transformer architectures without requiring re-training. Recent works have explored improving transformer efficiency, however often incur computationally expensive re-training procedures or depend on architecture-specific characteristics, thus impeding practical wide-scale adoption. To address these shortcomings, the OPTIN framework leverages intermediate feature distillation, capturing the long-range dependencies of model parameters (coined trajectory), to produce state-of-the-art results on natural language, image classification, transfer learning, and semantic segmentation tasks without re-training. Given a FLOP constraint, the OPTIN framework will compress the network while maintaining competitive accuracy performance and improved throughput. Particularly, we show a ≤2% accuracy degradation from NLP baselines and a $0.5$% improvement from state-of-the-art methods on image classification at competitive FLOPs reductions. We further demonstrate the generalization of tasks and architecture with comparative performance using Mask2Former for semantic segmentation and cnn-style networks. OPTIN presents one of the first one-shot efficient frameworks for compressing transformer architectures that generalizes well across different class domains, in particular: natural language and image-related tasks, without re-training.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2403.17921")

Code

Syntology Ran 15 of 23 code samples harvested from 1 repository linked to this paper; 8 have no recorded run. Of those that ran: 8 ran · honoured contract; 1 ran · violated contract; 6 ran · our draft was wrong.

By repository: official repository: 23 samples from 1 repository, 15 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

skhaki18/optin-transformer-pruning officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

23 samples harvested; 15 ran; 8 honoured the contract we drafted; 8 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

8ran · honoured contract
1ran · violated contract
6ran · our draft was wrong
8unverified

Licence: 0 of the 23 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from Skhaki18/optin-transformer-pruning. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

KLDiv Skhaki18/optin-transformer-pruning/prune/loss_components.py official repository ran · honoured contract MIT (permissive) · 027ae849d003750b · report
KLDiv skhaki18/optin-transformer-pruning/prune/main_prune.py official repository ran · honoured contract MIT (permissive) · da78ffebac4be236 · report
calculateComplexity skhaki18/optin-transformer-pruning/prune/main_prune.py official repository ran · our draft was wrong MIT (permissive) · 3e6b8dd06f26bd2e · report
compute_base_mac skhaki18/optin-transformer-pruning/prune/main_prune.py official repository ran · honoured contract MIT (permissive) · b8a3e26f899df98f · report
compute_mac skhaki18/optin-transformer-pruning/prune/main_prune.py official repository ran · violated contract fingerprinted MIT (permissive) · b9d5144329aa001b · report
compute_patch_mac skhaki18/optin-transformer-pruning/prune/main_prune.py official repository ran · honoured contract MIT (permissive) · 18b585baff750730 · report
compute_pruned_mac skhaki18/optin-transformer-pruning/prune/main_prune.py official repository ran · honoured contract MIT (permissive) · 57a2ac87aeb75bf5 · report
get_mac_details skhaki18/optin-transformer-pruning/prune/main_prune.py official repository ran · our draft was wrong MIT (permissive) · 8addab3b55f6f68e · report
globalRankingLanguage skhaki18/optin-transformer-pruning/prune/main_prune.py official repository ran · our draft was wrong MIT (permissive) · fa816ac012e18bee · report
mac_per_head skhaki18/optin-transformer-pruning/prune/main_prune.py official repository ran · honoured contract fingerprinted MIT (permissive) · 77c8d1bcdfe79662 · report
mac_per_neuron skhaki18/optin-transformer-pruning/prune/main_prune.py official repository ran · honoured contract fingerprinted MIT (permissive) · 159b80cd46f12b30 · report
manifold_Distillation Skhaki18/optin-transformer-pruning/prune/loss_components.py official repository ran · our draft was wrong MIT (permissive) · 82a7f6c6a07d3234 · report
manifold_Distillation skhaki18/optin-transformer-pruning/prune/main_prune.py official repository ran · our draft was wrong MIT (permissive) · 93b2e14d2ed2e49d · report
process_patch_mask skhaki18/optin-transformer-pruning/prune/main_prune.py official repository ran · our draft was wrong MIT (permissive) · dda1ad56be460a00 · report
query_conv_mac skhaki18/optin-transformer-pruning/prune/main_prune.py official repository ran · honoured contract MIT (permissive) · 4cabaf97a1cafcd2 · report
ModelHooking skhaki18/optin-transformer-pruning/prune/main_prune.py official repository unverified MIT (permissive) · 72a06dbfb15610ae · report
Prune skhaki18/optin-transformer-pruning/prune/main_prune.py official repository unverified MIT (permissive) · cb63f4eebf8926c2 · report
cnn_mmd Skhaki18/optin-transformer-pruning/prune/loss_components.py official repository unverified MIT (permissive) · fb4f698a0e53c90a · report
globalRankingVision skhaki18/optin-transformer-pruning/prune/main_prune.py official repository unverified MIT (permissive) · a7ccc4f26fd33e50 · report
pruneHead skhaki18/optin-transformer-pruning/prune/main_prune.py official repository unverified MIT (permissive) · 053bf2646cdcfa75 · report
pruneLanguageNeurons skhaki18/optin-transformer-pruning/prune/main_prune.py official repository unverified MIT (permissive) · c07e8573b3785e73 · report
pruneModel skhaki18/optin-transformer-pruning/prune/main_prune.py official repository unverified MIT (permissive) · 76238266383a6956 · report
pruneVisionNeurons skhaki18/optin-transformer-pruning/prune/main_prune.py official repository unverified MIT (permissive) · cd869fbca8ce1494 · report

Tasks

Image ClassificationSemantic SegmentationTransfer Learningimage-classification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections