SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.16282 · ICML · 2024

Reducing Fine-Tuning Memory Overhead by Approximate and Memory-Sharing Backpropagation

Xiantong Zhen, Jun Xu, Yuchen Yang, Yingdong Shi, Cheems Wang, Yuxuan Shi

arXiv · PDF · Open in the Atlas

Code that ran

10 of 21 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; 8 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 2 failures of our instrument; 11 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/2406.16282.json · badge: /api/ran/2406.16282.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
yyyyychen/LowMemoryBP canonical (classifier label)
classifier basis: census
8 ran · 10 no recorded run
yyyyychen/lowmemorybp canonical (classifier label)
classifier basis: classifier_2025
2 ran · 1 no recorded run
FunctionStatusWhere it lives
acc_and_f1 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
yyyyychen/LowMemoryBP/experiments/roberta_exp/metric.py
pointer only (licence: MIT); the stored copy get_code serves, from LequeuISIR/DSTG-encoder, is pointer only (licence: NONE) · get_code("454817035cd7e70d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from LequeuISIR/DSTG-encoder, 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. A run is recorded.

dgelu Ran
ran, honoured the contract we drafted
yyyyychen/lowmemorybp/search_act/sa_search.py
code served (permissive licence) · get_code("23d97b310f421cf4")
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 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
import torch
import numpy as np

# The function dgelu takes a single parameter 'x'
# Looking at the function body, it performs mathematical operations on x
# x should be a numeric value or array-like that supports:
# - division by scalars
# - addition with scalars
# - multiplication with scalars
# - exponentiation
# - math.erf() function

# We'll test with a simple float value
x_value = 0.5

ARGS = {
    "x": x_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
dgelu Ran
ran, honoured the contract we drafted
yyyyychen/LowMemoryBP/search_act/plot_results.py
code served (permissive licence) · get_code("5bab00057953eed3")
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 ndarray, 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 numpy as np
from scipy import special

# The function dgelu takes a single parameter x
# which is used with numpy operations: special.erf, np.exp, arithmetic
# x should be a numpy array or something array-like that works with these operations

# Create a small numpy array to use as input
x = np.array([[0.5, 1.0, -0.5, 2.0],
              [0.1, -0.1, 1.5, -1.5]])

ARGS = {
    "x": x
}
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 ndarray, 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
dgelu Ran
ran, honoured the contract we drafted
yyyyychen/LowMemoryBP/search_act/sa_search.py
code served (permissive licence) · get_code("d166f5c139047d8f")
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

# The function dgelu takes a single parameter x
# Looking at the body: x is used in math operations (math.erf, math.exp)
# This suggests x should be a number (int or float)

x = 0.5

ARGS = {
    "x": x
}
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
gelu Ran
ran, honoured the contract we drafted
yyyyychen/lowmemorybp/search_act/sa_search.py
code served (permissive licence) · get_code("7fcedfc60ac103d5")
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 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
import math

def gelu(x):
    y = 1 + math.erf(x / 2 ** 0.5)
    y *= x / 2
    return y

torch.manual_seed(0)

# The gelu function takes a single parameter 'x' which is used in mathematical operations
# It should be a numeric value or array-like that supports arithmetic operations
x_value = 2.5

ARGS = {
    'x': x_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
gelu Ran
ran, honoured the contract we drafted
yyyyychen/LowMemoryBP/search_act/plot_results.py
code served (permissive licence) · get_code("92d332f9f6d8d916")
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 ndarray, 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
import numpy as np
from scipy import special

torch.manual_seed(0)

# The gelu function takes a single parameter 'x'
# It applies scipy.special.erf to x, so x should be a numeric type
# that scipy.special.erf can handle (numpy array, scalar, or torch tensor)

# Create a small test input - a numpy array or torch tensor
x = np.array([[-1.5, -0.5, 0.0, 0.5], [1.0, 1.5, 2.0, 2.5]], dtype=np.float32)

ARGS = {
    'x': x
}
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 ndarray, 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
get_gelu_truncate_bounds Ran
ran, honoured the contract we drafted
yyyyychen/LowMemoryBP/search_act/sgd_search.py
code served (permissive licence) · get_code("bd4ce1c1da8ac7dd")
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 math

def get_gelu_truncate_bounds(truncated_error):

    def gelu(x):
        y = 1 + math.erf(x / 2 ** 0.5)
        y *= x / 2
        return y

    def check_condition(x):
        condition = abs(x - gelu(x)) < 1
        return condition
    one_side_truncated_error = truncated_error / 2
    bound = math.sqrt(-math.log(one_side_truncated_error * 2) * 2)
    assert check_condition(bound), 'condition must be met'
    return (-bound, bound)

ARGS = {
    "truncated_error": 0.1
}
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 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
get_silu_truncate_bounds Ran
ran, honoured the contract we drafted
yyyyychen/LowMemoryBP/search_act/sgd_search.py
code served (permissive licence) · get_code("9852f5e220563896")
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 math

def get_silu_truncate_bounds(truncated_error):

    def silu(x):
        y = x / (1 + math.exp(-x))
        return y

    def check_condition(x):
        condition_1 = abs(x - silu(x)) < 1
        condition_2 = math.exp(abs(x) / 2) - abs(x) - 1 > 0
        condition = condition_1 and condition_2
        return condition
    one_side_truncated_error = truncated_error / 2
    bound = -2 * math.log(one_side_truncated_error)
    assert check_condition(bound), 'condition must be met'
    return (-bound, bound)


# The function takes truncated_error as a parameter
# It needs to be a small positive value such that:
# 1. one_side_truncated_error = truncated_error / 2
# 2. bound = -2 * math.log(one_side_truncated_error) satisfies check_condition
# 
# check_condition requires:
# - abs(x - silu(x)) < 1
# - math.exp(abs(x) / 2) - abs(x) - 1 > 0
#
# The second condition is always true for x >= 0 (can verify with Taylor series)
# The first condition requires x to be in a reasonable range
# 
# Let's work backwards: if truncated_error = 0.1, then:
# one_side_truncated_error = 0.05
# bound = -2 * log(0.05) = -2 * (-2.996) ≈ 5.99
# 
# Check: silu(5.99) ≈ 5.99, so abs(5.99 - 5.99) ≈ 0 < 1 ✓
# exp(5.99/2) - 5.99 - 1 ≈ exp(2.995) - 6.99 ≈ 20 - 6.99 > 0 ✓

ARGS = {
    "truncated_error": 0.1
}
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 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
pearson_and_spearman Ran
ran; our contract draft was wrong, not the code
yyyyychen/LowMemoryBP/experiments/roberta_exp/metric.py
pointer only (licence: MIT); the stored copy get_code serves, from LequeuISIR/DSTG-encoder, is pointer only (licence: NONE) · get_code("e3e13638a674e4b1")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from LequeuISIR/DSTG-encoder, 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. A run is recorded.

silu Ran
ran, honoured the contract we drafted
yyyyychen/LowMemoryBP/search_act/plot_results.py
code served (permissive licence) · get_code("df56b7b4df2b7d62")
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 ndarray, 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 numpy as np

# The function silu takes a single parameter x and applies the SiLU activation
# x should be a numpy array or array-like that supports division and np.exp()

x = np.array([[1.0, -0.5, 2.0, 0.0],
              [0.5, -1.5, 1.5, -2.0]], dtype=np.float32)

ARGS = {
    'x': x
}
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 ndarray, 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
gelu Not yet run
unverified (harvested, no recorded run)
yyyyychen/LowMemoryBP/search_act/sa_search.py
code served (permissive licence) · get_code("55935d62b8500881")
How it ran

no invocation recorded.

layer_norm Not yet run
unverified (harvested, no recorded run)
yyyyychen/LowMemoryBP/lomem/normalization.py
code served (permissive licence) · get_code("24f25e03d2510fc4")
How it ran

no invocation recorded.

pack_bool_to_uint8 Not yet run
unverified (harvested, no recorded run)
yyyyychen/LowMemoryBP/lomem/packing.py
code served (permissive licence) · get_code("2e7e3714bf4747c5")
How it ran

no invocation recorded.

regelu2 Not yet run
unverified (harvested, no recorded run)
yyyyychen/LowMemoryBP/lomem/activation.py
code served (permissive licence) · get_code("aa093de845df408e")
How it ran

no invocation recorded.

replace_linear4bit Not yet run
unverified (harvested, no recorded run)
yyyyychen/LowMemoryBP/experiments/llama_exp/qlora.py
code served (permissive licence) · get_code("1eafd3b53f875c65")
How it ran

no invocation recorded.

resilu2 Not yet run
unverified (harvested, no recorded run)
yyyyychen/LowMemoryBP/lomem/activation.py
code served (permissive licence) · get_code("91254aa095e9a8e4")
How it ran

no invocation recorded.

rms_norm Not yet run
unverified (harvested, no recorded run)
yyyyychen/LowMemoryBP/lomem/normalization.py
code served (permissive licence) · get_code("dd3123886d069aa0")
How it ran

no invocation recorded.

silu Not yet run
unverified (harvested, no recorded run)
yyyyychen/lowmemorybp/search_act/sa_search.py
code served (permissive licence) · get_code("fc28c3f7ab3434fd")
How it ran

no invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back.

silu Not yet run
unverified (harvested, no recorded run)
yyyyychen/LowMemoryBP/search_act/sa_search.py
code served (permissive licence) · get_code("fbb6daa55e3cf79c")
How it ran

no invocation recorded.

simple_accuracy Not yet run
unverified (harvested, no recorded run)
yyyyychen/LowMemoryBP/experiments/roberta_exp/metric.py
pointer only (licence: MIT); the stored copy get_code serves, from LequeuISIR/DSTG-encoder, is pointer only (licence: NONE) · get_code("83eba990d34db6a2")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from LequeuISIR/DSTG-encoder, 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.

unpack_uint8_to_bool Not yet run
unverified (harvested, no recorded run)
yyyyychen/LowMemoryBP/lomem/packing.py
code served (permissive licence) · get_code("2d38c0e161fa803b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 21 samples lifted from this paper's linked repositories, 21 carry a function identity and 0 do not. Of the 18 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 3 later) and 15 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
acc_and_f1 5 other papers
4 dated earlier, 1 later
2301.12132 (2023-01)
AutoPEFT: Automatic Configuration Search for Parameter-Efficient Fine-Tuning
2308.16475 (2023-08)
$\rm SP^3$: Enhancing Structured Pruning via PCA Projection
2311.11696 (2023-11)
Sparse Low-rank Adaptation of Pre-trained Language Models
and 2 more not named here
pearson_and_spearman 5 other papers
4 dated earlier, 1 later
2301.12132 (2023-01)
AutoPEFT: Automatic Configuration Search for Parameter-Efficient Fine-Tuning
2308.16475 (2023-08)
$\rm SP^3$: Enhancing Structured Pruning via PCA Projection
2311.11696 (2023-11)
Sparse Low-rank Adaptation of Pre-trained Language Models
and 2 more not named here
simple_accuracy 5 other papers
4 dated earlier, 1 later
2301.12132 (2023-01)
AutoPEFT: Automatic Configuration Search for Parameter-Efficient Fine-Tuning
2308.16475 (2023-08)
$\rm SP^3$: Enhancing Structured Pruning via PCA Projection
2311.11696 (2023-11)
Sparse Low-rank Adaptation of Pre-trained Language Models
and 2 more not named here

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

Fine-tuning pretrained large models to downstream tasks is an important problem, which however suffers from huge memory overhead due to large-scale parameters. This work strives to reduce memory overhead in fine-tuning from perspectives of activation function and layer normalization. To this end, we propose the Approximate Backpropagation (Approx-BP) theory, which provides the theoretical feasibility of decoupling the forward and backward passes. We apply our Approx-BP theory to backpropagation training and derive memory-efficient alternatives of GELU and SiLU activation functions, which use derivative functions of ReLUs in the backward pass while keeping their forward pass unchanged. In addition, we introduce a Memory-Sharing Backpropagation strategy, which enables the activation memory to be shared by two adjacent layers, thereby removing activation memory usage redundancy. Our method neither induces extra computation nor reduces training efficiency. We conduct extensive experiments with pretrained vision and language models, and the results demonstrate that our proposal can reduce up to ∼30% of the peak memory usage. Our code is released at github.

For agents

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

get_harvested_code_for_paper("2406.16282")
get_code_for_paper("2406.16282")
have("2406.16282")

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

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

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

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

Connect an agent — have() is free.