deepseek R1基本原理解读与系列论文简介

文章目录

  • 前言
  • 一、deepseek R1发展史
  • 二、deepseek R1简介
    • 1、R1简介
    • 2、R1成功秘诀
    • 3、R1推理模型概念
    • 4、R1自我进化与顿悟时刻特点
    • 5、不同处理方法比较
    • 6、训练流程
    • 7、训练阶段
    • 8、R1的MLA结构
    • 9、R1的MOE结构
    • 10、R1的MTP结构
    • 11、R1的GRPO结构
  • 三、DeepSeek LLM Scaling Open-Source Language Models with Longtermism(2024.1)
    • 1、摘要
    • 2、引言
  • 四、DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligence(2024.6)
    • 1、摘要
    • 2、引言
  • 五、DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model(2024.6)
    • 1、摘要
    • 2、引言
  • 六、DeepSeek-V3 Technical Report(2024.12)
    • 1、摘要
    • 2、引言
  • 七、DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning(2025.1)
    • 1、摘要
    • 2、引言

前言

DeepSeek是一个专注于利用深度学习技术解决复杂问题的平台,旨在通过先进的算法和模型帮助研究人员和开发者探索数据深处的模式。特别值得一提的是DeepSeek R1,这是其推出的首个标志性模型或产品,凭借其卓越的性能和创新性在发布后迅速“出圈”,吸引了大量关注。DeepSeek R1不仅展示了在多个领域的强大应用潜力,如图像识别、自然语言处理等,还因其突破性的进展而获得了广泛的认可,成为人工智能领域的一个重要里程碑。它让用户能够更高效地应用深度学习技术实现创新和突破,进一步推动了该领域的发展。本篇文章简要解读deepseek系列文章。

一、deepseek R1发展史

我整理了一个deepseek的发展历史,请查看如下:

在这里插入图片描述

可以参考更多其它信息链接:https://www.huxiu.com/article/4009260.html

二、deepseek R1简介

1、R1简介

简介如下图所示:
在这里插入图片描述

2、R1成功秘诀

继续说明前人不成功内容,而R1成功,介绍如下:

在这里插入图片描述

3、R1推理模型概念

在这里插入图片描述

4、R1自我进化与顿悟时刻特点

在这里插入图片描述

5、不同处理方法比较

在这里插入图片描述

6、训练流程

在这里插入图片描述

7、训练阶段

在这里插入图片描述

8、R1的MLA结构

在这里插入图片描述
训练:
在这里插入图片描述
推理:

在这里插入图片描述

9、R1的MOE结构

在这里插入图片描述

10、R1的MTP结构

在这里插入图片描述

11、R1的GRPO结构

在这里插入图片描述

三、DeepSeek LLM Scaling Open-Source Language Models with Longtermism(2024.1)

在这里插入图片描述

1、摘要

The rapid development of open-source large language models (LLMs) has been truly remarkable. However, the scaling laws described in previous literature presents varying conclusions, which casts a dark cloud over scaling LLMs. We delve into the study of scaling laws and present our distinctive findings that facilitate the scaling of large scale models in two prevalent used opensource configurations, 7B and 67B. Guided by the scaling laws, we introduce DeepSeek LLM, a project dedicated to advancing open-source language models with a long-term perspective. To support the pre-training phase, we have developed a dataset that currently consists of 2 trillion tokens and is continuously expanding. We further conduct supervised fine-tuning (SFT) and direct preference optimization (DPO) on DeepSeek LLM Base models, resulting in the creation of DeepSeek Chat models. Our evaluation results demonstrate that DeepSeek LLM 67B surpasses LLaMA-2 70B across a range of benchmarks, especially in the domains of code, mathematics, and reasoning. Furthermore, open-ended evaluations reveal that our DeepSeek LLM 67B Chat exhibits superior performance compared to GPT-3.5.

开源大型语言模型(LLMs)的快速发展确实令人瞩目。然而,先前文献中描述的缩放定律提出了不同的结论,这给LLM的扩展蒙上了一层阴影。我们深入研究了这些缩放定律,并提出了独特的发现,以促进两种广泛使用的开源配置——7B和67B——的大规模模型的扩展。在缩放定律的指导下,我们推出了DeepSeek LLM项目,致力于从长远角度推进开源语言模型的发展。为了支持预训练阶段,我们构建了一个目前包含2万亿个令牌的数据集,并且该数据集正在持续扩展。我们进一步对DeepSeek LLM基础模型进行了监督微调(SFT)和直接偏好优化(DPO),从而开发出了DeepSeek Chat模型。我们的评估结果显示,DeepSeek LLM 67B在一系列基准测试中超越了LLaMA-2 70B,特别是在代码、数学和推理领域。此外,开放式评估表明,我们的DeepSeek LLM 67B Chat表现出比GPT-3.5更优的性能。

2、引言

Over the past few years, Large Language Models (LLMs) based on decoder-only Transformers (Vaswani et al., 2017) have increasingly become the cornerstone and pathway to achieving Artificial General Intelligence (AGI). By predicting the next word in continuous text, LLMs undergo self-supervised pre-training on massive datasets, enabling them to achieve various purposes and possess many abilities, such as novel creation, text summarization, code completion, and more. Subsequent developments like supervised fine-tuning and reward modeling have enabled Large Language Models (LLMs) to better follow user intentions and instructions. This has endowed
them with more versatile conversational capabilities and rapidly expanded their influence.
近年来,基于仅解码器Transformer(Vaswani等人,2017)的大型语言模型(LLMs)逐渐成为实现通用人工智能(AGI)的基石和途径。通过预测连续文本中的下一个词,LLMs在大规模数据集上进行自我监督预训练,使它们能够达成各种目的并拥有许多能力,如创作小说、文本摘要、代码补全等。后续的发展,例如监督微调和奖励模型,让LLMs更好地遵循用户意图和指令,赋予了它们更加多样化的对话能力,并迅速扩展了它们的影响范围。

This wave is sparked with closed products, such as ChatGPT (OpenAI, 2022), Claude (Anthropic, 2023), and Bard (Google, 2023), which are developed with extensive computational resources and substantial annotation costs. These products have significantly raised the community’s expectations for the capabilities of open-source LLMs, consequently inspiring a series of work (Bai et al., 2023; Du et al., 2022; Jiang et al., 2023; Touvron et al., 2023a,b; Yang et al., 2023). Among these, the LLaMA series models (Touvron et al., 2023a,b) stand out. It consolidates a range of works to create an efficient and stable architecture, building well-performing models ranging from 7B to 70B parameters. Consequently, the LLaMA series has become the de facto benchmark for architecture and performance among open-source models.
这一浪潮由诸如ChatGPT(OpenAI, 2022)、Claude(Anthropic, 2023)和Bard(Google, 2023)这样的闭源产品所引发,这些产品利用了大量的计算资源和显著的标注成本开发而成。这些产品大幅提升了社区对开源LLM能力的期望,从而激发了一系列工作(Bai等人,2023;Du等人,2022;Jiang等人,2023;Touvron等人,2023a,b;Yang等人,2023)。其中,LLaMA系列模型(Touvron等人,2023a,b)脱颖而出,它整合了一系列工作创建了一个高效稳定的架构,构建了从7B到70B参数不等的高性能模型。因此,LLaMA系列成为了开源模型中实际上的架构和性能基准。

Following LLaMA, the open-source community has primarily focused on training fixed-size (7B, 13B, 34B, and 70B), high-quality models, often neglecting research exploration into LLM scaling laws (Hoffmann et al., 2022; Kaplan et al., 2020). Nonetheless, research on scaling laws is of utmost importance, considering that the current open-source models are merely at the initial stage of Artificial General Intelligence (AGI) development. In addition, early works (Hoffmann et al., 2022; Kaplan et al., 2020) reached varying conclusions on the scaling of model and data with increased compute budgets and inadequately addressed hyperparameter discussions. In this paper, we extensively investigate the scaling behavior of language models and apply our findings in two widely used large-scale model configurations, namely 7B and 67B. Our study aims to lay the groundwork for future scaling of open-source LLMs, paving the way for further advancements in this domain. Specifically, we first examined the scaling laws of batch size and learning rate, and found their trends with model size. Building on this, we conducted a comprehensive study of the scaling laws of the data and model scale, successfully revealing the optimal model/data scaling-up allocation strategy and predicting the expected performance of our large-scale models. Additionally, during development, we discovered that the scaling laws derived from different datasets show significant differences. This suggests that choice of dataset remarkably affects the scaling behavior, indicating that caution should be exercised
when generalizing scaling laws across datasets.
在LLaMA之后,开源社区主要集中在训练固定规模(7B, 13B, 34B和70B)、高质量的模型上,往往忽视了对LLM缩放定律的研究探索(Hoffmann等人,2022;Kaplan等人,2020)。然而,考虑到当前开源模型仍处于AGI发展的初期阶段,缩放定律的研究至关重要。此外,早期的工作(Hoffmann等人,2022;Kaplan等人,2020)对于随着计算预算增加的模型和数据缩放得出了不同的结论,并且对超参数讨论不足。本文深入探讨了语言模型的缩放行为,并将我们的发现应用于两种广泛使用的大型模型配置,即7B和67B。我们的研究旨在为未来开源LLM的扩展奠定基础,进一步推动该领域的发展。具体而言,我们首先检查了批量大小和学习率的缩放规律,并发现了它们随模型大小变化的趋势。在此基础上,我们对数据和模型规模的缩放规律进行了全面研究,成功揭示了最优的模型/数据扩展分配策略,并预测了我们大规模模型的预期表现。此外,在开发过程中,我们发现不同数据集衍生的缩放定律显示出显著差异,这表明数据集的选择极大地影响了缩放行为,提示在跨数据集泛化缩放定律时应谨慎行事。

Under the guidance of our scaling laws, we build from scratch open-source large language models, and release as much information as possible for community reference. We collect 2 trillion tokens for pre-training, primarily in Chinese and English. At the model level, we
generally followed the architecture of LLaMA, but replaced the cosine learning rate scheduler with a multi-step learning rate scheduler, maintaining performance while facilitating continual training. We collected over 1 million instances for supervised fine-tuning (SFT) (Ouyang et al., 2022) from diverse sources. This paper shares our experiences with different SFT strategies and findings in data ablation techniques. Additionally, we have utilized direct preference optimization (DPO) (Rafailov et al., 2023) to improve the conversational performance of the model.
根据我们的缩放定律指导,我们从头开始构建开源大型语言模型,并尽可能多地发布信息供社区参考。我们收集了2万亿个令牌用于预训练,主要涵盖中文和英文。在模型层面,我们总体上遵循了LLaMA的架构,但用多步学习率调度器替换了余弦学习率调度器,在保持性能的同时便于持续训练。我们从多个来源收集了超过100万条实例用于监督微调(SFT)(Ouyang等人,2022)。本文分享了我们在不同SFT策略上的经验以及在数据消融技术方面的发现。此外,我们还利用直接偏好优化(DPO)(Rafailov等人,2023)来提升模型的对话表现。

We conduct extensive evaluations using our base and chat models. The evaluation results demonstrate that DeepSeek LLM surpasses LLaMA-2 70B across various benchmarks, particularly in the fields of code, mathematics, and reasoning. Following SFT and DPO, the DeepSeek 67B chat model outperforms GPT-3.5 in both Chinese and English open-ended evaluations. This highlights the superior performance of DeepSeek 67B in generating high-quality responses and engaging in meaningful conversations in both languages. Furthermore, the safety evaluation indicates that DeepSeek 67B Chat can provide harmless responses in practice.
我们使用基础模型和聊天模型进行了广泛的评估。评估结果显示DeepSeek LLM在多个基准测试中超越了LLaMA-2 70B,特别是在代码、数学和推理领域。经过SFT和DPO后,DeepSeek 67B聊天模型在中文和英文开放评估中均超过了GPT-3.5,这突显了DeepSeek 67B在生成高质量响应和进行有意义对话方面的能力。此外,安全性评估显示DeepSeek 67B Chat在实践中能够提供无害的回应。

In the rest of this paper, we first introduce our pre-training basic concepts of DeepSeek LLM in Section 2, including the composition of data, model architecture, infrastructure, and hyperparameters. In Section 3, we provide a detailed explanation of the scaling laws we have discovered and its implications. Additionally, we discuss the rationale behind our selection of pre-training hyperparameters, taking into account the insights gained from the scaling laws analysis. In Section 4, we discuss our fine-tuning methodology, encompassing the composition of fine-tuning data and specific methods during the SFT and DPO stages. We then present the detailed evaluation results of DeepSeek LLM in Section 5, covering both the base and chat models, as well as their performance in open-ended evaluations and safety evaluations. Finally, we discuss the current limitations and future directions of DeepSeek LLM in Section 6.
本文其余部分首先在第2节介绍DeepSeek LLM的预训练基本概念,包括数据组成、模型架构、基础设施和超参数。在第3节中,我们详细解释了我们发现的缩放定律及其含义,并讨论了基于缩放定律分析所得见解选择预训练超参数的依据。第4节讨论了我们的微调方法论,涵盖了微调数据的组成及SFT和DPO阶段的具体方法。然后,在第5节中我们展示了DeepSeek LLM详细的评估结果,包括基础模型和聊天模型的表现,以及在开放评估和安全评估中的表现。最后,在第6节中,我们讨论了DeepSeek LLM目前的局限性和未来方向。

四、DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligence(2024.6)

在这里插入图片描述

1、摘要

We present DeepSeek-Coder-V2, an open-source Mixture-of-Experts (MoE) code language model that achieves performance comparable to GPT4-Turbo in code-specific tasks. Specifically, DeepSeek-Coder-V2 is further pre-trained from an intermediate checkpoint of DeepSeek-V2 with additional 6 trillion tokens. Through this continued pre-training, DeepSeek-Coder-V2 substantially enhances the coding and mathematical reasoning capabilities of DeepSeek-V2, while maintaining comparable performance in general langua

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/20145.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

数据分析--数据清洗

一、数据清洗的重要性:数据质量决定分析成败 1.1 真实案例警示 电商平台事故:2019年某电商大促期间,因价格数据未清洗导致错误标价,产生3000万元损失医疗数据分析:未清洗的异常血压值(如300mmHg&#xff…

【进阶】微服务

微服务架构 服务架构演变过程 单体应用架构 所有的功能都在一个项目中(现在使用的就是单体架构) 集群架构 把一个单体项目部署多个,使用Nginx进行负载均衡,根据负载均衡策略调用后端服务 不好的地方:有的服务访问…

浏览器开发者工具(F12)查看请求的响应体内容显示”无法加载响应数据: No resource with given identifier found“

背景 复习在 SSM(Spring Spring MVC MyBatis)框架中,点击登录请求后返回 JSON 格式的数据,出现只有登录失败的请求才有响应值,比如: {success: false, message: “没有此用户”, code: 400} 而成功的请求…

Mybatisplus自定义sql

文章目录 引言流程 引言 mybatisplus最擅长的将where里面的语句给简便化,而不用我们自己写标签来实现条件查询 但是很多公司规范我们将sql写在mapper层中,不能写在service中 而且一些语句查询的不同select count(*) xxx from xxx 也难以用mp来实现 如何…

级联选择器多选动态加载

一.级联展示 注:因为级联选择器这里是动态加载,因此如果上来选中一级就需要加载出后面三级的全部数据,依然会很卡,因此,和产品协商把一二级多选框去掉了,这样也避免了你选择一级不能实现子级被全部选中的问…

MySQL-事务隔离级别

事务有四大特性(ACID):原子性,一致性,隔离性和持久性。隔离性一般在事务并发的时候需要保证事务的隔离性,事务并发会出现很多问题,包括脏写,脏读,不可重复读,…

【带你 langchain 双排系列教程】2. langchain 提示词工程应用实践

一、简介 提示词工程在利用 LangChain 与大型语言模型交互中起着关键作用,通过精心设计提示词,可以引导模型生成更准确、更符合预期的输出,从而提升应用的效果和用户体验。 二、基本提示词调用 可以使用 LangChain 提供的 PromptTemplate 来…

git删除本地分支

一、命令方式 1、查看本地分支 git branch 2、切换到一个不删除的分支 git checkout branch_name 3、强制删除分支 git branch -D local_branch_name 二、工具方式 1、选择"Browse references",右键"Delete branch"

[Computer Vision]实验四:相机标定

目录 一、实验内容 二、实验过程及结果 2.1 实验代码 2.2 实验结果及分析 一、实验内容 了解针孔照相机的相关知识,实现相机标定。(可使用提供的棋盘格或自行打印) 可视化棋盘格关键点、匹配点数(可加ransac)输出…

C++笔记之标准库中用于处理迭代器的`std::advance`和`std::distance`

C++笔记之标准库中用于处理迭代器的std::advance和std::distance code review! 文章目录 C++笔记之标准库中用于处理迭代器的`std::advance`和`std::distance`一.`std::advance`函数原型参数说明使用场景示例代码示例 1:移动 `std::vector` 的随机访问迭代器示例 2:移动 `st…

【C++】36.C++IO流

文章目录 1. C语言的输入与输出2. 流是什么3. CIO流3.1 C标准IO流3.2 C文件IO流 4. stringstream的简单介绍 1. C语言的输入与输出 C语言中我们用到的最频繁的输入输出方式就是scanf ()与printf()。 scanf(): 从标准输入设备(键盘)读取数据,并将值存放在变量中。pri…

【抽象代数】1.2. 半群与群

群的定义 群非空集合二元运算性质 定义1. 设 为一个非空集合,上有二元运算,满足结合律,则称或为一个半群。 定义2. 设 为半群,若元素 满足 ,则称 为 的左幺元(右幺元:)&#…

基于ollama+deepseek R1 1.5B本地部署语音交互助手(原创、附代码)

目录 现有的一些功能记录一些过程中遇到的问题安装llama_cpp 1、安装ollama和部署deepseek R12、使用本地部署的deepseek R1模型3、语音识别4、代码实现运行演示 现有的一些功能 1、正常与人沟通,但受限于电脑性能,还存在一定延迟; 2、可以根…

惠普HP Color LaserJet CP1215彩色激光打印机套色不准及套色错位的解决方法

一台惠普HP Color LaserJet CP1215彩色激光打印机出现故障,转印带断裂,于是更换了转印地,当更换完成测试的时候发现这台惠普HP Color LaserJet CP1215彩色激光打印机打印的颜色比较淡且颜色有错位的问题,继续检查机器之后&#xf…

开放签电子签章工具版 2.0 正式发布,构建全场景电子签约能力、满足复杂的签章管理场景

根据近半年开源用户和市场需求反馈,开放签团队推出电子签章工具版2.0版本,主要解决复杂的签约流程集成和电子印章授权管理场景。以API接口对外提供服务和配置一套可视化后台管理系统,可与业务系统无缝集成,用户使用起来毫无“违和…

docker 安装 Rabbitmq 详解

在平常的开发工作中,我们经常会使用到 rabbitmq,rabbitmq 主要可以进行应用解耦、异步通信、流量削峰、负载均衡、消息持久化、死信队列等。比如商城系统,下单后,通过消息队列通知库存系统、积分系统、物流系统等。发送短信时通过…

零基础学yolo系列

1.目标检测算法分类 基于深度学习的主流目标检测算法根据有无候选框生成阶段,分为双阶段目标检 测算法和单阶段目标检测算法两类 双阶段检测模型 将检测问题划分为两个阶段,首先产生候选区域,然后对候选区域分类并对目标位置进行精修&#x…

本智慧监考系统

本智慧监考系统共分为4个部分,分别为:展示层、业务层、算法层和数据库。 本系统的展示层基于Vue.js框架和Ant Design Vue UI框架编写。用户通过浏览器访问前端界面来实现与系统的交互。 业务层是基于SpringBoot框架编写的Java后台服务器。该层负责本系…

从开发到部署:EasyRTC嵌入式视频通话SDK如何简化实时音视频通信的集成与应用

嵌入式设备和视频综合管理平台均支持B/S架构。在B/S架构下,传统的视频观看方式依赖于微软的OCX控件,然而OCX控件的使用正面临越来越多的挑战: 首先,用户需要安装浏览器插件、调整浏览器安全级别,并允许ActiveX控件弹出…

如何查看 Linux 服务器的 MAC 地址:深入解析与实践指南

💝💝💝欢迎来到我的博客,很高兴能够在这里和您见面!希望您在这里可以感受到一份轻松愉快的氛围,不仅可以获得有趣的内容和知识,也可以畅所欲言、分享您的想法和见解。 推荐:kwan 的首页,持续学…