SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2503.23455 · 2025

Efficient Token Compression for Vision Transformer with Spatial Information Preserved

arXiv · PDF · Open in the Atlas

Code that ran

13 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 12 have no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2503.23455.json · badge: /api/ran/2503.23455.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
nust-machine-intelligence-laboratory/prune_and_merge canonical (classifier label)
classifier basis not recorded on the link
13 ran · 1 no recorded run
FunctionStatusWhere it lives
build_dataset Ran
ran; our contract draft was wrong, not the code
nust-machine-intelligence-laboratory/prune_and_merge/pm-vit/datasets.py
pointer only (licence: Apache-2.0) · get_code("43f5d3f52fed74d4")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, nust-machine-intelligence-laboratory/prune_and_merge, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

build_transform Ran
ran on a synthesized input
nust-machine-intelligence-laboratory/prune_and_merge/pm-vit/datasets.py
pointer only (licence: Apache-2.0) · get_code("298ab77e1ac660f2")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, nust-machine-intelligence-laboratory/prune_and_merge, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

gauss_norm Ran
ran on a synthesized input
nust-machine-intelligence-laboratory/prune_and_merge/pm-vit/tm_prune_merge_to_center.py
pointer only (licence: Apache-2.0) · get_code("3c5eb850c7f680b1")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, nust-machine-intelligence-laboratory/prune_and_merge, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_deit_base_patch16_224_config Ran
ran on a synthesized input
nust-machine-intelligence-laboratory/prune_and_merge/pm-vit/config.py
pointer only (licence: Apache-2.0) · get_code("49fe8666e9499cf8")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, nust-machine-intelligence-laboratory/prune_and_merge, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_deit_small_patch16_224_config Ran
ran on a synthesized input
nust-machine-intelligence-laboratory/prune_and_merge/pm-vit/config.py
pointer only (licence: Apache-2.0) · get_code("4697a5e7358211b5")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, nust-machine-intelligence-laboratory/prune_and_merge, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_deit_tiny_patch16_224_config Ran
ran on a synthesized input
nust-machine-intelligence-laboratory/prune_and_merge/pm-vit/config.py
pointer only (licence: Apache-2.0) · get_code("7288f110b9b4d4dd")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, nust-machine-intelligence-laboratory/prune_and_merge, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

load_matrix Ran
ran on a synthesized input
nust-machine-intelligence-laboratory/prune_and_merge/pm-vit/visualize.py
pointer only (licence: Apache-2.0) · get_code("22479ea1d7d13ebb")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, nust-machine-intelligence-laboratory/prune_and_merge, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

max_norm Ran
ran on a synthesized input
nust-machine-intelligence-laboratory/prune_and_merge/pm-vit/tm_prune.py
pointer only (licence: Apache-2.0) · get_code("9555f12025653843")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, nust-machine-intelligence-laboratory/prune_and_merge, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

mean_norm Ran
ran on a synthesized input
nust-machine-intelligence-laboratory/prune_and_merge/pm-vit/tm_prune.py
pointer only (licence: Apache-2.0) · get_code("bc76c12550d19a97")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, nust-machine-intelligence-laboratory/prune_and_merge, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

normalize Ran
ran on a synthesized input
nust-machine-intelligence-laboratory/prune_and_merge/pm-vit/tm_prune_merge_to_center.py
pointer only (licence: Apache-2.0) · get_code("43fe6cf78ba8bdc7")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, nust-machine-intelligence-laboratory/prune_and_merge, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

normalize Ran
ran on a synthesized input
nust-machine-intelligence-laboratory/prune_and_merge/pm-vit/tm_prune.py
pointer only (licence: Apache-2.0) · get_code("971af9b36e21c087")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, nust-machine-intelligence-laboratory/prune_and_merge, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

set1_except0 Ran
ran on a synthesized input
nust-machine-intelligence-laboratory/prune_and_merge/pm-vit/tm_prune_merge_to_center.py
pointer only (licence: Apache-2.0) · get_code("f5f252851e922349")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, nust-machine-intelligence-laboratory/prune_and_merge, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

split_image Ran
ran on a synthesized input
nust-machine-intelligence-laboratory/prune_and_merge/pm-vit/visualize.py
pointer only (licence: Apache-2.0) · get_code("2d962204e7a5f59a")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, nust-machine-intelligence-laboratory/prune_and_merge, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

process_blocks Not yet run
unverified (harvested, no recorded run)
nust-machine-intelligence-laboratory/prune_and_merge/pm-vit/visualize.py
pointer only (licence: Apache-2.0) · get_code("97427a40f42cf47b")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, nust-machine-intelligence-laboratory/prune_and_merge, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 13 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
build_dataset 25 other papers
24 dated earlier, 1 later
2104.05707 (2021-04)
LocalViT: Analyzing Locality in Vision Transformers
2106.00515 (2021-06)
KVT: k-NN Attention for Boosting Vision Transformers
2106.01401 (2021-06)
Container: Context Aggregation Network
and 22 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Token compression is essential for reducing the computational and memory requirements of transformer models, enabling their deployment in resource-constrained environments. In this work, we propose an efficient and hardware-compatible token compression method called Prune and Merge. Our approach integrates token pruning and merging operations within transformer models to achieve layer-wise token compression. By introducing trainable merge and reconstruct matrices and utilizing shortcut connections, we efficiently merge tokens while preserving important information and enabling the restoration of pruned tokens. Additionally, we introduce a novel gradient-weighted attention scoring mechanism that computes token importance scores during the training phase, eliminating the need for separate computations during inference and enhancing compression efficiency. We also leverage gradient information to capture the global impact of tokens and automatically identify optimal compression structures. Extensive experiments on the ImageNet-1k and ADE20K datasets validate the effectiveness of our approach, achieving significant speed-ups with minimal accuracy degradation compared to state-of-the-art methods. For instance, on DeiT-Small, we achieve a 1.64$\times$ speed-up with only a 0.2\% drop in accuracy on ImageNet-1k. Moreover, by compressing segmenter models and comparing with existing methods, we demonstrate the superior performance of our approach in terms of efficiency and effectiveness. Code and models have been made available at https://github.com/NUST-Machine-Intelligence-Laboratory/prune_and_merge.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2503.23455")
get_code_for_paper("2503.23455")
have("2503.23455")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2503.23455.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2503.23455.svg)](https://syntology.ai/paper/2503.23455)

Connect an agent — have() is free.