SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2411.17525 · 2024

Pushing the Limits of Large Language Model Quantization via the Linearity Theorem

arXiv · PDF · Open in the Atlas

Code that ran

21 of 36 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, 1 violated it and 12 have no contract verdict; 7 failures of our instrument; 15 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/2411.17525.json · badge: /api/ran/2411.17525.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
hanguo97/flute canonical (classifier label)
classifier basis: census
8 ran · 5 no recorded run
goodevening13/aquakv community (classifier label)
classifier basis not recorded on the link
13 ran · 10 no recorded run
FunctionStatusWhere it lives
apply_rotary_to_keys Ran
ran on a synthesized input
goodevening13/aquakv/aquakv/cache_utils.py
code served (permissive licence) · get_code("29d977b676b52dd7")
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 5, dtype family float, shape (1, 2, 3, 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
from transformers.models.llama.modeling_llama import apply_rotary_pos_emb

torch.manual_seed(0)

# Create tiny tensors for testing
# key_states: shape (batch_size, seq_len, num_heads, head_dim)
# We need at least seq_len=1 for the slicing operation
batch_size = 2
seq_len = 3
num_heads = 2
head_dim = 4

key_states = torch.randn(batch_size, seq_len, num_heads, head_dim)

# cos and sin tensors are typically shape (seq_len, head_dim) or (1, seq_len, 1, head_dim)
# based on how apply_rotary_pos_emb uses them
cos = torch.randn(1, seq_len, 1, head_dim)
sin = torch.randn(1, seq_len, 1, head_dim)

ARGS = {
    "key_states": key_states,
    "cos": cos,
    "sin": sin,
}
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 Tensor, ndim 5, dtype family float, shape (1, 2, 3, 2, 4) — shape (1, 2, 3, 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
build_chat Ran
ran on a synthesized input
goodevening13/aquakv/evaluate_longbench.py
code served (permissive licence) · get_code("c3b06c2ebcf2af2d")
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
from transformers import PreTrainedTokenizer

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        self.bos_token = "<s>"
    
    def build_chat_input(self, prompt):
        return {"input_ids": torch.tensor([[1, 2, 3]])}
    
    def build_prompt(self, prompt):
        return f"Prompt: {prompt}"
    
    def apply_chat_template(self, messages, tokenize=False, add_generation_prompt=False):
        return self.bos_token + "Applied template: " + messages[0]['content']

class MockTokenizerWithEndToken:
    def __init__(self):
        self.bos_token = "<s>"
    
    def apply_chat_template(self, messages, tokenize=False, add_generation_prompt=False):
        return self.bos_token + "Applied template: " + messages[0]['content']

ARGS = {
    "tokenizer": MockTokenizer(),
    "prompt": "Hello, how are you?",
    "model_name": "chatglm3-6b"
}
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 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
combine_heads Ran
ran on a synthesized input
goodevening13/aquakv/aquakv/cache_utils.py
code served (permissive licence) · get_code("5b7154a0c5684311")
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, 4, 15) 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)

# The function expects a 4D tensor and performs:
# 1. transpose(1, 2) - swaps dimensions 1 and 2
# 2. flatten(-2) - flattens the last two dimensions
# 
# So we need a tensor with shape (batch, dim1, dim2, dim3)
# Let's use distinct sizes: batch=2, dim1=3, dim2=4, dim3=5

key_states = torch.randn(2, 3, 4, 5)

ARGS = {
    "key_states": key_states,
}
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, 4, 15) — shape (2, 4, 15) 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
compute_centers_of_mass_with_gaussian_weights Ran
ran on a synthesized input
goodevening13/aquakv/aquakv/grid_generator.py
code served (permissive licence) · get_code("9d136789dc29ba63")
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

torch.manual_seed(0)

# grid: used with .T, torch.norm(..., dim=1), and indexing with closest_indices
# Should be 2D tensor of shape (num_centers, embedding_dim)
grid = torch.randn(3, 4)

# sampled_points: used with @ operator, pow, mean, and indexing with cell_mask
# Should be 2D tensor of shape (num_samples, embedding_dim)
sampled_points = torch.randn(2, 4)

ARGS = {
    "grid": grid,
    "sampled_points": sampled_points,
}
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
compute_relative_mse Ran
ran on a synthesized input
goodevening13/aquakv/train_predictors.py
code served (permissive licence) · get_code("6961cac72fc0f302")
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 float, 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

torch.manual_seed(0)

# Create a simple predictor model
class SimplePredictor(nn.Module):
    def __init__(self, input_dim, output_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)

# Build setup
predictor = SimplePredictor(input_dim=4, output_dim=3)
predictor.eval()

# Create small tensors: batch_size=2, input_dim=4, output_dim=3
X = torch.randn(2, 4)
Y = torch.randn(2, 3)

# Device and dtype
compute_device = torch.device('cpu')
compute_dtype = torch.float32

# Chunk size for memory-efficient computation
chunk_size = 1

ARGS = {
    'predictor': predictor,
    'X': X,
    'Y': Y,
    'chunk_size': chunk_size,
    'compute_device': compute_device,
    'compute_dtype': compute_dtype,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
entropy Ran
ran on a synthesized input
goodevening13/aquakv/aquakv/edenn.py
code served (permissive licence) · get_code("0e7f23886f4a1549")
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 float, 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

torch.manual_seed(0)

# The function takes 'idx' which is used with torch.unique() and return_counts=True
# It expects a tensor of indices
idx = torch.tensor([0, 1, 1, 2, 2, 2, 3, 3])

ARGS = {
    "idx": idx
}
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 float, 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
fit_linear_regression Ran
ran on a synthesized input
goodevening13/aquakv/aquakv/linear_utils.py
code served (permissive licence) · get_code("ce15ccccdf94984a")
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 numpy as np

torch.manual_seed(0)

# Create small tensors with distinct dimensions for clarity
# X: [nsamples=2, in_features=4]
# Y: [nsamples=2, out_features=3]
X = torch.randn(2, 4, dtype=torch.float32)
Y = torch.randn(2, 3, dtype=torch.float32)

# Construct ARGS dict with all parameters
ARGS = {
    'X': X,
    'Y': Y,
    'reg_rate': 0.01,
    'fit_intercept': True,
    'compute_device': None,  # CPU only
    'compute_dtype': torch.float32,
    'chunk_size': None,
    'verbose': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — 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
from_binary Ran
ran, honoured the contract we drafted
hanguo97/flute/flute/packbits_utils.py
code served (permissive licence) · get_code("4e9c1bc486b3cb15")
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 1, dtype family int, shape (2,) 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 binary tensor with shape (2, 4) where last dimension is num_bits
# dtype must be torch.bool
tensor = torch.randint(0, 2, (2, 4)).to(dtype=torch.bool)

# num_bits must match the last dimension of tensor and be <= 8
num_bits = 4

# legacy parameter controls which mask calculation is used
legacy = True

ARGS = {
    "tensor": tensor,
    "num_bits": num_bits,
    "legacy": legacy,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jaxtyping, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family int, shape (2,) — shape (2,) 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
generate_nested_switch Ran
ran; our contract draft was wrong, not the code
hanguo97/flute/flute/codegen_utils.py
code served (permissive licence) · get_code("8e030cc1d6d4e357")
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 typing import List, Dict, Tuple

torch.manual_seed(0)

# Construct valid arguments for generate_nested_switch
names = ["dtype", "layout"]
cases = {
    (0, 0): "kernel_fp32_row_major();",
    (0, 1): "kernel_fp32_col_major();",
    (1, 0): "kernel_fp16_row_major();",
    (1, 1): "kernel_fp16_col_major();",
}
constexprs = [False, True]
prefix = "    "

ARGS = {
    "names": names,
    "cases": cases,
    "constexprs": constexprs,
    "prefix": prefix,
}
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 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
get_gamma Ran
ran on a synthesized input
goodevening13/aquakv/aquakv/grid_generator.py
code served (permissive licence) · get_code("10865357dbe212e1")
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 float, 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 numpy as np

torch.manual_seed(0)

n = 5
GAMMA_0 = 2.0
A = 3.0
B = 0.5

ARGS = {
    "n": n,
    "GAMMA_0": GAMMA_0,
    "A": A,
    "B": B
}
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 float, 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
get_layers Ran
ran on a synthesized input
goodevening13/aquakv/aquakv/modelutils.py
code served (permissive licence) · get_code("6af39b9342e5f24f")
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 ModuleList. 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 transformers
from transformers import PretrainedConfig

torch.manual_seed(0)

# Create a minimal LLaMA-like model config
class MinimalConfig(PretrainedConfig):
    model_type = "llama"
    
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.hidden_size = 4
        self.num_hidden_layers = 2
        self.intermediate_size = 8

# Create minimal LLaMA-like model with layers attribute
class MinimalLlamaModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.config = MinimalConfig()
        self.model = nn.Module()
        self.model.layers = nn.ModuleList([
            nn.Linear(4, 4),
            nn.Linear(4, 4)
        ])
    
class MinimalLlamaForCausalLM(transformers.PreTrainedModel):
    config_class = MinimalConfig
    
    def __init__(self, config=None):
        if config is None:
            config = MinimalConfig()
        super().__init__(config)
        self.model = nn.Module()
        self.model.layers = nn.ModuleList([
            nn.Linear(4, 4),
            nn.Linear(4, 4)
        ])

# Build a model instance
model = MinimalLlamaForCausalLM()

ARGS = {
    "model": model
}
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 ModuleList — a ModuleList output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModuleList output the recorded ndim 1 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_parent Ran
ran; our contract draft was wrong, not the code
hanguo97/flute/flute/integrations/learnable.py
code served (permissive licence) · get_code("0449aa6e073b161d")
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 LeafModule. 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)

# Build a nested module structure that get_parent will traverse
class LeafModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.value = 42

class MiddleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.leaf = LeafModule()

class RootModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.middle = MiddleModule()

# Create the root module
root_module = RootModule()

# name_split should be a sequence of attribute names to traverse
# For example: ['middle', 'leaf'] traverses root_module.middle.leaf
name_split = ['middle', 'leaf']

ARGS = {
    'module': root_module,
    'name_split': name_split
}
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 LeafModule — a LeafModule output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LeafModule 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_values_pivots Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hanguo97/flute/flute/nf_utils.py
code served (permissive licence) · get_code("415d1476002d7be7")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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

torch.manual_seed(0)

ARGS = {
    "bits": 4,
    "symmetric": False,
    "dtype": torch.float32,
}
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
linspace Ran
ran; our contract draft was wrong, not the code
hanguo97/flute/flute/nf_utils.py
code served (permissive licence) · get_code("a9e13dbd57fe99fa")
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; no output shape is stated. It ran in syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1) at 2026-09-27T00:59:35Z. 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

torch.manual_seed(0)

# Create two small tensors with distinct shapes
# start: shape (4,) - a 1D tensor
# stop: shape (4,) - a 1D tensor with same shape as start
start = torch.tensor([1.0, 2.0, 3.0, 4.0], dtype=torch.float32)
stop = torch.tensor([5.0, 6.0, 7.0, 8.0], dtype=torch.float32)

# num: number of steps
num = 3

# dtype: torch data type
dtype = torch.float32

ARGS = {
    "start": start,
    "stop": stop,
    "num": num,
    "dtype": dtype,
}
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 — no output shape is stated: no later run recorded an output shape for this sample (observed_output and metamorphic_properties carry none; shape_contract and output_contract record ndim only)
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 syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1); 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
make_qmap2_from_qmap Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hanguo97/flute/flute/utils.py
code served (permissive licence) · get_code("c9c2ebb7e3ef65d4")
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 (4, 4, 1) 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 1D tensor with dtype float16
qmap = torch.randn(4, dtype=torch.float16)

ARGS = {
    "qmap": qmap
}
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 (4, 4, 1) — shape (4, 4, 1) 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
pack_bools_into_integers Ran
ran; our contract draft was wrong, not the code
hanguo97/flute/flute/packbits_utils.py
code served (permissive licence) · get_code("af30cd35745c055e")
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 jaxtyping

torch.manual_seed(0)

# Create a small binary tensor (1D, with 7 elements to test padding)
binary_tensor = torch.tensor([True, False, True, True, False, True, False], dtype=torch.bool)

# Create arguments for the function
ARGS = {
    "tensor": binary_tensor,
    "packed_dtype": torch.uint8,
    "legacy": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jaxtyping, 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
post_process Ran
ran, violated the contract we drafted
goodevening13/aquakv/evaluate_longbench.py
code served (permissive licence) · get_code("4489113b536ca6eb")
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) 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

torch.manual_seed(0)

# The function post_process takes two parameters:
# 1. response: a string that gets processed based on model_name
# 2. model_name: a string used to determine which processing branch to take

# Test case 1: xgen model
response_xgen = "Some response text\nAssistant: This is the assistant response"
model_name_xgen = "xgen-7b"

# Test case 2: internlm model
response_internlm = "Some response<eoa>This should be removed"
model_name_internlm = "internlm-chat"

# Test case 3: other model (no special processing)
response_other = "Just a regular response"
model_name_other = "gpt2"

# We'll use the xgen case as the primary test
ARGS = {
    "response": "Some response text\nAssistant: This is the assistant response",
    "model_name": "xgen-7b"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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
reduced_rank_regression Ran
ran on a synthesized input
goodevening13/aquakv/aquakv/linear_utils.py
code served (permissive licence) · get_code("175e3e1a5d9a01c2")
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 numpy as np

torch.manual_seed(0)

# Create small test tensors
nsamples = 2
in_features = 4
out_features = 3

X = torch.randn(nsamples, in_features)
Y = torch.randn(nsamples, out_features)
rank = 2

ARGS = {
    'X': X,
    'Y': Y,
    'rank': rank,
    'reg_rate': 0.01,
    'svd_niter': 10,
    'fit_intercept': True,
    'compute_device': torch.device('cpu'),
    'compute_dtype': torch.float32,
    'chunk_size': None,
}
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
sample_gaussian Ran
ran on a synthesized input
goodevening13/aquakv/aquakv/grid_generator.py
code served (permissive licence) · get_code("f5f502f02b4bc42d")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

ARGS = {
    "n_samples": 2,
    "dim": 4,
}
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
split_heads Ran
ran on a synthesized input
goodevening13/aquakv/aquakv/cache_utils.py
code served (permissive licence) · get_code("45d1e56d523d67f7")
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 4, dtype family float, shape (2, 4, 4, 2) 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)

# Analyze the function:
# - key_states: torch.Tensor with ndim == 3
# - head_dim: int
# The function reshapes key_states from (batch, seq_len, dim) to (batch, seq_len, num_heads, head_dim)
# Then transposes to (batch, num_heads, seq_len, head_dim)
# So we need: key_states.shape[2] divisible by head_dim

# Create a 3D tensor: (batch_size=2, seq_len=4, hidden_dim=8)
# 8 is divisible by 2 and 4, so we can use head_dim=2 or head_dim=4
key_states = torch.randn(2, 4, 8)
head_dim = 2

ARGS = {
    "key_states": key_states,
    "head_dim": head_dim,
}
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 4, dtype family float, shape (2, 4, 4, 2) — shape (2, 4, 4, 2) 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
to_binary Ran
ran; our contract draft was wrong, not the code
hanguo97/flute/flute/packbits_utils.py
code served (permissive licence) · get_code("2327775e49455531")
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, 4, 3) 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 jaxtyping

torch.manual_seed(0)

# Create a small uint8 tensor with values that fit within num_bits range
# Shape: (2, 4) - batch of 2, dimension of 4
tensor = torch.tensor(
    [[1, 2, 3, 4],
     [5, 6, 7, 0]],
    dtype=torch.uint8
)

num_bits = 3
legacy = True

ARGS = {
    "tensor": tensor,
    "num_bits": num_bits,
    "legacy": legacy
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jaxtyping, 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, 4, 3) — shape (2, 4, 3) 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
convert_rrr_to_module Not yet run
unverified (harvested, no recorded run)
goodevening13/aquakv/aquakv/linear_utils.py
code served (permissive licence) · get_code("8f5d43a58d5e35fd")
How it ran

no invocation recorded.

evaluate_perplexity Not yet run
unverified (harvested, no recorded run)
goodevening13/aquakv/evaluate_perplexity.py
code served (permissive licence) · get_code("b8dbc365b7e02acf")
How it ran

no invocation recorded.

get_accelerate_hook Not yet run
unverified (harvested, no recorded run)
hanguo97/flute/flute/integrations/base.py
code served (permissive licence) · get_code("1ca31572851e9670")
How it ran

no invocation recorded.

get_grid Not yet run
unverified (harvested, no recorded run)
goodevening13/aquakv/aquakv/edenn.py
code served (permissive licence) · get_code("43b836ca41904aad")
How it ran

no invocation recorded.

get_grid_norms_squared Not yet run
unverified (harvested, no recorded run)
goodevening13/aquakv/aquakv/edenn.py
code served (permissive licence) · get_code("8c89526526a53954")
How it ran

no invocation recorded.

get_inps Not yet run
unverified (harvested, no recorded run)
goodevening13/aquakv/aquakv/modelutils.py
code served (permissive licence) · get_code("5779965330a56105")
How it ran

no invocation recorded.

get_ptb Not yet run
unverified (harvested, no recorded run)
goodevening13/aquakv/aquakv/datautils.py
code served (permissive licence) · get_code("330e351424a2b37b")
How it ran

no invocation recorded.

get_red_pajama Not yet run
unverified (harvested, no recorded run)
goodevening13/aquakv/aquakv/datautils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from xinghaow99/BitStack, is pointer only (licence: NONE) · get_code("6f93456246f10e4f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from xinghaow99/BitStack, 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. No invocation recorded.

get_wikitext2 Not yet run
unverified (harvested, no recorded run)
goodevening13/aquakv/aquakv/datautils.py
code served (permissive licence) · get_code("e7d4ca6a631d3399")
How it ran

no invocation recorded.

get_workspace_streamk Not yet run
unverified (harvested, no recorded run)
hanguo97/flute/flute/utils.py
code served (permissive licence) · get_code("f1e34f158c99562b")
How it ran

no invocation recorded.

make_workspace_streamk Not yet run
unverified (harvested, no recorded run)
hanguo97/flute/flute/utils.py
code served (permissive licence) · get_code("d148bebf6417581d")
How it ran

no invocation recorded.

manual_nf4 Not yet run
unverified (harvested, no recorded run)
hanguo97/flute/flute/nf_utils.py
code served (permissive licence) · get_code("6972df470f34c81b")
How it ran

no invocation recorded.

parse_args Not yet run
unverified (harvested, no recorded run)
goodevening13/aquakv/evaluate_longbench.py
code served (permissive licence) · get_code("8acc0555324217dc")
How it ran

no invocation recorded.

replace_with_flute_linear Not yet run
unverified (harvested, no recorded run)
hanguo97/flute/flute/integrations/huggingface.py
code served (permissive licence) · get_code("5578730b99e18dce")
How it ran

no invocation recorded.

update_outs_inplace_ Not yet run
unverified (harvested, no recorded run)
goodevening13/aquakv/aquakv/modelutils.py
code served (permissive licence) · get_code("404c5dbba75966dd")
How it ran

no invocation recorded.

Also present in other papers' code

Of 36 samples lifted from this paper's linked repositories, 36 carry a function identity and 0 do not. Of the 36 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 1 later) and 32 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
post_process 14 other papers
9 dated earlier, 5 later
2311.09198 (2023-11)
Never Lost in the Middle: Mastering Long-Context Question Answering with Position-Agnostic Decompositional Training
2402.02750 (2024-02)
KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cache
2404.14469 (2024-04)
SnapKV: LLM Knows What You are Looking for Before Generation
and 11 more not named here
from_binary 1 other paper
1 dated earlier
2311.12023 (2023-11)
LQ-LoRA: Low-rank Plus Quantized Matrix Decomposition for Efficient Language Model Finetuning
get_red_pajama 1 other paper
1 dated earlier
2410.23918 (2024-10)
BitStack: Any-Size Compression of Large Language Models in Variable Memory Environments
to_binary 1 other paper
1 dated earlier
2311.12023 (2023-11)
LQ-LoRA: Low-rank Plus Quantized Matrix Decomposition for Efficient Language Model Finetuning

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

Quantizing large language models has become a standard way to reduce their memory and computational costs. Typically, existing methods focus on breaking down the problem into individual layer-wise sub-problems, and minimizing per-layer error, measured via various metrics. Yet, this approach currently lacks theoretical justification and the metrics employed may be sub-optimal. In this paper, we present a "linearity theorem" establishing a direct relationship between the layer-wise $\ell_2$ reconstruction error and the model perplexity increase due to quantization. This insight enables two novel applications: (1) a simple data-free LLM quantization method using Hadamard rotations and MSE-optimal grids, dubbed HIGGS, which outperforms all prior data-free approaches such as the extremely popular NF4 quantized format, and (2) an optimal solution to the problem of finding non-uniform per-layer quantization levels which match a given compression constraint in the medium-bitwidth regime, obtained by reduction to dynamic programming. On the practical side, we demonstrate improved accuracy-compression trade-offs on Llama-3.1 and 3.2-family models, as well as on Qwen-family models. Further, we show that our method can be efficiently supported in terms of GPU kernels at various batch sizes, advancing both data-free and non-uniform quantization for LLMs.

For agents

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

get_harvested_code_for_paper("2411.17525")
get_code_for_paper("2411.17525")
have("2411.17525")

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

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

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

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

Connect an agent — have() is free.