Manuscript Offprint

arXiv:2610.17191

FreeSolo: Linear-time Sparse Attention with Zero-Shot Length Extrapolation

Zekun Shi, Alastair James Arthur Price

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Linear-time sequence models typically store long-context information in a recurrent state. A fixed-size state limits how much information can be stored, while hybrid architectures that add full attention for better recall incur quadratic sequence cost. Alternatively, sparse attention with continued pretraining (CPT) can extend the effective context length. Generalization beyond the trained length remains challenging, however, and CPT can be costly. We introduce FREESOLO1^{1}, a native sparse attention mechanism with a short-range sliding window branch and a long-range branch that selects keypoint cells for direct token attention. Its linear-time variant, FS-L, learns to prune the prefix before query-dependent selection through short CPT. FS-B searches balanced trees with O(Nlog⁡2N)O(N\log^2 N) algorithmic cost including radix-sort construction. FreeSolo demonstrates better zero-shot length extrapolation than the baselines without long-context fine-tuning.

Figure

FS FS-L FS-B Raven Raven-full GDN

Figure 1: Zero-shot RULER extrapolation at 800M. Models train at 4k (dotted line); shading marks extrapolation. 100 examples per task and length.

1 Introduction

Long-context language modeling requires efficient attention and retrieval beyond the training length. Full attention has quadratic sequence cost (Vaswani et al., 2017). Recurrent models compress history into fixed-size states (Katharopoulos et al., 2020; Gu and Dao, 2023; Dao and Gu, 2024), while Native Sparse Attention

1^{1}We will open-source the code.

(NSA) (Yuan et al., 2025) and Mixture of Block Attention (MoBA) (Lu et al., 2025) preserve token access but score growing sets of blocks. Neither compression nor sparsity alone ensures length extrapolation. Continued pretraining (CPT) on longer sequences can extend retrieval at additional training cost (Fu et al., 2024).

We introduce FREESOLO (FS), a native sparse mechanism that learns token keys whose simple statistics make memory searchable, prunable, and hierarchically summarizable. Mean keys give a simple chunk representation for routing and hierarchical search, while maximum token-key norms provide pruning priorities. These summaries need only identify evidence: top-K selection is followed by attention over the cells' original token keys and values. FS scores all eligible cell summaries during training, but only selected token values enter the long-range readout. The read budget stays fixed as history grows. RoPE (Su et al., 2021) stays within a fixed local window, while long-range routing and readout use unrotated queries and keys, avoiding unseen rotary offsets (Figure 2).

We develop two main variants through short CPT from base FS at the same 4k context length. FreeSolo-Linear (FS-L) uses norm pruning for O(N)O(N) attention cost and bounded state. FreeSolo-Balanced Tree Search (FS-B) keeps a growing archive and uses two content forests, with O(Nlog⁡2N)O(N \log^2 N) algorithmic cost including radix-sort construction, superlinear but strictly subquadratic (Section 3.5). Both extrapolate zero-shot to 16k: at 800M, the RULER mean decreases only from 32.0 to 22.3 for FS-L and from 37.7 to 30.4 for FS-B relative to 4k. Notably, both retrieve single needles at 256k, 64×64 \times the training length. At both scales, FS-B achieves the highest RULER mean in the superlinear group at 4k and beyond, and FS-L leads the linear group at every reported length (Table 1).

References (62)