SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2602.15720 · ICML · 2026

ToaSt: Token Channel Selection and Structured Pruning for Efficient ViT

Steven Waslander, Cheonjun Park, Hyunchan Moon

arXiv · PDF · Open in the Atlas

Code that ran

3 of 6 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; 3 no recorded run), measured 2026-11-22; 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/2602.15720.json · badge: /api/ran/2602.15720.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
SHANNonLab-HUFS/ToaSt community
Papers with Code archive
3 ran · 3 no recorded run
FunctionStatusWhere it lives
arch_of Ran
ran; our contract draft was wrong, not the code
SHANNonLab-HUFS/ToaSt/toast/weight_pruning.py
code served (permissive licence) · get_code("51e9315f719ad241")
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 str. 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)

# Test case 1: ViT model with 'blocks' attribute
class ViTModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.blocks = nn.ModuleList([
            nn.Linear(4, 4) for _ in range(2)
        ])
    
    def forward(self, x):
        return x

# Test case 2: Swin model with 'layers' attribute
class SwinModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layers = nn.ModuleList([
            nn.Linear(4, 4) for _ in range(2)
        ])
    
    def forward(self, x):
        return x

# Create a ViT model instance
vit_model = ViTModel()

ARGS = {
    'model': vit_model
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
attention_layers Ran
ran; our contract draft was wrong, not the code
SHANNonLab-HUFS/ToaSt/toast/weight_pruning.py
code served (permissive licence) · get_code("4e7d61d7bca89620")
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 generator. 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 Iterator, Tuple

torch.manual_seed(0)

# Build a minimal ViT-like model with blocks
class MinimalAttention(nn.Module):
    def __init__(self):
        super().__init__()
        self.qkv = nn.Linear(4, 12)
        self.proj = nn.Linear(12, 4)
    
    def forward(self, x):
        return self.proj(self.qkv(x))

class MinimalBlock(nn.Module):
    def __init__(self):
        super().__init__()
        self.attn = MinimalAttention()
    
    def forward(self, x):
        return self.attn(x)

class MinimalViT(nn.Module):
    def __init__(self):
        super().__init__()
        self.blocks = nn.ModuleList([
            MinimalBlock(),
            MinimalBlock(),
            MinimalBlock()
        ])
    
    def forward(self, x):
        for block in self.blocks:
            x = block(x)
        return x

# Build a minimal Swin-like model with layers and stages
class MinimalSwinBlock(nn.Module):
    def __init__(self):
        super().__init__()
        self.attn = MinimalAttention()
    
    def forward(self, x):
        return self.attn(x)

class MinimalSwinStage(nn.Module):
    def __init__(self, num_blocks=2):
        super().__init__()
        self.blocks = nn.ModuleList([MinimalSwinBlock() for _ in range(num_blocks)])
    
    def forward(self, x):
        for block in self.blocks:
            x = block(x)
        return x

class MinimalSwin(nn.Module):
    def __init__(self):
        super().__init__()
        self.layers = nn.ModuleList([
            MinimalSwinStage(2),
            MinimalSwinStage(2)
        ])
    
    def forward(self, x):
        for layer in self.layers:
            x = layer(x)
        return x

# Create instances
vit_model = MinimalViT()
swin_model = MinimalSwin()

ARGS = {
    'model': vit_model,
    'skip_first_block': True
}
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 generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator 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
iter_blocks Ran
ran; our contract draft was wrong, not the code
SHANNonLab-HUFS/ToaSt/toast/weight_pruning.py
code served (permissive licence) · get_code("2429301e773af19e")
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 generator. 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 Iterator, Tuple

torch.manual_seed(0)

# Create a minimal ViT-style model with 'blocks' attribute
class MinimalViT(nn.Module):
    def __init__(self):
        super().__init__()
        self.blocks = nn.ModuleList([
            nn.Linear(4, 4),
            nn.Linear(4, 4),
            nn.Linear(4, 4),
        ])
    
    def forward(self, x):
        for block in self.blocks:
            x = block(x)
        return x

# Create a minimal Swin-style model with 'layers' attribute
class MinimalSwinBlock(nn.Module):
    def __init__(self):
        super().__init__()
        self.blocks = nn.ModuleList([
            nn.Linear(4, 4),
            nn.Linear(4, 4),
        ])

class MinimalSwin(nn.Module):
    def __init__(self):
        super().__init__()
        self.layers = nn.ModuleList([
            MinimalSwinBlock(),
            MinimalSwinBlock(),
        ])
    
    def forward(self, x):
        for stage in self.layers:
            for block in stage.blocks:
                x = block(x)
        return x

# Test with ViT model
vit_model = MinimalViT()

ARGS = {
    'model': vit_model
}
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 generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator 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
StructuredCoupledPruner Not yet run
unverified (harvested, no recorded run)
SHANNonLab-HUFS/ToaSt/toast/weight_pruning.py
code served (permissive licence) · get_code("d3f3fbc8697f8512")
How it ran

no invocation recorded.

head_importance Not yet run
unverified (harvested, no recorded run)
SHANNonLab-HUFS/ToaSt/toast/weight_pruning.py
code served (permissive licence) · get_code("6e446cfcdafce8e6")
How it ran

no invocation recorded.

reapply_masks Not yet run
unverified (harvested, no recorded run)
SHANNonLab-HUFS/ToaSt/toast/weight_pruning.py
code served (permissive licence) · get_code("ed8687c006a86f0c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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 6 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 Transformers (ViTs) have achieved remarkable success across various vision tasks, yet their deployment is often hindered by prohibitive computational costs. While structured weight pruning and token compression have emerged as promising solutions, they suffer from prolonged retraining and inter-layer dependencies that complicate optimization, respectively. We propose ToaSt, a decoupled framework applying specialized strategies to distinct ViT components. We apply coupled head-wise structured pruning to Multi-Head Self-Attention modules, leveraging attention operation characteristics to enhance robustness. For Feed-Forward Networks (over 60% of FLOPs), we introduce Token Channel Selection (TCS), a training-free method that filters redundant noise channels at inference time. Extensive evaluations across nine diverse models, including DeiT, ViT-MAE, and Swin Transformer, demonstrate that ToaSt achieves superior trade-offs between accuracy and efficiency, consistently outperforming existing baselines. On ViT-MAE-Huge, ToaSt achieves 88.52% accuracy (+1.64%p) with 39.4% FLOPs reduction. ToaSt also transfers effectively to diverse downstream tasks (COCO detection, ADE20K segmentation, CIFAR-100 classification), achieving 52.2 versus 51.9 mAP on COCO. Code: github.com/SHANNonLab-HUFS/ToaSt.

For agents

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

get_harvested_code_for_paper("2602.15720")
get_code_for_paper("2602.15720")
have("2602.15720")

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

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

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

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

Connect an agent — have() is free.