SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.09639 · ICML · 2024

DPZero: Private Fine-Tuning of Language Models without Backpropagation

Niao He, Liang Zhang, Bingcong Li, Sewoong Oh, Kiran Koshy Thekumparampil

arXiv · PDF · Open in the Atlas

Code that ran

8 of 17 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 9 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/2310.09639.json · badge: /api/ran/2310.09639.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
Liang137/DPZero canonical (classifier label)
classifier basis: census
8 ran · 6 no recorded run
liang137/dpzero canonical (classifier label)
classifier basis: classifier_2025
0 ran · 3 no recorded run
FunctionStatusWhere it lives
encode_prompt Ran
ran; our contract draft was wrong, not the code
Liang137/DPZero/opt/src/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from mathisall/zo-adamu, is pointer only (licence: NONE) · get_code("7c5d9ba063f6642c")
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 mathisall/zo-adamu, 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.

f1 Ran
ran, honoured the contract we drafted
Liang137/DPZero/opt/src/metrics.py
code served (permissive licence) · get_code("b989d4bce26f77ce")
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 float64, ndim 0, 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 numpy as np
import re
import string
from collections import Counter

# Define ARGS for the f1 function
ARGS = {
    "pred": "The answer is Paris",
    "gold": ["Paris", "the city of Paris"]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
find_module Ran
ran; our contract draft was wrong, not the code
Liang137/DPZero/opt/src/lora.py
pointer only (licence: MIT); the stored copy get_code serves, from JingXuTHU/Random-Masking-Finds-Winning-Tickets-for-Parameter-Efficient-Fine-tuning, is pointer only (licence: NONE) · get_code("b5adfd6ac99a1b18")
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 JingXuTHU/Random-Masking-Finds-Winning-Tickets-for-Parameter-Efficient-Fine-tuning, 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.

forward_wrap_with_option_len_dpzero Ran
ran; our contract draft was wrong, not the code
Liang137/DPZero/opt/src/utils.py
code served (permissive licence) · get_code("da6c8809e7b9fce0")
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 CausalLMOutputWithPast. 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 transformers.modeling_outputs import CausalLMOutputWithPast

torch.manual_seed(0)

# Create a minimal config object
class MinimalConfig:
    def __init__(self):
        self.pad_token_id = 0
        self.vocab_size = 10

# Create a minimal model that has the required attributes and methods
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.config = MinimalConfig()
        self.embed = nn.Embedding(10, 4)
        self.lm_head = nn.Linear(4, 10)
    
    def original_forward(self, input_ids=None, **kwargs):
        # Return outputs in the format expected by the function
        hidden_states = self.embed(input_ids)
        logits = self.lm_head(hidden_states)
        return CausalLMOutputWithPast(
            loss=None,
            logits=logits,
            past_key_values=None,
            hidden_states=hidden_states,
            attentions=None
        )

# Create model instance
model = MinimalModel()

# Create input tensors
batch_size = 2
seq_len = 5
input_ids = torch.randint(1, 10, (batch_size, seq_len))

# Create labels tensor - used for classification loss computation
labels = torch.tensor([[0], [1]], dtype=torch.long)

# Create option_len list - indicates how many tokens at end to compute loss for
option_len = [2, 3]

# Create num_options list - indicates number of options per example
num_options = [2, 2]

ARGS = {
    'self': model,
    'input_ids': input_ids,
    'labels': labels,
    'option_len': option_len,
    'num_options': num_options,
    'return_dict': True,
    'dpzero': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CausalLMOutputWithPast — a CausalLMOutputWithPast output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CausalLMOutputWithPast 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
input_example_to_string Ran
ran; our contract draft was wrong, not the code
Liang137/DPZero/roberta/src/dataset.py
code served (permissive licence) · get_code("e768e25ca95f70cd")
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 str. 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.

class Example:
    def __init__(self, text_a, text_b=None):
        self.text_a = text_a
        self.text_b = text_b

example_with_text_b = Example("Hello world", "This is text b")
example_without_text_b = Example("Hello world", None)

ARGS = {
    "example": example_with_text_b,
    "sep_token": "[SEP]"
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
input_example_to_tuple Ran
ran; our contract draft was wrong, not the code
Liang137/DPZero/roberta/src/dataset.py
code served (permissive licence) · get_code("fbef70dc7c700501")
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 logging
import pandas as pd

logger = logging.getLogger(__name__)

# Create a simple example class that mimics the structure needed
class Example:
    def __init__(self, text_a, text_b=None):
        self.text_a = text_a
        self.text_b = text_b

# Test case 1: example with both text_a and text_b
example_both = Example(text_a="Hello world", text_b="Goodbye world")

# Test case 2: example with only text_a
example_single = Example(text_a="Hello world", text_b=None)

# Test case 3: example with None text_a and None text_b
example_empty = Example(text_a=None, text_b=None)

# Use the most complete example for the ARGS dict
ARGS = {
    "example": example_both
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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
normalize_answer Ran
ran; our contract draft was wrong, not the code
Liang137/DPZero/opt/src/metrics.py
pointer only (licence: MIT); the stored copy get_code serves, from borealisai/radar-decoding, is pointer only (licence: LGPL-3.0) · get_code("e7e75981cb464788")
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 borealisai/radar-decoding, and LGPL-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.

tokenize_multipart_input Ran
ran; our contract draft was wrong, not the code
Liang137/DPZero/roberta/src/dataset.py
code served (permissive licence) · get_code("9a62fa939fc563a4")
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 logging
from unittest.mock import MagicMock

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

class StandInTokenizer:
    def __init__(self):
        self.bos_token_id = 101
        self.cls_token_id = 101
        self.eos_token_id = 102
        self.mask_token_id = 103
        self.sep_token_id = 102
        self.model_type = 'bert'
        self.__class__.__name__ = 'BertTokenizer'
    
    def encode(self, text, add_special_tokens=False):
        # Simple mock encoding: return token ids based on text length
        return [104 + i for i in range(len(text.split()) + 1)]
    
    def convert_tokens_to_ids(self, token):
        # Mock token to id conversion
        if isinstance(token, str):
            return 105 + ord(token[0])
        return 105

tokenizer = StandInTokenizer()

ARGS = {
    'input_text_list': ['This is the first sentence.', 'This is the second sentence.'],
    'max_length': 128,
    'tokenizer': tokenizer,
    'task_name': 'text_classification',
    'prompt': False,
    'template': None,
    'label_word_list': None,
    'first_sent_limit': None,
    'other_sent_limit': None,
    'gpt3': False,
    'truncate_head': False,
    'support_labels': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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
AsymmetricLstsqKernelSolver Not yet run
unverified (harvested, no recorded run)
liang137/dpzero/roberta/src/kernel_solvers.py
code served (permissive licence) · get_code("6819ef75ae988d6e")
How it ran

no invocation recorded.

BaseKernelSolver Not yet run
unverified (harvested, no recorded run)
liang137/dpzero/roberta/src/kernel_solvers.py
code served (permissive licence) · get_code("e4ad3f4b56f8bf3e")
How it ran

no invocation recorded.

LstsqKernelSolver Not yet run
unverified (harvested, no recorded run)
liang137/dpzero/roberta/src/kernel_solvers.py
code served (permissive licence) · get_code("4d101a4f2733809f")
How it ran

no invocation recorded.

attn_forward_hook Not yet run
unverified (harvested, no recorded run)
Liang137/DPZero/opt/src/prefix.py
code served (permissive licence) · get_code("bdb460cb247501dc")
How it ran

no invocation recorded.

calculate_metric Not yet run
unverified (harvested, no recorded run)
Liang137/DPZero/opt/src/metrics.py
code served (permissive licence) · get_code("84c658f2c9252878")
How it ran

no invocation recorded.

get_task Not yet run
unverified (harvested, no recorded run)
Liang137/DPZero/opt/src/tasks.py
code served (permissive licence) · get_code("f7c384f1e681ea7a")
How it ran

no invocation recorded.

prepare_inputs_for_generation Not yet run
unverified (harvested, no recorded run)
Liang137/DPZero/opt/src/prefix.py
code served (permissive licence) · get_code("84920a8095dca4fa")
How it ran

no invocation recorded.

tensor_all_gather Not yet run
unverified (harvested, no recorded run)
Liang137/DPZero/roberta/src/linearhead_trainer.py
code served (permissive licence) · get_code("c239cb1add74b809")
How it ran

no invocation recorded.

varsize_tensor_all_gather Not yet run
unverified (harvested, no recorded run)
Liang137/DPZero/roberta/src/linearhead_trainer.py
code served (permissive licence) · get_code("734d0491ecbc7841")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 distinct functions with an identity, 13 are also present in other papers whose code we hold (13 with at least one paper dated earlier, 1 the same month, 10 later) and 4 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
normalize_answer 133 other papers
49 dated earlier, 1 the same month, 81 later, 1 same year, order not determinable, 1 undated · 1 only as an assembly brick
1508.06615 (2015-08)
Character-Aware Neural Language Models
1606.05250 (2016-06)
SQuAD: 100,000+ Questions for Machine Comprehension of Text
1608.07905 (2016-08)
Machine Comprehension Using Match-LSTM and Answer Pointer
and 130 more not named here
input_example_to_string 9 other papers
7 dated earlier, 2 later
2110.01256 (2021-10)
Revisiting Self-Training for Few-Shot Learning of Language Model
2110.06274 (2021-10)
LiST: Lite Prompted Self-training Makes Parameter-Efficient Few-shot Learners
2202.11451 (2022-02)
Zero-shot Cross-lingual Transfer of Prompt-based Tuning with a Unified Multilingual Prompt
and 6 more not named here
input_example_to_tuple 9 other papers
7 dated earlier, 2 later
2110.01256 (2021-10)
Revisiting Self-Training for Few-Shot Learning of Language Model
2110.06274 (2021-10)
LiST: Lite Prompted Self-training Makes Parameter-Efficient Few-shot Learners
2202.11451 (2022-02)
Zero-shot Cross-lingual Transfer of Prompt-based Tuning with a Unified Multilingual Prompt
and 6 more not named here
find_module 8 other papers
1 dated earlier, 7 later
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes
2312.15184 (2023-12)
ZO-AdaMU Optimizer: Adapting Perturbation by the Momentum and Uncertainty in Zeroth-order Optimization
2402.11417 (2024-02)
LoRETTA: Low-Rank Economic Tensor-Train Adaptation for Ultra-Low-Parameter Fine-Tuning of Large Language Models
and 5 more not named here
calculate_metric 7 other papers
1 dated earlier, 6 later
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes
2312.15184 (2023-12)
ZO-AdaMU Optimizer: Adapting Perturbation by the Momentum and Uncertainty in Zeroth-order Optimization
2402.11417 (2024-02)
LoRETTA: Low-Rank Economic Tensor-Train Adaptation for Ultra-Low-Parameter Fine-Tuning of Large Language Models
and 4 more not named here
f1 7 other papers
1 dated earlier, 6 later
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes
2312.15184 (2023-12)
ZO-AdaMU Optimizer: Adapting Perturbation by the Momentum and Uncertainty in Zeroth-order Optimization
2402.11417 (2024-02)
LoRETTA: Low-Rank Economic Tensor-Train Adaptation for Ultra-Low-Parameter Fine-Tuning of Large Language Models
and 4 more not named here
get_task 7 other papers
1 dated earlier, 6 later
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes
2312.15184 (2023-12)
ZO-AdaMU Optimizer: Adapting Perturbation by the Momentum and Uncertainty in Zeroth-order Optimization
2402.11592 (2024-02)
Revisiting Zeroth-Order Optimization for Memory-Efficient LLM Fine-Tuning: A Benchmark
and 4 more not named here
attn_forward_hook 6 other papers
1 dated earlier, 5 later
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes
2312.15184 (2023-12)
ZO-AdaMU Optimizer: Adapting Perturbation by the Momentum and Uncertainty in Zeroth-order Optimization
2402.11417 (2024-02)
LoRETTA: Low-Rank Economic Tensor-Train Adaptation for Ultra-Low-Parameter Fine-Tuning of Large Language Models
and 3 more not named here
prepare_inputs_for_generation 6 other papers
1 dated earlier, 5 later
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes
2312.15184 (2023-12)
ZO-AdaMU Optimizer: Adapting Perturbation by the Momentum and Uncertainty in Zeroth-order Optimization
2402.11417 (2024-02)
LoRETTA: Low-Rank Economic Tensor-Train Adaptation for Ultra-Low-Parameter Fine-Tuning of Large Language Models
and 3 more not named here
encode_prompt 2 other papers
1 dated earlier, 1 later
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes
2312.15184 (2023-12)
ZO-AdaMU Optimizer: Adapting Perturbation by the Momentum and Uncertainty in Zeroth-order Optimization
tensor_all_gather 2 other papers
2 dated earlier
2210.05643 (2022-10)
A Kernel-Based View of Language Model Fine-Tuning
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes
varsize_tensor_all_gather 2 other papers
2 dated earlier
2210.05643 (2022-10)
A Kernel-Based View of Language Model Fine-Tuning
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes
tokenize_multipart_input 1 other paper
1 dated earlier
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes

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

The widespread practice of fine-tuning large language models (LLMs) on domain-specific data faces two major challenges in memory and privacy. First, as the size of LLMs continues to grow, the memory demands of gradient-based training methods via backpropagation become prohibitively high. Second, given the tendency of LLMs to memorize training data, it is important to protect potentially sensitive information in the fine-tuning data from being regurgitated. Zeroth-order methods, which rely solely on forward passes, substantially reduce memory consumption during training. However, directly combining them with standard differentially private gradient descent suffers more as model size grows. To bridge this gap, we introduce DPZero, a novel private zeroth-order algorithm with nearly dimension-independent rates. The memory efficiency of DPZero is demonstrated in privately fine-tuning RoBERTa and OPT on several downstream tasks. Our code is available at https://github.com/Liang137/DPZero.

For agents

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

get_harvested_code_for_paper("2310.09639")
get_code_for_paper("2310.09639")
have("2310.09639")

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

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

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

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

Connect an agent — have() is free.