SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.17316 · ICLR · 2024

Towards Robust and Efficient Cloud-Edge Elastic Model Adaptation via Selective Entropy Distillation

Mingkui Tan, Yaofo Chen, Shuaicheng Niu, Yaowei Wang, Shoukai Xu, Hengjie Song

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 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; 7 failures of our instrument; 3 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/2402.17316.json · badge: /api/ran/2402.17316.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
chenyaofo/CEMA canonical (classifier label)
classifier basis: census
4 ran · 3 no recorded run
chenyaofo/cema canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
bn_mean_var Ran
ran; our contract draft was wrong, not the code
chenyaofo/CEMA/codebase/core/bn_utils.py
code served (permissive licence) · get_code("15d72359d940ea49")
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 2, 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

torch.manual_seed(0)

# The function bn_mean_var takes a single parameter x which is a torch.Tensor
# It computes variance and mean along dimensions [0, 2, 3] with keepdim=False
# This suggests x should be a 4D tensor (batch, channels, height, width)
# We'll create a small tensor with distinct dimension sizes

x = torch.randn(2, 4, 3, 5)  # batch=2, channels=4, height=3, width=5

ARGS = {
    "x": x
}
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 2, 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
excute_tent_style_tta Ran
ran; our contract draft was wrong, not the code
chenyaofo/CEMA/codebase/core/tta/tent.py
code served (permissive licence) · get_code("0192a68f42100757")
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
import torch.optim as optim
from typing import Callable

torch.manual_seed(0)

# Create a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

# Create sample tensor (batch_size=2, features=4)
samples = torch.randn(2, 4)

# Create a loss function
def loss_fn(outputs):
    return outputs.mean()

# Create an optimizer
optimizer = optim.SGD(model.parameters(), lr=0.01)

ARGS = {
    'model': model,
    'samples': samples,
    'loss_fn': loss_fn,
    'optimizer': optimizer
}
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
prepare_model_for_tent_tta Ran
ran; our contract draft was wrong, not the code
chenyaofo/cema/codebase/core/tta/cema.py
code served (permissive licence) · get_code("94e22ca0ce687bca")
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 SimpleModel. 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 model with BatchNorm, Dropout, GroupNorm, and LayerNorm layers
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.bn1d = nn.BatchNorm1d(4)
        self.bn2d = nn.BatchNorm2d(3)
        self.bn3d = nn.BatchNorm3d(2)
        self.dropout = nn.Dropout(0.5)
        self.dropout1d = nn.Dropout1d(0.5)
        self.dropout2d = nn.Dropout2d(0.5)
        self.dropout3d = nn.Dropout3d(0.5)
        self.group_norm = nn.GroupNorm(2, 4)
        self.layer_norm = nn.LayerNorm(4)
        self.linear = nn.Linear(4, 2)
    
    def forward(self, x):
        return x

model = SimpleModel()

ARGS = {
    "model": model,
    "is_tbr": False,
    "update_all_parameters": False,
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
prepare_model_for_tent_tta Ran
ran; our contract draft was wrong, not the code
chenyaofo/CEMA/codebase/core/tta/eata.py
code served (permissive licence) · get_code("0ae9ad817a1ac72b")
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 TinyModel. 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)

# Create a small model with BatchNorm, Dropout, GroupNorm, and LayerNorm layers
class TinyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv1 = nn.Conv2d(3, 8, kernel_size=3)
        self.bn1 = nn.BatchNorm2d(8)
        self.dropout = nn.Dropout(0.5)
        self.fc1 = nn.Linear(8 * 3 * 3, 16)
        self.group_norm = nn.GroupNorm(4, 16)
        self.layer_norm = nn.LayerNorm(16)
    
    def forward(self, x):
        x = self.conv1(x)
        x = self.bn1(x)
        x = self.dropout(x)
        x = x.view(x.size(0), -1)
        x = self.fc1(x)
        x = self.group_norm(x)
        x = self.layer_norm(x)
        return x

model = TinyModel()

ARGS = {
    "model": model,
    "update_all_parameters": False
}
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 TinyModel — a TinyModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a TinyModel 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
set_bn_training_mode Ran
ran; our contract draft was wrong, not the code
chenyaofo/cema/codebase/core/tta/cema.py
code served (permissive licence) · get_code("610274b1cb340baf")
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 Sequential. 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 model with BatchNorm layers
model = nn.Sequential(
    nn.Linear(4, 8),
    nn.BatchNorm1d(8),
    nn.ReLU(),
    nn.Linear(8, 3),
    nn.BatchNorm1d(3),
)

# Test with mode=True
mode = True

ARGS = {
    "model": model,
    "mode": mode,
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
tbr_bn_forward_impl Ran
ran; our contract draft was wrong, not the code
chenyaofo/CEMA/codebase/core/tta/tbr.py
code served (permissive licence) · get_code("97ce91542b45921d")
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 4, dtype family float, shape (2, 3, 4, 5) 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

torch.manual_seed(0)

# Create a BatchNorm2d instance
# The function expects self to be nn.BatchNorm2d
# It uses: self.eps, self.running_mean, self.running_var, self.training, 
#         self.momentum, self.weight, self.bias
bn_module = nn.BatchNorm2d(num_features=3)

# Create input tensor with shape (batch_size, channels, height, width)
# Using batch=2, channels=3, height=4, width=5 for distinct dimensions
x = torch.randn(2, 3, 4, 5)

# Set the module to training mode so the running stats update
bn_module.train()

ARGS = {
    "self": bn_module,
    "x": x
}
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 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 4, 5) 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
update_model_probs Ran
ran; our contract draft was wrong, not the code
chenyaofo/cema/codebase/core/tta/cema.py
code served (permissive licence) · get_code("f4a71b97346fb88d")
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 1, dtype family float, shape (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)

# Case 1: current_model_probs is None, new_probs is non-empty
# This tests the first branch
current_model_probs_1 = None
new_probs_1 = torch.randn(2, 4)

# Case 2: current_model_probs is not None, new_probs is empty
# This tests the second branch
current_model_probs_2 = torch.randn(4)
new_probs_2 = torch.randn(0, 4)

# Case 3: both are non-empty
# This tests the third branch
current_model_probs_3 = torch.randn(4)
new_probs_3 = torch.randn(2, 4)

# Use case 1 as the primary test case
ARGS = {
    "current_model_probs": current_model_probs_1,
    "new_probs": new_probs_1,
}
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 1, dtype family float, shape (4,) — shape (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
get_bn_from_model Not yet run
unverified (harvested, no recorded run)
chenyaofo/CEMA/codebase/core/bn_utils.py
code served (permissive licence) · get_code("dfddb4df823eb265")
How it ran

no invocation recorded.

set_tta_bn_pre_hook Not yet run
unverified (harvested, no recorded run)
chenyaofo/CEMA/codebase/core/bn_utils.py
code served (permissive licence) · get_code("457ae3ea99eb8c82")
How it ran

no invocation recorded.

tema_bn_forward_impl Not yet run
unverified (harvested, no recorded run)
chenyaofo/CEMA/codebase/core/tta/tema.py
code served (permissive licence) · get_code("62a6e452f89ad16b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 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
update_model_probs 8 other papers
3 dated earlier, 4 later, 1 undated
2204.02610 (2022-04)
Efficient Test-Time Model Adaptation without Forgetting
2309.14949 (2023-09)
Towards Real-World Test-Time Adaptation: Tri-Net Self-Training with Balanced Normalization
2311.14402 (2023-11)
TEA: Test-time Energy Adaptation
and 5 more not named here

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

The conventional deep learning paradigm often involves training a deep model on a server and then deploying the model or its distilled ones to resource-limited edge devices. Usually, the models shall remain fixed once deployed (at least for some period) due to the potential high cost of model adaptation for both the server and edge sides. However, in many real-world scenarios, the test environments may change dynamically (known as distribution shifts), which often results in degraded performance. Thus, one has to adapt the edge models promptly to attain promising performance. Moreover, with the increasing data collected at the edge, this paradigm also fails to further adapt the cloud model for better performance. To address these, we encounter two primary challenges: 1) the edge model has limited computation power and may only support forward propagation; 2) the data transmission budget between cloud and edge devices is limited in latencysensitive scenarios. In this paper, we establish a Cloud-Edge Elastic Model Adaptation (CEMA) paradigm in which the edge models only need to perform forward propagation and the edge models can be adapted online. In our CEMA, to reduce the communication burden, we devise two criteria to exclude unnecessary samples from uploading to the cloud, i.e., dynamic unreliable and low-informative sample exclusion. Based on the uploaded samples, we update and distribute the affine parameters of normalization layers by distilling from the stronger foundation model to the edge model with a sample replay strategy. Extensive experimental results on ImageNet-C and ImageNet-R verify the effectiveness of our CEMA.

For agents

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

get_harvested_code_for_paper("2402.17316")
get_code_for_paper("2402.17316")
have("2402.17316")

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

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

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

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

Connect an agent — have() is free.