SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.18933 · 2026

A Geometric Analysis of Sign-Magnitude Asymmetry in a ReLU + RMSNorm Block under Ternary Quantization

Dong Lei

arXiv · PDF

Code that ran

15 of 19 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; 5 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 10 failures of our instrument; 4 no recorded run), measured 2026-11-23; 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/2605.18933.json · badge: /api/ran/2605.18933.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
donglei628/sign-magnitude-pre-norm canonical (classifier label)
classifier basis: census
15 ran · 4 no recorded run
FunctionStatusWhere it lives
c_theory Ran
ran, honoured the contract we drafted
donglei628/sign-magnitude-pre-norm/experiments/verify_theorem3.py
code served (permissive licence) · get_code("9b96d89c732cb3af")
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 math

def c_theory(p: float) -> float:
    """Theorem 3 asymptotic prediction for c(p)."""
    R_sign = p - 4 * p ** 1.5 / (3 * math.pi)
    R_mag = 2.0 / math.pi
    R_A = 1 - 4 * math.sqrt(p) / (3 * math.pi)
    return (1 - R_sign) / (1 - R_mag) * R_A


ARGS = {
    "p": 0.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 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
c_theory Ran
ran, honoured the contract we drafted
donglei628/sign-magnitude-pre-norm/figures/plot_theorem3.py
code served (permissive licence) · get_code("c11618d04e506835")
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

def c_theory(p):
    """Theoretical prediction for c(p) from Theorem 3."""
    pi = np.pi
    return pi / (pi - 2) * (1 - p) * (1 - 4 * np.sqrt(p) / (3 * pi))

ARGS = {
    "p": 0.25
}
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
compute_stats Ran
ran; our contract draft was wrong, not the code
donglei628/sign-magnitude-pre-norm/experiments/exp5_multilayer_toy.py
code served (permissive licence) · get_code("e31e075089fb7349")
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 math
from typing import List, Dict, Any, Tuple
import numpy as np
import torch

# Create a list of float values for testing
values = [1.2, 2.5, 3.1, 4.8, 5.3, 2.9, 3.7, 4.2]

ARGS = {
    "values": values
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, 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
compute_stats Ran
ran; our contract draft was wrong, not the code
donglei628/sign-magnitude-pre-norm/experiments/exp5_trained_weights.py
code served (permissive licence) · get_code("e1546806333b4018")
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 math
from typing import List, Dict, Any, Tuple
import numpy as np

# Construct valid arguments for compute_stats
# The function takes a single parameter: values (List[float])
# We'll create a small list of float values

values = [1.5, 2.3, 3.1, 2.8, 1.9, 3.4, 2.1]

ARGS = {
    'values': values
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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
compute_stats Ran
ran; our contract draft was wrong, not the code
donglei628/sign-magnitude-pre-norm/experiments/verify_theorem3.py
code served (permissive licence) · get_code("aa5f1ef94374f662")
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 math
from typing import List, Dict, Any, Tuple
import numpy as np

def compute_stats(values: List[float]) -> Dict[str, float]:
    arr = np.array(values)
    n = len(arr)
    mean = float(np.mean(arr))
    std = float(np.std(arr, ddof=1)) if n > 1 else 0.0
    se = std / math.sqrt(n) if n > 0 else 0.0
    t_val = 1.96 if n >= 30 else 2.09
    return {'n': n, 'mean': mean, 'median': float(np.median(arr)), 'std': std, 'se': se, 'ci95_lo': mean - t_val * se, 'ci95_hi': mean + t_val * se, 'min': float(np.min(arr)), 'max': float(np.max(arr))}

# Construct valid arguments for compute_stats
values = [1.5, 2.3, 3.1, 2.8, 3.5, 2.9, 3.2, 2.6, 3.0, 2.4]

ARGS = {
    'values': values
}
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 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_activation_fn Ran
ran; our contract draft was wrong, not the code
donglei628/sign-magnitude-pre-norm/experiments/exp5_multilayer_toy.py
code served (permissive licence) · get_code("5fec7274c7f22bcc")
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 builtin_function_or_method. 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)

ARGS = {
    'name': 'relu'
}
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 builtin_function_or_method — a builtin_function_or_method output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a builtin_function_or_method 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_linear_layers Ran
ran; our contract draft was wrong, not the code
donglei628/sign-magnitude-pre-norm/experiments/dn_outlier.py
code served (permissive licence) · get_code("d1ef356d1d206cff")
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 2, 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)

# Build a minimal model with linear layers
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Linear(4, 8)  # This should be skipped (has 'embed' in name)
        self.linear1 = nn.Linear(8, 6)    # This should be included
        self.linear2 = nn.Linear(6, 5)    # This should be included
        self.lm_head = nn.Linear(5, 3)    # This should be skipped (has 'lm_head' in name)
        self.dense = nn.Linear(3, 2)      # This should be included

model = SimpleModel()

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 list, ndim 2, 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_multilayer_data Ran
ran, honoured the contract we drafted
donglei628/sign-magnitude-pre-norm/figures/plot_multilayer.py
code served (permissive licence) · get_code("bcc415f45b6d945e")
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 2, 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 json
import numpy as np
import tempfile
import os

# Create a temporary JSON file with the expected structure
temp_dir = tempfile.mkdtemp()
filepath = os.path.join(temp_dir, 'experiment_data.json')

# Construct the nested data structure that the function expects
data = {
    'results': {
        'relu': {
            '2048': {
                'p=0.01': {
                    'per_layer': {
                        '0': {'mean': 0.45, 'std': 0.05, 'n': 20},
                        '1': {'mean': 0.52, 'std': 0.06, 'n': 20},
                        '2': {'mean': 0.58, 'std': 0.04, 'n': 20},
                        '3': {'mean': 0.61, 'std': 0.07, 'n': 20},
                    }
                }
            }
        }
    }
}

# Write the JSON file
with open(filepath, 'w') as f:
    json.dump(data, f)

ARGS = {
    'filepath': filepath,
    'activation': 'relu',
    'dim': '2048',
    'p': 'p=0.01'
}
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 tuple, ndim 2, 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
load_trained_data Ran
ran, honoured the contract we drafted
donglei628/sign-magnitude-pre-norm/figures/plot_multilayer.py
code served (permissive licence) · get_code("490bea4818f080cc")
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 2, 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 json
import numpy as np
import tempfile
import os

# Create a temporary JSON file with the expected structure
temp_dir = tempfile.mkdtemp()
filepath = os.path.join(temp_dir, "test_data.json")

# Construct the nested data structure expected by load_trained_data
data = {
    "results": {
        "trained": {
            "relu": {
                "p=0.01": {
                    "per_layer": {
                        "0": {
                            "mean": 0.45,
                            "ci95_lo": 0.40,
                            "ci95_hi": 0.50,
                            "std": 0.05,
                            "n": 10
                        },
                        "1": {
                            "mean": 0.55,
                            "ci95_lo": 0.50,
                            "ci95_hi": 0.60,
                            "std": 0.06,
                            "n": 10
                        },
                        "2": {
                            "mean": 0.65,
                            "ci95_lo": 0.60,
                            "ci95_hi": 0.70,
                            "std": 0.07,
                            "n": 10
                        }
                    }
                }
            },
            "tanh": {
                "p=0.01": {
                    "per_layer": {
                        "0": {
                            "mean": 0.35,
                            "ci95_lo": 0.30,
                            "ci95_hi": 0.40,
                            "std": 0.04,
                            "n": 10
                        }
                    }
                }
            }
        }
    }
}

# Write the JSON file
with open(filepath, 'w') as f:
    json.dump(data, f)

# Define ARGS with all parameters
ARGS = {
    "filepath": filepath,
    "activation": "relu",
    "p": "p=0.01"
}
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 tuple, ndim 2, 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
make_independent_mag_perturbation Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
donglei628/sign-magnitude-pre-norm/experiments/verify_proposition1.py
code served (permissive licence) · get_code("7662426d80eb3e6d")
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 (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

torch.manual_seed(0)

# Create a small weight tensor (4x3 to have distinct dimensions)
W = torch.randn(4, 3)

# Define target norm as a positive float
target_norm = 2.5

# Define seed as an integer
seed = 42

ARGS = {
    "W": W,
    "target_norm": target_norm,
    "seed": seed
}
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 (4, 3) — shape (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
make_sign_perturbation Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
donglei628/sign-magnitude-pre-norm/experiments/exp5_trained_weights.py
code served (permissive licence) · get_code("e93f530e8da8fbaf")
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 (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

torch.manual_seed(0)

# Construct a small weight tensor
W = torch.randn(4, 3)

# Define parameters
flip_frac = 0.3
seed = 42

ARGS = {
    'W': W,
    'flip_frac': flip_frac,
    'seed': seed
}
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 (4, 3) — shape (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
make_sign_perturbation Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
donglei628/sign-magnitude-pre-norm/experiments/verify_proposition1.py
code served (permissive licence) · get_code("596414b45c03dcc9")
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 (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

torch.manual_seed(0)

# Create a small weight tensor
W = torch.randn(4, 3, device='cpu')

# Define parameters
flip_frac = 0.3
seed = 42

# Construct ARGS dict with all parameters
ARGS = {
    'W': W,
    'flip_frac': flip_frac,
    'seed': seed,
}
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 (4, 3) — shape (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
measure_row_cos2 Ran
ran; our contract draft was wrong, not the code
donglei628/sign-magnitude-pre-norm/experiments/verify_theorem4.py
code served (permissive licence) · get_code("91b129a974e8046b")
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 math

torch.manual_seed(0)

# The function measure_row_cos2 takes a weight tensor W and computes
# row-level cosine similarity metrics. It expects:
# - W: a 2D tensor of shape (num_rows, num_cols)

# Create a small weight tensor with distinct dimensions
W = torch.randn(2, 4)  # 2 rows, 4 columns

ARGS = {
    'W': W
}
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
measure_vector_cos2 Ran
ran; our contract draft was wrong, not the code
donglei628/sign-magnitude-pre-norm/experiments/verify_theorem4.py
code served (permissive licence) · get_code("6591234932f35f45")
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 math

torch.manual_seed(0)

# Create a small weight matrix W with shape (m, n)
# The function uses: W.shape, W.to(device), W_dev.abs(), .sum(dim=1, keepdim=True), torch.sign()
# So we need a 2D tensor
W = torch.randn(3, 4)  # m=3, n=4

# Parameters for measure_vector_cos2
n_sphere = 10  # number of samples to draw from sphere
seed = 42
device = 'cpu'
batch_size = 5

ARGS = {
    'W': W,
    'n_sphere': n_sphere,
    'seed': seed,
    'device': device,
    'batch_size': batch_size
}
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
sample_sphere Ran
ran, honoured the contract we drafted
donglei628/sign-magnitude-pre-norm/experiments/exp5_multilayer_toy.py
code served (permissive licence) · get_code("6bd3e54f06121c07")
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)

ARGS = {
    'n': 4,
    'k': 2,
    'seed': 42,
    'device': 'cpu'
}
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
collect_activation_stats Not yet run
unverified (harvested, no recorded run)
donglei628/sign-magnitude-pre-norm/experiments/dn_outlier.py
code served (permissive licence) · get_code("da3a837e5baf47c9")
How it ran

no invocation recorded.

evaluate_ppl Not yet run
unverified (harvested, no recorded run)
donglei628/sign-magnitude-pre-norm/experiments/dn_outlier.py
code served (permissive licence) · get_code("7edbc98433bb3a0d")
How it ran

no invocation recorded.

measure_alpha_all_dims Not yet run
unverified (harvested, no recorded run)
donglei628/sign-magnitude-pre-norm/experiments/column_flip_verify.py
code served (permissive licence) · get_code("364061df24326431")
How it ran

no invocation recorded.

measure_column_perturbation_energy Not yet run
unverified (harvested, no recorded run)
donglei628/sign-magnitude-pre-norm/experiments/activation_level_verify.py
code served (permissive licence) · get_code("1e486d651f88f1bd")
How it ran

no invocation recorded.

Also present in other papers' code

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

Pre-norm Transformers with RMSNorm tolerate ternary {-1, 0, +1} weight quantization with surprisingly small loss [Ma et al., 2024]. We give a geometric explanation via sign-magnitude decomposition of weight perturbations. In a two-layer ReLU + RM-SNorm model with i.i.d. Gaussian weights, sign-flips produce π/(π -2) ≈ 2.75 times more transverse output energy than sign-preserving magnitude perturbations of equal Frobenius norm, as the flip rate p → 0 (Theorem 3). The mechanism: ReLU creates a hidden-space directional asymmetry between the two perturbation types, which RM-SNorm's transverse-projection Fréchet derivative selectively exposes. Sign-quantization error is itself a sign-preserving perturbation with angular alignment cos 2 → 2/π (Theorem 4); its post-ReLU radial fraction (0.365) matches the pre-ReLU value 1 -2/π within 0.4%, so ReLU is approximately transparent to ternary error. Multi-layer compounding of the 2.75× factor is not experimentally supported; the gap to real-model sign sensitivity arises from outlier features violating delocalization. For an input dimension with amplitude α, a single sign-flip produces post-ReLU energy amplified by R ≈ nα 2 relative to a delocalized entry. On TinyLlama-1.1B, at linear response (p ≤ 0.5%), count-matched NLL leverage stabilizes at ∼10× ≈ nE[α 2 ], matching the per-entry theory; the all-column NLL ratio of 5.0× falls within R col ≤ 19 (67× PPL gap reflects metric nonlinearity). Measured outlier α at layer 12 (median 0.024, max 0.26) confirms heavy-tailed concentration. The Bussgang constant 2/π, RMSNorm geometry, and ReLU half-space structure together explain sign-magnitude asymmetry in pre-norm models, with R ∝ nα 2 accounting for real-model deviations. Recent work on extremely low-bit large language models-notably BitNet b1.58 [Ma et al., 2024]-demonstrates that pre-norm Transformer architectures [Xiong et al., 2020] can operate with weights constrained to the ternary set {-1, 0, +1} while retaining most of their

For agents

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

get_harvested_code_for_paper("2605.18933")
get_code_for_paper("2605.18933")
have("2605.18933")

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

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

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

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

Connect an agent — have() is free.