RangeSWA: Training-Free Length Extrapolation for Continuous Diffusion Language Models
Organizations: Clemson University · University of Ottawa · PayPal · actAVA AI
Abstract
Continuous diffusion language models show promising potential in text generation tasks, but are prone to problems such as text repetition, semantic drift, and generation quality degradation when the generation length exceeds the training length. To address these challenges, we propose RangeSWA, a training-free length extrapolation method. The method combines local sliding-window attention, remote block summaries, and dynamic content retrieval to preserve local details and support long-range context access. In addition, generation degradation caused by length extrapolation is mitigated through positional remapping, conditioning attention correction, and denoising-stage-adaptive window scheduling. We conducted experiments on multiple continuous diffusion language models, and the results show that RangeSWA can effectively reduce generative perplexity and text repetition rates in long-text generation.
Figures & tables
| 1k | 2k | 4k | 8k | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Method | PPL | PPL | PPL | PPL | ||||||||
| ELF-B Full | 24.42 | 5.15 | 4.4 | 21.10 | 4.97 | 5.1 | 3.49 | 1.91 | 43.1 | 1.36 | 0.94 | 42.6 |
| Full + PI | 24.42 | 5.15 | 4.4 | 78.28 | 5.13 | 13.2 | 10.77 | 3.83 | 49.8 | 1.62 | 2.05 | 76.1 |
| Full + NTK | 24.42 | 5.15 | 4.4 | 16.68 | 4.23 | 12.5 | 8.67 | 2.36 | 57.9 | 1.72 | 0.55 | 15.3 |
| Self-Extend* | 24.42 | 5.15 | 4.4 | 20.05 | 5.01 | 7.0 | 7.97 | 2.75 | 48.8 | 5.90 | 1.89 | 82.7 |
| SWA(256,4) | 36.68 | 5.35 | 3.5 | 40.24 | 5.75 | 3.6 | 56.79 | 6.06 | 3.4 | 153.55 | 5.56 | 2.8 |
| CoLa: 1k prompt | LangFlow: 1k | LangFlow: 2k | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Method | PPL | PPL | PPL | ||||||
| Full | 80.92 | 3.57 | 1.3 | 36.17 | 5.25 | 4.9 | 99.36 | 5.86 | 0.2 |
| SWA | 20.32 | 3.61 | 7.3 | 5.61 | 4.25 | 51.1 | 6.09 | 4.86 | 49.5 |
| SumSWA | 28.61 | 3.61 | 4.7 | 15.63 | 5.08 | 23.3 | 42.75 | 5.75 | 5.3 |
| RangeSWA (Ours) | 56.50 | 3.59 | 1.6 | 36.97 | 5.27 | 4.3 | 33.94 | 5.68 | 5.3 |
| 2k | 4k | 8k | ||||
|---|---|---|---|---|---|---|
| Method | s | Speedup | s | Speedup | s | Speedup |
| Full | 2.08 | – | 4.48 | – | 10.84 | – |
| RangeSWA (Ours) | 2.36 | 0.88 | 4.46 | 1.01 | 8.98 | 1.21 |
| RangeSWA-Lite (Ours) | 1.81 | 1.15 | 3.41 | 1.32 | 6.71 | 1.62 |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| BF16 | Strict FP32 | |||||
|---|---|---|---|---|---|---|
| Method | 2k | 4k | 8k | 2k | 4k | 8k |
| Full | 2.08 | 4.48 | 10.84 | 7.74 | 20.17 | 58.30 |
| RangeSWA Triton (Ours) | 2.36 (0.88 ) | 4.46 (1.01 ) | 8.98 (1.21 ) | 10.92 (0.71 ) | 23.42 (0.86 ) | 50.52 (1.15 ) |
| RangeSWA-Lite Triton (Ours) | 1.81 (1.15 ) | 3.41 (1.32 ) | 6.71 (1.62 ) | 6.63 (1.17 ) | 13.41 (1.51 ) | 26.74 (2.18 ) |
Long-Context Language Modeling
Long-context language modeling studies how language models can use, retain, and efficiently process information across very long sequences.
See all 203 papers