SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.03782 · ICLR · 2025

DaWin: Training-free Dynamic Weight Interpolation for Robust Adaptation

Sangdoo Yun, Dongyoon Han, Yixuan Li, Changdae Oh, Kyungwoo Song

arXiv · PDF · Open in the Atlas

Code that ran

8 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 5 failures of our instrument; 5 no recorded run), measured 2026-11-24; 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/2410.03782.json · badge: /api/ran/2410.03782.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
naver-ai/dawin canonical (classifier label)
classifier basis: classifier_2025
8 ran · 5 no recorded run
FunctionStatusWhere it lives
BetaMixtureModel Ran
ran on a synthesized input · constructed an object; no result was computed
naver-ai/dawin/dawin_rft/main_dawin.py
code served (permissive licence) · get_code("6c2cd3f4b948c5d7")
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, BetaMixtureModel: 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 numpy as np
from scipy.special import betaln, logsumexp
from sklearn.cluster import KMeans

# Set random seed for reproducibility
np.random.seed(42)

# Create a small synthetic dataset with values in (0, 1) range
# Shape: (n_observations, n_components)
n_observations = 10
n_components = 4
data_matrix = np.random.beta(2, 5, size=(n_observations, n_components))

# Ensure data is strictly between 0 and 1 (avoid boundary values)
data_matrix = np.clip(data_matrix, 0.01, 0.99)

ARGS = {
    'n_mixtures': 3,
    'random_seed': 1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BetaMixtureModel — 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 BetaMixtureModel 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
ModelWrapper Ran
ran on a synthesized input · constructed an object; no result was computed
naver-ai/dawin/dawin_rft/main_dawin.py
code served (permissive licence) · get_code("039fa65f7f5e3c95")
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, ModelWrapper: 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)

class StandInModel(nn.Module):
    """Minimal model that implements encode_image method"""
    def __init__(self, feature_dim):
        super(StandInModel, self).__init__()
        self.feature_dim = feature_dim
        self.linear = nn.Linear(3, feature_dim)
    
    def encode_image(self, images):
        # images shape: (batch, 3, height, width)
        # flatten and project to feature_dim
        batch_size = images.shape[0]
        x = images.view(batch_size, -1)
        return self.linear(x)

# Create a minimal model
feature_dim = 8
num_classes = 5
model = StandInModel(feature_dim=feature_dim)

# Create initial weights for the classification head
initial_weights = torch.zeros(num_classes, feature_dim)
torch.nn.init.kaiming_uniform_(initial_weights, a=math.sqrt(5))

ARGS = {
    'model': model,
    'feature_dim': feature_dim,
    'num_classes': num_classes,
    'normalize': False,
    'initial_weights': initial_weights,
    'lp_flag': 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 ModelWrapper — 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 ModelWrapper 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
compute_accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
naver-ai/dawin/dawin_rft/main_dawin.py
code served (permissive licence) · get_code("21d6c99219deff61")
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. 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 small tensors for logits and labels
# logits: shape (batch_size=2, num_classes=4)
logits = torch.randn(2, 4)

# labels: shape (batch_size=2,) with class indices in range [0, 3]
labels = torch.tensor([0, 2])

ARGS = {
    "logits": logits,
    "labels": labels,
}
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
compute_sample_loss_uncertainty_acc Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
naver-ai/dawin/dawin_rft/main_dawin.py
code served (permissive licence) · get_code("b397d4b8f1854d1f")
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.functional as F

torch.manual_seed(0)

# Create small tensors for the function
batch_size = 2
num_classes = 4

# Test case 1: pseudo_label = 0 (standard cross-entropy path)
logits = torch.randn(batch_size, num_classes)
labels = torch.tensor([0, 2])
temperature = 1.0
pseudo_label = 0

ARGS = {
    "logits": logits,
    "labels": labels,
    "temperature": temperature,
    "pseudo_label": pseudo_label,
}
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
get_model_from_sd Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
naver-ai/dawin/dawin_rft/main_dawin.py
code served (permissive licence) · get_code("c78d8ca2d47dc29f")
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 ModelWrapper. 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 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)

# Create a minimal base model that has encode_image method
class MinimalModel(nn.Module):
    def __init__(self, feature_dim=4):
        super().__init__()
        self.feature_dim = feature_dim
        # Simple linear layer to act as encoder
        self.encoder = nn.Linear(3, feature_dim)
    
    def encode_image(self, images):
        # images shape: (batch, 3)
        return self.encoder(images)

# Create a minimal state dict with the expected keys
base_model = MinimalModel(feature_dim=4)
state_dict = {
    'classification_head.weight': torch.randn(5, 4),  # (num_classes=5, feature_dim=4)
    'classification_head.bias': torch.zeros(5),
}

ARGS = {
    'state_dict': state_dict,
    'base_model': base_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 ModelWrapper — a ModelWrapper output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModelWrapper 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
identity Ran
ran, honoured the contract we drafted
naver-ai/dawin/dawin_rft/main_dawin.py
code served (permissive licence) · get_code("c5bb65913ea0ddde")
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. 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

torch.manual_seed(0)

ARGS = {
    'x': torch.randn(2, 4),
    'device': 'cpu'
}
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
interpolation Ran
ran; our contract draft was wrong, not the code
naver-ai/dawin/dawin_rft/main_dawin.py
code served (permissive licence) · get_code("3fa6fd6e7e271a85")
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)

# Create two weight dictionaries with the same keys
# These represent model weights that can be interpolated
weight1 = {
    'layer1.weight': torch.randn(4, 3),
    'layer1.bias': torch.randn(4),
    'layer2.weight': torch.randn(5, 4),
}

weight2 = {
    'layer1.weight': torch.randn(4, 3),
    'layer1.bias': torch.randn(4),
    'layer2.weight': torch.randn(5, 4),
}

# Interpolation factor (between 0 and 1)
alpha = 0.3

ARGS = {
    'alpha': alpha,
    'weight1': weight1,
    'weight2': weight2,
}
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
maybe_dictionarize_batch Ran
ran; our contract draft was wrong, not the code
naver-ai/dawin/dawin_rft/main_dawin.py
code served (permissive licence) · get_code("436fbeb218857c5b")
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 numpy as np

torch.manual_seed(0)

# Test case 1: batch is already a dict
batch_dict = {
    'images': torch.randn(2, 4),
    'labels': torch.randint(0, 10, (2,)),
    'metadata': torch.randn(2, 3)
}

ARGS = {
    'batch': batch_dict
}
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 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
DaWin Not yet run
unverified (harvested, no recorded run)
naver-ai/dawin/dawin_rft/main_dawin.py
code served (permissive licence) · get_code("82d38f0648bab95b")
How it ran

no invocation recorded.

convert_weights Not yet run
unverified (harvested, no recorded run)
naver-ai/dawin/dawin_rft/main_dawin.py
code served (permissive licence) · get_code("459acf5ac1469588")
How it ran

no invocation recorded.

get_feats_logits_and_labels Not yet run
unverified (harvested, no recorded run)
naver-ai/dawin/dawin_rft/main_dawin.py
code served (permissive licence) · get_code("af186f1a90354fb8")
How it ran

no invocation recorded.

torch_load Not yet run
unverified (harvested, no recorded run)
naver-ai/dawin/dawin_rft/main_dawin.py
code served (permissive licence) · get_code("2235e9caabb77a27")
How it ran

no invocation recorded.

torch_save Not yet run
unverified (harvested, no recorded run)
naver-ai/dawin/dawin_rft/main_dawin.py
code served (permissive licence) · get_code("74d1e09d356b3810")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 3 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 10 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
torch_load
brick of this paper's assembly: helper
2 other papers
2 dated earlier
2208.05592 (2022-08)
Patching open-vocabulary models by interpolating weights
2308.12213 (2023-08)
CLIPN for Zero-Shot OOD Detection: Teaching CLIP to Say No
convert_weights
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2306.09244 (2023-06)
Text Promptable Surgical Instrument Segmentation with Vision-Language Models
maybe_dictionarize_batch
brick of this paper's assembly: helper
1 other paper
1 later
2411.09263 (2024-11)
Rethinking Weight-Averaged Model-merging

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-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Adapting a pre-trained foundation model on downstream tasks should ensure robustness against distribution shifts without the need to retrain the whole model. Although existing weight interpolation methods are simple yet effective, we argue that their static nature limits downstream performance while achieving efficiency. In this work, we propose DaWin, a training-free dynamic weight interpolation method that leverages the entropy of individual models over each unlabeled test sample to assess model expertise, and compute per-sample interpolation coefficients dynamically. Unlike previous works that typically rely on additional training to learn such coefficients, our approach requires no training. Then, we propose a mixture modeling approach that greatly reduces inference overhead raised by dynamic interpolation. We validate DaWin on the large-scale visual recognition benchmarks, spanning 14 tasks across robust fine-tuning -ImageNet and derived five distribution shift benchmarks -and multi-task learning with eight classification tasks. Results demonstrate that DaWin achieves significant performance gain in considered settings, with minimal computational overhead. We further discuss DaWin's analytic behavior to explain its empirical success. Here is our code.

For agents

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

get_harvested_code_for_paper("2410.03782")
get_code_for_paper("2410.03782")
have("2410.03782")

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

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

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

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

Connect an agent — have() is free.