SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.05516 · 2023

Optimize Weight Rounding via Signed Gradient Descent for the Quantization of LLMs

arXiv · PDF · Open in the Atlas

Code that ran

5 of 10 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, 1 violated it and 0 have no contract verdict; 4 failures of our instrument; 5 no recorded run), measured 2026-11-23; 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/2309.05516.json · badge: /api/ran/2309.05516.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
intel/auto-round canonical (classifier label)
classifier basis: census
5 ran · 5 no recorded run
FunctionStatusWhere it lives
apply_chat_template_to_samples Ran
ran; our contract draft was wrong, not the code
intel/auto-round/auto_round/calib_dataset.py
code served (permissive licence) · get_code("e52a1adf6e14e3f0")
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
import torch.nn as nn

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        self.chat_template = "{% for message in messages %}{{ message['role'] }}: {{ message['content'] }}\n{% endfor %}"
    
    def apply_chat_template(self, messages, tokenize=False, add_generation_prompt=False):
        rendered = ""
        for msg in messages:
            rendered += f"{msg['role']}: {msg['content']}\n"
        if add_generation_prompt:
            rendered += "assistant: "
        return rendered
    
    def __call__(self, texts, truncation=False, max_length=None):
        input_ids = []
        attention_masks = []
        for text in texts:
            tokens = [ord(c) % 256 for c in text[:max_length if max_length else len(text)]]
            if max_length:
                tokens = tokens[:max_length]
            input_ids.append(tokens)
            attention_masks.append([1] * len(tokens))
        
        return {
            'input_ids': input_ids,
            'attention_mask': attention_masks
        }

samples_list_str = [
    "Hello, how are you?",
    "What is the weather today?"
]

samples_list_messages = [
    [
        {'role': 'user', 'content': 'Tell me a story'},
        {'role': 'assistant', 'content': 'Once upon a time...'}
    ],
    [
        {'role': 'user', 'content': 'What is AI?'}
    ]
]

tokenizer = MockTokenizer()
seqlen = 128
system_prompt = "You are a helpful assistant."

ARGS = {
    'samples': samples_list_str,
    'tokenizer': tokenizer,
    'seqlen': seqlen,
    'system_prompt': system_prompt
}
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
get_code_calibration_dataset Ran
ran; our contract draft was wrong, not the code
intel/auto-round/auto_round/calib_dataset.py
code served (permissive licence) · get_code("7dde89a31f2370e3")
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.

import torch
import numpy as np
from packaging.version import Version

# Setup for get_code_calibration_dataset
# The function takes nsamples (int) and datasets_version (str or None)

ARGS = {
    'nsamples': 100,
    'datasets_version': '3.5.0',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, numpy, packaging, torch — 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
is_block_quantizer_config Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
intel/auto-round/auto_round/algorithms/config_resolver.py
code served (permissive licence) · get_code("3bfdd2b43d1ae35d")
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 bool, 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
from typing import Any

# Mock the auto_round module structure since we can't import it
class MockQuantizerConfig:
    def __init__(self, config_dict: dict):
        self.config_dict = config_dict
        self.algorithm = config_dict.get('algorithm', 'quantization')
    
    def __str__(self):
        return str(self.config_dict)


class MockBaseQuantizer:
    """Stand-in for BaseQuantizer"""
    pass


class MockRegistry:
    """Mock registry for algorithm resolution"""
    
    @staticmethod
    def normalize_algorithm_config(config: Any) -> Any:
        """Normalize config to a standard format"""
        if isinstance(config, dict):
            return config
        if hasattr(config, 'config_dict'):
            return config.config_dict
        return {'algorithm': 'quantization'}
    
    @staticmethod
    def resolve_pipeline_member(config: Any) -> type:
        """Resolve config to an algorithm class"""
        if isinstance(config, dict):
            algo_type = config.get('algorithm', 'quantization')
            if algo_type == 'quantization':
                # Return a class that is a subclass of BaseQuantizer
                class QuantizationAlgorithm(MockBaseQuantizer):
                    pass
                return QuantizationAlgorithm
            elif algo_type == 'invalid':
                raise ValueError("Invalid algorithm type")
        raise ValueError("Cannot resolve config")


# Patch the imports
import sys
from unittest.mock import MagicMock

auto_round_module = MagicMock()
auto_round_module.algorithms.registry.normalize_algorithm_config = MockRegistry.normalize_algorithm_config
auto_round_module.algorithms.registry.resolve_pipeline_member = MockRegistry.resolve_pipeline_member
auto_round_module.algorithms.quantization.base.BaseQuantizer = MockBaseQuantizer

sys.modules['auto_round'] = auto_round_module
sys.modules['auto_round.algorithms'] = auto_round_module.algorithms
sys.modules['auto_round.algorithms.registry'] = auto_round_module.algorithms.registry
sys.modules['auto_round.algorithms.quantization'] = auto_round_module.algorithms.quantization
sys.modules['auto_round.algorithms.quantization.base'] = auto_round_module.algorithms.quantization.base

# Now define test configs
quantization_config = {
    'algorithm': 'quantization',
    'bits': 4,
    'scheme': 'symmetric'
}

ARGS = {
    'config': quantization_config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
auto_round, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, 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
prepare_special_model_block_inputs Ran
ran, violated the contract we drafted
intel/auto-round/auto_round/special_model_handler.py
code served (permissive licence) · get_code("7cd246188fdf9359")
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

torch.manual_seed(0)

# Create a minimal attention module with required attributes
class MinimalAttention(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer_type = 'full_attention'
        self.head_dim = 4
        self.store_full_length_kv = True
    
    def forward(self, x):
        return x

# Create a minimal block module with required attributes
class MinimalBlock(nn.Module):
    def __init__(self):
        super().__init__()
        self.self_attn = MinimalAttention()
        self.layer_idx = 0
        self._shared_kv_states_global_ref = None
        self._rotary_emb_ref = None
        self._rotary_emb = None

# Instantiate the block
block = MinimalBlock()

# Create rotary_input tensor: (batch_size=2, seq_len=3, hidden_dim=4)
rotary_input = torch.randn(2, 3, 4)

# Create input_others dict with position_ids
input_others = {
    'position_ids': [torch.arange(3, dtype=torch.long).unsqueeze(0).expand(2, -1)]
}

# positional_inputs can be None or a tuple/list of tensors
positional_inputs = None

ARGS = {
    'block': block,
    'rotary_input': rotary_input,
    'input_others': input_others,
    'positional_inputs': positional_inputs
}
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
register_dataset Ran
ran; our contract draft was wrong, not the code
intel/auto-round/auto_round/calib_dataset.py
code served (permissive licence) · get_code("34b4d7cc1934723b")
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 function. 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 numpy as np

torch.manual_seed(0)

# Create a simple dataset class for testing
class SimpleDataset:
    def __init__(self):
        self.data = torch.randn(2, 4)
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return self.data[idx]

# The function takes one parameter: name
# name can be a string or a list of strings
# The function uses it in: isinstance(name, list) check and iteration over names

ARGS = {
    "name": "calibration_dataset"
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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_algorithm_class Not yet run
unverified (harvested, no recorded run)
intel/auto-round/auto_round/algorithms/config_resolver.py
code served (permissive licence) · get_code("8dc37cb8349ffb98")
How it ran

no invocation recorded.

get_algorithm_entry Not yet run
unverified (harvested, no recorded run)
intel/auto-round/auto_round/algorithms/registry.py
code served (permissive licence) · get_code("9c9808ac09eabbca")
How it ran

no invocation recorded.

is_preprocessor_config Not yet run
unverified (harvested, no recorded run)
intel/auto-round/auto_round/algorithms/config_resolver.py
code served (permissive licence) · get_code("2286f55df29e9f20")
How it ran

no invocation recorded.

resolve_algorithm_alias Not yet run
unverified (harvested, no recorded run)
intel/auto-round/auto_round/algorithms/registry.py
code served (permissive licence) · get_code("b0f8a04cc8cf723a")
How it ran

no invocation recorded.

resolve_algorithm_names Not yet run
unverified (harvested, no recorded run)
intel/auto-round/auto_round/algorithms/registry.py
code served (permissive licence) · get_code("c8689d617f69a13e")
How it ran

no invocation recorded.

Also present in other papers' code

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

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Large Language Models (LLMs) have demonstrated exceptional proficiency in language-related tasks, but their deployment poses significant challenges due to substantial memory and storage requirements. Weight-only quantization has emerged as a promising solution, significantly reducing memory and storage needs without sacrificing too much performance. In this study, we introduce SignRound, a method that leverages signed gradient descent (SignSGD) to optimize rounding values and weight clipping in just 200 steps. SignRound integrates the advantages of Quantization-Aware Training (QAT) and Post-Training Quantization (PTQ), delivering exceptional results across 2 to 4 bits while minimizing tuning costs and avoiding additional inference overhead. For example, SignRound achieved absolute average accuracy improvements ranging from 6.91% to 33.22% at 2bits, as measured by the average zero-shot accuracy across 11 tasks. It also demonstrates strong generalization in recent models, achieving near-lossless 4-bit quantization in most scenarios. The source code is publicly available at https://github.com/intel/auto-round.

For agents

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

get_harvested_code_for_paper("2309.05516")
get_code_for_paper("2309.05516")
have("2309.05516")

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

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

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

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

Connect an agent — have() is free.