Training Long-Context Vision-Language Models Effectively with Generalization Beyond 128K Context

Zhaowei Wang, Lishu Luo, Haodong Duan, Weiwei Liu, Sijin Wu, Ji Luo, Shen Yan, Shuai Peng, Sihang Yuan, Chaoyi Huang, Yi Lin, Yangqiu Song

TL;DR

This paper provides a systematic study and practical recipe for scaling the context window of Large Vision-Language Models (LVLMs) from 32K to 128K tokens using a modest 5B-token budget. The authors demonstrate that instruction-formatted long-document Visual Question Answering (VQA) is vastly superior to passive OCR transcription for long-context continued pre-training. Their resulting model, MMProLong, not only excels within its 128K training window but generalizes seamlessly up to 512K contexts and transfers effectively to long-video and webpage retrieval tasks without task-specific training.

What Problem Does This Paper Address?

While Large Language Models (LLMs) have successfully scaled their context windows to millions of tokens, the practical recipes for extending Large Vision-Language Models (LVLMs)—which must handle interleaved sequences of high-dimensional image tokens and text—remain largely underexplored.

Existing technical reports offer few details on how to construct, balance, and mix multimodal long-context data. Key questions remain unanswered: Should training data be heavily biased toward the maximum target length? Does long-context training ruin a model's short-context performance? What kind of tasks provide the best supervision signal? This paper bridges these gaps by providing a systematic empirical study of long-context continued pre-training (LongPT) for LVLMs.

Methods

The authors systematically extended a 7B parameter model (Qwen2.5-VL-7B) from a 32K context window to 128K tokens. Their approach relies on two core pillars:

  1. Positional Encoding Scaling: Following the Dynamic-NTK heuristic, they scaled the multimodal Rotary Position Embedding (mRoPE) base frequency from $1 \times 10^6$ to $4 \times 10^6$ to accommodate longer sequences.
  2. Short-to-Long Data Synthesis Pipeline: To generate high-quality training data efficiently, the authors developed a pipeline that samples a semantically coherent segment (8–15 pages) from a large document pool, uses a teacher LVLM (Seed 2.0) to generate a QA pair based only on that short segment, and then inserts the segment back into its original full-document context (32–50 pages). Crucially, they forced the generator to include explicit anchors (e.g., "on page 20") to prevent ambiguity when the question is evaluated against the entire document.
Long-document VQA synthesis pipeline

The authors evaluated five distinct synthetic tasks split into two categories: Long-Document VQA (single-page extraction, multi-page extraction, and reasoning) and OCR Transcription (full-document OCR and needle-page OCR).

Datasets

  • Training Data: Synthesized from a document pool of over 1.5 million PDF documents spanning academic papers, books, and technical manuals across diverse domains (Engineering, Medicine, Social Sciences, etc.).
  • Evaluation Benchmarks:
  • Long-Document VQA: MMLongBench (comprising MMLongBench-Doc, LongDocURL, and SlideVQA).
  • Multimodal Needle-in-a-Haystack: MM-NIAH.
  • Vision-Text Compression: VTCBench.
  • Long-Video Understanding: Video-MME, MLVU, and LongVideoBench.
  • Short-Context Benchmarks: MMBench, RWQA, MMMU, MMMU-Pro, MathVista, and OCRBench.

Key Insights and Ideas

  • VQA Beats OCR Hands Down: Long-document VQA is a far more effective supervision signal than OCR transcription. Even when OCR-trained models are given an additional SFT alignment stage, VQA-trained models vastly outperform them. Instruction-formatted tasks force the model to learn active information retrieval and complex reasoning rather than passive text mapping.
Comparison of VQA and OCR training data on MMLongBench
  • Balanced Length Distributions Generalize Better: Counter-intuitively, training on a natural, balanced distribution of document lengths (pool-native) outperforms a distribution heavily biased toward the 128K target length. This suggests that long-context capability requires continuous positional calibration across various lengths and relative distances, rather than specializing in a single maximum length.
Pool-native vs long-biased length distributions
  • Retrieval is the Primary Bottleneck: When grid-searching task mixtures, a moderately extraction-heavy ratio (8:2 extraction-to-reasoning) yielded the best results. This indicates that locating sparse information within massive multimodal inputs remains the hardest part of the long-context problem.
Data mixture grid search results
  • No "Short-Context Tax": Unlike text-only LLMs, which often suffer from catastrophic forgetting of short-context capabilities during long-context extension, pure long-document VQA training largely preserves short-context performance. The instruction-following nature of VQA data mitigates the need for complex short-data mixing.
Short data mixing ratio trade-offs

Key Results

The resulting model, MMProLong, achieved strong performance across multiple long-context dimensions:

  • VQA Improvements: Improved long-document VQA scores by 7.1% at 64K and 128K contexts compared to the Qwen2.5-VL-7B base model.
  • Out-of-Domain Extrapolation: Without any additional training or inference-time adaptation, MMProLong maintained robust performance at 256K and 512K contexts, outperforming the base model by over 20%.
  • Needle Retrieval: On the webpage-based MM-NIAH benchmark, MMProLong raised the average score from 20.0 to 49.4, showing massive gains in retrieval and reasoning.
MM-NIAH performance breakdown
  • Zero-Shot Transfer: Despite being trained exclusively on static documents, the model's long-context capabilities transferred directly to long videos, improving performance on Video-MME (+2.7), MLVU (+3.3), and LongVideoBench (+1.6).

Limitations and Future Work

The primary limitation acknowledged by the authors is scale. The systematic study was restricted to 7B/8B-scale LVLMs due to the high computational cost of long-context continued pre-training. It remains an open question how these data mixture and length distribution trends scale to 30B or 70B models, or to extreme context windows like 1M+ tokens. Additionally, the evaluation relies heavily on model-based judging (LLM-as-a-judge), which introduces substantial API costs and highlights the need for more efficient, low-cost long-context evaluation protocols.

Summary updated

BibTeX
@inproceedings{wang2026training,
  author = {Zhaowei Wang and Lishu Luo and Haodong Duan and Weiwei Liu and Sijin Wu and Ji Luo and Shen Yan and Shuai Peng and Sihang Yuan and Chaoyi Huang and Yi Lin and Yangqiu Song},
  title = {{Training Long-Context Vision-Language Models Effectively with Generalization Beyond 128K Context}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=yAqoDCAG9T},
}
Figure