SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.01812 · 2023

PPT: Token Pruning and Pooling for Efficient Vision Transformers

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures 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/2310.01812.json · badge: /api/ran/2310.01812.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
xjwu1024/PPT canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
batch_index_select Ran
ran; our contract draft was wrong, not the code
xjwu1024/PPT/ppt_deit.py
code served (permissive licence) · get_code("225f430160e1b0f3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (2, 2, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Case 1: 3D tensor (B, N, C)
x_3d = torch.randn(2, 4, 3)  # batch=2, N=4, C=3
idx_3d = torch.tensor([[0, 2], [1, 3]], dtype=torch.long)  # batch=2, N_new=2

# Case 2: 2D tensor (B, N)
x_2d = torch.randn(2, 4)  # batch=2, N=4
idx_2d = torch.tensor([[0, 2], [1, 3]], dtype=torch.long)  # batch=2, N_new=2

# Use 3D case for primary test
ARGS = {
    "x": x_3d,
    "idx": idx_3d
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 2, 3) — shape (2, 2, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
bipartite_soft_matching Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xjwu1024/PPT/merge.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from facebookresearch/tome, is pointer only (licence: NOASSERTION) · get_code("424049f15b90678d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from facebookresearch/tome, and GitHub could not classify the licence of that repository (NOASSERTION). 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; our contract draft was wrong, not the code
xjwu1024/PPT/datasets.py
code served (permissive licence) · get_code("ebeb7b6e20a434cf")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Compose. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from torchvision import transforms
from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD

torch.manual_seed(0)

class ArgsConfig:
    def __init__(self):
        self.input_size = 224
        self.color_jitter = 0.4
        self.aa = 'rand-m9-mstd0.5-inc1'
        self.train_interpolation = 'bicubic'
        self.reprob = 0.25
        self.remode = 'pixel'
        self.recount = 1
        self.eval_crop_ratio = 0.875

args = ArgsConfig()

ARGS = {
    'is_train': True,
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, timm, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
conv3x3 Ran
ran; our contract draft was wrong, not the code
xjwu1024/PPT/patchconvnet_models.py
code served (permissive licence) · get_code("ba6aa5f07daca9cd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'in_planes': 8,
    'out_planes': 16,
    'stride': 2
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
do_nothing Ran
ran, honoured the contract we drafted
xjwu1024/PPT/merge.py
code served (permissive licence) · get_code("969e8250d805a154")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    "x": torch.randn(2, 4),
    "mode": None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
kth_bipartite_soft_matching Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xjwu1024/PPT/merge.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from aiot-mlsys-lab/famba-v, is pointer only (licence: NONE) · get_code("674be50d432e8846")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from aiot-mlsys-lab/famba-v, and GitHub detected no licence in that repository when it was checked. 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_dataset Not yet run
unverified (harvested, no recorded run)
xjwu1024/PPT/datasets.py
code served (permissive licence) · get_code("d58967bba23da4e6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 6 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 2 the same month, 6 later) and 1 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
13 dated earlier, 8 later, 4 same year, order not determinable
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
do_nothing 13 other papers
2 dated earlier, 1 the same month, 10 later · 4 only as an assembly brick
2210.09461 (2022-10)
Token Merging: Your ViT But Faster
2307.10780 (2023-07)
Learned Thresholds Token Merging and Pruning for Vision Transformers
2310.19060 (2023-10)
TESTA: Temporal-Spatial Token Aggregation for Long-form Video-Language Understanding
and 10 more not named here
bipartite_soft_matching 6 other papers
2 dated earlier, 4 later
2210.09461 (2022-10)
Token Merging: Your ViT But Faster
2307.10780 (2023-07)
Learned Thresholds Token Merging and Pruning for Vision Transformers
2404.09490 (2024-04)
Leveraging Temporal Contextualization for Video Action Recognition
and 3 more not named here
build_transform 6 other papers
6 later
2312.00752 (2023-12)
Mamba: Linear-Time Sequence Modeling with Selective State Spaces
2403.01590 (2024-03)
The Hidden Attention of Mamba Models
2404.00974 (2024-04)
Improving Visual Recognition with Hyperbolical Visual Hierarchy Mapping
and 3 more not named here
conv3x3 4 other papers
1 dated earlier, 2 later, 1 same year, order not determinable
2112.13692 (2021-12)
Augmenting Convolutional networks with attention-based aggregation
Yu_LaPE_Layer-adaptive_Position_Embedding_for_Vision_Transformers_with_Independent_Layer_ICCV_2023_paper (2023 (year only))
LaPE: Layer-adaptive Position Embedding for Vision Transformers with Independent Layer Normalization
aaai_28109 (2024 (year only))
Bi-ViT: Pushing the Limit of Vision Transformer Quantization
and 1 more not named here
kth_bipartite_soft_matching 4 other papers
1 dated earlier, 1 the same month, 2 later
2307.10780 (2023-07)
Learned Thresholds Token Merging and Pruning for Vision Transformers
2310.19060 (2023-10)
TESTA: Temporal-Spatial Token Aggregation for Long-form Video-Language Understanding
2404.17176 (2024-04)
MovieChat+: Question-aware Sparse Memory for Long Video Question Answering
and 1 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

Vision Transformers (ViTs) have emerged as powerful models in the field of computer vision, delivering superior performance across various vision tasks. However, the high computational complexity poses a significant barrier to their practical applications in real-world scenarios. Motivated by the fact that not all tokens contribute equally to the final predictions and fewer tokens bring less computational cost, reducing redundant tokens has become a prevailing paradigm for accelerating vision transformers. However, we argue that it is not optimal to either only reduce inattentive redundancy by token pruning, or only reduce duplicative redundancy by token merging. To this end, in this paper we propose a novel acceleration framework, namely token Pruning & Pooling Transformers (PPT), to adaptively tackle these two types of redundancy in different layers. By heuristically integrating both token pruning and token pooling techniques in ViTs without additional trainable parameters, PPT effectively reduces the model complexity while maintaining its predictive accuracy. For example, PPT reduces over 37% FLOPs and improves the throughput by over 45% for DeiT-S without any accuracy drop on the ImageNet dataset. The code is available at https://github.com/xjwu1024/PPT and https://github.com/mindspore-lab/models/

For agents

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

get_harvested_code_for_paper("2310.01812")
get_code_for_paper("2310.01812")
have("2310.01812")

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

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

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

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

Connect an agent — have() is free.