SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2111.04578 · NeurIPS · 2021

Improved Regularization and Robustness for Fine-tuning in Neural Networks

Hongyang Zhang, Dongyue Li

arXiv · PDF · Open in the Atlas

Code that ran

10 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 6 failures of our instrument; 1 no recorded run); 2 of them were also run on the host, not in the jail, by the peer-agreement lane that set their level, 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/2111.04578.json · badge: /api/ran/2111.04578.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
VirtuosoResearch/Regularized-Self-Labeling canonical (classifier label)
classifier basis not recorded on the link
9 ran · 1 no recorded run
neu-statsml-research/regularized-self-labeling marked official in Papers with Code
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
np2th Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
VirtuosoResearch/Regularized-Self-Labeling/model/modeling_resnet.py
code served (permissive licence) · get_code("7d8eaf5537f699e4")
How it ran

Ran in Syntology's jail 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 (5, 4, 2, 3) as a later run recorded it. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-05T00:36:31Z). 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

torch.manual_seed(0)

# Create a small numpy array with shape HWIO (Height, Width, Input channels, Output channels)
# Using distinct dimensions: H=2, W=3, I=4, O=5
weights = np.random.randn(2, 3, 4, 5).astype(np.float32)

ARGS = {
    "weights": weights,
    "conv": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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 (5, 4, 2, 3) — shape (5, 4, 2, 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
swish Ran
ran; our contract draft was wrong, not the code
VirtuosoResearch/Regularized-Self-Labeling/model/modeling_vit.py
code served (permissive licence) · get_code("0f786c407fb1ee4c")
How it ran

Ran in Syntology's jail 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. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T22:33:52Z). 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)

# The function swish takes a single parameter 'x' which is used with:
# - torch.sigmoid(x) - requires a tensor
# - x * ... - requires a tensor that supports multiplication
# So x should be a tensor

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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
LInfLipschitzConstraint Ran
ran on a synthesized input · constructed an object; no result was computed
neu-statsml-research/regularized-self-labeling/utils/constraint.py
code served (permissive licence) · get_code("60bf9605f43a64d3")
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, LInfLipschitzConstraint: 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
from torch.nn import BatchNorm2d

torch.manual_seed(0)

# Create a simple model with Linear and Conv2d layers
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.conv1 = nn.Conv2d(3, 5, kernel_size=3)
        self.bn1 = BatchNorm2d(5)
        
    def forward(self, x):
        return x

model = SimpleModel()

# Create a state_dict by cloning the current parameters
state_dict = {}
for name, param in model.named_parameters():
    state_dict[name] = param.data.clone()

# Also capture BatchNorm2d state
for name, module in model.named_modules():
    if isinstance(module, BatchNorm2d):
        state_dict[name + '.weight'] = module.weight.data.clone()
        state_dict[name + '.running_var'] = module.running_var.data.clone()

ARGS = {
    'model_type': nn.Linear,
    'max_k': 2.0,
    'state_dict': state_dict,
    'excluding_key': None,
    'including_key': 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 LInfLipschitzConstraint — 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 LInfLipschitzConstraint 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
accuracy Ran
ran; our contract draft was wrong, not the code
VirtuosoResearch/Regularized-Self-Labeling/model/metric.py
pointer only (licence: MIT); the stored copy get_code serves, from lingbai-kong/causalformer, is pointer only (licence: GPL-3.0) · get_code("5dcb4148be3fcbaf")
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 lingbai-kong/causalformer, and GPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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.

add_penalties Ran
ran on a synthesized input
VirtuosoResearch/Regularized-Self-Labeling/reproduce-chexnet/model.py
code served (permissive licence) · get_code("310332a4414b2ad1")
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)

# Create a minimal state_dict
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Linear(3, 3)
        self.layer3 = nn.Linear(3, 3)
        self.layer4 = nn.Linear(3, 2)
        self.pred_head = nn.Linear(2, 1)
    
    def forward(self, x):
        x = self.layer1(x)
        x = self.layer2(x)
        x = self.layer3(x)
        x = self.layer4(x)
        x = self.pred_head(x)
        return x

model = SimpleModel()
state_dict = model.state_dict()

ARGS = {
    'norm': 'L2',
    'lambda_extractor': 0.01,
    'lambda_pred_head': 0.005,
    'state_dict': state_dict,
    'scale_factor': 2.0
}
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
add_penalty Ran
ran on a synthesized input
VirtuosoResearch/Regularized-Self-Labeling/reproduce-chexnet/constraint.py
code served (permissive licence) · get_code("f97515ae0c7bb673")
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 as nn

torch.manual_seed(0)

# Create a simple model with weight parameters (no bias for simplicity in test)
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3, bias=False)
        self.linear2 = nn.Linear(3, 2, bias=False)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

# Create a state_dict for comparison (optional parameter)
state_dict = {
    'linear1.weight': torch.randn(3, 4),
    'linear2.weight': torch.randn(2, 3),
}

ARGS = {
    'model': model,
    'norm': 'frob',
    '_lambda': 0.1,
    'excluding_key': None,
    'including_key': None,
    'state_dict': state_dict,
}
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
conv1x1 Ran
ran; our contract draft was wrong, not the code
VirtuosoResearch/Regularized-Self-Labeling/model/modeling_resnet.py
pointer only (licence: MIT); the stored copy get_code serves, from maloadba/mgenseg_2d, is pointer only (licence: NONE) · get_code("b0f916df39e78ae5")
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 maloadba/mgenseg_2d, and GitHub detected no licence in that repository when it was checked. 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.

conv3x3 Ran
ran; our contract draft was wrong, not the code
VirtuosoResearch/Regularized-Self-Labeling/model/modeling_resnet.py
pointer only (licence: MIT); the stored copy get_code serves, from maloadba/mgenseg_2d, is pointer only (licence: NONE) · get_code("4e5bf13dbdc4f008")
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 maloadba/mgenseg_2d, and GitHub detected no licence in that repository when it was checked. 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.

deep_copy Ran
ran on a synthesized input
VirtuosoResearch/Regularized-Self-Labeling/reproduce-chexnet/model.py
code served (permissive licence) · get_code("d2ee7320cf52c3fc")
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

torch.manual_seed(0)

# The function deep_copy takes a state_dict and clones/detaches each tensor value
# state_dict is expected to be a dict where values are tensors with .clone() and .detach() methods

state_dict = {
    "layer1.weight": torch.randn(4, 3),
    "layer1.bias": torch.randn(2),
    "layer2.weight": torch.randn(5, 4),
}

ARGS = {
    "state_dict": state_dict
}
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
top_k_acc Ran
ran; our contract draft was wrong, not the code
VirtuosoResearch/Regularized-Self-Labeling/model/metric.py
pointer only (licence: MIT); the stored copy get_code serves, from lingbai-kong/causalformer, is pointer only (licence: GPL-3.0) · get_code("61cc9667c37ecd27")
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 lingbai-kong/causalformer, and GPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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.

train_model Not yet run
unverified (harvested, no recorded run)
VirtuosoResearch/Regularized-Self-Labeling/reproduce-chexnet/model.py
code served (permissive licence) · get_code("4f41333015d53dc7")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 8 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 4 the same month, 8 later) and 3 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
swish 206 other papers
84 dated earlier, 2 the same month, 117 later, 3 same year, order not determinable · 44 only as an assembly brick
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1805.12114 (2018-05)
Deep Reinforcement Learning in a Handful of Trials using Probabilistic Dynamics Models
1809.01357 (2018-09)
Zero Shot Learning for Code Education: Rubric Sampling with Deep Learning Inference
and 203 more not named here
np2th 35 other papers
11 dated earlier, 1 the same month, 23 later · 5 only as an assembly brick
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2102.04306 (2021-02)
TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation
2103.07976 (2021-03)
TransFG: A Transformer Architecture for Fine-grained Recognition
and 32 more not named here
conv1x1 33 other papers
8 dated earlier, 2 the same month, 23 later · 3 only as an assembly brick
1912.11370 (2019-12)
Big Transfer (BiT): General Visual Representation Learning
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2102.04306 (2021-02)
TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation
and 30 more not named here
conv3x3 33 other papers
8 dated earlier, 2 the same month, 23 later · 3 only as an assembly brick
1912.11370 (2019-12)
Big Transfer (BiT): General Visual Representation Learning
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2102.04306 (2021-02)
TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation
and 30 more not named here
accuracy 5 other papers
2 dated earlier, 3 later
1609.09869 (2016-09)
Structured Inference Networks for Nonlinear State Space Models
1907.00865 (2019-07)
Radial Bayesian Neural Networks: Beyond Discrete Support In Large-Scale Bayesian Deep Learning
2206.02659 (2022-06)
Robust Fine-Tuning of Deep Neural Networks with Hessian-based Generalization Guarantees
and 2 more not named here
top_k_acc 4 other papers
1 dated earlier, 3 later
1609.09869 (2016-09)
Structured Inference Networks for Nonlinear State Space Models
2206.02659 (2022-06)
Robust Fine-Tuning of Deep Neural Networks with Hessian-based Generalization Guarantees
2312.10890 (2023-12)
Low-latency Space-time Supersampling for Real-time Rendering
and 1 more not named here
add_penalty 1 other paper
1 later
2302.04451 (2023-02)
Generalization in Graph Neural Networks: Improved PAC-Bayesian Bounds on Graph Diffusion
deep_copy 1 other paper
1 later
2302.04451 (2023-02)
Generalization in Graph Neural Networks: Improved PAC-Bayesian Bounds on Graph Diffusion

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

A widely used algorithm for transfer learning is fine-tuning, where a pre-trained model is fine-tuned on a target task with a small amount of labeled data. When the capacity of the pre-trained model is significantly larger than the size of the target dataset, fine-tuning is prone to overfitting and memorizing the training labels. Hence, a crucial question is to regularize fine-tuning and ensure its robustness against noise. To address this question, we begin by analyzing the generalization properties of fine-tuning. We present a PAC-Bayes generalization bound that depends on the distance traveled in each layer during fine-tuning and the noise stability of the fine-tuned model. We empirically measure these quantities. Based on the analysis, we propose regularized self-labeling-the interpolation between regularization and self-labeling methods, including (i) layer-wise regularization to constrain the distance traveled in each layer; (ii) self-label-correction and labelreweighting to correct mislabeled data points (that the model is confident) and reweight less confident data points. We validate our approach on an extensive collection of image and text datasets using multiple pre-trained model architectures. Our approach improves baseline methods by 1.76% (on average) for seven image classification tasks and 0.75% for a few-shot classification task. When the target data set includes noisy labels, our approach outperforms baseline methods by an average of 3.56% in two noisy settings.

For agents

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

get_harvested_code_for_paper("2111.04578")
get_code_for_paper("2111.04578")
have("2111.04578")

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

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

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

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

Connect an agent — have() is free.