SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.19707 · 2024

InfiniGen: Efficient Generative Inference of Large Language Models with Dynamic KV Cache Management

arXiv · PDF · Open in the Atlas

Code that ran

14 of 15 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 10 have no contract verdict; 4 failures of our instrument; 1 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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.19707.json · badge: /api/ran/2406.19707.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
snu-comparch/infinigen community (classifier label)
classifier basis not recorded on the link
14 ran · 1 no recorded run
FunctionStatusWhere it lives
repeat_kv Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
snu-comparch/infinigen/accuracy/src/modeling_llama_orig.py
code served (permissive licence) · get_code("30d7eec482ebf6b1")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 4, dtype family float, shape (2, 6, 5, 4) as a later run recorded it. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T23:09:20Z). 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 tensor with shape (batch, num_key_value_heads, seqlen, head_dim)
# Using distinct sizes: batch=2, num_key_value_heads=3, seqlen=5, head_dim=4
hidden_states = torch.randn(2, 3, 5, 4)

# n_rep is the repetition factor
n_rep = 2

ARGS = {
    "hidden_states": hidden_states,
    "n_rep": n_rep,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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, 6, 5, 4) — shape (2, 6, 5, 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
apply_rotary_pos_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
snu-comparch/infinigen/accuracy/src/modeling_llama_ours.py
code served (permissive licence) · get_code("9b4dff79d5e6102c")
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 tuple, ndim 5, 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

torch.manual_seed(0)

# Analyze the function to understand tensor shapes:
# q, k: used in element-wise operations with cos, sin
# cos, sin: gathered using position_ids, shape [batch, heads, seq_len, dim]
# position_ids: shape [batch, seq_len], used to gather from cos/sin at dim 2

batch_size = 2
num_heads = 3
seq_len = 4
head_dim = 4

# q and k: [batch, heads, seq_len, head_dim]
q = torch.randn(batch_size, num_heads, seq_len, head_dim)
k = torch.randn(batch_size, num_heads, seq_len, head_dim)

# cos and sin: [1, heads, seq_len, head_dim] (will be repeated to batch_size)
cos = torch.randn(1, num_heads, seq_len, head_dim)
sin = torch.randn(1, num_heads, seq_len, head_dim)

# position_ids: [batch, seq_len] with values in range [0, seq_len)
position_ids = torch.tensor([
    [0, 1, 2, 3],
    [0, 1, 2, 3]
], dtype=torch.long)

ARGS = {
    "q": q,
    "k": k,
    "cos": cos,
    "sin": sin,
    "position_ids": position_ids,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 5, 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
apply_rotary_pos_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
snu-comparch/infinigen/accuracy/src/modeling_llama_orig.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Beomi/BitNet-Transformers, is pointer only (licence: NONE) · get_code("37fc3129c3d06e0c")
How it ran

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

cut_indices Ran
ran on a synthesized input
snu-comparch/infinigen/speedup/flexgen/infinigen/pytorch_backend.py
code served (permissive licence) · get_code("58fb93e90d4ca515")
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 torch

torch.manual_seed(0)

# Construct indices tuple with slices
# indices is a tuple of slices, where SEG_DIM=1 points to the second element
# The function accesses indices[SEG_DIM] which should be a slice with start/stop attributes
# It also uses indices[:SEG_DIM] and indices[SEG_DIM + 1:] for tuple slicing

indices = (
    slice(0, 10),           # indices[0]
    slice(5, 15),           # indices[1] - this is SEG_DIM
    slice(0, 20),           # indices[2]
)

start = 3
stop = 12
base = 1

ARGS = {
    "indices": indices,
    "start": start,
    "stop": stop,
    "base": base,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, 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_choice Ran
ran on a synthesized input
snu-comparch/infinigen/speedup/flexgen/infinigen/flex_opt.py
code served (permissive licence) · get_code("66b0a9c4c8b9fac3")
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 numpy as np

# Construct arguments for get_choice function
cur_percent = 25.5
percents = [30.0, 40.0, 30.0]  # These will sum to 100 after cumsum operations
choices = ['option_a', 'option_b', 'option_c']

ARGS = {
    'cur_percent': cur_percent,
    'percents': percents,
    'choices': choices
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_filename Ran
ran on a synthesized input
snu-comparch/infinigen/speedup/flexgen/infinigen/flex_opt.py
code served (permissive licence) · get_code("aa4fd60bcb4735f7")
How it ran

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

import torch
import numpy as np

class Args:
    def __init__(self):
        self.model = "llama-7b"
        self.gpu_batch_size = 32
        self.num_gpu_batches = 4
        self.prompt_len = 512
        self.gen_len = 128
        self.percent = [0.5, 0.3, 0.2]
        self.cpu_cache_compute = False
        self.compress_weight = False
        self.compress_cache = False

ARGS = {
    'args': Args()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
partial_weight_index_generation Ran
ran on a synthesized input
snu-comparch/infinigen/speedup/infinigen/infinigen/partial_weight_generation_controller.py
code served (permissive licence) · get_code("68b8c44fbdc6b0bd")
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 int, shape (2, 4, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Small tensor for query: (batch=2, sequence_length=3, total_dim=16)
# total_dim = n_head * head_dim = 4 * 4 = 16
query = torch.randn(2, 3, 16)

# Number of attention heads
n_head = 4

# Hidden dimension per head
head_dim = 4

# Ratio for selecting top-k columns
partial_weight_ratio = 0.5

ARGS = {
    "query": query,
    "n_head": n_head,
    "head_dim": head_dim,
    "partial_weight_ratio": partial_weight_ratio,
}
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 int, shape (2, 4, 2) — shape (2, 4, 2) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
reform_hidden_states Ran
ran on a synthesized input
snu-comparch/infinigen/speedup/infinigen/infinigen/skewing_controller.py
code served (permissive licence) · get_code("60c756ef5ff6bb68")
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, 3, 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)

# Construct a small hidden states tensor with shape (batch=2, sequence_length=3, hidden_dim=4)
hidden_states = torch.randn(2, 3, 4)

ARGS = {
    "hidden_states": hidden_states
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 3, 5) — shape (2, 3, 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
rotate_half Ran
ran; our contract draft was wrong, not the code
snu-comparch/infinigen/accuracy/src/modeling_llama_orig.py
code served (permissive licence) · get_code("b99eea6376d1e212")
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 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)

# The function rotate_half takes a single parameter 'x' which is a tensor
# It accesses x.shape[-1] to get the last dimension
# It uses indexing with [..., :] slicing notation
# It calls torch.cat() to concatenate tensors

# Create a small tensor with shape (2, 4) - batch size 2, hidden dim 4
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
select_kv Ran
ran on a synthesized input
snu-comparch/infinigen/speedup/infinigen/infinigen/kv_selection_controller.py
code served (permissive licence) · get_code("dc50e1d3317233bc")
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 4, 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.functional as F

torch.manual_seed(0)

# Small dimensions: n=5 (sequence length), bh=3 (batch*heads), d=4 (embedding dim)
# n'=2 (number of prefetch indices)

n = 5
bh = 3
d = 4
n_prefetch = 2

# Create k_cache and v_cache
# Shape: (n, bh, d) = (5, 3, 4)
k_cache = torch.randn(n, bh, d)
v_cache = torch.randn(n, bh, d)

# Create prefetch_idx
# Shape should be (n', 1, bh) according to docstring
# These are indices into the cache (0 to n-1)
prefetch_idx = torch.randint(0, n, (n_prefetch, 1, bh))

ARGS = {
    "prefetch_idx": prefetch_idx,
    "k_cache": k_cache,
    "v_cache": v_cache,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 4, 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
set_partial_cache Ran
ran on a synthesized input
snu-comparch/infinigen/speedup/infinigen/infinigen/partial_weight_generation_controller.py
code served (permissive licence) · get_code("c48042fd1baff5fa")
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 (3, 4, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Parameters for set_partial_cache
n = 3  # sequence length
b = 2  # batch size
h = 2  # number of heads
d = 4  # head dimension

bh = b * h  # combined batch*heads dimension

# k_cache: (n, bh, d) - key cache tensor
k_cache = torch.randn(n, bh, d)

# partial_index: (b, h, d') - indices of top-k columns
# d' should be smaller than d to represent partial selection
d_prime = 2  # partial dimension
partial_index = torch.randint(0, d, (b, h, d_prime))

# n_head: number of heads
n_head = h

# head_dim: dimension of each head
head_dim = d

ARGS = {
    "k_cache": k_cache,
    "partial_index": partial_index,
    "n_head": n_head,
    "head_dim": head_dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (3, 4, 2) — shape (3, 4, 2) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
set_partial_weight Ran
ran on a synthesized input
snu-comparch/infinigen/speedup/infinigen/infinigen/partial_weight_generation_controller.py
code served (permissive licence) · get_code("8bd8cf4ddbf1f17b")
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 (6, 12) 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.functional as F

torch.manual_seed(0)

# Determine dimensions
D = 12  # Total dimension (query weight first dimension)
n_head = 3  # Number of heads
head_dim = 4  # Hidden dimension per head
k = 2  # Number of important columns per head
batch_size = 2

# Create w_q: Query weight matrix of shape (D, D)
w_q = torch.randn(D, D)

# Create partial_index: Indices of top-k columns (batch, heads, k_columns)
# partial_index[0] should have shape (n_head, k) with values in range [0, head_dim)
partial_index = torch.randint(0, head_dim, (batch_size, n_head, k))

ARGS = {
    "w_q": w_q,
    "partial_index": partial_index,
    "n_head": n_head,
    "head_dim": head_dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (6, 12) — shape (6, 12) 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
skew Ran
ran on a synthesized input
snu-comparch/infinigen/speedup/infinigen/infinigen/skewing_controller.py
code served (permissive licence) · get_code("7523546807dfeacd")
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 3, 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)

# Parameters
batch_size = 2
seq_len = 3
n_head = 2
head_dim = 4
D = n_head * head_dim  # Total hidden dimension = 8

# Construct query and key matrices: (b, n, h, d)
query = torch.randn(batch_size, seq_len, n_head, head_dim, dtype=torch.float32)
key = torch.randn(batch_size, seq_len, n_head, head_dim, dtype=torch.float32)

# Construct weight matrices: (D, D+1) where D = n_head * head_dim
wq = torch.randn(D, D + 1, dtype=torch.float16)
wk = torch.randn(D, D + 1, dtype=torch.float16)

ARGS = {
    "query": query,
    "key": key,
    "wq": wq,
    "wk": wk,
    "n_head": n_head,
    "head_dim": head_dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, 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
weight_bias_concat Ran
ran on a synthesized input
snu-comparch/infinigen/speedup/infinigen/infinigen/skewing_controller.py
code served (permissive licence) · get_code("65c813943048c026")
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, 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)

# Create a weight matrix of shape (D, D) where D=4
weight = torch.randn(4, 4)

# Create a bias vector of shape (D,) where D=4
bias = torch.randn(4)

# scaling parameter - boolean
scaling = False

# head_dim parameter - float representing hidden dimension of each head
head_dim = 1.0

ARGS = {
    "weight": weight,
    "bias": bias,
    "scaling": scaling,
    "head_dim": head_dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (4, 5) — shape (4, 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
speculate_attention Not yet run
unverified (harvested, no recorded run)
snu-comparch/infinigen/speedup/infinigen/infinigen/kv_selection_controller.py
code served (permissive licence) · get_code("9e45f95449a51acf")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 3 the same month, 4 later) and 8 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
rotate_half 360 other papers
135 dated earlier, 21 the same month, 195 later, 6 same year, order not determinable, 3 undated · 30 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2203.08913 (2022-03)
Memorizing Transformers
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
and 357 more not named here
repeat_kv 243 other papers
79 dated earlier, 16 the same month, 144 later, 2 same year, order not determinable, 2 undated · 22 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2203.08913 (2022-03)
Memorizing Transformers
2305.17888 (2023-05)
LLM-QAT: Data-Free Quantization Aware Training for Large Language Models
and 240 more not named here
apply_rotary_pos_emb 47 other papers
36 dated earlier, 2 the same month, 6 later, 3 same year, order not determinable
2305.14167 (2023-05)
DetGPT: Detect What You Need via Reasoning
2305.16103 (2023-05)
ChatBridge: Bridging Modalities with Large Language Model as a Language Catalyst
2305.16355 (2023-05)
PandaGPT: One Model To Instruction-Follow Them All
and 44 more not named here
apply_rotary_pos_emb 5 other papers
4 dated earlier, 1 later
2308.10882 (2023-08)
Giraffe: Adventures in Expanding Context Lengths in LLMs
2310.11453 (2023-10)
BitNet: Scaling 1-bit Transformers for Large Language Models
2312.15166 (2023-12)
SOLAR 10.7B: Scaling Large Language Models with Simple yet Effective Depth Up-Scaling
and 2 more not named here
cut_indices 1 other paper
1 dated earlier
2303.06865 (2023-03)
FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPU
get_choice 1 other paper
1 dated earlier
2303.06865 (2023-03)
FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPU
get_filename 1 other paper
1 dated earlier
2303.06865 (2023-03)
FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPU

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

Transformer-based large language models (LLMs) demonstrate impressive performance across various natural language processing tasks. Serving LLM inference for generating long contents, however, poses a challenge due to the enormous memory footprint of the transient state, known as the key-value (KV) cache, which scales with the sequence length and batch size. In this paper, we present InfiniGen, a novel KV cache management framework tailored for long-text generation, which synergistically works with modern offloading-based inference systems. InfiniGen leverages the key insight that a few important tokens that are essential for computing the subsequent attention layer in the Transformer can be speculated by performing a minimal rehearsal with the inputs of the current layer and part of the query weight and key cache of the subsequent layer. This allows us to prefetch only the essential KV cache entries (without fetching them all), thereby mitigating the fetch overhead from the host memory in offloading-based LLM serving systems. Our evaluation on several representative LLMs shows that InfiniGen improves the overall performance of a modern offloading-based system by up to 3.00x compared to prior KV cache management methods while offering substantially better model accuracy.

For agents

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

get_harvested_code_for_paper("2406.19707")
get_code_for_paper("2406.19707")
have("2406.19707")

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

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

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

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

Connect an agent — have() is free.