SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2501.08885 · ICCV · 2025

Perspective-Aware Teaching: Adapting Knowledge for Heterogeneous Distillation

Hong-Han Shuai, Wen-Huang Cheng, Yi Yao, Chan-Feng Hsu, Jhe-Hao Lin, Hong-Xia Xie

arXiv · PDF · Open in the Atlas

Code that ran

13 of 16 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (8 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 4 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/2501.08885.json · badge: /api/ran/2501.08885.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
jimmylin0979/PAT community
Papers with Code archive
13 ran · 3 no recorded run
FunctionStatusWhere it lives
BaseDistiller Ran
ran on a synthesized input · constructed an object; no result was computed
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("7faaedcc21f0004d")
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 an instance of its own class, BaseDistiller: the run constructed the object and did not call it, so no result was computed. 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)

# Build a minimal student model
class StudentModel(nn.Module):
    def __init__(self):
        super(StudentModel, self).__init__()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, x):
        return self.linear(x)

# Build a minimal teacher model
class TeacherModel(nn.Module):
    def __init__(self):
        super(TeacherModel, self).__init__()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, x):
        return self.linear(x)

# Create instances
student = StudentModel()
teacher = TeacherModel()

# Create a criterion (loss function)
criterion = nn.CrossEntropyLoss()

# Create args dict with minimal configuration
args = {
    'temperature': 4.0,
    'alpha': 0.5,
    'batch_size': 2,
    'learning_rate': 0.01,
}

ARGS = {
    'student': student,
    'teacher': teacher,
    'criterion': criterion,
    'args': args,
}
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 BaseDistiller — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BaseDistiller 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
CNN2CNNProjector Ran
ran on a synthesized input · constructed an object; no result was computed
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("373d5549a4931491")
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 an instance of its own class, CNN2CNNProjector: the run constructed the object and did not call it, so no result was computed. 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)

# CNN2CNNProjector expects two torch.Size objects for in_shapes and out_shapes
# in_shapes: (batch, channels_in, height_in, width_in)
# out_shapes: (batch, channels_out, height_out, width_out)
# The constructor asserts that height == width for both input and output

in_shapes = torch.Size([2, 4, 8, 8])  # batch=2, channels_in=4, h=8, w=8
out_shapes = torch.Size([2, 3, 6, 6])  # batch=2, channels_out=3, h=6, w=6

ARGS = {
    'in_shapes': in_shapes,
    'out_shapes': out_shapes
}
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 CNN2CNNProjector — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CNN2CNNProjector 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
CNN2ViTProjector Ran
ran on a synthesized input · constructed an object; no result was computed
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("58ec827bec449ba6")
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 an instance of its own class, CNN2ViTProjector: the run constructed the object and did not call it, so no result was computed. 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
from timm.models.layers import PatchEmbed

torch.manual_seed(0)

# Construct the arguments for CNN2ViTProjector
# Parameter breakdown:
# - in_shapes: tuple of (batch, channels, height, width)
# - embed_tokens: number of tokens (must be a perfect square for the square root operation)
# - embed_dim: embedding dimension

in_shapes = (2, 3, 8, 8)  # batch=2, channels=3, height=8, width=8
embed_tokens = 16  # 4x4 grid of tokens (16 = 4^2)
embed_dim = 64  # embedding dimension

ARGS = {
    "in_shapes": in_shapes,
    "embed_tokens": embed_tokens,
    "embed_dim": embed_dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CNN2ViTProjector — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CNN2ViTProjector 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
RAProjector Ran
ran on a synthesized input · constructed an object; no result was computed
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("7761c53ac0e3680a")
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 an instance of its own class, RAProjector: the run constructed the object and did not call it, so no result was computed. 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)

# Construct valid arguments for RAProjector
feat_shape = torch.Size([2, 4, 8, 8])  # batch=2, channels=4, height=8, width=8
patch_length = 16  # 4x4 patches
embed_dim = 32

is_q = True

ARGS = {
    "feat_shape": feat_shape,
    "patch_length": patch_length,
    "embed_dim": embed_dim,
    "is_q": is_q,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type RAProjector — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a RAProjector 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
RegionAttention Ran
ran on a synthesized input · constructed an object; no result was computed
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("897882a5e8a88c61")
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 an instance of its own class, RegionAttention: the run constructed the object and did not call it, so no result was computed. 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 math
import torch
import torch.nn as nn
from timm.models.layers import PatchEmbed
from typing import List

torch.manual_seed(0)

# Create small feature shapes for student and teacher
# Each shape is (batch, channels, height, width) format
feat_student_shapes = [
    torch.Size([2, 3, 8, 8]),
    torch.Size([2, 4, 4, 4]),
]

feat_teacher_shapes = [
    torch.Size([2, 3, 16, 16]),
    torch.Size([2, 4, 8, 8]),
]

num_queries = 5
dim = 64
heads = 4
dropout = 0.1

ARGS = {
    "feat_student_shapes": feat_student_shapes,
    "feat_teacher_shapes": feat_teacher_shapes,
    "num_queries": num_queries,
    "dim": dim,
    "heads": heads,
    "dropout": dropout,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type RegionAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a RegionAttention 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
SEBlock Ran
ran on a synthesized input · constructed an object; no result was computed
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("0546ce0adeb02bde")
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 an instance of its own class, SEBlock: the run constructed the object and did not call it, so no result was computed. 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)

# SEBlock.__init__ takes in_channels and ratio as parameters
ARGS = {
    "in_channels": 64,
    "ratio": 16,
}
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 SEBlock — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SEBlock 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
ViT2CNNProjector Ran
ran on a synthesized input · constructed an object; no result was computed
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("d352000861a8fd36")
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 an instance of its own class, ViT2CNNProjector: the run constructed the object and did not call it, so no result was computed. 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)

# Construct arguments for ViT2CNNProjector
# The __init__ takes:
# - in_shapes: torch.Size for input shape (batch, sequence_length, embedding_dim)
# - out_shapes: torch.Size for output shape (batch, channels, height, width)

# We need in_shapes where the sequence_length l is a perfect square
# so that int(math.sqrt(l)) produces a valid integer in forward()
# Let's use l=16 (4x4 patch grid)

in_shapes = torch.Size([2, 16, 8])  # batch=2, sequence_length=16 (4x4 grid), embedding_dim=8
out_shapes = torch.Size([2, 3, 7, 7])  # batch=2, channels=3, height=7, width=7

ARGS = {
    "in_shapes": in_shapes,
    "out_shapes": out_shapes,
}
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 ViT2CNNProjector — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ViT2CNNProjector 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
ViT2ViTProjector Ran
ran on a synthesized input · constructed an object; no result was computed
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("fd196a0c189320de")
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 an instance of its own class, ViT2ViTProjector: the run constructed the object and did not call it, so no result was computed. 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)

# Analyze the ViT2ViTProjector to understand parameter requirements:
# - in_shapes: tuple of 3 elements (batch, l1, d1)
# - embed_tokens: int (output sequence length)
# - embed_dim: int (embedding dimension)

# The forward pass shows:
# 1. x shape: (batch, l1, d1)
# 2. mlp_d: BatchNorm1d(l1) + Linear(d1 -> embed_dim) -> (batch, l1, embed_dim)
# 3. transpose to (batch, embed_dim, l1)
# 4. mlp_l: BatchNorm1d(embed_dim) + Linear(l1 -> embed_tokens) -> (batch, embed_dim, embed_tokens)
# 5. transpose to (batch, embed_tokens, embed_dim)

# Use distinct sizes for different dimensions:
# batch=2, l1=5, d1=3, embed_dim=4, embed_tokens=6

ARGS = {
    "in_shapes": (2, 5, 3),  # (batch, l1, d1)
    "embed_tokens": 6,
    "embed_dim": 4,
}
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 ViT2ViTProjector — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ViT2ViTProjector 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
get_positional_encoding Ran
ran, honoured the contract we drafted
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("df1050a734942c85")
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 (100, 1, 64) 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

torch.manual_seed(0)

ARGS = {
    "d_model": 64,
    "max_len": 100,
}
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 (100, 1, 64) — shape (100, 1, 64) 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_projector_module Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("f24a50ec4768698e")
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 CNN2ViTProjector. 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)

# Test case 1: CNN2ViTProjector (4D input -> 3D output)
in_shapes_cnn2vit = torch.Size([2, 4, 8, 8])  # batch=2, channels=4, height=8, width=8
out_shapes_cnn2vit = torch.Size([2, 16, 32])  # batch=2, embed_tokens=16, embed_dim=32

# Test case 2: CNN2CNNProjector (4D input -> 4D output)
in_shapes_cnn2cnn = torch.Size([2, 4, 8, 8])  # batch=2, channels=4, height=8, width=8
out_shapes_cnn2cnn = torch.Size([2, 6, 4, 4])  # batch=2, channels=6, height=4, width=4

# Test case 3: ViT2ViTProjector (3D input -> 3D output)
in_shapes_vit2vit = torch.Size([2, 9, 16])  # batch=2, seq_len=9, embed_dim=16
out_shapes_vit2vit = torch.Size([2, 16, 32])  # batch=2, embed_tokens=16, embed_dim=32

# Test case 4: ViT2CNNProjector (3D input -> 4D output)
in_shapes_vit2cnn = torch.Size([2, 9, 16])  # batch=2, seq_len=9, embed_dim=16
out_shapes_vit2cnn = torch.Size([2, 6, 3, 3])  # batch=2, channels=6, height=3, width=3

# Use CNN2ViTProjector as the primary test case
ARGS = {
    "in_shapes": in_shapes_cnn2vit,
    "out_shapes": out_shapes_cnn2vit,
    "init_weight": None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CNN2ViTProjector — a CNN2ViTProjector output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CNN2ViTProjector 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
hcl_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("f493ed098c0c2ecb")
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 0, dtype family float, 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 math
import torch
import torch.nn.functional as F
from einops import rearrange, repeat

torch.manual_seed(0)

# Create tiny 4D tensors (N, C, H, W)
# Using distinct dimensions: batch=2, channels=4, height=8, width=8
feat_s = torch.randn(2, 4, 8, 8)
feat_t = torch.randn(2, 4, 8, 8)

ARGS = {
    "feat_s": feat_s,
    "feat_t": feat_t,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, 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
kd_loss Ran
ran; our contract draft was wrong, not the code
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("23388af4327e43c1")
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 0, dtype family float, 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 torch.nn.functional as F

torch.manual_seed(0)

# Create small logit tensors for student and teacher
# batch_size=2, num_classes=4
logits_student = torch.randn(2, 4)
logits_teacher = torch.randn(2, 4)

# Temperature parameter for knowledge distillation
temperature = 3.0

ARGS = {
    "logits_student": logits_student,
    "logits_teacher": logits_teacher,
    "temperature": temperature,
}
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 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
register_distiller Ran
ran; our contract draft was wrong, not the code
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("0466efd8ed0a4c22")
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 function. 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 collections import OrderedDict

torch.manual_seed(0)

# The register_distiller function takes a single parameter: fn (a function)
# Looking at the function body:
# - It calls fn.__name__ to get the function name
# - It converts it to lowercase
# - It stores the function in _distiller_dict

# We need to create a simple callable function to pass as the 'fn' parameter
def sample_distiller_function():
    """A sample distiller function to be registered."""
    pass

ARGS = {
    "fn": sample_distiller_function
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
PAT Not yet run
unverified (harvested, no recorded run)
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("f4cf6aac98290b55")
How it ran

no invocation recorded.

PromptBlock Not yet run
unverified (harvested, no recorded run)
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("e4459f636cf3355d")
How it ran

no invocation recorded.

init_weights Not yet run
unverified (harvested, no recorded run)
jimmylin0979/PAT/distillers/pat.py
code served (permissive licence) · get_code("93f26e689279411d")
How it ran

no invocation recorded.

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, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 13 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
BaseDistiller
brick of this paper's assembly: helper
1 other paper
1 later
2507.21844 (2025-07)
Cross-Architecture Distillation Made Simple with Redundancy Suppression
init_weights
brick of this paper's assembly: helper
1 other paper
1 later
2507.21844 (2025-07)
Cross-Architecture Distillation Made Simple with Redundancy Suppression
register_distiller
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2507.21844 (2025-07)
Cross-Architecture Distillation Made Simple with Redundancy Suppression

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

Knowledge distillation (KD) involves transferring knowledge from a pre-trained heavy teacher model to a lighter student model, thereby reducing the inference cost while maintaining comparable effectiveness. Prior KD techniques typically assume homogeneity between the teacher and student models. However, as technology advances, a wide variety of architectures have emerged, ranging from initial Convolutional Neural Networks (CNNs) to Vision Transformers (ViTs), and Multi-Level Perceptrons (MLPs). Consequently, developing a universal KD framework compatible with any architecture has become an important research topic. In this paper, we introduce a perspective-aware teaching (PAT) KD framework to enable feature distillation across diverse architectures. Our framework comprises two key components. First, we design prompt tuning blocks that incorporate student feedback, allowing teacher features to adapt to the student model's learning process. Second, we propose region-aware attention to mitigate the view mismatch problem between heterogeneous architectures. By leveraging these two modules, effective distillation of intermediate features can be achieved across heterogeneous architectures. Extensive experiments on CIFAR, ImageNet, and COCO demonstrate the superiority of the proposed method. Our code is available at https://github.com/jimmylin0979/PAT.git.

For agents

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

get_harvested_code_for_paper("2501.08885")
get_code_for_paper("2501.08885")
have("2501.08885")

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

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

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

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

Connect an agent — have() is free.