Tongyi-Zhiwen

4 models • 1 total models in database
Sort by:

QwenLong-L1.5-30B-A3B

NaNK
license:apache-2.0
14,889
162

QwenLong-L1-32B

QwenLong-L1: Towards Long-Context Large Reasoning Models with Reinforcement Learning ----------------------------- [](https://opensource.org/licenses/Apache-2.0) [](https://arxiv.org/abs/2505.17667) [](https://github.com/Tongyi-Zhiwen/QwenLong-L1) [](https://modelscope.cn/models/iic/QwenLong-L1-32B) [](https://huggingface.co/Tongyi-Zhiwen/QwenLong-L1-32B) Fanqi Wan, Weizhou Shen, Shengyi Liao, Yingcheng Shi, Chenliang Li, Ziyi Yang, Ji Zhang, Fei Huang, Jingren Zhou, Ming Yan - May 28, 2025: 🔥 We release 🤗 QwenLong-L1-32B-AWQ, which has undergone AWQ int4 quantization using the ms-swift framework. - May 26, 2025: 🔥 We release 🤗 QwenLong-L1-32B, which is the first long-context LRM trained with reinforcement learning for long-context reasoning. Experiments on seven long-context DocQA benchmarks demonstrate that QwenLong-L1-32B outperforms flagship LRMs like OpenAI-o3-mini and Qwen3-235B-A22B, achieving performance on par with Claude-3.7-Sonnet-Thinking, demonstrating leading performance among state-of-the-art LRMs. - May 26, 2025: 🔥 We release 🤗 DocQA-RL-1.6K, which is a specialized RL training dataset comprising 1.6K document question answering (DocQA) problems spanning mathematical, logical, and multi-hop reasoning domains. In this work, we propose QwenLong-L1, a novel reinforcement learning (RL) framework designed to facilitate the transition of LRMs from short-context proficiency to robust long-context generalization. In our preliminary experiments, we illustrate the differences between the training dynamics of short-context and long-context reasoning RL. Our framework enhances short-context LRMs through progressive context scaling during RL training. The framework comprises three core components: a warm-up supervised fine-tuning (SFT) phase to initialize a robust policy, a curriculum-guided RL phase that facilitates stable adaptation from short to long contexts, and a difficulty-aware retrospective sampling mechanism that adjusts training complexity across stages to incentivize policy exploration. Leveraging recent RL algorithms, including GRPO and DAPO, our framework integrates hybrid reward functions combining rule-based and model-based binary outcome rewards to balance precision and recall. Through strategic utilization of group relative advantages during policy optimization, it guides LRMs to learn effective reasoning patterns essential for robust long-context grounding and superior reasoning capabilities. We release 🤗 QwenLong-L1-32B, which is the first long-context LRM trained with reinforcement learniing for long-context reasoning. Experiments on seven long-context DocQA benchmarks demonstrate that QwenLong-L1-32B outperforms flagship LRMs like OpenAI-o3-mini and Qwen3-235B-A22B, achieving performance on par with Claude-3.7-Sonnet-Thinking, demonstrating leading performance among state-of-the-art LRMs. Here's how you can run the model using the 🤗 Transformers: For input where the total length (including both input and output) significantly exceeds 32,768 tokens, we recommend using RoPE scaling techniques to handle long texts effectively. We have validated the model's performance on context lengths of up to 131,072 tokens using the YaRN method. YaRN is currently supported by several inference frameworks, e.g., `transformers` and `llama.cpp` for local use, `vllm` and `sglang` for deployment. In general, there are two approaches to enabling YaRN for supported frameworks: - Modifying the model files: In the `config.json` file, add the `ropescaling` fields: For `llama.cpp`, you need to regenerate the GGUF file after the modification. - Passing command line arguments: > [!IMPORTANT] > If you encounter the following warning > > please upgrade `transformers>=4.51.0`. > [!NOTE] > All the notable open-source frameworks implement static YaRN, which means the scaling factor remains constant regardless of input length, potentially impacting performance on shorter texts. > We advise adding the `ropescaling` configuration only when processing long contexts is required. > It is also recommended to modify the `factor` as needed. For example, if the typical context length for your application is 65,536 tokens, it would be better to set `factor` as 2.0. > [!NOTE] If the average context length does not exceed 32,768 tokens, we do not recommend enabling YaRN in this scenario, as it may potentially degrade model performance. To construct a challenging RL dataset for verifiable long-context reasoning, we develop 🤗 DocQA-RL-1.6K, which comprises 1.6K DocQA problems across three reasoning domains: (1) Mathematical Reasoning: We use 600 problems from the DocMath dataset, requiring numerical reasoning across long and specialized documents such as financial reports. For DocMath, we sample 75% items from each subset from its valid split for training and 25% for evaluation; (2) Logical Reasoning: We employ DeepSeek-R1 to synthesize 600 multi-choice questions requiring logic analysis of real-world documents spanning legal, financial, insurance, and production domains from our curated collection; (3) Multi-Hop Reasoning: We sample 200 examples from MultiHopRAG and 200 examples from Musique, emphasizing cross-document reasoning. Please download and put the following datasets in `./datasets/` for training and evaluation. Evaluation data: 🤗 docmath, 🤗 frames, 🤗 longbench. We provide the basic demo training code for single stage RL traininig with DAPO. We conduct evaluation on seven long-context DocQA benchmarks, including multi-hop reasoning benchmarks such as 2WikiMultihopQA, HotpotQA, Musique, NarrativeQA, Qasper, and Frames as well as mathematical reasoning benchmarks like DocMath. We report the maximum of exact match and LLM-judged accuracy as the final score, aligned with the reward function in our RL training process. We use DeepSeek-V3 as the judge model with a temperature of 0.0 to provide a reliable evaluation. 🌐 Join the Community Chinese users can scan QR codes to join WeChat/DingTalk groups. If you find this work is relevant with your research or applications, please feel free to cite our work! [](https://star-history.com/#Tongyi-Zhiwen/QwenLong-L1&Timeline)

NaNK
license:apache-2.0
1,634
161

QwenLong-L1-32B-AWQ

NaNK
license:apache-2.0
17
10

QwenLong-CPRS-7B

Note: For how to use QwenLong-CPRS-7B, please refer to the github repo QwenLong-CPRS: Towards ∞-LLMs with Dynamic Context Optimization ----------------------------- [](https://opensource.org/licenses/Apache-2.0) [](https://arxiv.org/abs/2505.18092) [](https://github.com/Tongyi-Zhiwen) [](https://modelscope.cn/models/iic/QwenLong-CPRS-7B) [](https://huggingface.co/Tongyi-Zhiwen) Weizhou Shen, Chenliang Li, Fanqi Wan, Shengyi Liao, Shaopeng Lai, Bo Zhang, Yingcheng Shi, Yuning Wu, Gang Fu, Zhansheng Li, Bin Yang,Ji Zhang, Fei Huang, Jingren Zhou, Ming Yan In this work, we present QwenLong-CPRS, a novel framework designed to optimize long-context processing through query-aware multi-granularity compression, outperforming RAG and sparse attention methods. Distinct from RAG's coarse chunk-level retrieval, it achieves precise information extraction via token-level content selection, enhancing accuracy. Unlike sparse attention (SA) requiring model retraining, it functions as a plug-and-play module compatible with any downstream LLMs while eliminating retraining demands. This dual advantage enables both fine-grained context optimization and seamless integration across architectures. We implement QwenLong-CPRS with four key innovations: Controllable Context Optimization: Processes control prompts + queries to generate compact, task-specific context segments without retraining. Hybrid Attention Architecture: Combines bi-directional modeling (context localization) with causal LM (representation fidelity). LM-as-Critic Framework: Repurposes the pretrained LM head to score token relevance, preserving original knowledge while enabling compression. Window-Parrallel Inference: Splits long context into $w$-sized windows for parallel processing, reducing prefill complexity. - May 26, 2025: 🔥 We release 🤗 QwenLong-CPRS-7B, a 7B context compression model designed for explicit long-context optimization. 🔥Key Achievements: ✅ Superior Performance: Outperforms RAG and sparse attention in both accuracy and efficiency across five long-context benchmarks. ✅ Universal Compatibility: Seamlessly integrates with all flagship LLMs (GPT-4o, Gemini 2.0-pro, Claude 3.7-sonnet, DeepSeek-v3, Qwen2.5-max), achieving 21.59× context compression and +19.15 avg. performance boost. ✅ New SOTA: When paired with Qwen2.5-32B-Instruct, it surpasses top proprietary models by +4.85 on Ruler-128K and +10.88 on InfiniteBench, setting a new SOTA. - May 24, 2025: 🔥 We release the 💻 Demo Code for deploying the QwenLong-CPRS API and runing simpling long-context tasks with QwenLong-CPRS cascading an LLM. Here we provide how to run QwenLong-CPRS with LLM in a long-context task: Step 2: Data Preparation Download Ruler-128K test data from huggingface-hub and put it on the `data` folder. If you find this work is relevant with your research or applications, please feel free to cite our work!

NaNK
license:apache-2.0
8
22