Qwen2.5技术报告总结
省流不看版
| 模块 | 主要改进与特点 |
|---|---|
| 模型结构 | 基于Transformer解码器,采用GQA、SwiGLU、RoPE、QKV偏置、RMSNorm,支持MoE架构,分词器BBPE,控制token扩展至22个。 |
| 预训练 | 数据过滤更优(Qwen2-Instruct筛选)、引入Qwen2.5-Math/Coder数据、合成数据质量提升、数据混合更均衡。 |
| 超参数缩放 | 系统性实验建立缩放定律,预测不同模型/数据规模下的最优超参数,指导MoE与Dense模型训练。 |
| 长文本预测 | 两阶段预训练,RoPE基频提升,Turbo版分阶段扩展上下文,推理引入YARN与DCA,Turbo支持百万token输入。 |
| 后训练 | 监督微调数据扩展,强化学习分Offline/Online两阶段,提升指令跟随、数学、代码、结构化数据、逻辑推理等能力。 |
| 监督微调 | 长序列生成、数学思维链、代码能力、指令跟随、结构化数据、逻辑推理、跨语言迁移、鲁棒系统指令、回复质量过滤。 |
| Offline RL | 针对客观任务(如数学、代码等)采样高质量正负例,结合人工与自动审核,DPO训练,提升模型可靠性。 |
| Online RL | 明确标签标准(真实性、帮助性、简洁、相关性、无害性、无偏见),优化输出质量与安全性。 |
| 长文本微调 | Turbo版后训练阶段加入更长上下文数据,短长token混合训练,兼顾长文本与短文本任务性能。 |
模型结构
原文:
For dense models, we maintain the Transformer-based decoder architectureas Qwen2. The architecture incorporates several key components: Grouped Query Attention (GQA) for efficient KV cache utilization, SwiGLU activation function for non-linear activation, Rotary Positional Embeddings (RoPE) for encoding position information, QKV bias in the attention mechanism and RMSNorm with pre-normalization to ensure stable training.
翻译:
对于密集模型,我们保持了基于 Transformer 的解码器架构 Qwen2。该架构包含几个关键组件:分组查询注意力(Grouped Query Attention, GQA),用于提高 KV 缓存的利用效率;SwiGLU 激活函数,用于实现非线性激活;旋转位置嵌入(Rotary Positional Embeddings, RoPE),用于编码位置信息;注意力机制中的 QKV 偏置,用于优化注意力计算;以及结合预归一化的 RMSNorm,用于确保训练的稳定性。
原文:
Building upon the dense model architectures, we extend it to MoE model architectures. This is achieved by replacing standard feed-forward network (FFN) layers with specialized MoE layers, where each layer comprises multiple FFN experts and a routing mechanism that dispatches tokens to the top-K experts.
翻译:
基于密集模型架构,我们将其扩展至 MoE 模型架构。具体实现方式是用专门的 MoE 层替换标准的前馈网络(FFN)层,每个 MoE 层由多个 FFN 专家组成,并通过路由机制将 token 分配给 top-K 专家。
原文:
For tokenization, we utilize Qwen’s tokenizer, which implements byte-level byte-pair encoding (BBPE) with a vocabulary of 151,643 regular tokens. We have expanded the set of control tokens from 3 to 22 compared to previous Qwen versions, adding two new tokens for tool functionality and allocating the remainder for other model capabilities.
翻译:
对于分词,我们使用 Qwen 的分词器,该分词器实现了字节级字节对编码(BBPE),词汇表包含 151,643 个常规 token。与之前的 Qwen 版本相比,我们将控制 token 的集合从 3 扩展到 22,新增了两个用于工具功能的 token,其余用于其他模型功能。
模型结构总结:
Qwen2.5 使用基于 Transformer 的解码器架构,包含以下关键组件:
- 分组查询注意力(Grouped Query Attention, GQA):提高 KV 缓存利用效率。
- SwiGLU 激活函数:实现非线性激活。
- 旋转位置嵌入(Rotary Positional Embeddings, RoPE):编码位置信息。
- 注意力机制中的 QKV 偏置:优化注意力计算。
- RMSNorm 结合预归一化:确保训练稳定性。
并在此基础上扩展至MOE架构,用MOE来替代FFN网络
Qwen2.5 使用 Qwen 的分词器,采用字节级字节对编码(BBPE),词汇表包含 151,643 个常规 token。相比之前版本,控制 token 的集合从 3 扩展到 22,其中新增两个用于工具功能,其余用于其他模型功能。
预训练
原文:
Our language model pre-training process consists of several key components. First, we carefully curate high-quality training data through sophisticated filtering and scoring mechanisms, combined with strategic data mixture. Second, we conduct extensive research on hyperparameter optimization to effectively train models at various scales. Finally, we incorporate specialized long-context pre-training to enhance the model’s ability to process and understand extended sequences.
翻译:
我们的语言模型预训练过程包括几个关键组件。
首先,我们通过复杂的过滤和评分机制结合战略性数据混合,精心筛选高质量的训练数据。
其次,我们对超参数优化进行了广泛研究,以有效训练不同规模的模型。
最后,我们引入了专门的长上下文预训练,以增强模型处理和理解长序列的能力。
预训练数据
qwen2.5的预训练数据在qwen2的基础上改进了以下几点:
- 更好的数据过滤
就是用qwen2作为过滤器,来筛选优秀的训练数据
原文:
Better data filtering. High-quality pre-training data is crucial for model performance, making data quality assessment and filtering a critical component of our pipeline. We leverage Qwen2-Instruct models as data quality filters that perform comprehensive, multi-dimensional analysis to evaluate and score training samples. The filtering method represents a significant advancement over our previous approach used for Qwen2, as it benefits from Qwen2’s expanded pre-training on a larger multilingual corpus. The enhanced capabilities enable more nuanced quality assessment, resulting in both improved retention of high-quality training data and more effective filtering of low-quality samples across multiple languages.
翻译:
更好的数据过滤。高质量的预训练数据对于模型性能至关重要,因此数据质量评估和过滤是我们流程中的关键环节。我们利用 Qwen2-Instruct 模型作为数据质量过滤器,对训练样本进行全面、多维度的分析、评估和打分。与 Qwen2 之前的方法相比,这种过滤方式有了显著提升,因为它受益于 Qwen2 在更大多语料库上的扩展预训练。增强后的能力能够实现更细致的质量评估,从而在多种语言中更好地保留高质量训练数据,并更有效地过滤低质量样本。
- 更好的数学和代码数据
就是在用了qwen2.5-Math 和qwen2.5-Coder的训练数据作为qwen2.5的训练数据,从而使Qwen2.5可以继承数学和代码能力
原文:
Better math and code data. During the pre-training phase of Qwen2.5, we incorporate training data from Qwen2.5-Math and Qwen2.5-Coder. This data integration strategy proves highly effective, as these specialized datasets are instrumental in achieving state-of-the-art performance on mathematical and coding tasks. By leveraging these high-quality domain-specific datasets during pre-training, Qwen2.5 inherits strong capabilities in both mathematical reasoning and code generation.
翻译:
更好的数学和代码数据。在 Qwen2.5 的预训练阶段,我们引入了 Qwen2.5-Math和 Qwen2.5-Coder的训练数据。这种数据整合策略非常有效,因为这些专用数据集对于在数学和编程任务上实现最先进的性能起到了关键作用。通过在预训练过程中利用这些高质量的领域特定数据集,Qwen2.5 继承了强大的数学推理和代码生成能力。
- 更好的合成数据
利用 Qwen2-72B-Instruct和 Qwen2Math-72B-Instruct 来合成数据,在通过Qwen2-Math-RM-72B进行过滤
原文:
Better synthetic data. To generate high-quality synthetic data, particularly in mathematics, code, and knowledge domains, we leverage both Qwen2-72B-Instruct and Qwen2Math-72B-Instruct. The quality of this synthesized data is further enhanced through rigorous filtering using our proprietary general reward model and the specialized Qwen2-Math-RM-72B (Qwen Team, 2024c) model.
翻译:
更好的合成数据。为了生成高质量的合成数据,特别是在数学、代码和知识领域,我们利用了 Qwen2-72B-Instruct和 Qwen2Math-72B-Instruct。这些合成数据的质量通过我们自研的通用奖励模型和专用的 Qwen2-Math-RM-72B模型进行严格过滤,进一步得到了提升。
-
更好的数据混合
利用Qwen2-Instruct来进行数据的分类和平衡,指出了网络数据中的数据相对而言信息质量低一点,学术研究的信息质量高一点原文:
Better data mixture. To optimize the pre-training data distribution, we employ Qwen2-Instruct models to classify and balance content across different domains. Our analysis revealed that domains like e-commerce, social media, and entertainment are significantly overrepresented in web-scale data, often containing repetitive, template-based, or machine-generated content. Conversely, domains such as technology, science, and academic research, while containing higherquality information, are traditionally underrepresented. Through strategic down-sampling of overrepresented domains and up-sampling of high-value domains, we ensure a more balanced and information-rich training dataset that better serves our model’s learning objectives.翻译:
更好的数据混合。为了优化预训练数据的分布,我们利用 Qwen2-Instruct 模型对不同领域的内容进行分类和平衡。我们的分析发现,电商、社交媒体和娱乐等领域在大规模网络数据中占比过高,且常包含重复、模板化或机器生成的内容。相反,技术、科学和学术研究等领域虽然信息质量更高,但传统上占比较低。通过对过度代表的领域进行下采样、对高价值领域进行上采样,我们确保训练数据集更加均衡且信息丰富,更好地服务于模型的学习目标。
超参数缩放
原文:
We develop scaling laws for hyper-parameter based on the pre-training data of Qwen2.5 (Hoffmann et al., 2022; Kaplan et al., 2020). While previous studies (Dubey et al., 2024; Almazrouei et al., 2023; Hoffmann et al., 2022) primarily used scaling laws to determine optimal model sizes given compute budgets, we leverage them to identify optimal hyperparameters across model architectures. Specifically, our scaling laws help determine key training parameters like batch size B and learning rate μ for both dense models and MoE models of varying sizes.
Through extensive experimentation, we systematically study the relationship between model architecture and optimal training hyper-parameters. Specifically, we analyze how the optimal learning rate μopt and batch size Bopt vary with model size N and pre-training data size D. Our experiments cover a comprehensive range of architectures, including dense models with 44M to 14B parameters and MoE models with 44M to 1B activated parameters, trained on datasets ranging from 0.8B to 600B tokens. Using these optimal hyper-parameter predictions, we then model the final loss as a function of model architecture and training data scale.
Additionally, we leverage scaling laws to predict and compare the performance of MoE models with varying parameter counts against their dense counterparts. This analysis guides our hyper-parameter configuration for MoE models, enabling us to achieve performance parity with specific dense model variants (such as Qwen2.5-72B and Qwen2.5-14B) through careful tuning of both activated and total parameters.
翻译:
我们基于 Qwen2.5 的预训练数据制定了超参数缩放定律(Hoffmann 等, 2022;Kaplan 等, 2020)。以往的研究(Dubey 等, 2024;Almazrouei 等, 2023;Hoffmann 等, 2022)主要利用缩放定律在给定算力预算下确定最优模型规模,而我们则用其来寻找不同模型架构下的最优超参数。具体来说,我们的缩放定律有助于确定密集模型和不同规模 MoE 模型的关键训练参数,如 batch size B 和学习率 μ。
通过大量实验,我们系统性地研究了模型架构与最优训练超参数之间的关系。具体而言,我们分析了最优学习率 μopt 和 batch size Bopt 如何随模型规模 N 和预训练数据规模 D 变化。我们的实验涵盖了从 44M 到 14B 参数的密集模型,以及从 44M 到 1B 激活参数的 MoE 模型,训练数据规模从 0.8B 到 600B token 不等。利用这些最优超参数预测,我们将最终损失建模为模型架构和训练数据规模的函数。
此外,我们还利用缩放定律预测并比较了不同参数量的 MoE 模型与对应密集模型的性能。这一分析为 MoE 模型的超参数配置提供了指导,使我们能够通过精细调整激活参数和总参数,实现与特定密集模型(如 Qwen2.5-72B 和 Qwen2.5-14B)性能相当的效果。
总结来说,Qwen2.5 确定最优超参数的核心思想是:
-
通过大规模、系统性的实验,收集不同模型大小和数据规模下最优超参数(学习率和批次大小)的数据。
-
基于这些数据,构建数学模型或经验公式,揭示超参数与模型大小、数据规模之间的标度律关系。
-
利用这些标度律来预测在不同配置下的最优超参数,并进而预测最终的模型性能,从而有效地指导模型训练和架构选择,尤其是对于 MoE 模型。
长文本预测
原文:
For optimal training efficiency, Qwen2.5 employs a two-phase pre-training approach: an initial phase with a 4,096-token context length, followed by an extension phase for longer sequences. Following the strategy used in Qwen2, we extend the context length from 4,096 to 32,768 tokens during the final pre-training stage for all model variants except Qwen2.5-Turbo. Concurrently, we increase the base frequency of RoPEfrom 10,000 to 1,000,000 using the ABF technique (Xiong et al., 2023).
For Qwen2.5-Turbo, we implement a progressive context length expansion strategy during training, advancing through four stages: 32,768 tokens, 65,536 tokens, 131,072 tokens, and ultimately 262,144 tokens, with a RoPE base frequency of 10,000,000. At each stage, we carefully curate the training data to include 40% sequences at the current maximum length and 60% shorter sequences. This progressive training methodology enables smooth adaptation to increasing context lengths while maintaining the model’s ability to effectively process and generalize across sequences of varying lengths.
To enhance our models’ ability to process longer sequences during inference, we implement two key strategies: YARN (Peng et al., 2023) and Dual Chunk Attention (DCA, An et al., 2024). Through these innovations, we achieve a four-fold increase in sequence length capacity, enabling Qwen2.5-Turbo to handle up to 1 million tokens and other models to process up to 131,072 tokens. Notably, these approaches not only improve the modeling of long sequences by reducing perplexity but also maintain the models’ strong performance on shorter sequences, ensuring consistent quality across varying input lengths.
翻译:
为了实现最佳训练效率,Qwen2.5 采用了两阶段预训练方法:第一阶段使用 4,096 token 的上下文长度,第二阶段则扩展到更长的序列。延续 Qwen2 的策略,除 Qwen2.5-Turbo 外,所有模型在最终预训练阶段将上下文长度从 4,096 扩展到 32,768 token。同时,利用 ABF 技术(Xiong 等, 2023),将 RoPE 的基频从 10,000 提升到 1,000,000。
对于 Qwen2.5-Turbo,我们在训练过程中采用了渐进式上下文长度扩展策略,分为四个阶段:32,768 token、65,536 token、131,072 token,最终达到 262,144 token,RoPE 基频为 10,000,000。在每个阶段,我们精心挑选训练数据,使当前最大长度的序列占 40%,较短序列占 60%。这种渐进式训练方法使模型能够平滑适应不断增长的上下文长度,同时保持对不同长度序列的有效处理和泛化能力。
为了提升模型在推理阶段处理长序列的能力,我们引入了两项关键技术:YARN和 Dual Chunk Attention(DCA)。通过这些创新,Qwen2.5-Turbo 的序列长度能力提升了 4 倍,可处理高达 100 万 token 的输入,其它模型也能处理最多 131,072 token 的序列。值得注意的是,这些方法不仅通过降低困惑度提升了长序列建模能力,还保持了模型在短序列上的强大性能,确保在不同输入长度下的一致高质量表现。
- Qwen2.5 采用两阶段预训练策略,先用 4,096 token 上下文长度训练,再在最后阶段扩展到更长序列(大多数模型为 32,768 token,Turbo 版最高达 262,144 token)。
- Qwen2.5-Turbo 通过分阶段、渐进式扩展上下文长度(32,768 → 65,536 → 131,072 → 262,144),并在每阶段合理分配长短序列比例,提升模型对超长文本的适应能力。
- 训练中提升 RoPE 基频(普通模型至 1,000,000,Turbo 版至 10,000,000),增强模型对长序列的编码能力。
- 推理阶段引入 YARN 和 Dual Chunk Attention(DCA)技术,使 Turbo 版可处理高达 100 万 token 的输入,其它模型最高可达 131,072 token。
- 这些方法不仅提升了长文本建模能力,还保证了短文本任务上的性能一致性。
后训练
Qwen2.5在Qwen2的基础上再后训练上改了两点
- 扩展的监督微调数据覆盖范围(增加了训练数据的质量和数量)
监督式微调过程利用了包含大量高质量示例的海量数据集。这种扩展专门解决了以前模型存在局限性的关键领域,例如长序列生成、数学问题解决、编码、指令跟踪、结构化数据理解、逻辑推理、跨语言迁移和稳健的系统教学。
- 两阶段强化学习
强化学习分为两个阶段Offline RL (离线强化学习) 和 Online RL (在线强化学习)
- Offline RL:此阶段侧重于开发奖励模型难以评估的能力,例如推理、事实性和指令遵循。通过对训练数据的精心构建和验证,我们确保离线 RL 信号既可学习又可靠,使模型能够有效地获得这些复杂的技能。
- Online RL:在线 RL 阶段利用奖励模型的能力来检测输出质量的细微差别,包括真实性、有用性、简洁性、相关性、无害性和消除偏见。它使模型能够生成精确、连贯且结构良好的响应,同时保持安全性和可读性。因此,该模型的输出始终符合人类质量标准和期望
监督微调
以下是几个核心增强方法在监督微调状态
- 长序列生成能力
总结而言就是使用了长序列回复数据集
原文:
Qwen2.5 is capable of generating high-quality content with an output context length of up to 8,192 tokens, a significant advancement over the typical posttraining response length, which often remains under 2,000 tokens. To address this gap, we develop long-response datasets (Quan et al., 2024). We employ back-translation techniques to generate queries for long-text data from pre-training corpora, impose output length constraints, and use Qwen2 to filter out low-quality paired data.
翻译:
Qwen2.5 能够生成高质量内容,输出上下文长度最高可达 8,192 token,这一能力相比以往后训练阶段通常不足 2,000 token 的响应长度有了显著提升。为弥补这一差距,我们开发了长回复数据集。我们采用回译技术,从预训练语料中生成长文本数据的查询,设置输出长度约束,并利用 Qwen2 过滤低质量的配对数据。
- 数学
使用了Qwen2.5-Math的思维链数据
原文:
We introduce the chain-of-thought data of Qwen2.5-Math (Yang et al., 2024b), which encompasses a diverse range of query sources, including public datasets, K-12 problem collections, and synthetic problems. To ensure high-quality reasoning, we employ rejection sampling (Yuan et al., 2023) along with reward modeling and annotated answers for guidance, producing step-by-step reasoning process.
翻译:
我们引入了 Qwen2.5-Math 的思维链数据(Yang 等, 2024b),涵盖了多样化的查询来源,包括公开数据集、K-12 题库和合成题目。为确保高质量的推理过程,我们采用了**拒绝采样**、奖励建模以及带注释的答案进行指导,从而生成逐步推理的过程。
- 代码
使用 Qwen2.5Coder 的数据,以及与代码相关的QA问题和github上的算法片段作为数据集
原文:
To enhance coding capabilities, we incorporate the instruction tuning data of Qwen2.5Coder (Hui et al., 2024). We use multiple language-specific agents into a collaborative framework, generating diverse and high-quality instruction pairs across nearly 40 programming languages. We expand our instruction dataset by synthesizing new examples from code-related Q&A websites and gathering algorithmic code snippets from GitHub. A comprehensive multilingual sandbox is used to perform static code checking and validate code snippets through automated unit testing, ensuring code quality and correctness (Dou et al., 2024; Yang et al., 2024c).
翻译:
为了增强编码能力,我们整合了 Qwen2.5Coder 的指令调优数据。我们将多个特定于语言的代理使用到一个协作框架中,在近 40 种编程语言中生成多样化和高质量的指令对。我们通过从与代码相关的 Q&A 网站综合新示例并从 GitHub 收集算法代码片段来扩展我们的教学数据集。使用全面的多语言沙箱执行静态代码检查,并通过自动化单元测试验证代码片段,确保代码质量和正确性。
- 指令跟随
使用代码编写的验证框架来监督大模型的生成的指令和其对应的代码的准确性,从而保证大模型可以准确的指令跟随
原文:
To ensure high-quality instruction-following data, we implement a rigorous code-based validation framework. In this approach, LLMs generate both instructions and corresponding verification code, along with comprehensive unit tests for cross-validation. Through execution feedback-based rejection sampling, we carefully curate the training data used for Supervised Fine-Tuning, thereby guaranteeing the model’s faithful adherence to intended instructions.
翻译:
为了确保高质量的指令跟随数据,我们实现了严格的基于代码的验证框架。在该方法中,大模型会同时生成指令及其对应的验证代码,并配套生成全面的单元测试用于交叉验证。通过基于执行反馈的拒绝采样,我们精心筛选用于监督微调的训练数据,从而保证模型能够忠实地遵循预期指令。
- 结构化数据理解
使用一个全面的结构化数据集
原文:
We develop a comprehensive structured understanding dataset that encompasses both traditional tasks, such as tabular question-answering, fact verification, error correction, and structural understanding, as well as complex tasks involving structured and semi-structured data. By incorporating reasoning chains into the model’s responses, we significantly enhance its ability to infer information from structured data, thereby improving its performance across these diverse tasks. This approach not only broadens the scope of the dataset but also deepens the model’s capacity to reason and derive meaningful insights from complex data structures.
翻译:
我们开发了一个全面的结构化理解数据集,涵盖了传统任务(如表格问答、事实核查、错误纠正和结构化理解)以及涉及结构化和半结构化数据的复杂任务。通过在模型回复中引入推理链,显著提升了模型从结构化数据中推断信息的能力,从而提升了其在多样化任务中的表现。这种方法不仅拓宽了数据集的覆盖范围,还加深了模型对复杂数据结构进行推理和获取有意义见解的能力。
- 逻辑推理
使用包含选择题,判断题和开放性问题的大量查询,训练模型系统性使用各种推理方法来解决问题。
原文:
To enhance the model’s logical reasoning capabilities, we introduce a diverse set of 70,000 new queries spanning various domains. These queries encompass multiple-choice questions, true / false questions, and open-ended questions. The model is trained to approach problems systematically, employing a range of reasoning methods such as deductive reasoning, inductive generalization, analogical reasoning, causal reasoning, and statistical reasoning. Through iterative refinement, we systematically filter out data containing incorrect answers or flawed reasoning processes. This process progressively strengthens the model’s ability to reason logically and accurately, ensuring robust performance across different types of reasoning tasks.
翻译:
为了增强模型的逻辑推理能力,我们引入了涵盖多个领域的 70,000 条新查询。这些查询包括选择题、判断题和开放性问题。模型在训练时被要求系统性地解决问题,采用多种推理方法,如演绎推理、归纳泛化、类比推理、因果推理和统计推理。通过迭代优化,我们系统性地筛除包含错误答案或推理过程有缺陷的数据。该过程逐步强化了模型的逻辑和准确推理能力,确保其在不同类型推理任务中的稳健表现。
- 跨语言转换
将原本的训练指令翻译成别的语言,同时检查回复的准确性和一致性。
原文:
To facilitate the transfer of the model’s general capabilities across languages, we employ a translation model to convert instructions from high-resource languages into various low-resource languages, thereby generating corresponding response candidates. To ensure the accuracy and consistency of these responses, we evaluate the semantic alignment between each multilingual response and its original counterpart. This process preserves the logical structure and stylistic nuances of the original responses, thereby maintaining their integrity and coherence across different languages.
翻译:
为了促进模型通用能力在多语言间的迁移,我们采用翻译模型将高资源语言的指令转换为多种低资源语言,从而生成相应的回复候选。为确保这些回复的准确性和一致性,我们评估每个多语言回复与其原始回复之间的语义对齐程度。该过程保留了原始回复的逻辑结构和风格细节,从而在不同语言间保持其完整性和连贯性。
- 鲁棒的系统指令
构建了大量的通用系统指令,来训练其鲁棒性
原文:
We construct hundreds of general system prompts to improve the diversity of system prompts in post-training, ensuring consistency between system prompts and conversations. Evaluations with different system prompts show that the model maintains good performance (Lu et al., 2024b) and reduced variance, indicating improved robustness.
翻译:
我们构建了大量通用系统指令,以提升后训练阶段系统指令的多样性,并确保系统指令与对话内容的一致性。通过不同系统指令的评测结果显示,模型能够保持良好的性能并降低方差,表明其鲁棒性得到了提升。
- 回答过滤
使用多种方法来保证回复的高质量
原文:
To evaluate the quality of responses, we employ multiple automatic annotation methods, including a dedicated critic model and a multi-agent collaborative scoring system. Responses are subjected to rigorous assessment, and only those deem flawless by all scoring systems are retained. This comprehensive approach ensures that our outputs maintain the highest quality standards.
翻译:
为了评估回复的质量,我们采用了多种自动化标注方法,包括专用的批判模型和多智能体协作评分系统。所有回复都经过严格评估,只有在所有评分系统中都被认为无瑕疵的回复才会被保留。这种全面的方法确保了输出始终保持最高质量标准。
监督微调部分总结
主要是使用大量精心准备的数据,来保证模型的可靠性。也证明了大模型的最重要的一个点就是数据!
Offline RL
原文:
Compared to Online Reinforcement Learning (RL), Offline RL enables the pre-preparation of training signals, which is particularly advantageous for tasks where standard answers exist but are challenging to evaluate using reward models. In this study, we focus on objective query domains such as mathematics, coding, instruction following, and logical reasoning, where obtaining accurate evaluations can be complex. In the previous phase, we extensively employ strategies like execution feedback and answer matching to ensure the quality of responses. For the current phase, we reuse that pipeline, employing the SFT model to resample responses for a new set of queries. Responses that pass our quality checks are used as positive examples, while those that fail are treated as negative examples for Direct Preference Optimization (DPO) training (Rafailov et al., 2023). To further enhance the reliability and accuracy of the training signals, we make use of both human and automated review processes (Cao et al., 2024). This dual approach ensures that the training data is not only learnable but also aligned with human expectations. Ultimately, we construct a dataset consisting of approximately 150,000 training pairs. The model is then trained for one epoch using the Online Merging Optimizer (Lu et al., 2024a), with a learning rate of 7 × 10−7.
翻译:
与在线强化学习(Online RL)相比,离线强化学习(Offline RL)允许提前准备训练信号,这对于那些存在标准答案但难以通过奖励模型评估的任务尤其有利。在本研究中,我们关注于数学、编程、指令跟随和逻辑推理等客观查询领域,这些领域获得准确评估较为复杂。在前一阶段,我们广泛采用了执行反馈和答案匹配等策略,以确保回复质量。在当前阶段,我们复用该流程,利用 SFT 模型为新一批查询重新采样回复。通过质量检查的回复作为正例,未通过的作为 Direct Preference Optimization(DPO)训练的负例(Rafailov 等, 2023)。为进一步提升训练信号的可靠性和准确性,我们结合了人工和自动化审核流程(Cao 等, 2024)。这种双重方法确保训练数据不仅可学习,还能符合人类期望。最终,我们构建了约 150,000 对训练样本。模型随后使用 Online Merging Optimizer(Lu 等, 2024a)进行一个 epoch 的训练,学习率为 7 × 10⁻⁷。
Online Rl
制定了一套精心定义的标签标准。这些标准确保模型生成的响应不仅高质量,而且符合道德和以用户为中心的标准
原文:
Truthfulness: Responses must be grounded in factual accuracy, faithfully reflecting the provided context and instructions. The model should avoid generating information that is false or unsupported by the given data.
翻译:
真实性: 回答必须以事实准确性为基础,忠实地反映所提供的上下文和说明。该模型应避免生成错误的或给定数据不支持的信息
原文:
Helpfulness: The model’s output should be genuinely useful, addressing the user’s query effectively while providing content that is positive, engaging, educational, and relevant. It should follow the given instructions precisely and offer value to the user.
翻译:
帮助性: 模型的输出应该是真正有用的,有效地解决用户的查询,同时提供积极、引人入胜、具有教育意义和相关的内容。它应该精确地遵循给定的说明并为用户提供价值。
原文:
Conciseness: Responses should be succinct and to the point, avoiding unnecessary verbosity. The goal is to convey information clearly and efficiently without overwhelming the user with excessive detail.
翻译:
简洁:回复应简洁明了,避免不必要的冗长。目标是清晰有效地传达信息,而不会因过多的细节而使用户不知所措。
原文:
Relevance: All parts of the response should be directly related to the user’s query, dialogue history, and the assistant’s context. The model should tailor its output to ensure it is perfectly aligned with the user’s needs and expectations.
翻译:
相关性:回复的所有部分都应与用户的查询、对话历史记录和助理的上下文直接相关。模型应调整其输出,以确保它与用户的需求和期望完全一致。
原文:
Harmlessness: The model must prioritize user safety by avoiding any content that could lead to illegal, immoral, or harmful behavior. It should promote ethical conduct and responsible communication at all times.
翻译:
无害性:该模型必须优先考虑用户安全,避免任何可能导致非法、不道德或有害行为的内容。它应该始终促进道德行为和负责任的沟通。
原文:
Debiasing: The model should produce responses that are free from bias, including but not limited to gender, race, nationality, and politics. It should treat all topics equally and fairly, adhering to widely accepted moral and ethical standards.
翻译:
无偏见性:该模型应产生无偏见的响应,包括但不限于性别、种族、国籍和政治。它应该平等、公平地对待所有主题,遵守广泛接受的道德和伦理标准
长文本微调
为了进一步的扩展Qwen2.5-Turbo的长文本能力,在后训练期间添加了更长的监督微调数据。
现在32678个tokens长度的基础上训练,然后再在微调阶段结合短token和长token继续训练,在增强长上下文性能的同时保持短任务上的能力。
更多推荐



所有评论(0)