SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2409.17137 · NeurIPS · 2024

PACE: Marrying generalization in PArameter-efficient fine-tuning with Consistency rEgularization

Piotr Koniusz, Yao Ni, Shan Zhang

arXiv · PDF · Open in the Atlas

Code that ran

8 of 18 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; 4 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 2 failures of our instrument; 10 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/2409.17137.json · badge: /api/ran/2409.17137.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
MaxwellYaoNi/PACE canonical (classifier label)
classifier basis: census
5 ran · 6 no recorded run
maxwellyaoni/pace canonical (classifier label)
classifier basis: classifier_2025
3 ran · 4 no recorded run
FunctionStatusWhere it lives
PACE_MSELoss Ran
ran on a synthesized input
maxwellyaoni/pace/Vision/pace/pace_ops.py
code served (permissive licence) · get_code("48cd5985c19fb541")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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

class PACE_MSELoss(nn.Module):

    def forward(self, input: torch.Tensor, target: torch.Tensor) -> torch.Tensor:
        return (input - target).square().sum(dim=-1).mean()


INIT_ARGS = {}

ARGS = {
    'input': torch.randn(2, 4),
    'target': torch.randn(2, 4),
}

if __name__ == '__main__':
    model = PACE_MSELoss(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output value: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SharableDropPath Ran
ran on a synthesized input · constructed an object; no result was computed
maxwellyaoni/pace/Vision/pace/pace_ops.py
code served (permissive licence) · get_code("fb1f1dbfe9b8cf1c")
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, SharableDropPath: 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 timm

torch.manual_seed(0)

# The function is a custom DropPath layer that expects:
# 1. drop_prob: float - probability of dropping
# 2. scale_by_keep: bool - whether to scale by keep probability
# 3. duplicate: int - number of duplicates to handle
# 4. **kwargs: additional arguments passed to parent class

# Create a small input tensor to test with
# Shape: (batch_size, channels, height, width) - 4D tensor
x = torch.randn(4, 3, 2, 2)

ARGS = {
    "drop_prob": 0.5,
    "scale_by_keep": True,
    "duplicate": 2,
}
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 SharableDropPath — 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 SharableDropPath 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_loss_pace Ran
ran; our contract draft was wrong, not the code
maxwellyaoni/pace/Vision/pace/pace_ops.py
code served (permissive licence) · get_code("82cf5ebffd77609b")
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 dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import timm

torch.manual_seed(0)

# Build a minimal model that uses SharableDropPath and returns logits
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.drop_path = timm.layers.DropPath(drop_prob=0.1)
        self.sharable_drop_path = timm.layers.DropPath(drop_prob=0.1)
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        # x shape: (batch, 4)
        x = self.linear(x)
        return x

# Build a model with SharableDropPath
class ModelWithSharableDropPath(nn.Module):
    def __init__(self):
        super().__init__()
        self.sharable_drop_path = timm.layers.DropPath(drop_prob=0.1)
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        # x shape: (batch, 4)
        x = self.linear(x)
        x = self.sharable_drop_path(x)
        return x

model = ModelWithSharableDropPath()
model.eval()

# Create small tensors
x = torch.randn(2, 4)  # batch_size=2, feature_dim=4
y = torch.randn(2, 3)  # batch_size=2, num_classes=3

# Create a simple criterion
criterion = nn.MSELoss()

# Create PACE_MSELoss instance
from torch.nn import Module

class PACE_MSELoss(nn.Module):
    def forward(self, input: torch.Tensor, target: torch.Tensor) -> torch.Tensor:
        return (input - target).square().sum(dim=-1).mean()

pace_criterion = PACE_MSELoss()

ARGS = {
    'model': model,
    'x': x,
    'y': y,
    'criterion': criterion,
    'lbd_pace': 1.0,
    'pace_criterion': pace_criterion,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
timm, 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
file_loader Ran
ran, honoured the contract we drafted
MaxwellYaoNi/PACE/Vision/utils/h5dataset.py
code served (permissive licence) · get_code("56f674f6d6be2ea3")
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 Image. 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 tempfile
import os
from PIL import Image
import numpy as np

# Create a temporary directory with a test image
temp_dir = tempfile.mkdtemp()
test_image_array = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
test_image = Image.fromarray(test_image_array, 'RGB')
test_image_path = os.path.join(temp_dir, 'test_image.jpg')
test_image.save(test_image_path)

ARGS = {
    'data_source': temp_dir,
    'imkey': 'test_image.jpg'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, h5py, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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_few_shot_classes_num Ran
ran, honoured the contract we drafted
MaxwellYaoNi/PACE/Vision/utils/few_shot.py
code served (permissive licence) · get_code("97fed394e0216ad7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

# The function get_few_shot_classes_num takes a dataset_name string parameter
# and returns the number of classes for that dataset from a hardcoded dictionary.
# We need to provide a valid dataset_name that exists in the dictionary.

ARGS = {
    'dataset_name': 'fgvc-aircraft'
}
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 int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_vtab_classes_num Ran
ran, honoured the contract we drafted
MaxwellYaoNi/PACE/Vision/utils/vtab.py
code served (permissive licence) · get_code("1c8363bbc179dca8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# The function get_vtab_classes_num takes a dataset_name parameter
# and looks it up in a dictionary to return the number of classes
# We need to test it with a valid dataset_name that exists in _vtab_class_num_dict

ARGS = {
    'dataset_name': 'cifar'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
h5_loader Ran
ran, honoured the contract we drafted
MaxwellYaoNi/PACE/Vision/utils/h5dataset.py
code served (permissive licence) · get_code("aad01b2cb2ffc65b")
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 Image. 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 h5py
import json
import io
import os
from PIL import Image
import numpy as np
import tempfile

# Create a temporary HDF5 file with image data
temp_dir = tempfile.mkdtemp()
h5_path = os.path.join(temp_dir, "test.h5")

# Create sample RGB image data (3 channels, 4x4 pixels)
img_array = np.random.randint(0, 256, (4, 4, 3), dtype=np.uint8)

# Convert to PNG bytes
img = Image.fromarray(img_array, 'RGB')
img_bytes = io.BytesIO()
img.save(img_bytes, format='PNG')
img_bytes.seek(0)

# Store in HDF5 file
with h5py.File(h5_path, 'w') as f:
    f.create_dataset('test_image', data=np.frombuffer(img_bytes.getvalue(), dtype=np.uint8))

# Open the HDF5 file for reading
data_source = h5py.File(h5_path, 'r')

ARGS = {
    'data_source': data_source,
    'imkey': 'test_image'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, h5py, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
json_flist_reader Ran
ran; our contract draft was wrong, not the code
MaxwellYaoNi/PACE/Vision/utils/h5dataset.py
code served (permissive licence) · get_code("78ec74c6116ef799")
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 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 json
import tempfile
import os

# Create a temporary JSON file with test data
temp_dir = tempfile.mkdtemp()
test_flist = os.path.join(temp_dir, "test_flist.json")

# Create a valid JSON file with image keys and labels
test_data = {
    "image_001.jpg": "0",
    "image_002.jpg": "1",
    "image_003.jpg": "0",
    "image_004.jpg": "2"
}

with open(test_flist, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    "flist": test_flist
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
h5py — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, 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
compute_loss_pace Not yet run
unverified (harvested, no recorded run)
maxwellyaoni/pace/Vision/pace/pace_ops.py
code served (permissive licence) · get_code("44fc0511d7e1a0dd")
How it ran

no invocation recorded.

compute_loss_pace Not yet run
unverified (harvested, no recorded run)
MaxwellYaoNi/PACE/Vision/pace/pace_ops.py
code served (permissive licence) · get_code("ba29b36136b86e32")
How it ran

no invocation recorded.

compute_loss_pace_fast Not yet run
unverified (harvested, no recorded run)
maxwellyaoni/pace/Vision/pace/pace_ops.py
code served (permissive licence) · get_code("8a60a79c5b0af617")
How it ran

no invocation recorded.

compute_loss_pace_fast Not yet run
unverified (harvested, no recorded run)
MaxwellYaoNi/PACE/Vision/pace/pace_ops.py
code served (permissive licence) · get_code("070f23861c50b2fa")
How it ran

no invocation recorded.

compute_loss_pace_lazy_half Not yet run
unverified (harvested, no recorded run)
maxwellyaoni/pace/Vision/pace/pace_ops.py
code served (permissive licence) · get_code("4af58ad2abc3b86c")
How it ran

no invocation recorded.

compute_loss_pace_lazy_half Not yet run
unverified (harvested, no recorded run)
MaxwellYaoNi/PACE/Vision/pace/pace_ops.py
code served (permissive licence) · get_code("7b04172d2fc2b071")
How it ran

no invocation recorded.

get_adapters_and_block_ids Not yet run
unverified (harvested, no recorded run)
MaxwellYaoNi/PACE/Vision/pace/residual_adapters.py
code served (permissive licence) · get_code("8158dccb9a5c0dce")
How it ran

no invocation recorded.

get_few_shot_data Not yet run
unverified (harvested, no recorded run)
MaxwellYaoNi/PACE/Vision/utils/few_shot.py
code served (permissive licence) · get_code("b206d92af9c75e6b")
How it ran

no invocation recorded.

get_vtab_data Not yet run
unverified (harvested, no recorded run)
MaxwellYaoNi/PACE/Vision/utils/vtab.py
code served (permissive licence) · get_code("d5f280240b4e3f98")
How it ran

no invocation recorded.

set_duplicate Not yet run
unverified (harvested, no recorded run)
maxwellyaoni/pace/Vision/pace/pace_ops.py
code served (permissive licence) · get_code("b8549cf24c5edd2e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 14 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.

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

Parameter-Efficient Fine-Tuning (PEFT) effectively adapts pre-trained transformers to downstream tasks. However, the optimization of tasks performance often comes at the cost of generalizability in fine-tuned models. To address this issue, we theoretically connect smaller weight gradient norms during training and larger datasets to the improvements in model generalization. Motivated by this connection, we propose reducing gradient norms for enhanced generalization and aligning finetuned model with the pre-trained counterpart to retain knowledge from large-scale pre-training data. Yet, naive alignment does not guarantee gradient reduction and can potentially cause gradient explosion, complicating efforts to manage gradients. To address such an issue, we propose PACE, marrying generalization of PArameterefficient fine-tuning with Consistency rEgularization. We perturb features learned from the adapter with the multiplicative noise and ensure the fine-tuned model remains consistent for same sample under different perturbations. Theoretical analysis shows that PACE not only implicitly regularizes gradients for enhanced generalization, but also implicitly aligns the fine-tuned and pre-trained models to retain knowledge. Experimental evidence supports our theories. PACE surpasses existing PEFT methods in visual adaptation tasks (VTAB-1k, FGVC, few-shot learning, domain adaptation) showcasing its potential for resource-efficient finetuning. It also improves LoRA in text classification (GLUE) and mathematical reasoning (GSM-8K). The code is available at github.com/MaxwellYaoNi/PACE.

For agents

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

get_harvested_code_for_paper("2409.17137")
get_code_for_paper("2409.17137")
have("2409.17137")

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

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

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

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

Connect an agent — have() is free.