ASRN: Adaptive Sparse Recurrence Networks — Linear-memory long-range copying with a learned proper-time clock and a Hawkes-gated copy gate
The work per token of attention grows with the context, while linear-time models such as Mamba-2 and RWKV-7 keep a fixed-size state and lose exact recall of long spans. ASRN (Adaptive Sparse Recurrence Network) is a language-model layer that retrieves exact earlier occurrences with bounded work per token: each token attends only to its C most recent mates in learned sign-hash buckets and copies the token that followed each match; a learned proper-time clock B_t = Σ β_u sets the decay α_s·exp(−κ(B_t − B_s)) of both the retrieval scores and a Hawkes (self-exciting) intensity over repeated n-grams; and a gate reads those intensities and a repetition streak through a learned non-monotone response to decide when to copy. Release 1.0 adds numerical protections to the v89 layer (exact masking, a 64-bit clock, bounds) that close a measured causal leak and clock drift for +7.5% time and +5.2% memory at 262k tokens, and generates in O(1) time per new token. On one A100, at 262,144 tokens an ASRN layer is 21.6× faster than FlashAttention-2 attention, 7.6× faster than RWKV-7 and 2.5× faster than a Mamba-2 block without causal-conv1d; a ~50M-parameter model trains at 163–172k tokens/s from 1k to 32k tokens per sequence (199–210k compiled), 2.08× the speed of our Transformer++ at 32k (2.20× with both compiled), which is faster below about 2.4k tokens (5.4k compiled). With 2.5–46M parameters and 3 seeds, ASRN copies at 4× the training length when it leaves the initial plateau (99.99% and 99.98%; the third seed stayed on it), keeps MQAR recall with 4× the pairs (99.75%; Mamba-2 26.1%, RWKV-7 16.5%, neither fully converged), and reaches WikiText-103 perplexity 67.9 against 93.3 for the Transformer++ (p = 0.002), 74.3 for Mamba-2 (p = 0.008) and 75.8 for RWKV-7 (not significant, p = 0.13), far from convergence. It is slower on short inputs, uses about twice the memory of attention and generated slowest on the A100 (43 ms/token, measured with the earlier O(t) writer; on CPU the O(1) writer stays at 9.5–12.5 ms/token from 512 to 131k tokens of context, 9.7× faster than the O(t) one at 131k). In a controlled bounded-quotation experiment (3 seeds, on CPU and on the A100), the gate learns without explicit supervision when to stop copying: the longest written repetition stays at 10 tokens, as in the real text, against 19–39 without its repetition signals or without a gate (removing only the Hawkes and streak signals leaves the validation loss practically unchanged). Includes the English and Spanish versions of the preprint. Code, tests and all measurements: https://github.com/KIROKOWA/ASRN (Apache 2.0). Prepared with the assistance of Claude (Anthropic), an AI model, under the author's direction.
Authors
- Alexis Calvario (ORCID: https://orcid.org/0009-0004-0854-6398)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-10-24
- DOI
- https://doi.org/10.5281/zenodo.23607505
- Primary Topic
- Topic Modeling
- Type
- preprint