The search for computationally efficient alternatives to the Transformer has yielded numerous architectures in recent years; however, most exhibit severe weaknesses in associative recall-such as key-value (KV) retrieval-and length extrapolation, where even standard Transformers struggle. This paper introduces LimeTree, a linear-complexity architecture in both memory and compute for sequence modeling. By integrating synthetic KV retrieval tasks directly into standard language modeling training, LimeTree achieves strong perplexity alongside reliable recall. Two variants were evaluated on WikiText-103 and PG-19 under strict compute constraints. On WikiText-103, LimeTree reaches a token-level perplexity of 19 in just 6 hours on four Quadro RTX 8000 GPUs, while maintaining 100% KV retrieval accuracy even when extrapolating from a training context length of 512 to an evaluation length of 16,384. On PG-19, the model achieves a token-level perplexity of 13 in 35 hours on a single RTX PRO 6000 Blackwell GPU with minimal hyperparameter tuning. These results position LimeTree as a competitive linear-complexity alternative to Transformers, combining superior perplexity and training throughput with robust in-context retrieval and length extrapolation.
Figures & tables
Figure 1
Figure 1: Sequence-to-Graph-Tree Construction. Adjacent context tokens are bound via shift-invariant bilinear interactions, causal Conv1D ( K=4 ), and intra-chunk causal RoPE attention ( W=64 ) to form leaf states H(0) . The hierarchy is recursively merged upward with 2-level quadruple shortcuts while extracting (i) rightmost Fenwick boundary tails Ttail at every depth, (ii) top-down refined subtree slots H~mid ( ≤128 nodes) augmented with adaptive leaf pooling, and (iii) the global root rfinal .
Figure 2: Architecture of the GNN. (a) During the bottom-up pass, sibling pairs (hL,hR) are combined via a learned differential convex gate gbu with a right-branch recency prior boverride , followed by a tanh -gated FFN and multi-hop 4-grandchild mean/max skip connections every two tree levels. (b) During the top-down pass, the global root hroot modulates mid-level subtree slots Hmid through a multiplicative bilinear gate before a secondary convex tree sweep produces the global summary htd .
Component / Module
Configuration
Role in Graph-Tree & GNN Pipeline
Leaf Bigram & Conv1D
K=4 , αconv=0.15
Shift-invariant odd/even token pair binding
LocalChunkAttentionBlock
W=64 , H=24 , dh=64
O(L⋅W) intra-chunk RoPE leaf enrichment
GraphTreeCell (Bottom-Up)
boverride=0.15 , βm=0.15
Norm-preserving convex sibling interpolation
Quadruple Skip Connection
4→1 Mean ∥ Max, βq=0.15
Halves tree path length; preserves sparse KV spikes
Top-Down Root Refinement
3D→D bilinear gate
Broadcasts global root context into Hmid
Memory Bank M
1+128+64=193 slots
Global root rfinal , subtrees H~mid , Fenwick tails Ttail
Figure 3: Distributed training dataflow across four NVIDIA Quadro RTX 8000 GPUs. Each device samples disjoint sequences from a local 4 GB int16 VRAM cache and accumulates gradients locally under no_sync() before overlapping bucketed AllReduce communication with the final micro-batch backward pass.
Configuration
WikiText-103 Model
PG-19 Long-Context Model
LM Training Context ( LLM )
Fixed: 512
Multi-scale: {1024,2048,4096}
LM Sampling Weights
1.0
1:2:3
KV Training Lengths ( LKV )
{64,128,256,512}
{64,128,…,4096}
Evaluation Lengths ( Leval )
{64,128,…,65536} ( 128× extrap.)
{64,128,…,524288} ( 128× extrap.)
Hardware (DDP)
4× Quadro RTX 8000
1× Quadro RTX 6000 Pro BSE
Table 2: Training and evaluation configurations for the WikiText-103 and PG-19 models.
Figure 4: Performance of LimeTree 381 on Wikitext 103. (a) shows the excellent extrapolation capabilities, where the best perplexity score is achieved at the training context length 512. (b) shows the performance on the KV retrieval task.
Figure 5: Processing speed of LimeTree 381 on Wikitext 103. (a) shows the tokens per second in both the language modeling (LM) and key-value retrieval (KV) task. (b) shows the latency in the key-value retrieval task as well as the peak GPU VRAM usage in the language modeling task. The orange dashed line indicates the training context length of 512 .
Figure 6: Comparison of LimeTree 173, 230 and 381. All three models show a similar PPL score at the training context length of 512, but LimeTree 381 demonstrates the strongst extrapolation capabilities up to 65536.
Model (Year)
Test PPL
Parameters
Context & Complexity
GPUs
Time
Grave LSTM Cache (2016) Grave et al. (2017)
40.80
150M
2000, Linear
1 M40
96h
Gated CNN (2017) Dauphin et al. (2017)
37.20
229M
200, Linear
8 M40
168h
QRNN (2018) Merity et al. (2018) ; Bradbury et al. (2017)
33.00
151M
140, Linear
1 K80
36h
Adaptive Input (2018) Baevski and Auli (2019)
18.70
247M
3072, Quadratic
8 V100
63h
Transformer-XL (2019) Dai et al. (2019)
18.30
257M
1600, Quadratic
32 V100
60h
Compressive Transformer (2019) Rae et al. (2020)
17.10
277M
3200, Quadratic
32 TPUv3
48h
Table 3: Closed-corpus word-level language modeling benchmark progression on WikiText-103.
Context
KV Exact-3 (%)
KV Slot (%)
NLL
Tok PPL
Word PPL
Throughput
Peak VRAM
Act. VRAM
Length
( ↑ )
( ↑ )
( ↓ )
( ↓ )
( ↓ )
(k tok/s)
(GB)
(GB)
64
100.00
100.00
2.5575
12.90
48.69
5.7
3.93
+0.19
256
100.00
100.00
2.4661
11.78
42.37
9.1
3.93
+0.20
512
100.00
100.00
2.4374
11.44
40.56
13.4
3.93
+0.20
1k
100.00
100.00
2.4092
11.12
38.86
22.4
3.93
+0.20
2k
100.00
100.00
2.3955
10.97
38.06
38.9
3.93
+0.20
Table 4: Multi-scale evaluation of LimeTree ( L=16,D=1536 , step 44000, BS=1 ) across context lengths up to 512k tokens. The horizontal rule marks the maximum training context length (4k tokens).
Figure 7: PG19 test evaluation with extrapolation.
Model
Citation
Params
Complexity
Train Ctx
Eval Ctx
Compute Infrastructure
Train Time / Steps
Test PPL ↓
Panel A: From-Scratch PG-19 Training — Official Word-Level Perplexity (6.97M test words)
Transformer-XL (36L)
Rae et al. (2020)
∼529 M
O(W2+WM)
512+1024
1536
64× TPUv3 cores
∼24 h (NR steps)
36.30
Compressive Transformer (36L)
Rae et al. (2020)
∼529 M
O(W2+W(M+Mc))
512+2048
2560
64× TPUv3 cores
>12 – 24 h
33.60
Routing Transformer (22L)
Roy et al. (2021)
490M
O(N1.5d)
8,192
8,192
128× TPUv3 cores
∼250 k steps
33.20
Perceiver AR (60L)
Hawthorne et al. (2022)
975M
O(NLd+L2d)
2,048
2,048 / 4,096
TPUv3 Pod
200 k steps (420B tok)
28.90 / 29.00
Block-Recurrent Trans. (24L)
Hutchins et al. (2022)
650M
O(NWd)
4,096 ( W=512 )
Full book
32× TPUv4 cores
∼48 h ( 500 k steps)
28.46
Table 5: Comparison of sequence modeling architectures evaluated on the PG-19 long-range book benchmark, highlighting sub-quadratic models alongside canonical quadratic/cached baselines. Complexity is reported per layer with respect to sequence length N , segment/window size W , latent/state dimension d (or latent count L ), and external memory size M . NR denotes metrics not reported by the original authors.