From 7ca5e1e7f75e12a1c561fffaa6aa686708f881ae Mon Sep 17 00:00:00 2001 From: stack-heap-overflow Date: Sat, 1 Feb 2025 13:31:39 +0800 Subject: [PATCH 01/11] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index c6ea85a..d9d4ccf 100644 --- a/README.md +++ b/README.md @@ -207,6 +207,9 @@ python3 -m sglang.launch_server --model deepseek-ai/DeepSeek-R1-Distill-Qwen-32B 3. For mathematical problems, it is advisable to include a directive in your prompt such as: "Please reason step by step, and put your final answer within \boxed{}." 4. When evaluating model performance, it is recommended to conduct multiple tests and average the results. +Additionally, we have observed that the DeepSeek-R1 series models tend to bypass thinking pattern (i.e., outputting "\\n\n\") when responding to certain queries, which can adversely affect the model's performance. +**To ensure that the model engages in thorough reasoning, we recommend enforcing the model to initiate its response with "\\n" at the beginning of every output.** + ## 7. License This code repository and the model weights are licensed under the [MIT License](https://github.com/deepseek-ai/DeepSeek-R1/blob/main/LICENSE). DeepSeek-R1 series support commercial use, allow for any modifications and derivative works, including, but not limited to, distillation for training other LLMs. Please note that: From 88b7fb8486a8cc4e2f27151788d274bd2dc5f8b1 Mon Sep 17 00:00:00 2001 From: Konano Date: Sat, 8 Feb 2025 14:14:15 +0800 Subject: [PATCH 02/11] chore: add stale issue management configuration --- .github/stale.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..9032daa --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,18 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 30 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 14 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - security +# Label to use when marking an issue as stale +staleLabel: stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. If you + believe this issue is still relevant, please leave a comment to keep it open. + Thank you for your contributions! +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false From b58f392d3d2a3930377652dd762b1556052cd2b1 Mon Sep 17 00:00:00 2001 From: Konano Date: Sat, 8 Feb 2025 14:32:20 +0800 Subject: [PATCH 03/11] chore: replace stale conf with Actions --- .github/stale.yml | 18 ------------------ .github/workflows/stale.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 18 deletions(-) delete mode 100644 .github/stale.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 9032daa..0000000 --- a/.github/stale.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 30 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 14 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - security -# Label to use when marking an issue as stale -staleLabel: stale -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. If you - believe this issue is still relevant, please leave a comment to keep it open. - Thank you for your contributions! -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..a7caa2b --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,28 @@ +name: "Mark and close stale issues" +on: + schedule: + - cron: "0 0 * * *" + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - name: "Mark and close stale issues" + uses: actions/stale@v9 + with: + days-before-issue-stale: 30 + days-before-issue-close: 14 + stale-issue-label: "stale" + close-issue-label: "closed-as-stale" + exempt-issue-labels: | + pinned + security + stale-issue-message: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. If you + believe this issue is still relevant, please leave a comment to keep it open. + Thank you for your contributions! + close-issue-message: false + days-before-pr-stale: -1 + days-before-pr-close: -1 + repo-token: ${{ secrets.GITHUB_TOKEN }} From bbf12c6e1151148d55624ea2b0ca151dfe07404b Mon Sep 17 00:00:00 2001 From: Nano Date: Sat, 8 Feb 2025 14:46:34 +0800 Subject: [PATCH 04/11] Apply suggestions from code review Co-authored-by: Shigma --- .github/workflows/stale.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index a7caa2b..c048685 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,10 +1,12 @@ name: "Mark and close stale issues" on: + workflow_dispatch: schedule: - cron: "0 0 * * *" jobs: stale: + if: ${{ github.repository == 'deepseek-ai/DeepSeek-R1' }} runs-on: ubuntu-latest steps: - name: "Mark and close stale issues" From f40029063a57c47670d261320b3b900a75c4f549 Mon Sep 17 00:00:00 2001 From: Konano Date: Sat, 8 Feb 2025 18:24:54 +0800 Subject: [PATCH 05/11] chore: update README.md to improve layout and image attributes --- README.md | 58 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index d9d4ccf..af6c7d0 100644 --- a/README.md +++ b/README.md @@ -4,37 +4,51 @@
- DeepSeek-V3 + DeepSeek-R1

- - Homepage - - - Chat - - - Hugging Face - + Homepage + Chat + Hugging Face
- - Discord - - - Wechat - - - Twitter Follow - + Discord + WeChat + Twitter Follow
- - License - + License
From 2cb7de612740c545d2768189be03bf84cf0e9fb7 Mon Sep 17 00:00:00 2001 From: DeepSeekPH <152240452+DeepSeekPH@users.noreply.github.com> Date: Fri, 14 Feb 2025 11:13:49 +0800 Subject: [PATCH 06/11] Add fileupload and websearch prompt --- README.md | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d9d4ccf..f77b310 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@

Paper Link👁️

- + ## 1. Introduction @@ -210,6 +210,62 @@ python3 -m sglang.launch_server --model deepseek-ai/DeepSeek-R1-Distill-Qwen-32B Additionally, we have observed that the DeepSeek-R1 series models tend to bypass thinking pattern (i.e., outputting "\\n\n\") when responding to certain queries, which can adversely affect the model's performance. **To ensure that the model engages in thorough reasoning, we recommend enforcing the model to initiate its response with "\\n" at the beginning of every output.** +### Official Prompts +For file upload, please follow the template to create prompts, where {file_name}, {file_content} and {question} are arguments. +``` +file_template = \ +"""[file name]: {file_name} +[file content begin] +{file_content} +[file content end] +{question}""" +``` + +For Web Search, {search_results}, {cur_data}, and {question} are arguments. + +For Chinese query, we use the prompt: +``` +search_answer_zh_template = \ +'''# 以下内容是基于用户发送的消息的搜索结果: +{search_results} +在我给你的搜索结果中,每个结果都是[webpage X begin]...[webpage X end]格式的,X代表每篇文章的数字索引。请在适当的情况下在句子末尾引用上下文。请按照引用编号[citation:X]的格式在答案中对应部分引用上下文。如果一句话源自多个上下文,请列出所有相关的引用编号,例如[citation:3][citation:5],切记不要将引用集中在最后返回引用编号,而是在答案对应部分列出。 +在回答时,请注意以下几点: +- 今天是{cur_date}。 +- 并非搜索结果的所有内容都与用户的问题密切相关,你需要结合问题,对搜索结果进行甄别、筛选。 +- 对于列举类的问题(如列举所有航班信息),尽量将答案控制在10个要点以内,并告诉用户可以查看搜索来源、获得完整信息。优先提供信息完整、最相关的列举项;如非必要,不要主动告诉用户搜索结果未提供的内容。 +- 对于创作类的问题(如写论文),请务必在正文的段落中引用对应的参考编号,例如[citation:3][citation:5],不能只在文章末尾引用。你需要解读并概括用户的题目要求,选择合适的格式,充分利用搜索结果并抽取重要信息,生成符合用户要求、极具思想深度、富有创造力与专业性的答案。你的创作篇幅需要尽可能延长,对于每一个要点的论述要推测用户的意图,给出尽可能多角度的回答要点,且务必信息量大、论述详尽。 +- 如果回答很长,请尽量结构化、分段落总结。如果需要分点作答,尽量控制在5个点以内,并合并相关的内容。 +- 对于客观类的问答,如果问题的答案非常简短,可以适当补充一到两句相关信息,以丰富内容。 +- 你需要根据用户要求和回答内容选择合适、美观的回答格式,确保可读性强。 +- 你的回答应该综合多个相关网页来回答,不能重复引用一个网页。 +- 除非用户要求,否则你回答的语言需要和用户提问的语言保持一致。 + +# 用户消息为: +{question}''' +``` + + +For English query, we use the prompt: +``` +search_answer_en_template = \ +'''# The following contents are the search results related to the user's message: +{search_results} +In the search results I provide to you, each result is formatted as [webpage X begin]...[webpage X end], where X represents the numerical index of each article. Please cite the context at the end of the relevant sentence when appropriate. Use the citation format [citation:X] in the corresponding part of your answer. If a sentence is derived from multiple contexts, list all relevant citation numbers, such as [citation:3][citation:5]. Be sure not to cluster all citations at the end; instead, include them in the corresponding parts of the answer. +When responding, please keep the following points in mind: +- Today is {cur_date}. +- Not all content in the search results is closely related to the user's question. You need to evaluate and filter the search results based on the question. +- For listing-type questions (e.g., listing all flight information), try to limit the answer to 10 key points and inform the user that they can refer to the search sources for complete information. Prioritize providing the most complete and relevant items in the list. Avoid mentioning content not provided in the search results unless necessary. +- For creative tasks (e.g., writing an essay), ensure that references are cited within the body of the text, such as [citation:3][citation:5], rather than only at the end of the text. You need to interpret and summarize the user's requirements, choose an appropriate format, fully utilize the search results, extract key information, and generate an answer that is insightful, creative, and professional. Extend the length of your response as much as possible, addressing each point in detail and from multiple perspectives, ensuring the content is rich and thorough. +- If the response is lengthy, structure it well and summarize it in paragraphs. If a point-by-point format is needed, try to limit it to 5 points and merge related content. +- For objective Q&A, if the answer is very brief, you may add one or two related sentences to enrich the content. +- Choose an appropriate and visually appealing format for your response based on the user's requirements and the content of the answer, ensuring strong readability. +- Your answer should synthesize information from multiple relevant webpages and avoid repeatedly citing the same webpage. +- Unless the user requests otherwise, your response should be in the same language as the user's question. + +# The user's message is: +{question}''' +``` + ## 7. License This code repository and the model weights are licensed under the [MIT License](https://github.com/deepseek-ai/DeepSeek-R1/blob/main/LICENSE). DeepSeek-R1 series support commercial use, allow for any modifications and derivative works, including, but not limited to, distillation for training other LLMs. Please note that: From 9fe93026eb92067787b0d739ec35701c29abeb5d Mon Sep 17 00:00:00 2001 From: DeepSeekPH <152240452+DeepSeekPH@users.noreply.github.com> Date: Fri, 14 Feb 2025 11:19:00 +0800 Subject: [PATCH 07/11] add official temperature --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f77b310..aae7e29 100644 --- a/README.md +++ b/README.md @@ -211,6 +211,8 @@ Additionally, we have observed that the DeepSeek-R1 series models tend to bypass **To ensure that the model engages in thorough reasoning, we recommend enforcing the model to initiate its response with "\\n" at the beginning of every output.** ### Official Prompts +In the official DeepSeek web/app, we don't use system prompts but design two specific prompts for file upload and web search for better user experience. In addition, the temperature in web/app is 0.6. + For file upload, please follow the template to create prompts, where {file_name}, {file_content} and {question} are arguments. ``` file_template = \ From a92eec0ffb071288687c8969ac2130ce5f8eb971 Mon Sep 17 00:00:00 2001 From: Konano Date: Fri, 14 Feb 2025 12:14:10 +0800 Subject: [PATCH 08/11] chore: update README.md to improve layout and image attributes --- README.md | 65 +++++++++++++++---------------------------------------- 1 file changed, 18 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index af6c7d0..f45ec13 100644 --- a/README.md +++ b/README.md @@ -8,54 +8,25 @@
- Homepage - Chat - Hugging Face -
- -
- Discord - WeChat - Twitter Follow -
- -
- License -
- - -

+ Homepage + Chat + Hugging Face +
+ Discord + WeChat + Twitter Follow +
+ License +
Paper Link👁️ -

- + ## 1. Introduction From 14a53eccedb96d296eb0d230900d5d5725a7bfc2 Mon Sep 17 00:00:00 2001 From: User670 <22617255+User670@users.noreply.github.com> Date: Tue, 18 Feb 2025 16:24:16 +0800 Subject: [PATCH 09/11] fix typo in readme cur_data -> cur_date --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aae7e29..14edbc9 100644 --- a/README.md +++ b/README.md @@ -223,7 +223,7 @@ file_template = \ {question}""" ``` -For Web Search, {search_results}, {cur_data}, and {question} are arguments. +For Web Search, {search_results}, {cur_date}, and {question} are arguments. For Chinese query, we use the prompt: ``` From 3f906d9724e3825c41891a03d5138edf14af20f0 Mon Sep 17 00:00:00 2001 From: Nano Date: Tue, 18 Feb 2025 22:12:05 +0800 Subject: [PATCH 10/11] add CITATION.cff --- CITATION.cff | 217 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 CITATION.cff diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..cb6b320 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,217 @@ +cff-version: 1.2.0 +message: "If you use this work, please cite it using the following metadata." +title: "DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning" +authors: + - name: "DeepSeek-AI" + - name: "Daya Guo" + - name: "Dejian Yang" + - name: "Haowei Zhang" + - name: "Junxiao Song" + - name: "Ruoyu Zhang" + - name: "Runxin Xu" + - name: "Qihao Zhu" + - name: "Shirong Ma" + - name: "Peiyi Wang" + - name: "Xiao Bi" + - name: "Xiaokang Zhang" + - name: "Xingkai Yu" + - name: "Yu Wu" + - name: "Z.F. Wu" + - name: "Zhibin Gou" + - name: "Zhihong Shao" + - name: "Zhuoshu Li" + - name: "Ziyi Gao" + - name: "Aixin Liu" + - name: "Bing Xue" + - name: "Bingxuan Wang" + - name: "Bochao Wu" + - name: "Bei Feng" + - name: "Chengda Lu" + - name: "Chenggang Zhao" + - name: "Chengqi Deng" + - name: "Chenyu Zhang" + - name: "Chong Ruan" + - name: "Damai Dai" + - name: "Deli Chen" + - name: "Dongjie Ji" + - name: "Erhang Li" + - name: "Fangyun Lin" + - name: "Fucong Dai" + - name: "Fuli Luo" + - name: "Guangbo Hao" + - name: "Guanting Chen" + - name: "Guowei Li" + - name: "H. Zhang" + - name: "Han Bao" + - name: "Hanwei Xu" + - name: "Haocheng Wang" + - name: "Honghui Ding" + - name: "Huajian Xin" + - name: "Huazuo Gao" + - name: "Hui Qu" + - name: "Hui Li" + - name: "Jianzhong Guo" + - name: "Jiashi Li" + - name: "Jiawei Wang" + - name: "Jingchang Chen" + - name: "Jingyang Yuan" + - name: "Junjie Qiu" + - name: "Junlong Li" + - name: "J.L. Cai" + - name: "Jiaqi Ni" + - name: "Jian Liang" + - name: "Jin Chen" + - name: "Kai Dong" + - name: "Kai Hu" + - name: "Kaige Gao" + - name: "Kang Guan" + - name: "Kexin Huang" + - name: "Kuai Yu" + - name: "Lean Wang" + - name: "Lecong Zhang" + - name: "Liang Zhao" + - name: "Litong Wang" + - name: "Liyue Zhang" + - name: "Lei Xu" + - name: "Leyi Xia" + - name: "Mingchuan Zhang" + - name: "Minghua Zhang" + - name: "Minghui Tang" + - name: "Meng Li" + - name: "Miaojun Wang" + - name: "Mingming Li" + - name: "Ning Tian" + - name: "Panpan Huang" + - name: "Peng Zhang" + - name: "Qiancheng Wang" + - name: "Qinyu Chen" + - name: "Qiushi Du" + - name: "Ruiqi Ge" + - name: "Ruisong Zhang" + - name: "Ruizhe Pan" + - name: "Runji Wang" + - name: "R.J. Chen" + - name: "R.L. Jin" + - name: "Ruyi Chen" + - name: "Shanghao Lu" + - name: "Shangyan Zhou" + - name: "Shanhuang Chen" + - name: "Shengfeng Ye" + - name: "Shiyu Wang" + - name: "Shuiping Yu" + - name: "Shunfeng Zhou" + - name: "Shuting Pan" + - name: "S.S. Li " + - name: "Shuang Zhou" + - name: "Shaoqing Wu" + - name: "Shengfeng Ye" + - name: "Tao Yun" + - name: "Tian Pei" + - name: "Tianyu Sun" + - name: "T. Wang" + - name: "Wangding Zeng" + - name: "Wanjia Zhao" + - name: "Wen Liu" + - name: "Wenfeng Liang" + - name: "Wenjun Gao" + - name: "Wenqin Yu" + - name: "Wentao Zhang" + - name: "W.L. Xiao" + - name: "Wei An" + - name: "Xiaodong Liu" + - name: "Xiaohan Wang" + - name: "Xiaokang Chen" + - name: "Xiaotao Nie" + - name: "Xin Cheng" + - name: "Xin Liu" + - name: "Xin Xie" + - name: "Xingchao Liu" + - name: "Xinyu Yang" + - name: "Xinyuan Li" + - name: "Xuecheng Su" + - name: "Xuheng Lin" + - name: "X.Q. Li" + - name: "Xiangyue Jin" + - name: "Xiaojin Shen" + - name: "Xiaosha Chen" + - name: "Xiaowen Sun" + - name: "Xiaoxiang Wang" + - name: "Xinnan Song" + - name: "Xinyi Zhou" + - name: "Xianzu Wang" + - name: "Xinxia Shan" + - name: "Y.K. Li" + - name: "Y.Q. Wang" + - name: "Y.X. Wei" + - name: "Yang Zhang" + - name: "Yanhong Xu" + - name: "Yao Li" + - name: "Yao Zhao" + - name: "Yaofeng Sun" + - name: "Yaohui Wang" + - name: "Yi Yu" + - name: "Yichao Zhang" + - name: "Yifan Shi" + - name: "Yiliang Xiong" + - name: "Ying He" + - name: "Yishi Piao" + - name: "Yisong Wang" + - name: "Yixuan Tan" + - name: "Yiyang Ma" + - name: "Yiyuan Liu" + - name: "Yongqiang Guo" + - name: "Yuan Ou" + - name: "Yuduan Wang" + - name: "Yue Gong" + - name: "Yuheng Zou" + - name: "Yujia He" + - name: "Yunfan Xiong" + - name: "Yuxiang Luo" + - name: "Yuxiang You" + - name: "Yuxuan Liu" + - name: "Yuyang Zhou" + - name: "Y.X. Zhu" + - name: "Yanhong Xu" + - name: "Yanping Huang" + - name: "Yaohui Li" + - name: "Yi Zheng" + - name: "Yuchen Zhu" + - name: "Yunxian Ma" + - name: "Ying Tang" + - name: "Yukun Zha" + - name: "Yuting Yan" + - name: "Z.Z. Ren" + - name: "Zehui Ren" + - name: "Zhangli Sha" + - name: "Zhe Fu" + - name: "Zhean Xu" + - name: "Zhenda Xie" + - name: "Zhengyan Zhang" + - name: "Zhewen Hao" + - name: "Zhicheng Ma" + - name: "Zhigang Yan" + - name: "Zhiyu Wu" + - name: "Zihui Gu" + - name: "Zijia Zhu" + - name: "Zijun Liu" + - name: "Zilin Li" + - name: "Ziwei Xie" + - name: "Ziyang Song" + - name: "Zizheng Pan" + - name: "Zhen Huang" + - name: "Zhipeng Xu" + - name: "Zhongyu Zhang" + - name: "Zhen Zhang" +year: 2025 +identifiers: + - type: doi + value: 10.48550/arXiv.2501.12948 + - type: arXiv + value: 2501.12948 +url: "https://arxiv.org/abs/2501.12948" +categories: + - "cs.CL" +repository-code: "https://github.com/deepseek-ai/DeepSeek-R1" +license: "MIT" +abstract: > + We introduce our first-generation reasoning models, DeepSeek-R1-Zero and DeepSeek-R1. DeepSeek-R1-Zero, a model trained via large-scale reinforcement learning (RL) without supervised fine-tuning (SFT) as a preliminary step, demonstrates remarkable reasoning capabilities. Through RL, DeepSeek-R1-Zero naturally emerges with numerous powerful and intriguing reasoning behaviors. However, it encounters challenges such as poor readability, and language mixing. To address these issues and further enhance reasoning performance, we introduce DeepSeek-R1, which incorporates multi-stage training and cold-start data before RL. DeepSeek-R1 achieves performance comparable to OpenAI-o1-1217 on reasoning tasks. To support the research community, we open-source DeepSeek-R1-Zero, DeepSeek-R1, and six dense models (1.5B, 7B, 8B, 14B, 32B, 70B) distilled from DeepSeek-R1 based on Qwen and Llama. From abb3ab9f2e2d4456701a1a52d0ffc20f2ebb84b5 Mon Sep 17 00:00:00 2001 From: Nano Date: Tue, 18 Feb 2025 22:18:40 +0800 Subject: [PATCH 11/11] remove a empty line in citation --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index b91f75d..832eb0b 100644 --- a/README.md +++ b/README.md @@ -271,7 +271,6 @@ DeepSeek-R1 series support commercial use, allow for any modifications and deriv primaryClass={cs.CL}, url={https://arxiv.org/abs/2501.12948}, } - ``` ## 9. Contact