Skip to main content
QUICK REVIEW

[Paper Review] Qwen2.5-1M Technical Report

Yang An, B. X. Yu|ArXiv.org|Jan 26, 2025
Solidification and crystal growth phenomenaMaterials Science7 citations
TL;DR

Qwen2.5-1M extends context length to 1M tokens, introducing long-context pretraining, post-training, and an open-source inference framework with length extrapolation, sparse attention, and system-level optimizations that yield substantial prefill speedups for ultra-long inputs.

ABSTRACT

We introduce Qwen2.5-1M, a series of models that extend the context length to 1 million tokens. Compared to the previous 128K version, the Qwen2.5-1M series have significantly enhanced long-context capabilities through long-context pre-training and post-training. Key techniques such as long data synthesis, progressive pre-training, and multi-stage supervised fine-tuning are employed to effectively enhance long-context performance while reducing training costs. To promote the use of long-context models among a broader user base, we present and open-source our inference framework. This framework includes a length extrapolation method that can expand the model context lengths by at least four times, or even more, without additional training. To reduce inference costs, we implement a sparse attention method along with chunked prefill optimization for deployment scenarios and a sparsity refinement method to improve precision. Additionally, we detail our optimizations in the inference engine, including kernel optimization, pipeline parallelism, and scheduling optimization, which significantly enhance overall inference performance. By leveraging our inference framework, the Qwen2.5-1M models achieve a remarkable 3x to 7x prefill speedup in scenarios with 1 million tokens of context. This framework provides an efficient and powerful solution for developing applications that require long-context processing using open-source models. The Qwen2.5-1M series currently includes the open-source models Qwen2.5-7B-Instruct-1M and Qwen2.5-14B-Instruct-1M, as well as the API-accessed model Qwen2.5-Turbo. Evaluations show that Qwen2.5-1M models have been greatly improved in long-context tasks without compromising performance in short-context scenarios. Specifically, the Qwen2.5-14B-Instruct-1M model significantly outperforms GPT-4o-mini in long-context tasks and supports contexts eight times longer.

Motivation & Objective

  • Motivate and enable long-context processing beyond 128k tokens for LLMs.
  • Develop efficient long-context pre-training and post-training strategies to improve long-range reasoning while preserving short-context performance.
  • Provide an open-source inference framework with length extrapolation, sparse attention, and engine optimizations to reduce costs and accelerate deployment.

Proposed method

  • Long-context pre-training with synthetic data and long-range training steps to improve long-distance dependencies.
  • Post-training with synthetic long-instruction data and a two-stage supervised fine-tuning plus offline reinforcement learning.
  • An open-source inference framework featuring length extrapolation (via Dual Chunk Attention and YaRN attention scaling), sparse attention with MInference, and chunked prefill optimization; engine optimizations include kernel, pipeline, and scheduling enhancements.

Experimental results

Research questions

  • RQ1How can we effectively extend LLM context to 1M tokens while maintaining or improving short-context performance?
  • RQ2What data and training strategies best promote long-range dependencies in Qwen2.5-1M?
  • RQ3How can inference be made cost-efficient and scalable for ultra-long contexts through extrapolation, sparse attention, and engine optimizations?
  • RQ4What is the impact of length extrapolation and sparsity refinements on long-context retrieval and question-answer tasks?
  • RQ5How do Qwen2.5-1M models compare to existing 1M-context alternatives on long-context benchmarks?

Key findings

  • Qwen2.5-1M models achieve 1M-context processing with substantial speedups in prefill when using the open-source inference framework (3x to 7x prefill speedup).
  • Long-context training with progressive context lengths up to 262,144 tokens and synthetic long-data tasks improves long-context comprehension without sacrificing short-context performance.
  • Two-stage post-training plus offline RL improves alignment with human preferences and generalizes to long-context tasks, with measurable gains on Longbench-Chat after RL.
  • Length extrapolation via Dual Chunk Attention (DCA) and YaRN attention scaling significantly boosts performance on long-context tasks such as Passkey Retrieval and NIAH with contexts up to 1M tokens.
  • MInference-based sparse attention, chunked prefill, and sparsity refinement recover most retrieval accuracy in Needle in a Haystack tests with 1M-token contexts, while enabling substantial speedups.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.