SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2304.09145 · EMNLP · 2023

Outlier Suppression+: Accurate quantization of large language models by equivalent and effective shifting and scaling

Yuhang Li, Ruihao Gong, Xiuying Wei, Xianglong Liu, Yunchen Zhang, Xiangguo Zhang, Jinyang Guo

arXiv · PDF · Open in the Atlas

Code that ran

5 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 3 failures of our instrument; 2 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/2304.09145.json · badge: /api/ran/2304.09145.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
modeltc/outlier_suppression_plus marked official in Papers with Code
Papers with Code archive
5 ran · 2 no recorded run
FunctionStatusWhere it lives
MinMaxObserver Ran
ran on a synthesized input · constructed an object; no result was computed
modeltc/outlier_suppression_plus/quant_transformer/quantization/migration.py
code served (permissive licence) · get_code("618d2924baa4dc1d")
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, MinMaxObserver: 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 torch.nn as nn

torch.manual_seed(0)

# Create test tensors with distinct sizes to allow shape probing
# x_orig will be passed to forward() method
x_test = torch.randn(2, 4, 3)  # batch=2, seq_len=4, hidden=3

# Optional observation_mask for selective padding removal
observation_mask_test = torch.ones(8, dtype=torch.int32)  # 2*4=8 elements

# seq_pos parameter for reshape operations
seq_pos_test = 1

ARGS = {
    "bit": 8,
    "symmetric": False,
    "ch_axis": -1,
}
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 MinMaxObserver — 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 MinMaxObserver 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
ObserverBase Ran
ran on a synthesized input · constructed an object; no result was computed
modeltc/outlier_suppression_plus/quant_transformer/quantization/migration.py
code served (permissive licence) · get_code("2f6f74a2cba77dd3")
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, ObserverBase: 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 torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'bit': 8,
    'symmetric': False,
    'ch_axis': -1,
}
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 ObserverBase — 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 ObserverBase 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
_transform_to_ch_axis Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
modeltc/outlier_suppression_plus/quant_transformer/quantization/migration.py
code served (permissive licence) · get_code("90fb18c1f9adc9e2")
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 2, dtype family float, shape (3, 40) 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

torch.manual_seed(0)

# Create a small tensor with distinct dimensions
# Shape: (batch=2, channels=3, height=4, width=5)
x = torch.randn(2, 3, 4, 5)

# ch_axis parameter - specify which axis contains channels
ch_axis = 1

ARGS = {
    "x": x,
    "ch_axis": ch_axis
}
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 2, dtype family float, shape (3, 40) — shape (3, 40) 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
fake_quantize_per_channel_affine Ran
ran; our contract draft was wrong, not the code
modeltc/outlier_suppression_plus/quant_transformer/quantization/migration.py
code served (permissive licence) · get_code("c0dfc9372ddd11ec")
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 2, dtype family float, shape (2, 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

torch.manual_seed(0)

# Create a small input tensor: shape (2, 4) - batch size 2, 4 channels
x = torch.randn(2, 4, dtype=torch.float32)

# Per-channel scale: one scale value per channel (4 channels)
scale = torch.tensor([0.1, 0.2, 0.15, 0.25], dtype=torch.float32)

# Per-channel zero_point: one zero point per channel (4 channels)
zero_point = torch.tensor([0, 1, 2, 1], dtype=torch.int32)

# Channel axis (which axis contains the channels)
ch_axis = 1

# Quantization range (typical int8 range)
quant_min = -128
quant_max = 127

ARGS = {
    "x": x,
    "scale": scale,
    "zero_point": zero_point,
    "ch_axis": ch_axis,
    "quant_min": quant_min,
    "quant_max": quant_max,
}
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 2, dtype family float, shape (2, 4) — shape (2, 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
fake_quantize_per_tensor_affine Ran
ran; our contract draft was wrong, not the code
modeltc/outlier_suppression_plus/quant_transformer/quantization/migration.py
code served (permissive licence) · get_code("f5f3045a5c318d7c")
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 2, dtype family float, shape (2, 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

torch.manual_seed(0)

# Construct small test tensors and parameters
x = torch.randn(2, 4)  # Small tensor for input
scale = 0.1  # Scalar scale factor
zero_point = 0  # Zero point for quantization
quant_min = 0  # Minimum quantization level
quant_max = 255  # Maximum quantization level (8-bit)

ARGS = {
    "x": x,
    "scale": scale,
    "zero_point": zero_point,
    "quant_min": quant_min,
    "quant_max": quant_max,
}
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 2, dtype family float, shape (2, 4) — shape (2, 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
Migrator1DRangeSearch Not yet run
unverified (harvested, no recorded run)
modeltc/outlier_suppression_plus/quant_transformer/quantization/migration.py
code served (permissive licence) · get_code("8b470374c5bcffcf")
How it ran

no invocation recorded.

MigratorBase Not yet run
unverified (harvested, no recorded run)
modeltc/outlier_suppression_plus/quant_transformer/quantization/migration.py
code served (permissive licence) · get_code("0b04ff29f1122a99")
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, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 6 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
fake_quantize_per_tensor_affine
brick of this paper's assembly: helper
2 other papers
2 later
2405.03144 (2024-05)
PTQ4SAM: Post-Training Quantization for Segment Anything
Zhang_AHCPTQ_Accurate_and_Hardware-Compatible_Post-Training_Quantization_for_Segment_Anything_Model_ICCV_2025_paper (2025 (year only))
AHCPTQ: Accurate and Hardware-Compatible Post-Training Quantization for Segment Anything Model

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

Post-training quantization (PTQ) of transformer language models faces significant challenges due to the existence of detrimental outliers in activations. We observe that these outliers are concentrated in specific channels and are asymmetric across channels. To address this issue, we propose the Outlier Suppression+ (OS+) framework, which contains the channel-wise shifting for asymmetry and channel-wise scaling for concentration. We show that these operations can be seamlessly migrated into subsequent modules while maintaining equivalence. Second, we propose a fast and stable scheme to calculate effective shifting and scaling values. The channel-wise shifting aligns the center of each channel for removal of outlier asymmetry. The channel-wise scaling quantitatively evaluates changes brought by migration and quantization for better quantization burden balance. We validate our OS+ under both standard and fine-grained quantization settings with models including BERT, OPT, BLOOM, BLOOMZ, and LLaMA. Comprehensive results across various tasks demonstrate the superiority of our approach. Especially, with standard quantization, OS+ can achieve near-floating-point performance on both small models and large language models on 8-bit and 6-bit. Besides, we establish a new state-of-the-art for 4-bit BERT with 15.5% improvement. Our code is available at https://github.com/ModelTC/ Outlier_Suppression_Plus.

For agents

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

get_harvested_code_for_paper("2304.09145")
get_code_for_paper("2304.09145")
have("2304.09145")

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

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

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

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

Connect an agent — have() is free.