SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2107.00910 · 2021

Learned Token Pruning for Transformers

arXiv · PDF · Open in the Atlas

Code that ran

10 of 12 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, 1 violated it and 2 have no contract verdict; 6 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2107.00910.json · badge: /api/ran/2107.00910.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
kssteven418/ltp canonical (classifier label)
classifier basis: census
10 ran · 2 no recorded run
FunctionStatusWhere it lives
check_number_comma Ran
ran, violated the contract we drafted
kssteven418/ltp/src/transformers/convert_slow_tokenizer.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from UW-Madison-Lee-Lab/looped-tf, is pointer only (licence: NONE) · get_code("a727df5fd2f5599a")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, kssteven418/ltp, 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.

collect_data Ran
ran on a synthesized input
kssteven418/ltp/make_pibert_paper_plots.py
pointer only (licence: Apache-2.0) · get_code("75992437e8972200")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, kssteven418/ltp, 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.

create_position_ids_from_input_ids Ran
ran; our contract draft was wrong, not the code
kssteven418/ltp/src/transformers/models/ltp/modeling_ltp.py
pointer only (licence: Apache-2.0) · get_code("83995d570ba89e6d")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, kssteven418/ltp, 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.

ensure_valid_input Ran
ran; our contract draft was wrong, not the code
kssteven418/ltp/src/transformers/convert_graph_to_onnx.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from UW-Madison-Lee-Lab/looped-tf, is pointer only (licence: NONE) · get_code("d770e1dd1d799a47")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, kssteven418/ltp, 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.

gelu_fast Ran
ran; our contract draft was wrong, not the code
kssteven418/ltp/src/transformers/activations.py
pointer only (licence: Apache-2.0) · get_code("a4475703ff58ecf9")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, kssteven418/ltp, 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.

gelu_fast Ran
ran on a synthesized input
kssteven418/ltp/src/transformers/activations_tf.py
pointer only (licence: Apache-2.0) · get_code("ac1bc5cb23b3f2ec")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, kssteven418/ltp, 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.

gelu_new Ran
ran; our contract draft was wrong, not the code
kssteven418/ltp/src/transformers/activations.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from astro-jon/LCWL, is pointer only (licence: NONE) · get_code("45bb87451230d5e8")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, kssteven418/ltp, 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.

generate_identified_filename Ran
ran; our contract draft was wrong, not the code
kssteven418/ltp/src/transformers/convert_graph_to_onnx.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from UW-Madison-Lee-Lab/looped-tf, is pointer only (licence: NONE) · get_code("7efe3db5c9e2f94d")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, kssteven418/ltp, 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.

mish Ran
ran, honoured the contract we drafted
kssteven418/ltp/src/transformers/activations_tf.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from VITA-Group/READ-ME, is pointer only (licence: NONE) · get_code("cc8c8c3ebf0c343f")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, kssteven418/ltp, 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.

mish Ran
ran; our contract draft was wrong, not the code
kssteven418/ltp/src/transformers/activations.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from thu-coai/Emotional-Support-Conversation, is pointer only (licence: NOASSERTION) · get_code("f889d53c68539013")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, kssteven418/ltp, 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.

convert_slow_tokenizer Not yet run
unverified (harvested, no recorded run)
kssteven418/ltp/src/transformers/convert_slow_tokenizer.py
pointer only (licence: Apache-2.0) · get_code("5de43db1a351fd89")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, kssteven418/ltp, 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.

infer_shapes Not yet run
unverified (harvested, no recorded run)
kssteven418/ltp/src/transformers/convert_graph_to_onnx.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from UW-Madison-Lee-Lab/looped-tf, is pointer only (licence: NONE) · get_code("3449d7d975edfb89")
How it ran

The body of this sample is withheld: Apache-2.0, as GitHub detects it on this paper's repository, kssteven418/ltp, 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 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 11 are also present in other papers whose code we hold (9 with at least one paper dated earlier, 1 the same month, 11 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
create_position_ids_from_input_ids 28 other papers
1 the same month, 27 later
2107.14035 (2021-07)
ProtoTransformer: A Meta-Learning Approach to Providing Student Feedback
2201.11732 (2022-01)
IGLUE: A Benchmark for Transfer Learning across Modalities, Tasks, and Languages
2202.07962 (2022-02)
Revisiting Parameter-Efficient Tuning: Are We Really There Yet?
and 25 more not named here
mish 25 other papers
3 dated earlier, 22 later
2007.07779 (2020-07)
AdapterHub: A Framework for Adapting Transformers
2104.08400 (2021-04)
Structure-Aware Abstractive Conversation Summarization via Discourse and Action Graphs
2106.00420 (2021-06)
Dialogue-oriented Pre-training
and 22 more not named here
gelu_new 24 other papers
5 dated earlier, 19 later
2004.10964 (2020-04)
Don't Stop Pretraining: Adapt Language Models to Domains and Tasks
2104.08066 (2021-04)
Effect of Visual Extensions on Natural Language Understanding in Vision-and-Language Models
2104.08400 (2021-04)
Structure-Aware Abstractive Conversation Summarization via Discourse and Action Graphs
and 21 more not named here
gelu_fast 22 other papers
5 dated earlier, 17 later
2010.03957 (2020-10)
Transformers for Modeling Physical Systems
2104.08066 (2021-04)
Effect of Visual Extensions on Natural Language Understanding in Vision-and-Language Models
2104.08400 (2021-04)
Structure-Aware Abstractive Conversation Summarization via Discourse and Action Graphs
and 19 more not named here
ensure_valid_input 14 other papers
1 dated earlier, 13 later
2007.07779 (2020-07)
AdapterHub: A Framework for Adapting Transformers
2111.00160 (2021-11)
DSEE: Dually Sparsity-embedded Efficient Tuning of Pre-trained Language Models
2111.05498 (2021-11)
Attention Approximates Sparse Distributed Memory
and 11 more not named here
generate_identified_filename 14 other papers
1 dated earlier, 13 later
2007.07779 (2020-07)
AdapterHub: A Framework for Adapting Transformers
2111.00160 (2021-11)
DSEE: Dually Sparsity-embedded Efficient Tuning of Pre-trained Language Models
2111.05498 (2021-11)
Attention Approximates Sparse Distributed Memory
and 11 more not named here
infer_shapes 14 other papers
1 dated earlier, 13 later
2007.07779 (2020-07)
AdapterHub: A Framework for Adapting Transformers
2111.00160 (2021-11)
DSEE: Dually Sparsity-embedded Efficient Tuning of Pre-trained Language Models
2111.05498 (2021-11)
Attention Approximates Sparse Distributed Memory
and 11 more not named here
check_number_comma 13 other papers
1 dated earlier, 12 later
2007.07779 (2020-07)
AdapterHub: A Framework for Adapting Transformers
2111.00160 (2021-11)
DSEE: Dually Sparsity-embedded Efficient Tuning of Pre-trained Language Models
2111.05498 (2021-11)
Attention Approximates Sparse Distributed Memory
and 10 more not named here
convert_slow_tokenizer 13 other papers
1 dated earlier, 12 later
2007.07779 (2020-07)
AdapterHub: A Framework for Adapting Transformers
2111.00160 (2021-11)
DSEE: Dually Sparsity-embedded Efficient Tuning of Pre-trained Language Models
2111.05498 (2021-11)
Attention Approximates Sparse Distributed Memory
and 10 more not named here
mish 4 other papers
1 dated earlier, 3 later
2104.08066 (2021-04)
Effect of Visual Extensions on Natural Language Understanding in Vision-and-Language Models
2109.03808 (2021-09)
Smelting Gold and Silver for Improved Multilingual AMR-to-Text Generation
2405.15179 (2024-05)
VB-LoRA: Extreme Parameter Efficient Fine-Tuning with Vector Banks
and 1 more not named here
gelu_fast 1 other paper
1 later
2109.03808 (2021-09)
Smelting Gold and Silver for Improved Multilingual AMR-to-Text Generation

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-22.

Repositories linked to this paper

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

Abstract

Deploying transformer models in practice is challenging due to their inference cost, which scales quadratically with input sequence length. To address this, we present a novel Learned Token Pruning (LTP) method which adaptively removes unimportant tokens as an input sequence passes through transformer layers. In particular, LTP prunes tokens with an attention score below a threshold value which is learned for each layer during training. Our threshold-based method allows the length of the pruned sequence to vary adaptively based on the input sequence, and avoids algorithmically expensive operations such as top-k token selection. We extensively test the performance of LTP on GLUE tasks and show that our method outperforms the prior state-of-the-art token pruning methods by up to ~2.5% higher accuracy with the same amount of FLOPs. In particular, LTP achieves up to 2.1x FLOPs reduction with less than 1% accuracy drop, which results in up to 1.9x and 2.0x throughput improvement on Intel Haswell CPUs and NVIDIA V100 GPUs, respectively. Furthermore, we demonstrate that LTP is more robust than prior methods to variations on input sentence lengths. Our code has been developed in PyTorch and has been open-sourced.

For agents

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

get_harvested_code_for_paper("2107.00910")
get_code_for_paper("2107.00910")
have("2107.00910")

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

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

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

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

Connect an agent — have() is free.