SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.10254 · ICLR · 2025

LoLCATs: On Low-Rank Linearizing of Large Language Models

Christopher Ré, Michael Zhang, Simran Arora, Rahul Chalamala, Benjamin Spector, Alan Wu, Aaryan Singhal, Krithik Ramesh

arXiv · PDF · Open in the Atlas

Code that ran

23 of 32 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (9 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 13 have no contract verdict; 10 failures of our instrument; 9 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/2410.10254.json · badge: /api/ran/2410.10254.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
HazyResearch/lolcats canonical (classifier label)
classifier basis: classifier_2025
1 ran · 3 no recorded run
hazyresearch/lolcats community
Papers with Code archive
22 ran · 6 no recorded run
FunctionStatusWhere it lives
DynamicNTKScalingRotaryEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("363df15c92df5f35")
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 an instance of its own class, DynamicNTKScalingRotaryEmbedding: the run constructed the object and did not call it, so no result was computed. 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)

ARGS = {
    'dim': 4,
    'max_position_embeddings': 2048,
    'base': 10000,
    'device': None,
    'scaling_factor': 1.0
}
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 DynamicNTKScalingRotaryEmbedding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DynamicNTKScalingRotaryEmbedding 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
Exp Ran
ran on a synthesized input
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("cdf03be65a92f940")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, 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 as nn

class FeatureMapAct(nn.Module):
    """
    Base class for feature map activations
    """

    def __init__(self, eps: float=1e-12):
        super().__init__()
        self.eps = eps

    def forward(self, x: torch.Tensor, *args: any, **kwargs: any):
        """
        x.shape is (batch_size, n_heads, seq_len, head_dim)
        """
        return x

class Exp(FeatureMapAct):
    """
    Exp activation as in https://arxiv.org/abs/2402.04347
    """

    def forward(self, x: torch.Tensor, *args: any, **kwargs: any):
        x_max = torch.amax(x, dim=-1, keepdim=True)
        x_min = torch.amin(x, dim=-1, keepdim=True)
        return torch.cat([torch.exp(x - x_max), torch.exp(-x + x_min)], dim=-1).clamp(min=self.eps)


INIT_ARGS = {
    'eps': 1e-12
}

ARGS = {
    'x': torch.randn(2, 3, 4, 5)
}

if __name__ == '__main__':
    model = Exp(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output:\n{output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ExpHalfspace Ran
ran on a synthesized input · constructed an object; no result was computed
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("72f5147b8da94cef")
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 an instance of its own class, ExpHalfspace: the run constructed the object and did not call it, so no result was computed. 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)

# ExpHalfspace only has one parameter: eps (inherited from FeatureMapAct)
# The forward method takes x as input which should be a tensor of shape
# (batch_size, n_heads, seq_len, head_dim)

# Create a small test tensor matching the expected shape
# batch_size=2, n_heads=3, seq_len=4, head_dim=5
x = torch.randn(2, 3, 4, 5)

ARGS = {
    "eps": 1e-12
}
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 ExpHalfspace — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ExpHalfspace 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
FeatureMap Ran
ran on a synthesized input · constructed an object; no result was computed
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("d60bb1001847bf81")
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 an instance of its own class, FeatureMap: the run constructed the object and did not call it, so no result was computed. 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 minimal MLP module that the FeatureMap will use
class MinimalMLP(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x, *args, **kwargs):
        return self.linear(x)

# Create a small tensor with shape (batch_size, n_heads, seq_len, head_dim)
# Using distinct sizes: batch=2, n_heads=3, seq_len=5, head_dim=4
x = torch.randn(2, 3, 5, 4)

ARGS = {
    "activation_name": "relu",
    "head_dim_idx": -1,
    "eps": 1e-12,
    "mlp": MinimalMLP(),
    "fullspace": True,
}
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 FeatureMap — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FeatureMap 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
FeatureMapAct Ran
ran on a synthesized input · constructed an object; no result was computed
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("8508acb10b82cae5")
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 an instance of its own class, FeatureMapAct: the run constructed the object and did not call it, so no result was computed. 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)

ARGS = {
    "eps": 1e-12,
}
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 FeatureMapAct — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FeatureMapAct 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
FeatureMapAdapter Ran
ran on a synthesized input · constructed an object; no result was computed
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("11df4b1bdd5a0634")
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 an instance of its own class, FeatureMapAdapter: the run constructed the object and did not call it, so no result was computed. 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)

ARGS = {
    'hidden_dim': 8,
    'num_heads': 2,
    'head_dim': 4,
    'feature_dim': 4,
    'dtype': torch.float32,
    'device': torch.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 FeatureMapAdapter — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FeatureMapAdapter 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
FeatureMapMLP Ran
ran on a synthesized input · constructed an object; no result was computed
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("624f03bff20eeff4")
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 an instance of its own class, FeatureMapMLP: the run constructed the object and did not call it, so no result was computed. 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)

ARGS = {
    "num_heads": 2,
    "head_dim": 4,
    "feature_dim": 4,
    "dtype": torch.float32,
    "device": torch.device("cpu"),
    "skip_connection": False,
    "bias": False,
    "zero_init": False,
    "normal_init": 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 FeatureMapMLP — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FeatureMapMLP 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
LinearScalingRotaryEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("8e7478585c4a072f")
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 an instance of its own class, LinearScalingRotaryEmbedding: the run constructed the object and did not call it, so no result was computed. 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)

ARGS = {
    "dim": 8,
    "max_position_embeddings": 512,
    "base": 10000,
    "device": None,
    "scaling_factor": 2.0,
}
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 LinearScalingRotaryEmbedding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LinearScalingRotaryEmbedding 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
PosELU Ran
ran on a synthesized input · constructed an object; no result was computed
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("222e712a93c7c816")
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 an instance of its own class, PosELU: the run constructed the object and did not call it, so no result was computed. 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 torch.nn.functional as F

torch.manual_seed(0)

class FeatureMapAct(nn.Module):
    """
    Base class for feature map activations
    """

    def __init__(self, eps: float=1e-12):
        super().__init__()
        self.eps = eps

    def forward(self, x: torch.Tensor, *args: any, **kwargs: any):
        """
        x.shape is (batch_size, n_heads, seq_len, head_dim)
        """
        return x

class PosELU(FeatureMapAct):
    """
    1 + ELU activation as in https://arxiv.org/abs/2006.16236
    """

    def forward(self, x: torch.Tensor, *args: any, **kwargs: any):
        return (1 + F.elu(x)).clamp(min=self.eps)


# Create a small test tensor with shape (batch_size, n_heads, seq_len, head_dim)
# Using distinct sizes: 2, 3, 4, 5
x = torch.randn(2, 3, 4, 5)

ARGS = {
    "eps": 1e-12
}
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 PosELU — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PosELU 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
ReLU Ran
ran on a synthesized input
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("f8a915d0998d5a10")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, 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 as nn
import torch.nn.functional as F

class FeatureMapAct(nn.Module):
    """
    Base class for feature map activations
    """

    def __init__(self, eps: float=1e-12):
        super().__init__()
        self.eps = eps

    def forward(self, x: torch.Tensor, *args: any, **kwargs: any):
        """
        x.shape is (batch_size, n_heads, seq_len, head_dim)
        """
        return x

class ReLU(FeatureMapAct):
    """
    ReLU activation as in https://arxiv.org/abs/2103.13076
    """

    def forward(self, x: torch.Tensor, *args: any, **kwargs: any):
        return F.relu(x).clamp(min=self.eps)


INIT_ARGS = {
    'eps': 1e-12
}

ARGS = {
    'x': torch.randn(2, 4, 3, 5)
}

if __name__ == '__main__':
    model = ReLU(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output min value: {output.min().item()}")
    print(f"Output max value: {output.max().item()}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
RotaryEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("c2be9851321e656a")
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 an instance of its own class, RotaryEmbedding: the run constructed the object and did not call it, so no result was computed. 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)

# RotaryEmbedding takes the following parameters:
# - dim: embedding dimension (int)
# - max_position_embeddings: maximum sequence length (int, default 2048)
# - base: base for the frequency computation (int, default 10000)
# - device: device to place tensors on (optional)

ARGS = {
    'dim': 8,
    'max_position_embeddings': 128,
    'base': 10000,
    'device': None
}
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 RotaryEmbedding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a RotaryEmbedding 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
SoftmaxDim Ran
ran on a synthesized input
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("45348551e263b890")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, 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 as nn

class FeatureMapAct(nn.Module):
    """
    Base class for feature map activations
    """

    def __init__(self, eps: float=1e-12):
        super().__init__()
        self.eps = eps

    def forward(self, x: torch.Tensor, *args: any, **kwargs: any):
        """
        x.shape is (batch_size, n_heads, seq_len, head_dim)
        """
        return x

class SoftmaxDim(FeatureMapAct):
    """
    Softmax activation as in https://arxiv.org/abs/2402.04347
    """

    def forward(self, x: torch.Tensor, *args: any, **kwargs: any):
        return torch.cat([torch.softmax(x, dim=-1), torch.softmax(-x, dim=-1)], dim=-1).clamp(min=self.eps)


INIT_ARGS = {
    'eps': 1e-12
}

ARGS = {
    'x': torch.randn(2, 3, 4, 5)
}

if __name__ == '__main__':
    model = SoftmaxDim(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output min: {output.min().item()}")
    print(f"Output max: {output.max().item()}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SoftmaxDimHalfspace Ran
ran on a synthesized input
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("79ecf2b5021ec165")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, 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 as nn

class FeatureMapAct(nn.Module):
    """
    Base class for feature map activations
    """

    def __init__(self, eps: float=1e-12):
        super().__init__()
        self.eps = eps

    def forward(self, x: torch.Tensor, *args: any, **kwargs: any):
        """
        x.shape is (batch_size, n_heads, seq_len, head_dim)
        """
        return x

class SoftmaxDimHalfspace(FeatureMapAct):
    """
    Softmax activation as in https://arxiv.org/abs/2402.04347
    """

    def forward(self, x: torch.Tensor, *args: any, **kwargs: any):
        return torch.softmax(x, dim=-1).clamp(min=self.eps)


INIT_ARGS = {
    'eps': 1e-12
}

ARGS = {
    'x': torch.randn(2, 3, 4, 5)
}

if __name__ == '__main__':
    model = SoftmaxDimHalfspace(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output min value: {output.min().item()}")
    print(f"Output max value: {output.max().item()}")
    print(f"Sum along last dim (should be ~1.0): {output.sum(dim=-1)[0, 0, 0].item()}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
apply_rotary_pos_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("8f7f3f7e4221d5c0")
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 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)

# Create small tensors for query and key
# batch_size=2, seq_len=3, hidden_dim=4
batch_size = 2
seq_len = 3
hidden_dim = 4

q = torch.randn(batch_size, seq_len, hidden_dim)
k = torch.randn(batch_size, seq_len, hidden_dim)

# Create cos and sin tensors for rotary embeddings
# Shape: (seq_len, hidden_dim)
cos = torch.randn(seq_len, hidden_dim)
sin = torch.randn(seq_len, hidden_dim)

# Create position_ids tensor
# Shape: (batch_size, seq_len)
position_ids = torch.tensor([[0, 1, 2], [0, 1, 2]], dtype=torch.long)

# unsqueeze_dim parameter
unsqueeze_dim = 1

ARGS = {
    "q": q,
    "k": k,
    "cos": cos,
    "sin": sin,
    "position_ids": position_ids,
    "unsqueeze_dim": unsqueeze_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 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
get_rotary_embeddings Ran
ran; our contract draft was wrong, not the code
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("3d075a97ebad15d7")
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 LinearScalingRotaryEmbedding. 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)

ARGS = {
    'rope_scaling_type': 'linear',
    'head_dim': 128,
    'max_position_embeddings': 4096,
    'rope_theta': 10000.0,
    'rope_scaling_factor': 1.5,
    'device': None,
}
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 LinearScalingRotaryEmbedding — a LinearScalingRotaryEmbedding output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LinearScalingRotaryEmbedding 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
init_feature_map Ran
ran; our contract draft was wrong, not the code
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("4fcb658ea76a7904")
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 FeatureMap. 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)

# Build a minimal MLP that accepts x and optional args/kwargs
class MinimalMLP(nn.Module):
    def __init__(self, input_dim: int = 64, output_dim: int = 64):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x: torch.Tensor, *args, **kwargs):
        # The function calls self.mlp(x, *mlp_args, **mlp_kwargs)
        # We need to handle the tensor and pass through additional args
        return self.linear(x)

# Create a small MLP instance
mlp_module = MinimalMLP(input_dim=64, output_dim=64)

# Define arguments for init_feature_map
ARGS = {
    'name': 'pos_elu',
    'mlp': mlp_module,
    'head_dim_idx': -1,
    'eps': 1e-12,
    'fullspace': True,
}
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 FeatureMap — a FeatureMap output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FeatureMap 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
init_feature_map_act Ran
ran; our contract draft was wrong, not the code
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("d9fed240ed04f9af")
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 SoftmaxDim. 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)

ARGS = {
    "name": "softmax_dim",
    "fullspace": True,
    "eps": 1e-12,
}
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 SoftmaxDim — a SoftmaxDim output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SoftmaxDim 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
init_learned_kernel Ran
ran; our contract draft was wrong, not the code
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("7ea7286d8db1055b")
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 FeatureMapMLP. 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 `init_learned_kernel` takes a `name` string and **kwargs
# Looking at the code, it checks if name == 'untied_head_einsum' and returns FeatureMapMLP(**kwargs)
# The kwargs are passed to FeatureMapMLP.__init__

# FeatureMapMLP requires:
# - num_heads: int
# - head_dim: int
# - feature_dim: int
# - dtype: torch.dtype
# - device: torch.device
# - skip_connection: bool (default False)
# - bias: bool (default False)
# - zero_init: bool (default False)
# - normal_init: bool (default False)

ARGS = {
    'name': 'untied_head_einsum',
    'num_heads': 2,
    'head_dim': 4,
    'feature_dim': 3,
    'dtype': torch.float32,
    'device': torch.device('cpu'),
    'skip_connection': False,
    'bias': False,
    'zero_init': False,
    'normal_init': 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 FeatureMapMLP — a FeatureMapMLP output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FeatureMapMLP 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
quadratic_attention Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("95f5da87ec68a1ed")
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. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Tiny tensors matching function signature expectations
# Shape: (batch_size, num_heads, seq_len, feature_dim)
batch_size = 2
num_heads = 3
seq_len = 4
feature_dim = 5
head_dim = 6

q = torch.randn(batch_size, num_heads, seq_len, feature_dim)
k = torch.randn(batch_size, num_heads, seq_len, feature_dim)
v = torch.randn(batch_size, num_heads, seq_len, head_dim)

ARGS = {
    "q": q,
    "k": k,
    "v": v,
    "causal": True,
    "fp32_attention": False,
    "eps": 1e-12,
}
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 — a tuple output has no array shape of its own; none is 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
repeat_kv Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("ab05d5e4c4236572")
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 4, dtype family float, shape (2, 6, 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)

# The function takes:
# - hidden_states: torch.Tensor with shape (batch, num_key_value_heads, seqlen, head_dim)
# - n_rep: int, the repetition factor

# Create a small tensor with distinct dimensions for clarity
# batch=2, num_key_value_heads=3, seqlen=4, head_dim=5
hidden_states = torch.randn(2, 3, 4, 5)

# n_rep is a simple integer
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, 4, 5) — shape (2, 6, 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
sliding_window_softmax_attention Ran
ran; our contract draft was wrong, not the code
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("8e336d9e009bb875")
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. 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

torch.manual_seed(0)

# Construct small tensors for the function
batch_size = 2
seq_len = 8
num_heads = 3
d_model = 4

# q: shape (batch, num_heads, seq_len, d_model)
q = torch.randn(batch_size, num_heads, seq_len, d_model)

# k: shape (batch, num_heads, seq_len, d_model)
k = torch.randn(batch_size, num_heads, seq_len, d_model)

# v: shape (batch, num_heads, seq_len, d_model)
v = torch.randn(batch_size, num_heads, seq_len, d_model)

# window_size: integer controlling the sliding window
window_size = 3

# window_factor: float scaling factor for the attention weights
window_factor = 1.0

# mask_value: float value for masking (default provided)
mask_value = -100000000.0

ARGS = {
    'q': q,
    'k': k,
    'v': v,
    'window_size': window_size,
    'window_factor': window_factor,
    'mask_value': mask_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 tuple — a tuple output has no array shape of its own; none is 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
softmax_attention Ran
ran; our contract draft was wrong, not the code
HazyResearch/lolcats/src/model/linear_attention/linear_attention.py
code served (permissive licence) · get_code("95392cd040b0c2e7")
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. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Construct tiny tensors for attention computation
# Shape: (batch_size, num_heads, seq_len, head_dim)
batch_size = 2
num_heads = 3
seq_len_q = 4
seq_len_k = 5
head_dim = 6

q = torch.randn(batch_size, num_heads, seq_len_q, head_dim)
k = torch.randn(batch_size, num_heads, seq_len_k, head_dim)
v = torch.randn(batch_size, num_heads, seq_len_k, head_dim)

ARGS = {
    "q": q,
    "k": k,
    "v": v,
    "causal": True,
    "fp32_attention": True,
}
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 — a tuple output has no array shape of its own; none is 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
softmax_attention Ran
ran; our contract draft was wrong, not the code
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("f122b39d7b617e75")
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. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Construct valid arguments for softmax_attention
batch_size = 2
num_heads = 3
seq_len = 4
head_dim = 5

# Create q, k, v tensors with shape (batch_size, num_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)
v = torch.randn(batch_size, num_heads, seq_len, head_dim)

ARGS = {
    'q': q,
    'k': k,
    'v': v,
    'causal': True,
    'fp32_attention': True
}
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 — a tuple output has no array shape of its own; none is 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
LolcatsLinearAttention Not yet run
unverified (harvested, no recorded run)
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("5ca6886743273ec2")
How it ran

no invocation recorded.

LolcatsLinearSlidingWindowAttention Not yet run
unverified (harvested, no recorded run)
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("22e03adc01e6f4af")
How it ran

no invocation recorded.

causal_dot_product Not yet run
unverified (harvested, no recorded run)
HazyResearch/lolcats/src/model/linear_attention/linear_attention.py
code served (permissive licence) · get_code("c61cbc5f0923bbf5")
How it ran

no invocation recorded.

evaluate_model Not yet run
unverified (harvested, no recorded run)
HazyResearch/lolcats/distill_llama.py
code served (permissive licence) · get_code("99199bb3bba7f5ed")
How it ran

no invocation recorded.

flash_attention_2 Not yet run
unverified (harvested, no recorded run)
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("7adc1fdae7b7a47d")
How it ran

no invocation recorded.

hybrid_attention_linear Not yet run
unverified (harvested, no recorded run)
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("6cc2057faa9846d2")
How it ran

no invocation recorded.

linear_attention Not yet run
unverified (harvested, no recorded run)
HazyResearch/lolcats/src/model/linear_attention/linear_attention.py
code served (permissive licence) · get_code("d8595b54ec29491c")
How it ran

no invocation recorded.

linear_attention Not yet run
unverified (harvested, no recorded run)
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("61e674e010a5aa26")
How it ran

no invocation recorded.

under_window_linear_attention Not yet run
unverified (harvested, no recorded run)
hazyresearch/lolcats/src/model/linear_attention/linear_window_attention_sw_linear.py
code served (permissive licence) · get_code("20430ccdc09ccdc0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 32 samples lifted from this paper's linked repositories, 32 carry a function identity and 0 do not. Of the 30 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 1 later) and 27 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
repeat_kv
brick of this paper's assembly: helper
243 other papers
119 dated earlier, 24 the same month, 96 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
FeatureMapAct
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2402.04347 (2024-02)
The Hedgehog & the Porcupine: Expressive Linear Attentions with Softmax Mimicry
SoftmaxDim
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2402.04347 (2024-02)
The Hedgehog & the Porcupine: Expressive Linear Attentions with Softmax Mimicry

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

Recent works show we can linearize large language models (LLMs)-swapping the quadratic attentions of popular Transformer-based LLMs with subquadratic analogs, such as linear attention-avoiding the expensive pretraining costs. However, linearizing LLMs often significantly degrades model quality, still requires training over billions of tokens, and remains limited to smaller 1.3B to 7B LLMs. We thus propose Low-rank Linear Conversion via Attention Transfer (LoLCATs), a simple two-step method that improves LLM linearizing quality with orders of magnitudes less memory and compute. We base these steps on two findings. First, we can replace an LLM's softmax attentions with closely-approximating linear attentions, simply by training the linear attentions to match their softmax counterparts with an output MSE loss ("attention transfer "). Then, this enables adjusting for approximation errors and recovering LLM quality simply with low-rank adaptation (LoRA). LoLCATs significantly improves linearizing quality, training efficiency, and scalability. We significantly reduce the linearizing quality gap and produce state-of-the-art subquadratic LLMs from Llama 3 8B and Mistral 7B v0.1, leading to 20+ points of improvement on 5-shot MMLU. Furthermore, LoLCATs does so with only 0.2% of past methods' model parameters and 0.4% of their training tokens. Finally, we apply LoLCATs to create the first linearized 70B and 405B LLMs (50× larger than prior work). When compared with prior approaches under the same compute budgets, LoLCATs significantly improves linearizing quality, closing the gap between linearized and original Llama 3.1 70B and 405B LLMs by 77.8% and 78.1% on 5-shot MMLU.

For agents

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

get_harvested_code_for_paper("2410.10254")
get_code_for_paper("2410.10254")
have("2410.10254")

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

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

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

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

Connect an agent — have() is free.