mlsanityData to 7 Oct 2026

ROSA-Tuning: Enhancing Long-Context Modeling via Suffix Matching

arXiv 2602.02499 ↗First posted 14 Jan 2026cs.CLcited by 0

Not on the map. Why?

Abstract (arXiv)

Long-context capability and computational efficiency are among the central challenges facing today's large language models. Existing efficient attention methods reduce computational complexity, but they typically suffer from a limited coverage of the model state. This paper proposes ROSA-Tuning, a retrieval-and-recall mechanism for enhancing the long-context modeling ability of pretrained models. Beyond the standard attention mechanism, ROSA-Tuning leverages in parallel a CPU-based ROSA (RWKV Online Suffix Automaton) retrieval module, which efficiently locates historical positions in long contexts that are relevant to the current query, and injects the retrieved information into the model state in a trainable manner; subsequent weighted fusion can then be handled by range-restricted attention. To enable end-to-end training, we employ the binary discretization strategy and the counterfactual gradient algorithm, and further optimize overall execution efficiency via an asynchronous CPU-GPU pipeline. Systematic evaluations on Qwen3-Base-1.7B show that ROSA-Tuning substantially restores the long-context modeling ability of windowed-attention models, achieving performance close to and in some cases matching global attention on benchmarks such as LongBench, while maintaining computational efficiency and GPU memory usage that are nearly comparable to windowed-attention methods, offering a new technical path for efficient long-context processing. The example code can be found at https://github.com/zyaaa-ux/ROSA-Tuning.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 11 of its 13 references that are in the map. First posted on arXiv 14 Jan 2026.

Builds on

11 of 13 references.

References · 11

  1. 2017Attention Is All You Needcited by 59,932
  2. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
  3. 2013Estimating or Propagating Gradients Through Stochastic Neurons for Conditional Computationcited by 2,031
  4. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,979
  5. 2019Generating Long Sequences with Sparse Transformerscited by 1,523
  6. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
  7. 2019Compressive Transformers for Long-Range Sequence Modellingcited by 699
  8. 2024FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precisioncited by 507
  9. 2024Lessons from the Trenches on Reproducible Evaluation of Language Modelscited by 172
  10. 2025RWKV-7 "Goose" with Expressive Dynamic State Evolutioncited by 134
  11. 2026Conditional Memory via Scalable Lookup: A New Axis of Sparsity for Large Language Modelscited by 78

Built on by

Not cited yet.