SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2412.06464 · ICLR · 2025

Gated Delta Networks: Improving Mamba2 with Delta Rule

Jan Kautz, Ali Hatamizadeh, Songlin Yang

arXiv · PDF · Open in the Atlas

Code that ran

11 of 13 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; 2 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2412.06464.json · badge: /api/ran/2412.06464.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
NVlabs/GatedDeltaNet canonical (classifier label)
classifier basis: census
5 ran · 2 no recorded run
torchrwkv/flash-linear-attention community (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
FunctionStatusWhere it lives
apply_rotary_emb_torch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
NVlabs/GatedDeltaNet/lit_gpt/rotary.py
pointer only (licence: NONE); the stored copy get_code serves, from amazon-science/dualkv-flash-attn-for-rl, is pointer only (licence: NOASSERTION) · get_code("5ec949977c334f87")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NVlabs/GatedDeltaNet 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.

build_rope_cache Ran
ran, honoured the contract we drafted
NVlabs/GatedDeltaNet/lit_gpt/model.py
pointer only (licence: NONE) · get_code("a30c7463cb6330d7")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NVlabs/GatedDeltaNet 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.

ceil_div Ran
ran on a synthesized input
torchrwkv/flash-linear-attention/fla/ops/log_linear_attn/chunk.py
code served (permissive licence) · get_code("881e6b15cd91e16c")
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 math

def ceil_div(x: int, y: int) -> int:
    return math.ceil(x / y)

ARGS = {
    "x": 10,
    "y": 3,
}
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 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
code Ran
ran, honoured the contract we drafted
NVlabs/GatedDeltaNet/lit_gpt/packed_dataset.py
pointer only (licence: NONE); the stored copy get_code serves, from hrtan/fastmix, is pointer only (licence: NONE) · get_code("fa298642043e1282")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NVlabs/GatedDeltaNet 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.

construct_H_matrix Ran
ran on a synthesized input
torchrwkv/flash-linear-attention/fla/ops/log_linear_attn/naive.py
code served (permissive licence) · get_code("35a90dba5e6339cb")
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, 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

torch.manual_seed(0)

# Analyze the function:
# - construct_H_matrix takes parameters: a, L
# - a is used with .size(-1) and passed to segsum()
# - L is used with .size(-1) and .device, indexed as L[..., level, :], has shape implying (..., num_levels, T)
# - segsum(x) expects x to have at least 1 dimension (uses .size(-1))
# - construct_level_mask(level, L) expects L to have shape (..., num_levels, T)

# Let's construct:
# T = sequence length (let's use 4)
# a: shape (batch, T) = (2, 4)
# L: shape (batch, num_levels, T) where num_levels = ceil(log2(T)) + 1 = ceil(log2(4)) + 1 = 3

T = 4
batch_size = 2
num_levels = int(np.ceil(np.log2(T))) + 1  # ceil(log2(4)) + 1 = 3

# a should be shape (batch, T) - this gets passed to segsum
a = torch.randn(batch_size, T, dtype=torch.float32)

# L should be shape (batch, num_levels, T)
# Looking at construct_level_mask, it accesses L[..., level, :] which suggests
# L has shape (..., num_levels, T) where ... can be batch dimensions
L = torch.randn(batch_size, num_levels, T, dtype=torch.float32)

ARGS = {
    "a": a,
    "L": L
}
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, 4) — shape (2, 4, 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
construct_binary_level_mask Ran
ran on a synthesized input
torchrwkv/flash-linear-attention/fla/ops/log_linear_attn/chunk.py
code served (permissive licence) · get_code("f425d46b52d30143")
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 int, shape (4, 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)

# Analyze the function:
# - level: an integer representing a level parameter
# - T: an integer representing a sequence length/dimension
# The function constructs a binary level mask of shape (T, T)

ARGS = {
    "level": 1,
    "T": 4
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family int, shape (4, 4) — shape (4, 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
construct_level_mask Ran
ran on a synthesized input
torchrwkv/flash-linear-attention/fla/ops/log_linear_attn/naive.py
code served (permissive licence) · get_code("2eeea785ff36049a")
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, 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)

# Analyze the function:
# - level: an integer (0 or positive)
# - L: a tensor with shape (..., num_levels, T) where T is the last dimension
#   The function accesses L[..., level, :] and L.size(-1)

# Construct L tensor
# Shape: (batch, num_levels, T) where batch=2, num_levels=3, T=4
L = torch.randn(2, 3, 4)

# level parameter - test with level=1
level = 1

ARGS = {
    "level": level,
    "L": L,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 4, 4) — shape (2, 4, 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
level_lut Ran
ran on a synthesized input
torchrwkv/flash-linear-attention/fla/ops/log_linear_attn/chunk.py
code served (permissive licence) · get_code("2196376162089b22")
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 int, shape (8, 8) 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 math

torch.manual_seed(0)

ARGS = {
    "BT": 8,
    "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 int, shape (8, 8) — shape (8, 8) 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
maybe_align Ran
ran; our contract draft was wrong, not the code
NVlabs/GatedDeltaNet/lit_gpt/rmsnorm.py
pointer only (licence: NONE); the stored copy get_code serves, from hrtan/fastmix, is pointer only (licence: NONE) · get_code("c6283b7a1a1785ba")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NVlabs/GatedDeltaNet 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.

rotate_half Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
NVlabs/GatedDeltaNet/lit_gpt/rotary.py
pointer only (licence: NONE); the stored copy get_code serves, from amazon-science/dualkv-flash-attn-for-rl, is pointer only (licence: NOASSERTION) · get_code("163292f43a3c861b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NVlabs/GatedDeltaNet 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.

segsum Ran
ran on a synthesized input
torchrwkv/flash-linear-attention/fla/ops/log_linear_attn/naive.py
code served (permissive licence) · get_code("f0e873ec510a64bc")
How it ran

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

import torch

torch.manual_seed(0)

# The function takes a tensor x and computes segment sums
# It expects x to have a last dimension T, and works with cumsum along that dimension
# Create a small tensor with shape (batch, feature, time) or similar
x = torch.randn(2, 4, 5)  # batch_size=2, features=4, sequence_length=5

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 4, 5, 5) — shape (2, 4, 5, 5) 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
create_block Not yet run
unverified (harvested, no recorded run)
NVlabs/GatedDeltaNet/lit_gpt/model.py
pointer only (licence: NOASSERTION) · get_code("cf8f6cb38ea274f7")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, NVlabs/GatedDeltaNet (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_flops_available Not yet run
unverified (harvested, no recorded run)
NVlabs/GatedDeltaNet/lit_gpt/speed_monitor.py
pointer only (licence: NONE); the stored copy get_code serves, from hrtan/fastmix, is pointer only (licence: NONE) · get_code("3f3d25ea807f6d5c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NVlabs/GatedDeltaNet 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.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 6 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 6 later) and 7 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
build_rope_cache 8 other papers
4 dated earlier, 4 later
2401.02385 (2024-01)
TinyLlama: An Open-Source Small Language Model
2408.03506 (2024-08)
1.5-Pints Technical Report: Pretraining in Days, Not Months -- Your Language Model Thrives on Quality Data
2409.17115 (2024-09)
Programming Every Example: Lifting Pre-training Data Quality Like Experts at Scale
and 5 more not named here
apply_rotary_emb_torch 6 other papers
2 dated earlier, 4 later
2309.06180 (2023-09)
Efficient Memory Management for Large Language Model Serving with PagedAttention
2407.08608 (2024-07)
FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision
2601.17367 (2026-01)
Elastic Attention: Test-time Adaptive Sparsity Ratios for Efficient Transformers
and 3 more not named here
rotate_half 6 other papers
2 dated earlier, 4 later
2309.06180 (2023-09)
Efficient Memory Management for Large Language Model Serving with PagedAttention
2407.08608 (2024-07)
FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision
2511.10056 (2025-11)
From Static Structures to Ensembles: Studying and Harnessing Protein Structure Tokenization
and 3 more not named here
code 5 other papers
4 dated earlier, 1 later
2401.02385 (2024-01)
TinyLlama: An Open-Source Small Language Model
2406.06046 (2024-06)
MATES : Model-Aware Data Selection for Efficient Pretraining with Data Influence Models
2410.08102 (2024-10)
Efficient Pretraining Data Selection for Language Models via Multi-Actor Collaboration
and 2 more not named here
maybe_align 5 other papers
3 dated earlier, 2 later
2401.02385 (2024-01)
TinyLlama: An Open-Source Small Language Model
2407.05483 (2024-07)
Just read twice: closing the recall gap for recurrent language models
2410.05363 (2024-10)
Towards World Simulator: Crafting Physical Commonsense-Based Benchmark for Video Generation
and 2 more not named here
get_flops_available 2 other papers
2 later
2503.15450 (2025-03)
SkyLadder: Better and Faster Pretraining via Context Window Scheduling
2606.14971 (2026-06)
FastMix: Fast Data Mixture Optimization via Gradient Descent

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

Linear Transformers have gained attention as efficient alternatives to standard Transformers, but their performance in retrieval and long-context tasks has been limited. To address these limitations, recent work has explored two distinct mechanisms: gating for adaptive memory control and the delta update rule for precise memory modifications. We observe that these mechanisms are complementary-gating enables rapid memory erasure while the delta rule facilitates targeted updates. Building on this insight, we introduce the gated delta rule and develop a parallel training algorithm optimized for modern hardware. Our proposed architecture, Gated DeltaNet, consistently surpasses existing models like Mamba2 and DeltaNet across multiple benchmarks, including language modeling, commonsense reasoning, in-context retrieval, length extrapolation, and long-context understanding. We further enhance performance by developing hybrid architectures that combine Gated DeltaNet layers with sliding window attention or Mamba2 layers, achieving both improved training efficiency and superior task performance.

For agents

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

get_harvested_code_for_paper("2412.06464")
get_code_for_paper("2412.06464")
have("2412.06464")

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

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

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

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

Connect an agent — have() is free.