SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.04870 · 2023

Offsite-Tuning: Transfer Learning without Full Model

arXiv · PDF · Open in the Atlas

Code that ran

4 of 7 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 4 have no contract verdict; 0 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/2302.04870.json · badge: /api/ran/2302.04870.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
mit-han-lab/offsite-tuning canonical (classifier label)
classifier basis not recorded on the link
4 ran · 3 no recorded run
FunctionStatusWhere it lives
add_epilogue Ran
ran on a synthesized input
mit-han-lab/offsite-tuning/offsite_tuning/utils.py
code served (permissive licence) · get_code("644daf7343d41357")
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 SimpleModule. 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 simple module to use as the base
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create a simple epilogue function that processes the output
def simple_epilogue(x):
    return x * 2

# Create instances
module = SimpleModule()
epilogue = simple_epilogue

ARGS = {
    "module": module,
    "epilogue": epilogue
}
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 SimpleModule — a SimpleModule output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModule 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
add_prologue Ran
ran on a synthesized input
mit-han-lab/offsite-tuning/offsite_tuning/utils.py
code served (permissive licence) · get_code("4c9ea68663be734c")
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 SimpleModule. 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 simple module to be modified
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create a prologue function that takes input and transforms it
def prologue_fn(x):
    return x * 2

# Create instances
module = SimpleModule()
prologue = prologue_fn

ARGS = {
    "module": module,
    "prologue": prologue
}
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 SimpleModule — a SimpleModule output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModule 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_lm_datasets Ran
ran on a synthesized input
mit-han-lab/offsite-tuning/offsite_tuning/data.py
code served (permissive licence) · get_code("e503e07fecd0ae48")
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 MinimalDataset. 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 logging
from itertools import chain
from unittest.mock import MagicMock
import torch

torch.manual_seed(0)
logging.basicConfig(level=logging.WARNING)

# Create a minimal tokenizer stand-in
class MinimalTokenizer:
    def __init__(self, model_max_length=512):
        self.model_max_length = model_max_length

# Create a minimal args object
class MinimalArgs:
    def __init__(self, block_size=None, preprocessing_num_workers=1, overwrite_cache=False):
        self.block_size = block_size
        self.preprocessing_num_workers = preprocessing_num_workers
        self.overwrite_cache = overwrite_cache

# Create a minimal accelerator stand-in
class MinimalAccelerator:
    def main_process_first(self):
        # Return a context manager that does nothing
        from contextlib import contextmanager
        @contextmanager
        def dummy_context():
            yield
        return dummy_context()

# Create a minimal dataset that mimics HuggingFace datasets
class MinimalDataset:
    def __init__(self):
        self.data = {
            'input_ids': [
                [1, 2, 3, 4],
                [5, 6, 7, 8],
            ]
        }
    
    def map(self, func, batched=False, num_proc=1, load_from_cache_file=True, desc=''):
        # Apply the function to the data
        if batched:
            result = func(self.data)
        else:
            result = func(self.data)
        
        # Return a new dataset-like object with the mapped data
        new_dataset = MinimalDataset()
        new_dataset.data = result
        return new_dataset

# Create instances for ARGS
args = MinimalArgs(block_size=None, preprocessing_num_workers=1, overwrite_cache=False)
tokenizer = MinimalTokenizer(model_max_length=512)
accelerator = MinimalAccelerator()
tokenized_datasets = MinimalDataset()

ARGS = {
    'tokenized_datasets': tokenized_datasets,
    'args': args,
    'accelerator': accelerator,
    'tokenizer': tokenizer,
    'lm_type': 'clm'
}
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 MinimalDataset — a MinimalDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalDataset 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
map_dataset_name_and_config Ran
ran on a synthesized input
mit-han-lab/offsite-tuning/offsite_tuning/tasks.py
code served (permissive licence) · get_code("0ed6b0ea7d0d953a")
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 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 argparse

class Args:
    def __init__(self):
        self.dataset_name = 'arc_easy'
        self.dataset_config_name = None

ARGS = {
    'args': Args()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, 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
add_adapter Not yet run
unverified (harvested, no recorded run)
mit-han-lab/offsite-tuning/offsite_tuning/param_efficient.py
code served (permissive licence) · get_code("f2c5c52ee0e49837")
How it ran

no invocation recorded.

get_tokenized_datasets Not yet run
unverified (harvested, no recorded run)
mit-han-lab/offsite-tuning/offsite_tuning/data.py
code served (permissive licence) · get_code("ebd8572c5c5152b0")
How it ran

no invocation recorded.

uniform_choose_layers Not yet run
unverified (harvested, no recorded run)
mit-han-lab/offsite-tuning/offsite_tuning/utils.py
code served (permissive licence) · get_code("0a5252c9d50f4927")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 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 7 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

Transfer learning is important for foundation models to adapt to downstream tasks. However, many foundation models are proprietary, so users must share their data with model owners to fine-tune the models, which is costly and raise privacy concerns. Moreover, fine-tuning large foundation models is computation-intensive and impractical for most downstream users. In this paper, we propose Offsite-Tuning, a privacy-preserving and efficient transfer learning framework that can adapt billion-parameter foundation models to downstream data without access to the full model. In offsite-tuning, the model owner sends a light-weight adapter and a lossy compressed emulator to the data owner, who then fine-tunes the adapter on the downstream data with the emulator's assistance. The fine-tuned adapter is then returned to the model owner, who plugs it into the full model to create an adapted foundation model. Offsite-tuning preserves both parties' privacy and is computationally more efficient than the existing fine-tuning methods that require access to the full model weights. We demonstrate the effectiveness of offsite-tuning on various large language and vision foundation models. Offsite-tuning can achieve comparable accuracy as full model fine-tuning while being privacy-preserving and efficient, achieving 6.5x speedup and 5.6x memory reduction. Code is available at https://github.com/mit-han-lab/offsite-tuning.

For agents

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

get_harvested_code_for_paper("2302.04870")
get_code_for_paper("2302.04870")
have("2302.04870")

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

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

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

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

Connect an agent — have() is free.