SepSeq: A Training-Free Framework for Long Numerical Sequence Processing in LLMs
Organizations: University of Science and Technology of China · Shanghai Innovation Institute · Nanjing University · University of Edinburgh ·
Abstract
While transformer-based Large Language Models (LLMs) theoretically support massive context windows, they suffer from severe performance degradation when processing long numerical sequences. We attribute this failure to the attention dispersion in the Softmax mechanism, which prevents the model from concentrating attention. To overcome this, we propose Separate Sequence (SepSeq), a training-free, plug-and-play framework to mitigate dispersion by strategically inserting separator tokens. Mechanistically, we demonstrate that separator tokens act as an attention sink, recalibrating attention to focus on local segments while preserving global context. Extensive evaluations on 9 widely-adopted LLMs confirm the effectiveness of our approach: SepSeq yields an average relative accuracy improvement of 35.6% across diverse domains while reducing total inference token consumption by 16.4% on average.
Figures & tables
| Task | Answer Rate (%, ) | Accuracy (%, ) | ||||||
|---|---|---|---|---|---|---|---|---|
| Vanilla | CoT | ICL | SepSeq (Incr.) | Vanilla | CoT | ICL | SepSeq (Incr.) | |
| counting | 100.0 0.0 | 100.0 0.0 | 100.0 0.0 | 100.0 0.0 ( 0 +0.0%) | 42.7 2.7 | 41.2 3.0 | 37.9 3.2 | 76.7 1.2 ( 0 +79.6% ) |
| indexing | 100.0 0.0 | 100.0 0.0 | 100.0 0.0 | 100.0 0.0 ( 0 +0.0%) | 38.8 3.1 | 33.4 3.4 | 34.9 2.9 | 86.6 0.8 ( +123.0% ) |
| max-float | 100.0 0.0 | 100.0 0.0 | 100.0 0.0 | 100.0 0.0 ( 0 +0.0%) | 63.9 1.9 | 60.5 2.1 | 63.3 1.7 | 81.0 1.1 ( 0 +26.8% ) |
| max-int | 100.0 0.0 | 100.0 0.0 | 100.0 0.0 | 100.0 0.0 ( 0 +0.0%) | 75.3 1.1 | 68.8 1.7 | 71.0 1.4 | 92.4 0.4 ( 0 +22.7% ) |
| min-float | 100.0 0.0 | 100.0 0.0 | 100.0 0.0 | 100.0 0.0 ( 0 +0.0%) | 63.1 1.7 | 60.2 2.2 | 60.4 1.9 | 79.3 1.0 ( 0 +25.7% ) |
| Model | Answer Rate (%, ) | Accuracy (%, ) | ||||||
|---|---|---|---|---|---|---|---|---|
| Vanilla | CoT | ICL | SepSeq (Incr.) | Vanilla | CoT | ICL | SepSeq (Incr.) | |
| Qwen3-8B | 0 79.4 1.1 | 0 79.5 0.9 | 0 75.2 1.3 | 0 87.3 0.6 ( 0 +9.8% ) | 45.5 2.8 | 40.3 2.9 | 38.5 3.2 | 69.6 1.6 ( +53.0% ) |
| Qwen3-30B-A3B | 0 80.6 0.9 | 0 80.9 1.1 | 0 81.0 0.8 | 0 90.2 0.5 ( +11.4% ) | 54.3 2.4 | 52.7 2.2 | 52.3 2.5 | 80.7 1.1 ( +48.6% ) |
| QwQ-32B | 0 72.7 1.5 | 0 72.2 1.3 | 0 72.7 1.2 | 0 75.6 1.1 ( 0 +4.0% ) | 34.2 3.4 | 28.9 3.7 | 28.5 3.5 | 57.8 2.0 ( +69.0% ) |
| DeepSeek-V3 | 100.0 0.0 | 100.0 0.0 | 100.0 0.0 | 100.0 0.0 ( 0 +0.0%) | 45.7 2.6 | 44.5 2.9 | 45.2 2.7 | 50.9 2.5 ( +11.4% ) |
| DeepSeek-R1 | 0 99.9 0.1 | 0 99.9 0.0 | 0 99.8 0.1 | 0 99.9 0.0 ( 0 +0.0%) | 61.1 1.8 | 56.6 2.3 | 57.9 2.0 | 70.5 1.4 ( +15.4% ) |
| Prompting | Input Formatting | |
|---|---|---|
| Standard | SepSeq | |
| Vanilla | 53.25 | 70.35 |
| PoT | 78.90 | 84.45 |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Size | Total | Qwen3-30B-A3B-Instruct Model | Qwen3-30B-A3B-Thinking-2507 | ||
| # Correct | Accuracy | # Correct | Accuracy | ||
| S: 2-32 | 50 | 50 | 100.00% | 50 | 100.00% |
| M: 33-128 | 50 | 50 | 100.00% | 36 | 72.00% |
| L: 129-256 | 50 | 50 | 100.00% | 16 | 32.00% |
| XL: 257-512 | 50 | 7 | 14.00% | 0 | 0.00% |
| XXL: 513-1024 | 50 | 0 | 0.00% | 0 | 0.00% |
| Task Type | Question Only (Tokens) | Full Prompt (Tokens) | #Samples | ||||||||||
| Min | 25% | 50% | Mean | 75% | Max | Min | 25% | 50% | Mean | 75% | Max | ||
| max_int | 56 | 56 | 56 | 56.0 | 56 | 56 | 88 | 153 | 341 | 411.9 | 594 | 1070 | 200 |
| min_int | 56 | 56 | 56 | 56.0 | 56 | 56 | 88 | 149 | 341 | 410.3 | 594 | 1104 | 200 |
| max_float | 56 | 56 | 56 | 56.0 | 56 | 56 | 106 | 318 | 957 | 1252.8 | 1867 | 3613 | 200 |
| min_float | 56 | 56 | 56 | 56.0 | 56 | 56 | 99 | 334 | 968 | 1232.3 | 1869 | 3562 | 200 |
| counting | 24 | 24 | 24 | 24.0 | 24 | 24 | 56 | 117 | 309 | 392.9 | 565 | 1076 | 200 |
Long-Context Language Model Inference
Long-context language model inference makes processing and generating over lengthy prompts faster and more memory-efficient.
See all 227 papers