SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.09192 · ECCV · 2024

PYRA: Parallel Yielding Re-Activation for Training-Inference Efficient Task Adaptation

Jungong Han, Guiguang Ding, Tianxiang Hao, Hui Chen, Zijia Lin, Yongjun Bao, Guoxin Wang, Yizhe Xiong, Yuesong Zhang

arXiv · PDF · Open in the Atlas

Code that ran

16 of 16 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; 5 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 11 failures of our instrument; 0 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.09192.json · badge: /api/ran/2403.09192.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
thu-mig/pyra canonical (classifier label)
classifier basis: census
15 ran · 0 no recorded run
THU-MIG/PYRA community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
bipartite_soft_matching Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
thu-mig/pyra/model/adaptive_merge.py
code served (permissive licence) · get_code("b6129d06b30c292b")
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, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 math

torch.manual_seed(0)

# Create a small metric tensor
# Shape: [batch=2, tokens=8, channels=4]
# The function expects metric with shape [batch, tokens, channels]
metric = torch.randn(2, 8, 4)

# r is the number of tokens to remove
# Must be <= (t - protected) // 2
# With t=8 and no protected tokens, max r is 4
r = 2

# class_token: whether there's a class token
class_token = False

# distill_token: whether there's a distillation token
distill_token = False

ARGS = {
    "metric": metric,
    "r": r,
    "class_token": class_token,
    "distill_token": distill_token,
}
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, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
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
build_dataset Ran
ran; our contract draft was wrong, not the code
thu-mig/pyra/lib/datasets.py
code served (permissive licence) · get_code("4d972cb75e0ce17d")
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 tempfile
import os
from torchvision import transforms

torch.manual_seed(0)

# Create a temporary directory structure for dataset files
temp_dir = tempfile.mkdtemp()

# Create dummy train/test list files
train_list_path = os.path.join(temp_dir, 'train800val200.txt')
test_list_path = os.path.join(temp_dir, 'test.txt')

with open(train_list_path, 'w') as f:
    f.write('img1.jpg 0\n')
    f.write('img2.jpg 1\n')

with open(test_list_path, 'w') as f:
    f.write('img3.jpg 0\n')
    f.write('img4.jpg 1\n')

# Create dummy image files
from PIL import Image
import numpy as np

for img_name in ['img1.jpg', 'img2.jpg', 'img3.jpg', 'img4.jpg']:
    img_path = os.path.join(temp_dir, img_name)
    img = Image.fromarray(np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8))
    img.save(img_path)

# Create args object with all required attributes
class Args:
    def __init__(self):
        self.data_path = temp_dir
        self.data_set = 'clevr_count'
        self.input_size = 224
        self.no_aug = False
        self.mode = 'normal'
        self.color_jitter = 0.4
        self.aa = 'rand-m9-mstd0.5'
        self.train_interpolation = 'bicubic'
        self.reprob = 0.25
        self.remode = 'pixel'
        self.recount = 1
        self.direct_resize = False
        self.inception = False

args = Args()

ARGS = {
    'is_train': True,
    'args': args,
    'folder_name': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, 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 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
build_transform Ran
ran; our contract draft was wrong, not the code
thu-mig/pyra/lib/datasets.py
code served (permissive licence) · get_code("4352f21759f08de9")
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 torch.nn as nn
from types import SimpleNamespace

torch.manual_seed(0)

class Args:
    def __init__(self):
        self.no_aug = False
        self.mode = 'train'
        self.input_size = 224
        self.color_jitter = 0.4
        self.aa = 'rand-m9-mstd0.5'
        self.train_interpolation = 'bicubic'
        self.reprob = 0.25
        self.remode = 'pixel'
        self.recount = 2
        self.direct_resize = False
        self.inception = False

args = Args()

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
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
checkpoint_filter_fn Ran
ran; our contract draft was wrong, not the code
thu-mig/pyra/model/vision_transformer_timm.py
code served (permissive licence) · get_code("6d8a1f8a0697180f")
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 dict. 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
import math

torch.manual_seed(0)

# Build a minimal model that checkpoint_filter_fn expects
class PatchEmbed(nn.Module):
    def __init__(self):
        super().__init__()
        # proj weight shape: (out_channels, in_channels, kernel_h, kernel_w)
        self.proj = nn.Conv2d(3, 16, kernel_size=4, stride=4)
        self.grid_size = [8, 8]  # 64x64 input -> 16x16 patches

class TinyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.patch_embed = PatchEmbed()
        # pos_embed shape: (1, num_patches + num_tokens, embed_dim)
        # 64 patches (8x8 grid) + 1 cls token = 65 tokens
        self.pos_embed = nn.Parameter(torch.randn(1, 65, 12))
        self.num_tokens = 1

model = TinyModel()

# Create a state_dict to pass to checkpoint_filter_fn
state_dict = {
    'model': {
        'patch_embed.proj.weight': torch.randn(16, 3, 4, 4),
        'pos_embed': torch.randn(1, 65, 12),
        'other_param': torch.randn(2, 3),
    }
}

ARGS = {
    'state_dict': state_dict,
    'model': 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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
do_nothing Ran
ran, honoured the contract we drafted
thu-mig/pyra/model/adaptive_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
drop_path Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
thu-mig/pyra/model/utils.py
code served (permissive licence) · get_code("39eace7e2822504f")
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) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 3, 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)

# Create a small tensor for testing
# Shape: (batch_size=2, channels=4, height=3, width=3) - 4D tensor
x = torch.randn(2, 4, 3, 3, dtype=torch.float32)

ARGS = {
    "x": x,
    "drop_prob": 0.5,
    "training": True,
}
Setup block drafted by
a language model, Claude Haiku 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 Tensor, ndim 4, dtype family float, shape (2, 4, 3, 3) — shape (2, 4, 3, 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
even Ran
ran, honoured the contract we drafted
thu-mig/pyra/model/utils.py
code served (permissive licence) · get_code("c2766d58552b5f37")
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 int, ndim 0, dtype family int, shape () 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 numpy as np

# The function 'even' takes a single parameter 'num' which must be an int
# It checks if num is even, and if not, returns num + 1
# So we just need to provide a valid integer

ARGS = {
    "num": 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () 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
get_merging_schedule Ran
ran, honoured the contract we drafted
thu-mig/pyra/model/tome.py
code served (permissive licence) · get_code("8b5a189b881cc7e5")
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 list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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

ARGS = {
    'model_name': 'vit_base_patch16_224_in21k',
    'schedule_name': 'low'
}
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 list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
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
init_pyra_scale Ran
ran, honoured the contract we drafted
THU-MIG/PYRA/model/adaptive_merge.py
code served (permissive licence) · get_code("c41aa8b3b7005800")
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) and returned Parameter, ndim 2, dtype family float, shape (8, 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 math
import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'tome_dim': 8,
    'dim': 4,
    'init': 'zero'
}
Setup block drafted by
a language model, Claude Haiku 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 Parameter, ndim 2, dtype family float, shape (8, 4) — shape (8, 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
make_tome_class Ran
ran; our contract draft was wrong, not the code
thu-mig/pyra/model/tome.py
code served (permissive licence) · get_code("6ee649c2dcd0e4a1")
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 type. 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 List, Tuple, Union

torch.manual_seed(0)

# Create a minimal transformer class that will be passed to make_tome_class
class MinimalTransformer(nn.Module):
    def __init__(self):
        super().__init__()
        # Create a minimal blocks structure with 3 layers
        self.blocks = nn.ModuleList([
            nn.Linear(4, 4),
            nn.Linear(4, 4),
            nn.Linear(4, 4),
        ])
        self.r = 8  # Token reduction parameter
        self._tome_info = {'r': None, 'size': None, 'source': None}
    
    def forward(self, x):
        for block in self.blocks:
            x = block(x)
        return x

ARGS = {
    'transformer_class': MinimalTransformer
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
optimizer_kwargs Ran
ran; our contract draft was wrong, not the code
thu-mig/pyra/model/optim_factory.py
code served (permissive licence) · get_code("04ae1a80bf45d2eb")
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 dict. 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)

class ConfigStandIn:
    def __init__(self):
        self.opt = 'adam'
        self.lr = 0.001
        self.weight_decay = 1e-4
        self.momentum = 0.9
        self.opt_eps = 1e-8
        self.opt_betas = (0.9, 0.999)
        self.opt_args = {'amsgrad': True}

ARGS = {
    'cfg': ConfigStandIn()
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
parse_r Ran
ran, honoured the contract we drafted
thu-mig/pyra/model/tome.py
pointer only (licence: MIT); the stored copy get_code serves, from tue-mps/algm-segmenter, is pointer only (licence: NOASSERTION) · get_code("94e8f254ce489a4b")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from tue-mps/algm-segmenter, 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.

pre_process Ran
ran; our contract draft was wrong, not the code
thu-mig/pyra/model/optim_factory.py
code served (permissive licence) · get_code("c481267a68f1cd79")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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)

# Build a minimal model with parameters that exercise the function's logic
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        # Parameters with different shapes to test the len(param.shape) == 1 condition
        self.linear1 = nn.Linear(4, 3)  # weight: (3, 4), bias: (3,)
        self.linear2 = nn.Linear(3, 2)  # weight: (2, 3), bias: (2,)
        # Add a parameter with 'ssf' in the name to test separate_lr_for_pyra logic
        self.ssf_layer = nn.Linear(2, 2)  # weight and bias
        # Add a parameter in skip_list
        self.skip_param = nn.Parameter(torch.randn(5))
        
    def forward(self, x):
        return self.ssf_layer(self.linear2(self.linear1(x)))

model = MinimalModel()

# Create arguments for the pre_process function
ARGS = {
    'model': model,
    'weight_decay': 1e-05,
    'skip_list': ('skip_param',),
    'separate_lr_for_pyra': True,
    'pyra_lr': 0.001
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
resize_pos_embed Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
thu-mig/pyra/model/vision_transformer_timm.py
code served (permissive licence) · get_code("191b2735955d18f4")
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 (1, 17, 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 math

torch.manual_seed(0)

# The function resizes positional embeddings from one shape to another
# posemb: original position embeddings tensor (batch_size, num_tokens, embedding_dim)
# posemb_new: target position embeddings tensor with desired shape
# num_tokens: number of special tokens (like cls token) to preserve
# gs_new: target grid size (height, width) for the spatial part

# Create small test tensors
embedding_dim = 4
num_special_tokens = 1
old_grid_size = 3  # 3x3 = 9 spatial tokens
old_total_tokens = num_special_tokens + (old_grid_size * old_grid_size)  # 1 + 9 = 10

# Original position embedding: (batch=1, num_tokens=10, embedding_dim=4)
posemb = torch.randn(1, old_total_tokens, embedding_dim)

# New position embedding target shape
new_grid_size = 4  # 4x4 = 16 spatial tokens
new_total_tokens = num_special_tokens + (new_grid_size * new_grid_size)  # 1 + 16 = 17
posemb_new = torch.randn(1, new_total_tokens, embedding_dim)

# Grid size for new embedding (4x4 spatial grid)
gs_new = [4, 4]

ARGS = {
    'posemb': posemb,
    'posemb_new': posemb_new,
    'num_tokens': num_special_tokens,
    'gs_new': gs_new,
}
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 (1, 17, 4) — shape (1, 17, 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
test_model_latency Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
thu-mig/pyra/engine.py
code served (permissive licence) · get_code("55b52c9838727c38")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv1 = nn.Conv2d(3, 8, kernel_size=3, padding=1)
        self.fc = nn.Linear(8 * 224 * 224, 10)
    
    def forward(self, x):
        x = self.conv1(x)
        x = x.view(x.size(0), -1)
        x = self.fc(x)
        return x

model = SimpleModel()
device = 'cpu'
test_batch_size = 2

ARGS = {
    'model': model,
    'device': device,
    'test_batch_size': test_batch_size
}
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 float, ndim 0, dtype family float, shape () — shape () 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
trunc_normal_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
thu-mig/pyra/model/utils.py
code served (permissive licence) · get_code("02566da69866c48c")
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) 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
import math

torch.manual_seed(0)

# Create a small tensor to be filled with truncated normal values
tensor = torch.empty(2, 4)

# Define arguments for trunc_normal_
ARGS = {
    'tensor': tensor,
    'mean': 0.0,
    'std': 1.0,
    'a': -2.0,
    'b': 2.0
}
Setup block drafted by
a language model, Claude Haiku 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 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

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 4 the same month, 6 later) and 9 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
drop_path 224 other papers
150 dated earlier, 6 the same month, 60 later, 7 same year, order not determinable, 1 undated · 38 only as an assembly brick
2003.12039 (2020-03)
RAFT: Recurrent All-Pairs Field Transforms for Optical Flow
2007.09384 (2020-07)
Multi-Scale Positive Sample Refinement for Few-Shot Object Detection
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
and 221 more not named here
trunc_normal_ 160 other papers
99 dated earlier, 4 the same month, 55 later, 2 same year, order not determinable · 36 only as an assembly brick
1911.10194 (2019-11)
Panoptic-DeepLab: A Simple, Strong, and Fast Baseline for Bottom-Up Panoptic Segmentation
2005.10242 (2020-05)
Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere
2007.12911 (2020-07)
Tighter risk certificates for neural networks
and 157 more not named here
checkpoint_filter_fn 37 other papers
20 dated earlier, 2 the same month, 13 later, 2 same year, order not determinable · 1 only as an assembly brick
2105.12723 (2021-05)
Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding
2112.07658 (2021-12)
AdaViT: Adaptive Tokens for Efficient Vision Transformer
and 34 more not named here
resize_pos_embed 20 other papers
10 dated earlier, 2 the same month, 8 later · 1 only as an assembly brick
2105.12723 (2021-05)
Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding
2202.07800 (2022-02)
Not All Patches are What You Need: Expediting Vision Transformers via Token Reorganizations
and 17 more not named here
do_nothing 13 other papers
4 dated earlier, 9 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.01812 (2023-10)
PPT: Token Pruning and Pooling for Efficient Vision Transformers
and 10 more not named here
parse_r 4 other papers
2 dated earlier, 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
2406.09936 (2024-06)
ALGM: Adaptive Local-then-Global Token Merging for Efficient Semantic Segmentation with Plain Vision Transformers
and 1 more not named here
build_transform 1 other paper
1 dated earlier
2206.04673 (2022-06)
Neural Prompt Search

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

Recently, the scale of transformers has grown rapidly, which introduces considerable challenges in terms of training overhead and inference efficiency in the scope of task adaptation. Existing works, namely Parameter-Efficient Fine-Tuning (PEFT) and model compression, have separately investigated the challenges. However, PEFT cannot guarantee the inference efficiency of the original backbone, especially for large-scale models. Model compression requires significant training costs for structure searching and re-training. Consequently, a simple combination of them cannot guarantee accomplishing both training efficiency and inference efficiency with minimal costs. In this paper, we propose a novel Parallel Yielding Re-Activation (PYRA) method for such a challenge of training-inference efficient task adaptation. PYRA first utilizes parallel yielding adaptive weights to comprehensively perceive the data distribution in downstream tasks. A re-activation strategy for token modulation is then applied for tokens to be merged, leading to calibrated token features. Extensive experiments demonstrate that PYRA outperforms all competing methods under both low compression rate and high compression rate, demonstrating its effectiveness and superiority in maintaining both training efficiency and inference efficiency for large-scale foundation models. Our code is available at https://github.com/THU-MIG/PYRA.

For agents

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

get_harvested_code_for_paper("2403.09192")
get_code_for_paper("2403.09192")
have("2403.09192")

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

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

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

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

Connect an agent — have() is free.