SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2023.emnlp-main.404 · EMNLP · 2023

Efficient Classification of Long Documents via State-Space Models

Mehdi Rezagholizadeh, Bang Liu, Suyuchen Wang, Peng Lu, Ivan Kobyzev

Code that ran

3 of 5 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 0 have no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-24; 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/2023.emnlp-main.404.json · badge: /api/ran/2023.emnlp-main.404.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/safari canonical (classifier label)
classifier basis: census
3 ran · 2 no recorded run
FunctionStatusWhere it lives
fftconv Ran
ran; our contract draft was wrong, not the code
HazyResearch/safari/standalone_hyena.py
code served (permissive licence) · get_code("70f945c43f8fc063")
How it ran

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

import torch
import torch.nn as nn

torch.manual_seed(0)

# u: input signal tensor with shape (batch, channels, seqlen)
# The function calls u.shape[-1] to get seqlen
# The function calls u.to(dtype=k.dtype) and u * D.unsqueeze(-1)
# So u should be a 3D tensor (batch, channels, seqlen) or higher
u = torch.randn(2, 4, 8)

# k: kernel tensor for FFT convolution
# The function calls torch.fft.rfft(k, n=fft_size)
# The function checks len(u.shape) > 3 and conditionally unsqueezes k_f
# If u.shape is 3D, k should work with broadcasting for (batch, channels, seqlen)
# k appears to be applied per-channel, so shape (channels, seqlen) or (1, seqlen)
k = torch.randn(4, 8)

# D: parameter for residual connection
# The function calls D.unsqueeze(-1)
# D is used in: u * D.unsqueeze(-1), so it should be broadcastable with u
# u has shape (batch, channels, seqlen), so D should be (channels,)
D = torch.randn(4)

ARGS = {
    'u': u,
    'k': k,
    'D': D,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 4, 8) — shape (2, 4, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
mul_sum Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HazyResearch/safari/standalone_hyena.py
code served (permissive licence) · get_code("5dd28d20c60f0c19")
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 1, dtype family float, shape (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)

# Create small tensors for q and y
# q and y are multiplied element-wise then summed along dim=1
# So they need to be 2D tensors with matching shapes
q = torch.randn(2, 4)  # batch_size=2, feature_dim=4
y = torch.randn(2, 4)  # batch_size=2, feature_dim=4

ARGS = {
    "q": q,
    "y": y,
}
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 1, dtype family float, shape (2,) — shape (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
preprocess Ran
ran; our contract draft was wrong, not the code
HazyResearch/safari/evals/lambada.py
code served (permissive licence) · get_code("bb34448b589bbd0f")
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

torch.manual_seed(0)

# Analyze the function:
# - preprocess(text) takes a single parameter: text
# - text is expected to be a string (has .replace() and .strip() methods called on it)
# - The function performs string replacements and returns a modified string

ARGS = {
    "text": 'Hello "world" and "friends"'
}
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 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
benchmark_backward Not yet run
unverified (harvested, no recorded run)
HazyResearch/safari/benchmarks/runtime_hyena_flashmha.py
code served (permissive licence) · get_code("8e1d4c268cc9da28")
How it ran

no invocation recorded.

benchmark_forward Not yet run
unverified (harvested, no recorded run)
HazyResearch/safari/benchmarks/runtime_hyena_flashmha.py
code served (permissive licence) · get_code("05d27c923381be24")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 3 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 2 later) and 2 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
mul_sum 9 other papers
1 dated earlier, 3 later, 5 same year, order not determinable · 1 only as an assembly brick
2212.14052 (2022-12)
Hungry Hungry Hippos: Towards Language Modeling with State Space Models
2302.10866 (2023-02)
Hyena Hierarchy: Towards Larger Convolutional Language Models
2305.04120 (2023-05)
A Latent Diffusion Model for Protein Structure Generation
and 6 more not named here
fftconv 2 other papers
2 same year, order not determinable
2306.15794 (2023-06)
HyenaDNA: Long-Range Genomic Sequence Modeling at Single Nucleotide Resolution
2311.12570 (2023-11)
BEND: Benchmarking DNA Language Models on biologically meaningful tasks
preprocess 1 other paper
1 later
2405.06147 (2024-05)
State-Free Inference of State-Space Models: The Transfer Function Approach

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-24.

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 models have achieved stateof-the-art performance on numerous NLP applications. However, long documents which are prevalent in real-world scenarios cannot be efficiently processed by transformers with the vanilla self-attention module due to their quadratic computation complexity and limited length extrapolation ability. Instead of tackling the computation difficulty for self-attention with sparse or hierarchical structures, in this paper, we investigate the use of State-Space Models (SSMs) for long document classification tasks. We conducted extensive experiments on six long document classification datasets, including binary, multi-class, and multi-label classification, comparing SSMs (with and without pre-training) to self-attention-based models. We also introduce the SSM-pooler model and demonstrate that it achieves comparable performance while being on average 36% more efficient. Additionally our method exhibits higher robustness to the input noise even in the extreme scenario of 40%. * Research done during internship in Huawei Noah's Ark Lab (Montreal).

For agents

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

get_harvested_code_for_paper("2023.emnlp-main.404")
get_code_for_paper("2023.emnlp-main.404")
have("2023.emnlp-main.404")

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

curl https://syntology.ai/api/ran/2023.emnlp-main.404.json

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

[![Syntology run record](https://syntology.ai/api/ran/2023.emnlp-main.404.svg)](https://syntology.ai/paper/2023.emnlp-main.404)

Connect an agent — have() is free.