SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2202.00441 · 2022

Few-Bit Backward: Quantized Gradients of Activation Functions for Memory Footprint Reduction

arXiv · PDF · Open in the Atlas

Code that ran

15 of 17 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 15 have no contract verdict; 0 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/2202.00441.json · badge: /api/ran/2202.00441.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
SkoltechAI/fewbit canonical (classifier label)
classifier basis not recorded on the link
15 ran · 2 no recorded run
FunctionStatusWhere it lives
append_reference Ran
ran on a synthesized input
SkoltechAI/fewbit/fewbit/modules/activations.py
code served (permissive licence) · get_code("ffdba334e16081d0")
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 torch.nn as nn

torch.manual_seed(0)

# The function takes a doc string and a name string, and appends a formatted reference
# to the doc string. It uses str.format() on the SEE_ALSO template.

doc_example = "This is a documentation string for some function.\n\nParameters:\n    x: input tensor"
name_example = "Linear"

ARGS = {
    "doc": doc_example,
    "name": name_example,
}
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 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
approximate Ran
ran on a synthesized input
SkoltechAI/fewbit/fewbit/approx.py
code served (permissive licence) · get_code("1f6d08cef9a84d45")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from typing import Tuple

# Set random seed for reproducibility
np.random.seed(0)

# Define a simple test function to approximate
def test_fn(xs):
    """A simple vectorized function: sin(x)"""
    return np.sin(xs)

# Define the primitive (antiderivative) of the test function
def test_fn_prim(xs):
    """Primitive of sin(x) is -cos(x)"""
    return -np.cos(xs)

# Set up the arguments dictionary
ARGS = {
    'fn': test_fn,
    'fn_prim': test_fn_prim,
    'cardinality': 5,
    'domain': (-10.0, 10.0),
    'parity': False,
    'max_iters': 100,
    'beps': 0.001,
    'leps': 0.001,
    'random_state': 42,
}
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 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
clamp Ran
ran on a synthesized input
SkoltechAI/fewbit/fewbit/functional/linear.py
code served (permissive licence) · get_code("c8f42186142a2a86")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# Construct arguments for the clamp function
ARGS = {
    "val": 42,
    "minval": 10,
    "maxval": 100,
}
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 int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
dct Ran
ran on a synthesized input
SkoltechAI/fewbit/fewbit/fft.py
code served (permissive licence) · get_code("0984394a69efa89b")
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 numpy as np

torch.manual_seed(0)

# Create a small input tensor
# The function operates on x along a specified dimension
x = torch.randn(2, 4, 3)  # batch=2, feature=4, sequence=3

# Define all parameters for the dct function
ARGS = {
    'x': x,
    'type': 2,
    'n': None,
    'dim': -1,
    'norm': 'backward'
}
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 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
dispatch Ran
ran on a synthesized input
SkoltechAI/fewbit/fewbit/functional/activations.py
code served (permissive licence) · get_code("0490b30beebe8a38")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F
from pathlib import Path

torch.manual_seed(0)

# The dispatch function takes two parameters: name and wrapper
# Let's look at how they're used:
# 1. name: used as a string to getattr from T.nn.functional and T.ops.fewbit
# 2. wrapper: used as a fallback if getattr(T.ops.fewbit, name) is needed

# We'll use 'relu' as a valid activation function name that exists in both modules
name = 'relu'

# For wrapper, we can pass None (it will use getattr(T.ops.fewbit, name) as fallback)
# Or we can pass an actual function. Let's create a simple wrapper function
# that matches the signature of how it's used in the code
def simple_wrapper(input_tensor, borders, values, *args, **kwargs):
    """Dummy wrapper function that mimics the expected signature"""
    return F.relu(input_tensor)

wrapper = simple_wrapper

ARGS = {
    'name': name,
    'wrapper': wrapper,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
estimate_correlation Ran
ran on a synthesized input
SkoltechAI/fewbit/fewbit/modules/variance.py
code served (permissive licence) · get_code("3ae5fdf58952210a")
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 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 as T

T.manual_seed(0)

# Create small, distinct-sized tensors
# input: (4, 3) - represents 4 samples with 3 features
# output: (4, 2) - represents 4 samples with 2 output dimensions
input_tensor = T.randn(4, 3)
output_tensor = T.randn(4, 2)

ARGS = {
    "input": input_tensor,
    "output": output_tensor,
}
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 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
estimate_memory_usage Ran
ran on a synthesized input
SkoltechAI/fewbit/fewbit/util.py
code served (permissive licence) · get_code("11e69fa774fc1892")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a small tensor that requires grad so it has a grad_fn
variable = torch.randn(2, 4, requires_grad=True)

# Perform some operations to build a computation graph
output = variable * 2
loss = output.sum()

# Compute gradients to populate the grad_fn graph
loss.backward()

# Now variable.grad_fn exists and can be traversed
ARGS = {
    "variable": variable,
    "saved_only": False
}
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 int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
estimate_variance_rmm Ran
ran on a synthesized input
SkoltechAI/fewbit/fewbit/modules/variance.py
code served (permissive licence) · get_code("6fc8638c18f0ce42")
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 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 as T

T.manual_seed(0)

# Create small tensors for input and output
# input: batch_size=2, input_dim=4
# output: batch_size=2, output_dim=3
input_tensor = T.randn(2, 4)
output_tensor = T.randn(2, 3)

# bs_proj is optional and defaults to input.shape[0] if not provided
# We can test both cases - here we'll set it explicitly
bs_proj_value = 2

ARGS = {
    "input": input_tensor,
    "output": output_tensor,
    "bs_proj": bs_proj_value
}
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 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
estimate_variance_sgd Ran
ran on a synthesized input
SkoltechAI/fewbit/fewbit/modules/variance.py
code served (permissive licence) · get_code("68f0decf99978fcb")
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 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 as T

T.manual_seed(0)

# Create small tensors for input and output
# input: shape (2, 4) - batch size 2, feature dimension 4
# output: shape (2, 3) - batch size 2, output dimension 3
input_tensor = T.randn(2, 4)
output_tensor = T.randn(2, 3)

# bs (batch size) is optional, can be None or an int
batch_size = None

ARGS = {
    "input": input_tensor,
    "output": output_tensor,
    "bs": 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 Tensor, 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
idct Ran
ran on a synthesized input
SkoltechAI/fewbit/fewbit/fft.py
code served (permissive licence) · get_code("227e256653d49044")
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 as T
import numpy as np

T.manual_seed(0)

# Create a small tensor for testing
# The function operates on a tensor along a specified dimension
# Shape: (batch=2, feature_dim=4)
x = T.randn(2, 4, dtype=T.float32)

# Define all parameters for the idct function
ARGS = {
    'x': x,
    'type': 2,
    'n': None,
    'dim': -1,
    'norm': 'backward'
}
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 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
insert_args Ran
ran on a synthesized input
SkoltechAI/fewbit/fewbit/modules/activations.py
code served (permissive licence) · get_code("920472b6219d42b5")
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 re

re_shape = re.compile('^(\\s*)Shape:\\s*?$', re.M)

BITS_ARG = 'bits: number of bits in gradient approximation: Default: 3\n'

BITS_ARGS = '\n    Args:\n        ' + BITS_ARG

def insert_args(doc: str) -> str:
    if (res := re_shape.search(doc)) is None:
        doc += BITS_ARGS
        return doc
    beg = res.start(0)
    doc = doc[:beg] + BITS_ARGS + doc[beg:]
    return doc


# Test case 1: doc without "Shape:" section
doc_without_shape = """
This is a function documentation.

It does something important.
"""

# Test case 2: doc with "Shape:" section
doc_with_shape = """
This is a function documentation.

    Shape:
        input: (batch, features)
        output: (batch, classes)
"""

ARGS = {
    "doc": doc_with_shape
}
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 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
map_module Ran
ran on a synthesized input
SkoltechAI/fewbit/fewbit/util.py
code served (permissive licence) · get_code("2adbb1ba9627b56f")
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 SimpleModel. 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 re
from typing import Callable

torch.manual_seed(0)

# Create a simple module tree for testing
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Linear(3, 2)
    
    def forward(self, x):
        return self.layer2(self.layer1(x))

# Create root module
root = SimpleModel()

# Create a function that modifies modules (returns modified module)
def modification_func(module: nn.Module, path: str) -> nn.Module:
    """Example function that could modify a module and return it."""
    return module

# Create a pattern to match module paths
patt = ".*layer.*"

ARGS = {
    "root": root,
    "func": modification_func,
    "patt": patt
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
stepwise Ran
ran on a synthesized input
SkoltechAI/fewbit/fewbit/approx.py
code served (permissive licence) · get_code("b43ba240a309b25f")
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 StepWiseFunction. 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 numpy as np

# Create valid arguments for the stepwise function
# The function expects xs (borders) and ys (levels)
# From the __init__ assertions:
# - borders.ndim == 1
# - levels.ndim == 1
# - borders.size == levels.size + 1

# Create borders: 1D array with n+1 elements
borders = np.array([0.0, 1.5, 3.0, 5.5, 8.0])

# Create levels: 1D array with n elements (one fewer than borders)
levels = np.array([0.5, 1.2, 2.1, 3.8])

ARGS = {
    'xs': borders,
    'ys': levels
}
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 StepWiseFunction — a StepWiseFunction output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a StepWiseFunction 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
teniter Ran
ran on a synthesized input
SkoltechAI/fewbit/fewbit/util.py
code served (permissive licence) · get_code("9a1cb09a2c15016b")
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 generator. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple computation graph with gradients
# The function expects a tensor with a grad_fn (result of operations)
x = torch.randn(2, 4, requires_grad=True)
y = torch.randn(2, 4, requires_grad=True)

# Perform operations to create a grad_fn
z = (x * y).sum()

# Now z has a grad_fn and we can traverse it
variable = z

# include_ordinary and include_saved are boolean flags
include_ordinary = True
include_saved = False

ARGS = {
    "variable": variable,
    "include_ordinary": include_ordinary,
    "include_saved": include_saved,
}
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 generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator 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
update_args Ran
ran on a synthesized input
SkoltechAI/fewbit/fewbit/modules/activations.py
code served (permissive licence) · get_code("e093939e7df95a04")
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 re

# Analyze the function to understand what it needs:
# - doc: str - a documentation string
# - beg: int - a beginning index (position in the string)
# - prefix: str - optional prefix parameter with default value '    '

# The function processes documentation strings, looking for argument patterns
# and inserting a BITS_ARG line at appropriate locations.

# Create a sample documentation string that the function can process
sample_doc = """    approximate: bool, optional
    inplace: bool, optional
    learning_rate: float
        The learning rate for optimization
"""

# beg should be a valid starting position in the doc string
beg_value = 0

# prefix is already optional with default, but we can provide one
prefix_value = '    '

ARGS = {
    'doc': sample_doc,
    'beg': beg_value,
    'prefix': prefix_value
}
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 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
estimate_error Not yet run
unverified (harvested, no recorded run)
SkoltechAI/fewbit/fewbit/approx.py
code served (permissive licence) · get_code("a5c843a81567e736")
How it ran

no invocation recorded.

load_func Not yet run
unverified (harvested, no recorded run)
SkoltechAI/fewbit/fewbit/functional/activations.py
code served (permissive licence) · get_code("5d477abefd44b2d0")
How it ran

no invocation recorded.

Also present in other papers' code

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

Memory footprint is one of the main limiting factors for large neural network training. In backpropagation, one needs to store the input to each operation in the computational graph. Every modern neural network model has quite a few pointwise nonlinearities in its architecture, and such operation induces additional memory costs which -- as we show -- can be significantly reduced by quantization of the gradients. We propose a systematic approach to compute optimal quantization of the retained gradients of the pointwise nonlinear functions with only a few bits per each element. We show that such approximation can be achieved by computing optimal piecewise-constant approximation of the derivative of the activation function, which can be done by dynamic programming. The drop-in replacements are implemented for all popular nonlinearities and can be used in any existing pipeline. We confirm the memory reduction and the same convergence on several open benchmarks.

For agents

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

get_harvested_code_for_paper("2202.00441")
get_code_for_paper("2202.00441")
have("2202.00441")

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

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

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

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

Connect an agent — have() is free.