SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2509.10918 · ICML · 2025

ToMA: Token Merge with Attention for Diffusion Models

Yuxuan Xia, Wenbo Lu, Shaoyi Zheng, Shengjie Wang

arXiv · PDF · Open in the Atlas

Code that ran

11 of 18 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 0 have no contract verdict; 9 failures of our instrument; 7 no recorded run), measured 2026-11-24; 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/2509.10918.json · badge: /api/ran/2509.10918.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
WenboLuu/ToMA community
Papers with Code archive
11 ran · 7 no recorded run
FunctionStatusWhere it lives
apply_rotary_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("208e2100acfde26e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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.

batched_facility_location Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("5ade63ed6618f3fe")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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.

create_flux_transformer_block Ran
ran; our contract draft was wrong, not the code
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("f4a7eae675fa67d1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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.

do_nothing Ran
ran, honoured the contract we drafted
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("3dc9b1a39943f29e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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.

fold_with_indices Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("9b9fc96a1092e8b4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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.

isinstance_str Ran
ran, violated the contract we drafted
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("4d43c39d84b84472")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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.

local_tile_wise_facility Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("4445496141dac5db")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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.

remove_patch Ran
ran; our contract draft was wrong, not the code
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("115cd04d3861aed1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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.

stripe_attention_merge Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("8dbb589ce2ef2ed8")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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.

tile_attention_merge Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("f0906818176c5c3d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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.

unfold_with_indices Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("6316efeb5120f8b6")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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.

AttnProcessor Not yet run
unverified (harvested, no recorded run)
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("67c075726d5f41eb")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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. No invocation recorded.

FluxGlobalAttentionProcessor Not yet run
unverified (harvested, no recorded run)
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("78499dabb8628941")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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. No invocation recorded.

apply_patch Not yet run
unverified (harvested, no recorded run)
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("3d87583091d93955")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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. No invocation recorded.

compute_merge Not yet run
unverified (harvested, no recorded run)
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("f28cd4b5d2f5c515")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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. No invocation recorded.

create_flux_single_transformer_block Not yet run
unverified (harvested, no recorded run)
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("3803c1243a084543")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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. No invocation recorded.

merge_helper Not yet run
unverified (harvested, no recorded run)
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("d021703ca179bf9f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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. No invocation recorded.

stripe_wise_facility Not yet run
unverified (harvested, no recorded run)
WenboLuu/ToMA/toma/patch.py
pointer only (licence: NONE) · get_code("796fdd38c185e58e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WenboLuu/ToMA 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. No invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 18 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 2 later) and 15 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
isinstance_str
brick of this paper's assembly: helper
10 other papers
9 dated earlier, 1 later
2303.17604 (2023-03)
Token Merging for Fast Stable Diffusion
2307.10373 (2023-07)
TokenFlow: Consistent Diffusion Features for Consistent Video Editing
2312.02212 (2023-12)
Portrait Diffusion: Training-free Face Stylization with Chain-of-Painting
and 7 more not named here
do_nothing
brick of this paper's assembly: helper
7 other papers
5 dated earlier, 1 later, 1 same year, order not determinable · 2 only as an assembly brick
2210.09461 (2022-10)
Token Merging: Your ViT But Faster
2303.17604 (2023-03)
Token Merging for Fast Stable Diffusion
2312.10656 (2023-12)
VidToMe: Video Token Merging for Zero-Shot Video Editing
and 4 more not named here
apply_rotary_emb
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2504.06232 (2025-04)
HiFlow: Training-free High-Resolution Image Generation with Flow-Aligned Guidance

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

Repositories linked to this paper

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

Abstract

Diffusion models excel in high-fidelity image generation but face scalability limits due to transformers' quadratic attention complexity. Plug-andplay token reduction methods like ToMeSD and ToFu reduce FLOPs by merging redundant tokens in generated images but rely on GPU-inefficient operations (e.g., sorting, scattered writes), introducing overheads that negate theoretical speedups when paired with optimized attention implementations (e.g., FlashAttention). To bridge this gap, we propose Token Merge with Attention (ToMA), an off-the-shelf method that redesigns token reduction for GPU-aligned efficiency, with three key contributions: 1) a reformulation of token merge as a submodular optimization problem to select diverse tokens; 2) merge/unmerge as an attentionlike linear transformation via GPU-friendly matrix operations; and 3) exploiting latent locality and sequential redundancy (pattern reuse) to minimize overhead. ToMA reduces SDXL/Flux generation latency by 24%/23% (with DINO ∆ < 0.07), outperforming prior methods. This work bridges the gap between theoretical and practical efficiency for transformers in diffusion. Code available at github.com/WenboLuu/ToMA.

For agents

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

get_harvested_code_for_paper("2509.10918")
get_code_for_paper("2509.10918")
have("2509.10918")

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

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

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

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

Connect an agent — have() is free.