LongForge: Measuring and Improving Long-Context Instruction Data via Evidence-Assertion Reasoning Graphs
Abstract
Existing quality control for long-context instruction-tuning data is a one-shot judgment inside the generation pipeline that leaves only a scalar, revealing neither which document parts an answer uses nor how many reasoning steps it writes down; the data can thus be neither audited nor controlled. We formalize data quality as a property of the alignment structure among document, question, and answer, and build LongForge, which pairs an analyzer that measures long-context data with a synthesizer that generates it. The analyzer reverse-reconstructs each sample into an evidence-assertion reasoning graph and programmatically computes four dimensions on it: breadth, depth, correctness, and completeness. Every reading traces back to specific evidence spans and reasoning steps, making data auditable. Measuring seven mainstream datasets reveals two previously unquantified defects: breadth barely grows with document length, and depth is generally low, the two being nearly orthogonal. The synthesizer then embeds the analyzer into generation, gating on correctness and completeness and deferring breadth and depth to a training-time mixture over measured values, which makes the training distribution controllable. On two backbones, its two mixtures, LongForge-1 and LongForge-N, outperform the strongest baseline by 2.2-4.7 points on average over six long-context benchmarks, and in a controlled comparison that holds the gate and the candidate pool fixed, raising breadth and depth alone is worth a further 1.16 points, making the structural distribution of training data a lever on downstream quality rather than only a description of it.
Figures & tables
| Seven baselines | LongForge-1 | LongForge-N | |
|---|---|---|---|
| Breadth | 7.18 | 12.2 | 95.5 |
| Depth | 1.798 | 2.89 | 4.42 |
| Single-step rate | 0.434 | 0.154 | 0.015 |
| Correctness | 0.786 | 0.928 | 0.918 |
| Completeness | 0.913 | 1.000 | 1.000 |
| Document utilization | 0.121 | 0.102 | 0.519 |
| Training data | LongBench | LongBench v2 | LooGLE | MRCR | HELMET | RULER | Avg. |
|---|---|---|---|---|---|---|---|
| Llama3.1-8B | |||||||
| + LongAlign | 35.37 0.53 | 25.23 1.66 | 61.67 0.26 | 1.54 1.29 | 42.15 1.39 | 81.99 1.45 | 41.32 0.51 |
| + LongAlpaca | 30.78 0.27 | 26.17 3.92 | 62.08 0.73 | 0.02 0.03 | 42.91 1.47 | 80.33 1.76 | 40.38 0.52 |
| + LongReward | 35.28 0.73 | 26.53 0.70 | 61.78 0.30 | 4.60 2.57 | 49.07 1.51 | 83.81 0.71 | 43.51 0.82 |
| + SEALONG | 23.02 0.61 | 19.23 1.45 | 43.35 3.17 | 0.85 0.73 | 44.32 3.51 | 83.31 0.75 | 35.68 0.44 |
| + LongMIT | 33.69 0.91 | 24.27 0.67 | 63.01 0.56 | 11.98 3.15 | 46.71 0.93 | 86.40 1.09 | 44.34 0.46 |
| Item | LongForge-1 (control) | Document source | Synthesis model | Distribution mixture |
|---|---|---|---|---|
| Document pool | Mixed pool | LongMagpie only | Mixed pool | Mixed pool |
| Synthesis model | DeepSeek-V4.1-Flash | DeepSeek-V4.1-Flash | Qwen3.8-27B | DeepSeek-V4.1-Flash |
| Breadth (mean / median) | 12.2 / 10 | 11.7 / 10 | 11.2 / 9 | 4.41 / 5 |
| Depth | 2.89 | 3.12 | 2.74 | 1.95 |
| Single-step rate | 0.154 | 0.092 | 0.210 | 0.462 |
| LongBench | 46.34 0.35 | 45.67 0.65 | 48.53 0.52 | 45.57 0.45 |
Appendix figures & tables18 assets
Supplementary material from the paper’s appendix.
Appendix
| Round | Passed in round | Cumulative pass rate |
|---|---|---|
| 1 (first answer) | 17,912 | 87.46% |
| 2 | 1,943 | 96.95% |
| 3 | 346 | 98.64% |
| 4 | 117 | 99.21% |
| Finally failed | 162 | – |
| Component | Stage | Per doc. | Per QA | Share |
|---|---|---|---|---|
| Synthesizer | Question generation | 1.0 | 0.20 | 0.15% |
| Answering (incl. re-answers) | 5.8 | 1.17 | 0.86% | |
| Subtotal | 6.8 | 1.37 | 1.01% | |
| Analyzer | Evidence extraction | 518.3 | 103.7 | 76.49% |
| Graph assembly | 25.5 | 5.1 | 3.76% | |
| Step judgment | 126.9 | 25.4 | 18.73% |
| Qwen tokenizer | Llama tokenizer | |||||
|---|---|---|---|---|---|---|
| Data | Total | Input | Output | Total | Input | Output |
| LongAlign | 16254 | 16072 | 182 | 16974 | 16773 | 201 |
| LongAlpaca | 12828 | 12559 | 270 | 12409 | 12144 | 265 |
| LongReward | 22136 | 21858 | 278 | 23555 | 23214 | 341 |
| SEALONG | 19421 | 19157 | 264 | 18465 | 18212 | 253 |
| LongMIT | 69699 | 69554 | 145 | 78131 | 77957 | 174 |
| Dataset | Samples | Breadth (median / mean) | Depth (median / mean) | Single-step rate | Wide-and-deep | Modal cell (depth / breadth) |
|---|---|---|---|---|---|---|
| LongAlign | 994 | 4.5 / 6.27 | 2 / 1.649 | 48.3% | 28.6% | 1 / 2–3 |
| LongAlpaca | 963 | 10 / 11.17 | 2 / 1.977 | 34.5% | 55.9% | 2 / 7–11 |
| LongReward | 986 | 10 / 12.43 | 1 / 1.595 | 54.4% | 38.7% | 1 / 7–11 |
| SEALONG | 1000 | 3 / 4.08 | 2 / 1.835 | 39.8% | 15.0% | 1 / 2–3 |
| LongMIT | 1000 | 6 / 6.44 | 1 / 1.621 | 51.2% | 31.4% | 1 / 2–3 |
| LongMagpie | 891 | 5 / 6.51 | 2 / 1.860 | 48.6% | 25.6% | 1 / 2–3 |
| Breadth | Depth | Correctness | Completeness | |
| Breadth | – | 0.189 | 0.109 | |
| Depth | 0.070 | – | 0.010 | |
| Correctness | – | 0.032 | ||
| Completeness | 0.100 | 0.035 | – |
| Dimension | Axis | Computation (aggregated within a dataset) | Meaning |
|---|---|---|---|
| Breadth | Narrow | Share of samples with breadth at most 2 | The answer uses at most two evidence spans |
| Breadth | Local | Sample mean of evidence spread ; the evidence spread is the index difference between the first and last chunks that yield evidence, and the denominator is 1 when | Evidence is clustered in a small part of the document |
| Breadth | Doc-starved | Sample mean of document utilization; document utilization is the number of chunks that yield evidence | Most of the document is never used |
| Depth | Shallow | Share of samples with depth 1 | No explicit intermediate reasoning is written down |
| Correctness | Ungrounded | Share of isolated assertions among all assertions of a sample, averaged over samples | Some whole answer sentences connect to no evidence |
| Correctness | Unsupported | Sample mean of correctness | An assertion connects to evidence, but the step does not derive it |
| Dimension | Meaning of the analyzer’s value | Consistent | Minor deviation | Major deviation |
|---|---|---|---|---|
| Breadth | Number of evidence spans counted toward breadth, excluding evidence discarded at assembly | The auditor’s evidence count equals the analyzer’s, or differs by 1 where that span is a borderline case (quoted range slightly wider or narrower) | Differs by 1–2 without changing the order-of-magnitude judgment of how much of the document the sample uses | Differs by 3 or more; or a counted evidence span is entirely irrelevant to the question; or a discarded evidence span is necessary for the answer |
| Depth | Number of hops of the longest reasoning path after paraphrase contraction | The longest chain reconstructed by the auditor has the same number of hops as the analyzer’s | Differs by 1 hop without crossing the boundary between 1 and 2 | Differs by 2 or more hops; or crosses the boundary between 1 and 2 (1 hop means no intermediate reasoning and 2 hops at least one inference, a qualitative difference); or a step counted as reasoning is a pure paraphrase |
| Correctness | Share of supported steps among all reasoning steps | The auditor’s set of supported steps is identical to the analyzer’s | Exactly 1 step is judged differently, without crossing 0.5 | 2 or more steps are judged differently; or crosses 0.5 (majority supported vs. majority unsupported); or a step the analyzer judges supported is clearly underivable (evidence unrelated to the assertion, or a proper noun absent from the inputs) |
| Completeness | Share of answered information points among all information points | The auditor’s judgments of whether each information point is answered all match the analyzer’s | Some information points are judged differently, without crossing complete vs. incomplete | Crosses complete vs. incomplete (1.0 vs. below 1.0); or the question decomposition itself is wrong (e.g., what should be two information points is decomposed as one) |
| Dimension | Usable rate (A / B / both) | Binary agreement | Binary AC1 | Three-level agreement | Three-level AC1 |
|---|---|---|---|---|---|
| Breadth | 99.7% / 100% / 99.7% | 0.997 | 0.997 | 0.997 | 0.997 |
| Depth | 97.4% / 98.6% / 96.2% | 0.965 | 0.964 | 0.957 | 0.956 |
| Correctness | 89.6% / 95.4% / 87.9% | 0.908 | 0.893 | 0.671 | 0.568 |
| Completeness | 98.0% / 100% / 98.0% | 0.980 | 0.979 | 0.971 | 0.971 |
| Training data | Overall | 2-needle | 4-needle | 8-needle |
|---|---|---|---|---|
| LongAlign | 18.87 5.42 | 26.56 5.41 | 18.62 6.85 | 11.57 4.02 |
| LongAlpaca | 8.21 3.48 | 11.18 4.95 | 6.25 4.46 | 7.28 1.43 |
| LongReward | 17.11 1.38 | 23.79 3.11 | 15.55 1.43 | 12.14 0.10 |
| SEALONG | 0.26 0.28 | 0.29 0.31 | 0.36 0.38 | 0.12 0.15 |
| LongMIT | 15.54 3.35 | 21.97 5.14 | 13.32 3.50 | 11.46 1.63 |
| LongMagpie | 15.86 1.38 | 20.98 1.81 | 13.89 1.70 | 12.81 1.31 |
| Training data | HellaSwag | ARC-C | ARC-E | PIQA | WinoGrande | LogiQA | LAMBADA | MMLU | GSM8K | Avg. |
|---|---|---|---|---|---|---|---|---|---|---|
| Llama3.1-8B | ||||||||||
| + LongAlign | 80.09 0.38 | 56.09 2.06 | 57.48 1.39 | 78.56 0.55 | 74.19 0.62 | 29.70 0.18 | 77.20 0.99 | 47.10 4.50 | 38.62 2.12 | 59.89 0.42 |
| + LongAlpaca | 81.79 0.70 | 58.76 1.11 | 69.73 0.80 | 80.38 0.23 | 74.88 0.16 | 30.67 2.00 | 76.28 0.82 | 42.69 6.33 | 42.30 1.59 | 61.94 0.58 |
| + LongReward | 78.98 0.48 | 56.97 0.43 | 60.59 0.97 | 78.53 0.33 | 74.38 1.23 | 30.01 0.47 | 77.32 1.22 | 44.63 2.87 | 37.20 5.08 | 59.84 0.82 |
| + SEALONG | 76.59 0.43 | 52.82 1.27 | 51.73 0.34 | 77.98 0.45 | 74.69 0.36 | 30.01 0.64 | 75.28 0.59 | 34.27 5.60 | 31.31 0.95 | 56.07 0.58 |
| + LongMIT | 76.11 0.82 | 55.18 1.45 | 67.44 3.02 | 79.72 0.17 | 71.32 2.73 | 30.57 1.26 | 76.08 0.67 | 51.28 2.81 | 21.10 3.22 | 58.76 0.81 |
| Training samples | LongBench | LongBench v2 | LooGLE | MRCR | HELMET | RULER | Avg. |
|---|---|---|---|---|---|---|---|
| 2048 (control) | 46.34 0.35 | 37.00 0.20 | 71.39 0.56 | 35.18 1.25 | 60.61 0.61 | 90.87 0.56 | 56.90 0.10 |
| 4096 | 47.94 1.21 | 36.73 1.81 | 71.27 0.83 | 36.07 1.53 | 60.30 0.86 | 91.20 0.83 | 57.25 0.33 |
| 8192 | 48.55 0.36 | 36.80 0.92 | 70.00 0.78 | 35.50 0.74 | 60.19 0.40 | 91.08 0.93 | 57.02 0.37 |
| Training data | Short-dep QA | Long-dep QA |
|---|---|---|
| Llama3.1-8B | ||
| + LongAlign | 82.62 0.98 | 40.72 1.36 |
| + LongAlpaca | 83.13 0.18 | 41.03 1.29 |
| + LongReward | 80.94 0.22 | 42.63 0.41 |
| + SEALONG | 59.45 3.83 | 27.25 2.54 |
| + LongMIT | 84.67 1.48 | 41.35 2.57 |
| Training data | Avg | Single-Doc QA | Multi-Doc QA | Summarization | Few-shot | Synthetic | Code |
|---|---|---|---|---|---|---|---|
| Llama3.1-8B | |||||||
| + LongAlign | 35.37 0.53 | 17.44 0.12 | 13.95 0.43 | 24.75 0.20 | 60.45 1.31 | 50.13 2.51 | 63.05 2.76 |
| + LongAlpaca | 30.78 0.27 | 16.74 0.44 | 13.54 0.89 | 21.12 1.38 | 61.90 0.34 | 20.54 6.31 | 65.80 2.33 |
| + LongReward | 35.28 0.73 | 19.52 0.19 | 14.46 0.16 | 24.60 0.16 | 62.63 0.95 | 39.80 5.42 | 68.26 2.13 |
| + SEALONG | 23.02 0.61 | 8.17 0.64 | 3.31 0.17 | 17.16 0.59 | 60.66 0.92 | 2.42 1.64 | 59.48 7.89 |
| + LongMIT | 33.69 0.91 | 32.78 2.67 | 20.04 4.90 | 22.76 0.29 | 60.35 0.46 | 12.07 7.13 | 63.84 1.08 |
| Training data | Overall | Easy | Hard | Short | Medium | Long |
|---|---|---|---|---|---|---|
| Llama3.1-8B | ||||||
| + LongAlign | 25.23 1.66 | 25.17 2.12 | 25.30 1.45 | 27.40 3.59 | 24.07 0.71 | 24.10 2.80 |
| + LongAlpaca | 26.17 3.92 | 26.73 5.62 | 25.80 3.05 | 28.87 4.72 | 23.87 3.71 | 26.23 3.52 |
| + LongReward | 26.53 0.70 | 27.60 0.87 | 25.93 1.19 | 28.17 3.07 | 25.73 0.71 | 25.63 1.93 |
| + SEALONG | 19.23 1.45 | 20.33 1.55 | 18.53 2.56 | 18.33 2.39 | 19.23 2.41 | 20.70 6.17 |
| + LongMIT | 24.27 0.67 | 23.97 1.55 | 24.43 2.12 | 21.30 3.73 | 25.90 1.49 | 25.93 6.11 |
| Training data | Avg | 8K | 16K | 32K | 64K | 128K |
|---|---|---|---|---|---|---|
| Llama3.1-8B | ||||||
| + LongAlign | 1.54 1.29 | 3.65 2.94 | 1.64 1.60 | 0.82 0.74 | 1.29 1.01 | 0.13 0.20 |
| + LongAlpaca | 0.02 0.03 | 0.00 0.00 | 0.00 0.00 | 0.00 0.00 | 0.13 0.18 | 0.00 0.00 |
| + LongReward | 4.60 2.57 | 2.64 1.76 | 6.06 3.93 | 5.73 3.71 | 8.23 3.88 | 0.58 0.56 |
| + SEALONG | 0.85 0.73 | 0.94 0.78 | 1.45 1.24 | 1.39 1.62 | 0.47 0.41 | 0.00 0.00 |
| + LongMIT | 11.98 3.15 | 17.52 5.73 | 18.58 3.34 | 12.66 4.94 | 8.67 1.31 | 2.12 0.36 |
| Training data | Avg | RAG | ICL | Re-rank | LongQA |
|---|---|---|---|---|---|
| Llama3.1-8B | |||||
| + LongAlign | 42.15 1.39 | 49.06 3.03 | 78.91 3.34 | 29.55 4.83 | 11.05 3.04 |
| + LongAlpaca | 42.91 1.47 | 59.64 0.38 | 72.10 3.50 | 26.14 1.39 | 13.75 1.08 |
| + LongReward | 49.07 1.51 | 59.34 1.40 | 80.36 2.16 | 31.57 1.93 | 25.01 4.40 |
| + SEALONG | 44.32 3.51 | 49.48 4.71 | 76.59 0.63 | 30.00 4.98 | 21.19 3.86 |
| + LongMIT | 46.71 0.93 | 60.16 0.27 | 77.75 1.24 | 18.02 2.28 | 30.90 0.79 |
Synthetic Data Generation for Language Models
Synthetic data generation for language models creates artificial text, tasks, and interaction traces to train or evaluate models.
See all 293 papers