Adaptive Memory Decay for Log-Linear Attention

Yaxita Amin, Helen Zichen Li, Mengfan Zhang, Samet Ayhan
5/7/2026
cs.LGcs.AI

No confident code implementation found for this paper.

Abstract

Sequence models face a fundamental tradeoff between memory capacity and computational efficiency. Transformers achieve expressive context modeling at quadratic cost, while linear attention and state-space models run in linear time by compressing context into a fixed-size hidden state, inherently limiting recall.

Show full abstract

Log-linear attention navigates this tradeoff by organizing memory across a Fenwick tree hierarchy, growing its hidden state logarithmically with sequence length at log-linear compute cost. However, its memory decay parameter λ is fixed and independent of the input, assigning uniform weights across all hierarchy levels regardless of the content, which introduces unnecessary rigidity. We propose learning λ directly from the input via a lightweight two-layer MLP, producing per-token, per-level decay that adapts to content rather than position. A softplus activation lets each Fenwick tree level scale independently, avoiding the inter-level competition that softmax introduces. This modification preserves log-linear complexity exactly and adds negligible parameter overhead. We evaluate on associative recall, selective copying, and language modeling, finding that input-dependent decay consistently outperforms the baseline, with the largest gains in long-range memory settings where baseline λ degrades or collapses entirely.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{amin2026adaptive,
  title  = {Adaptive Memory Decay for Log-Linear Attention},
  author = {Yaxita Amin and Helen Zichen Li and Mengfan Zhang and Samet Ayhan},
  year   = {2026},
  eprint = {2605.06946},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.06946v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2605.06946.svg)](https://codeofpaper.com/paper/2605.06946)

Discussion