SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.10030 · CVPR · 2024

Multi-criteria Token Fusion with One-step-ahead Attention for Efficient Vision Transformers

Hyunwoo Kim, Sanghyeok Lee, Joonmyung Choi

arXiv · PDF · Open in the Atlas

Code that ran

3 of 5 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 0 have no contract verdict; 3 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/2403.10030.json · badge: /api/ran/2403.10030.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
mlvlab/MCTF community
Papers with Code archive
3 ran · 2 no recorded run
FunctionStatusWhere it lives
do_nothing Ran
ran; our contract draft was wrong, not the code
mlvlab/MCTF/utils/mctf.py
code served (permissive licence) · get_code("00e9d5d63d4079de")
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 tuple. 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)

# The function do_nothing takes x and mode as parameters
# It simply returns (x, None), so x can be any object
# mode defaults to None but can be any value

# Create a simple tensor for x
x = torch.randn(2, 4)

# Define the arguments dict
ARGS = {
    'x': x,
    '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 tuple — a tuple output has no array shape of its own; none is 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
merge_source Ran
ran; our contract draft was wrong, not the code
mlvlab/MCTF/utils/mctf.py
code served (permissive licence) · get_code("8a67c271b170dd65")
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, 4, 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
import torch.nn as nn
from typing import Callable

torch.manual_seed(0)

# Create a simple merge callable that applies an aggregation function
class MergeModule(nn.Module):
    def __init__(self):
        super().__init__()
    
    def forward(self, tensor, mode='amax'):
        # Simple merge operation - just return the tensor as-is for this test
        # In practice, this would aggregate along some dimension based on mode
        if mode == 'amax':
            return tensor
        return tensor

# Instantiate the merge module
merge_fn = MergeModule()

# Create input tensor x with shape (batch=2, tokens=4, features=3)
x = torch.randn(2, 4, 3)

# Create source tensor (adjacency matrix) with shape (batch=2, tokens=4, tokens=4)
# This represents connections between initial tokens and merged groups
source = torch.randn(2, 4, 4)

ARGS = {
    'merge': merge_fn,
    'x': x,
    'source': source
}
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, 4, 4) — shape (2, 4, 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
merge_wavg Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mlvlab/MCTF/utils/mctf.py
code served (permissive licence) · get_code("35fd12a5c86d3087")
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 tuple. 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
from typing import Callable

torch.manual_seed(0)

class SimpleMerge(nn.Module):
    """A simple merge function that combines tokens based on mode."""
    def __init__(self):
        super().__init__()
    
    def forward(self, x, mode='sum'):
        """
        Simulates merging/pooling operation.
        Expects x to have shape compatible with merge operations.
        Returns merged tensor.
        """
        if mode == 'sum':
            # Sum along a merge dimension (e.g., dim 1)
            return x.sum(dim=1, keepdim=True)
        elif mode == 'amax':
            # Max along a merge dimension
            return x.amax(dim=1, keepdim=True)
        return x

# Create merge function
merge_fn = SimpleMerge()

# Set up tensors with distinct dimensions for clarity
batch_size = 2
seq_len = 3
hidden_dim = 4
attn_heads = 2
attn_seq = 3

# x: shape (batch, seq_len, hidden_dim)
x = torch.randn(batch_size, seq_len, hidden_dim)

# size: shape (batch, seq_len, 1) - token sizes
size = torch.ones(batch_size, seq_len, 1)

# attn: shape (batch, attn_heads, attn_seq) - attention weights
attn = torch.randn(batch_size, attn_heads, attn_seq)

# Merge function as callable
def merge_callable(tensor, mode='sum'):
    return merge_fn(tensor, mode=mode)

ARGS = {
    'merge': merge_callable,
    'x': x,
    'size': size,
    'attn': attn,
    'one_step_ahead': 0,
    'pooling_type': 0,
}
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 tuple — a tuple output has no array shape of its own; none is 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
bipartite_soft_matching Not yet run
unverified (harvested, no recorded run)
mlvlab/MCTF/utils/mctf.py
code served (permissive licence) · get_code("58a3d8aacef250bc")
How it ran

no invocation recorded.

mctf Not yet run
unverified (harvested, no recorded run)
mlvlab/MCTF/utils/mctf.py
code served (permissive licence) · get_code("92d18f3cf6ae00a5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 5 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.

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

Vision Transformer (ViT) has emerged as a prominent backbone for computer vision. For more efficient ViTs, recent works lessen the quadratic cost of the self-attention layer by pruning or fusing the redundant tokens. However, these works faced the speed-accuracy trade-off caused by the loss of information. Here, we argue that token fusion needs to consider diverse relations between tokens to minimize information loss. In this paper, we propose a Multi-criteria Token Fusion (MCTF), that gradually fuses the tokens based on multi-criteria (i.e., similarity, informativeness, and size of fused tokens). Further, we utilize the one-step-ahead attention, which is the improved approach to capture the informativeness of the tokens. By training the model equipped with MCTF using a token reduction consistency, we achieve the best speed-accuracy trade-off in the image classification (ImageNet1K). Experimental results prove that MCTF consistently surpasses the previous reduction methods with and without training. Specifically, DeiT-T and DeiT-S with MCTF reduce FLOPs by about 44% while improving the performance (+0.5%, and +0.3%) over the base model, respectively. We also demonstrate the applicability of MCTF in various Vision Transformers (e.g., T2T-ViT, LV-ViT), achieving at least 31% speedup without performance degradation. Code is available at https://github.com/mlvlab/MCTF.

For agents

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

get_harvested_code_for_paper("2403.10030")
get_code_for_paper("2403.10030")
have("2403.10030")

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

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

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

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

Connect an agent — have() is free.