SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.13430 · ICLR · 2025

Fine-tuning Quantized Neural Networks with Zeroth-order Optimization

Kaiyang Zhou, Jiayi Zhou, Minxian Li, Sifeng Shang, Chenyu Lin

arXiv · PDF · Open in the Atlas

Code that ran

10 of 15 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; 2 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 2 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/2505.13430.json · badge: /api/ran/2505.13430.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
maifoundations/qzo canonical (classifier label)
classifier basis not recorded on the link
10 ran · 5 no recorded run
FunctionStatusWhere it lives
encode_prompt Ran
ran on a synthesized input
maifoundations/qzo/large_language_models/utils.py
code served (permissive licence) · get_code("e82be1ebda714ec3")
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 logging

logging.basicConfig(level=logging.WARNING)

class MockTokenizer:
    def __init__(self):
        self.add_bos_token = False
    
    def encode(self, text):
        # Simple mock: split by spaces and convert to token ids
        tokens = text.split()
        return [hash(t) % 1000 for t in tokens]

class MockCandidate:
    def __init__(self, text):
        self.text = text
    
    def __str__(self):
        return self.text

class MockSample:
    def __init__(self, text, candidates, correct_idx=0):
        self.text = text
        self.candidates = candidates
        self.correct_candidate = candidates[correct_idx]
    
    def __str__(self):
        return self.text

class MockTemplate:
    def verbalize(self, sample, candidate):
        return f"{sample.text} {candidate.text}"
    
    def verbalize_sfc(self, sample, candidate):
        return f"{sample.text} {candidate.text}"
    
    def encode(self, sample):
        return sample.text
    
    def encode_sfc(self, sample):
        return sample.text

class MockTask:
    def __init__(self):
        self.train_sep = " [SEP] "

# Create mock objects
tokenizer = MockTokenizer()
task = MockTask()
template = MockTemplate()

# Create candidates
cand1 = MockCandidate("yes")
cand2 = MockCandidate("no")
candidates = [cand1, cand2]

# Create train samples
train_sample1 = MockSample("Question 1", candidates, correct_idx=0)
train_sample2 = MockSample("Question 2", candidates, correct_idx=1)
train_samples = [train_sample1, train_sample2]

# Create eval sample
eval_sample = MockSample("Eval question", candidates, correct_idx=0)

max_length = 512
max_new_tokens = 50

ARGS = {
    'task': task,
    'template': template,
    'train_samples': train_samples,
    'eval_sample': eval_sample,
    'tokenizer': tokenizer,
    'max_length': max_length,
    'sfc': False,
    'icl_sfc': False,
    'generation': False,
    'generation_with_gold': False,
    'max_new_tokens': max_new_tokens,
}
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
encode_sd3_prompt_with_clip Ran
ran on a synthesized input
maifoundations/qzo/stable_diffusion/text_to_image/train_utils.py
code served (permissive licence) · get_code("93a86bf0447b5071")
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 as nn

torch.manual_seed(0)

# Create a minimal tokenizer that satisfies the function's usage
class MinimalTokenizer:
    def __call__(self, prompt, padding=None, max_length=None, truncation=None, return_tensors=None):
        # Return a mock tokenizer output with input_ids
        batch_size = len(prompt) if isinstance(prompt, list) else 1
        input_ids = torch.randint(0, 1000, (batch_size, max_length))
        
        class TokenizerOutput:
            def __init__(self, input_ids):
                self.input_ids = input_ids
        
        return TokenizerOutput(input_ids)

# Create a minimal text encoder that satisfies the function's usage
class MinimalTextEncoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.dtype = torch.float32
        # Linear layer to project to embedding dimension
        self.proj = nn.Linear(1000, 8)  # 1000 is vocab-like, 8 is embedding dim
    
    def forward(self, input_ids, output_hidden_states=None):
        # Embed input_ids to get hidden states
        # input_ids shape: (batch_size, seq_len)
        batch_size, seq_len = input_ids.shape
        
        # Create a simple embedding representation
        hidden = torch.randn(batch_size, seq_len, 8)
        
        # Create output with hidden_states attribute
        class EncoderOutput:
            def __init__(self, pooled, hidden_states_list):
                # Index 0 is pooled_prompt_embeds
                self.data = pooled
                self.hidden_states = hidden_states_list
            
            def __getitem__(self, idx):
                if idx == 0:
                    return self.data
                return self.hidden_states[idx]
        
        pooled = torch.randn(batch_size, 8)
        # hidden_states[-2] will be used, so provide at least 2 states
        hidden_states_list = [torch.randn(batch_size, seq_len, 8) for _ in range(3)]
        
        return EncoderOutput(pooled, hidden_states_list)

# Create instances
tokenizer = MinimalTokenizer()
text_encoder = MinimalTextEncoder()

# Set up arguments
ARGS = {
    'text_encoder': text_encoder,
    'tokenizer': tokenizer,
    'prompt': 'a cat sitting on a mat',
    'device': 'cpu',
    'num_images_per_prompt': 2,
    'max_token_length': 77
}
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
encode_sd3_prompt_with_t5 Ran
ran on a synthesized input
maifoundations/qzo/stable_diffusion/text_to_image/train_utils.py
code served (permissive licence) · get_code("2b6f26327780ae00")
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 3, dtype family float, shape (2, 77, 4) 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)

class MockTokenizer:
    def __call__(self, text, padding=None, max_length=None, truncation=None, add_special_tokens=None, return_tensors=None):
        batch_size = len(text) if isinstance(text, list) else 1
        return MockTokenizerOutput(
            input_ids=torch.randint(0, 1000, (batch_size, max_length)),
            attention_mask=torch.ones(batch_size, max_length)
        )

class MockTokenizerOutput:
    def __init__(self, input_ids, attention_mask):
        self.input_ids = input_ids
        self.attention_mask = attention_mask

class MockTextEncoder(nn.Module):
    def __init__(self, hidden_size=4, dtype=torch.float32):
        super().__init__()
        self._dtype = dtype
        self.linear = nn.Linear(1000, hidden_size)
    
    @property
    def dtype(self):
        return self._dtype
    
    def forward(self, input_ids):
        batch_size, seq_len = input_ids.shape
        embeddings = torch.randn(batch_size, seq_len, 4)
        return (embeddings,)

text_encoder = MockTextEncoder(hidden_size=4, dtype=torch.float32)
tokenizer = MockTokenizer()
prompt = "a dog in a park"
num_images_per_prompt = 2
device = "cpu"
zero_padding_tokens = True
max_sequence_length = 77

ARGS = {
    "text_encoder": text_encoder,
    "tokenizer": tokenizer,
    "prompt": prompt,
    "num_images_per_prompt": num_images_per_prompt,
    "device": device,
    "zero_padding_tokens": zero_padding_tokens,
    "max_sequence_length": max_sequence_length
}
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 3, dtype family float, shape (2, 77, 4) — shape (2, 77, 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
f1 Ran
ran, honoured the contract we drafted
maifoundations/qzo/large_language_models/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
forward_wrap_with_option_len Ran
ran; our contract draft was wrong, not the code
maifoundations/qzo/large_language_models/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from mathisall/zo-adamu, is pointer only (licence: NONE) · get_code("54a6124d697bc2c2")
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.

get_calib_dataset Ran
ran on a synthesized input
maifoundations/qzo/large_language_models/quantization.py
code served (permissive licence) · get_code("0e575c7c824b1546")
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 logging

torch.manual_seed(0)

class MockTokenizer:
    def encode(self, text):
        # Simple mock: return a list of token ids
        return [1, 2, 3] * (len(text) // 3 + 1)

# Create a mock tokenizer
tokenizer = MockTokenizer()

# Create mock dataset as list of strings
mock_data = [
    "This is a sample text for calibration",
    "Another sample text to process",
    "Yet another example for the dataset",
    "More text samples here",
]

ARGS = {
    'data': mock_data,
    'tokenizer': tokenizer,
    'n_samples': 4,
    'max_seq_len': 512,
    'split': 'train',
    'text_column': 'text'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, 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
load_tes Ran
ran on a synthesized input
maifoundations/qzo/stable_diffusion/text_to_image/train_utils.py
code served (permissive licence) · get_code("d7899d043687bf12")
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 torch
import torch.nn as nn
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create mock args object
class MockArgs:
    def __init__(self):
        self.variant = "fp32"
        self.quantize_method = "none"
        self.model_family = "pixart_sigma"
        self.revision = "main"
        self.pretrained_model_name_or_path = "/tmp/model"

args = MockArgs()

# Create mock text encoder classes
class MockTextEncoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def eval(self):
        return self
    
    @classmethod
    def from_pretrained(cls, path, subfolder=None, revision=None, 
                       quantization_config=None, variant=None, 
                       torch_dtype=None):
        return cls()

text_encoder_cls_1 = MockTextEncoder
text_encoder_cls_2 = MockTextEncoder
text_encoder_cls_3 = MockTextEncoder
text_encoder_classes = (text_encoder_cls_1, text_encoder_cls_2, text_encoder_cls_3)

# Create mock tokenizers
tokenizer_1 = Mock()
tokenizer_2 = Mock()
tokenizer_3 = None
tokenizers = (tokenizer_1, tokenizer_2, tokenizer_3)

# Set weight dtype
weight_dtype = torch.float32

# Set paths
text_encoder_path = "/tmp/text_encoder"
text_encoder_subfolder = "subfolder"

ARGS = {
    "args": args,
    "text_encoder_classes": text_encoder_classes,
    "tokenizers": tokenizers,
    "weight_dtype": weight_dtype,
    "text_encoder_path": text_encoder_path,
    "text_encoder_subfolder": text_encoder_subfolder,
}
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 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
next_power_of_2 Ran
ran, honoured the contract we drafted
maifoundations/qzo/large_language_models/aqlm_inference_kernel/triton_kernel_dequant.py
code served (permissive licence) · get_code("9782bd07382e951c")
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 math

def next_power_of_2(x):
    return 1 if x == 0 else 2 ** math.ceil(math.log2(x))

# Test with various values
ARGS = {
    "x": 5
}
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 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
normalize_answer Ran
ran; our contract draft was wrong, not the code
maifoundations/qzo/large_language_models/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.

zo_step Ran
ran on a synthesized input
maifoundations/qzo/stable_diffusion/text_to_image/MeZO_utils.py
code served (permissive licence) · get_code("c66c0606fd369119")
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 as nn
import numpy as np

torch.manual_seed(0)

class SimpleUNet(nn.Module):
    """Minimal UNet-like model for diffusion"""
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 8)
        self.linear2 = nn.Linear(8, 4)
    
    def forward(self, noisy_latents, timesteps, encoder_hidden_states=None, return_dict=False):
        x = self.linear1(noisy_latents)
        x = self.linear2(x)
        if return_dict:
            return {"sample": x}
        return (x,)

class ArgsConfig:
    def __init__(self):
        self.quantized_model_finetune = False
        self.zo_eps = 1e-3
        self.grad_clip_threshold = 1.0
        self.gradient_accumulation_steps = 1
        self.local_rank = -1
        self.model_family = 'sd1'
        self.train_batch_size = 2

model = SimpleUNet()
batch = {
    'noisy_latents': torch.randn(2, 4),
}
args = ArgsConfig()
timesteps = torch.randint(0, 1000, (2,))
target = torch.randn(2, 4)
lr = 1e-4
device = 'cpu'
encoder_hidden_states = torch.randn(2, 3, 8)

ARGS = {
    'model': model,
    'batch': batch,
    'args': args,
    'timesteps': timesteps,
    'target': target,
    'lr': lr,
    'device': device,
    'encoder_hidden_states': encoder_hidden_states,
}
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 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
calculate_metric Not yet run
unverified (harvested, no recorded run)
maifoundations/qzo/large_language_models/metrics.py
code served (permissive licence) · get_code("84c658f2c9252878")
How it ran

no invocation recorded.

get_backward_pass_kernel Not yet run
unverified (harvested, no recorded run)
maifoundations/qzo/large_language_models/aqlm_inference_kernel/kernel_selector.py
code served (permissive licence) · get_code("e5420b8f9ec6a920")
How it ran

no invocation recorded.

get_forward_pass_kernel Not yet run
unverified (harvested, no recorded run)
maifoundations/qzo/large_language_models/aqlm_inference_kernel/kernel_selector.py
code served (permissive licence) · get_code("72f47794c604a79d")
How it ran

no invocation recorded.

get_task Not yet run
unverified (harvested, no recorded run)
maifoundations/qzo/large_language_models/tasks.py
code served (permissive licence) · get_code("f7c384f1e681ea7a")
How it ran

no invocation recorded.

zo_forward Not yet run
unverified (harvested, no recorded run)
maifoundations/qzo/stable_diffusion/text_to_image/MeZO_utils.py
code served (permissive licence) · get_code("4347ff075572d341")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 4 later) and 9 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
106 dated earlier, 20 later, 6 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
calculate_metric 7 other papers
6 dated earlier, 1 later
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes
2310.09639 (2023-10)
DPZero: Private Fine-Tuning of Language Models without Backpropagation
2312.15184 (2023-12)
ZO-AdaMU Optimizer: Adapting Perturbation by the Momentum and Uncertainty in Zeroth-order Optimization
and 4 more not named here
f1 7 other papers
6 dated earlier, 1 later
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes
2310.09639 (2023-10)
DPZero: Private Fine-Tuning of Language Models without Backpropagation
2312.15184 (2023-12)
ZO-AdaMU Optimizer: Adapting Perturbation by the Momentum and Uncertainty in Zeroth-order Optimization
and 4 more not named here
get_task 7 other papers
6 dated earlier, 1 later
2305.17333 (2023-05)
Fine-Tuning Language Models with Just Forward Passes
2310.09639 (2023-10)
DPZero: Private Fine-Tuning of Language Models without Backpropagation
2312.15184 (2023-12)
ZO-AdaMU Optimizer: Adapting Perturbation by the Momentum and Uncertainty in Zeroth-order Optimization
and 4 more not named here
forward_wrap_with_option_len 2 other papers
2 dated earlier
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
next_power_of_2 1 other paper
1 dated earlier
2405.14852 (2024-05)
PV-Tuning: Beyond Straight-Through Estimation for Extreme LLM Compression

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

As the size of large language models grows exponentially, GPU memory has become a bottleneck for adapting these models to downstream tasks. In this paper, we aim to push the limits of memory-efficient training by minimizing memory usage on model weights, gradients, and optimizer states, within a unified framework. Our idea is to eliminate both gradients and optimizer states using zeroth-order optimization, which approximates gradients by perturbing weights during forward passes to identify gradient directions. To minimize memory usage on weights, we employ model quantization, e.g., converting from bfloat16 to int4. However, directly applying zeroth-order optimization to quantized weights is infeasible due to the precision gap between discrete weights and continuous gradients, which would otherwise require de-quantization and re-quantization. To overcome this challenge, we propose Quantized Zeroth-order Optimization (QZO), a simple yet effective approach that perturbs the continuous quantization scale for gradient estimation and uses a directional derivative clipping method to stabilize training. QZO is orthogonal to both scalar-based and codebook-based post-training quantization methods. Compared to full-parameter fine-tuning in 16 bits, QZO can reduce the total memory cost by more than 18× for 4-bit LLMs, and enables fine-tuning Llama-2-13B within a single 24GB GPU.

For agents

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

get_harvested_code_for_paper("2505.13430")
get_code_for_paper("2505.13430")
have("2505.13430")

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

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

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

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

Connect an agent — have() is free.