SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.19534 · ICML · 2023

Recasting Self-Attention with Holographic Reduced Representations

Stella Biderman, Edward Raff, Tim Oates, James Holt, Mohammad Alam

arXiv · PDF · Open in the Atlas

Code that ran

4 of 11 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 4 have no contract verdict; 0 failures of our instrument; 7 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/2305.19534.json · badge: /api/ran/2305.19534.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
neuromorphiccomputationresearchprogram/hrrformer canonical (classifier label)
classifier basis: census
4 ran · 4 no recorded run
FutureComputing4AI/Hrrformer canonical (classifier label)
classifier basis: classifier_2025
0 ran · 3 no recorded run
FunctionStatusWhere it lives
cross_entropy_loss Ran
ran on a synthesized input
neuromorphiccomputationresearchprogram/hrrformer/image/hrrformer_mgpu.py
code served (permissive licence) · get_code("11b73c012ece44e7")
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 ArrayImpl, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import jax.numpy as jnp
import optax

# Create valid arguments for cross_entropy_loss function
# The function expects:
# - true: label probabilities (after smoothing), shape (batch, num_classes)
# - pred: predicted log probabilities, shape (batch, num_classes)

batch_size = 2
num_classes = 4

# true: ground truth labels - can be one-hot or soft labels
# Will be smoothed by optax.smooth_labels inside the function
true = jnp.array([
    [1.0, 0.0, 0.0, 0.0],
    [0.0, 1.0, 0.0, 0.0]
], dtype=jnp.float32)

# pred: predicted log probabilities from model
# Should be log-softmax output
pred = jnp.array([
    [-0.5, -2.0, -1.5, -3.0],
    [-1.0, -0.3, -2.0, -2.5]
], dtype=jnp.float32)

ARGS = {
    "true": true,
    "pred": pred
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, optax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
evaluate Ran
ran on a synthesized input
neuromorphiccomputationresearchprogram/hrrformer/image/hrrformer_mgpu.py
code served (permissive licence) · get_code("f0b8db0a03177b1a")
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 ArrayImpl, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import jax.numpy as np

# The function evaluate takes two parameters: true and pred
# Both are expected to be arrays that can be passed to np.argmax(axis=-1)
# They should have compatible shapes for element-wise comparison

# Create small dummy arrays with shape (batch_size, num_classes)
# Using distinct dimensions: batch=2, num_classes=4
true = np.array([
    [0.1, 0.2, 0.6, 0.1],  # class 2
    [0.3, 0.5, 0.1, 0.1],  # class 1
])

pred = np.array([
    [0.05, 0.15, 0.7, 0.1],  # class 2
    [0.2, 0.6, 0.1, 0.1],    # class 1
])

ARGS = {
    "true": true,
    "pred": pred,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
look_ahead_mask Ran
ran on a synthesized input
neuromorphiccomputationresearchprogram/hrrformer/utils.py
code served (permissive licence) · get_code("387fdc05497309c2")
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 ArrayImpl, 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 jax.numpy as np

# look_ahead_mask expects a JAX array x with shape (batch_size, sequence_length, ...)
# The function uses x.shape[0] for batch size and x.shape[1] for sequence length
# It creates a lower triangular mask and repeats it across the batch dimension

x = np.ones((2, 4, 3))

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
pad_collate_func Ran
ran on a synthesized input
neuromorphiccomputationresearchprogram/hrrformer/malware/binaryLoader.py
code served (permissive licence) · get_code("38dc6299f38b0c74")
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
from torch.nn.functional import one_hot

torch.manual_seed(0)

# Create a small batch of data
# Each item in batch is a tuple of (vector, label)
# Vectors can have different lengths (that's why we need padding)
# Labels should be 2D tensors with shape [1, 1] since y[:, 0] is accessed

vec1 = torch.randn(3, 4)  # sequence length 3, feature dim 4
vec2 = torch.randn(5, 4)  # sequence length 5, feature dim 4
label1 = torch.tensor([[0]])  # shape [1, 1]
label2 = torch.tensor([[1]])  # shape [1, 1]

batch = [
    (vec1, label1),
    (vec2, label2),
]

ARGS = {
    "batch": batch,
}
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
initialize_model Not yet run
unverified (harvested, no recorded run)
FutureComputing4AI/Hrrformer/malware/hrrformer_mgpu.py
code served (permissive licence) · get_code("a98da1a55cc51929")
How it ran

no invocation recorded.

initialize_model Not yet run
unverified (harvested, no recorded run)
neuromorphiccomputationresearchprogram/hrrformer/image/hrrformer_mgpu.py
code served (permissive licence) · get_code("4f1a5274115568d4")
How it ran

no invocation recorded.

initialize_model Not yet run
unverified (harvested, no recorded run)
neuromorphiccomputationresearchprogram/hrrformer/retrieval/hrrformer_mgpu.py
code served (permissive licence) · get_code("c574416e3c30908b")
How it ran

no invocation recorded.

merge Not yet run
unverified (harvested, no recorded run)
neuromorphiccomputationresearchprogram/hrrformer/utils.py
code served (permissive licence) · get_code("9332d0930ef1d545")
How it ran

no invocation recorded.

predict Not yet run
unverified (harvested, no recorded run)
FutureComputing4AI/Hrrformer/malware/hrrformer_mgpu.py
code served (permissive licence) · get_code("a8de53c24dc4ea75")
How it ran

no invocation recorded.

split Not yet run
unverified (harvested, no recorded run)
neuromorphiccomputationresearchprogram/hrrformer/utils.py
code served (permissive licence) · get_code("aaa1f91613c8db28")
How it ran

no invocation recorded.

train_step Not yet run
unverified (harvested, no recorded run)
FutureComputing4AI/Hrrformer/malware/hrrformer_mgpu.py
code served (permissive licence) · get_code("73cf404c6a2e8e98")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 11 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-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

In recent years, self-attention has become the dominant paradigm for sequence modeling in a variety of domains. However, in domains with very long sequence lengths the O(T 2 ) memory and O(T 2 H) compute costs can make using transformers infeasible. Motivated by problems in malware detection, where sequence lengths of T ≥ 100, 000 are a roadblock to deep learning, we re-cast self-attention using the neuro-symbolic approach of Holographic Reduced Representations (HRR). In doing so we perform the same high-level strategy of the standard self-attention: a set of queries matching against a set of keys, and returning a weighted response of the values for each key. Implemented as a "Hrrformer" we obtain several benefits including O(T H log H) time complexity, O(T H) space complexity, and convergence in 10× fewer epochs. Nevertheless, the Hrrformer achieves near state-of-the-art accuracy on LRA benchmarks and we are able to learn with just a single layer. Combined, these benefits make our Hrrformer the first viable Transformer for such long malware classification sequences and up to 280× faster to train on the Long Range Arena benchmark. Code is available at https: //github.com/NeuromorphicComputa tionResearchProgram/Hrrformer

For agents

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

get_harvested_code_for_paper("2305.19534")
get_code_for_paper("2305.19534")
have("2305.19534")

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

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

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

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

Connect an agent — have() is free.