DeepSeek R1已经到了,它不仅是另一个AI模型,而且是AI功能的重大飞跃,接受了先前发布的DeepSeek-V3基本变体的训练。随着DeepSeek R1的全面发行,它在性能和灵活性方面与Openai O1保持一致。使它更加引人注目的是它的开放权重和麻省理工学院的许可,使其在商业上可行,并将其定位为开发人员和企业的强大选择。
>
但真正使DeepSeek R1与众不同的是它如何挑战Openai这样的行业巨头,从而获得了一小部分资源,取得了非凡的成果。在短短的两个月内,DeepSeek做了似乎不可能的事情 - 启动了一种在严格的限制下运行的开源AI模型,该模型与专有系统相匹配。在本文中,我们将比较 - DeepSeek R1与OpenAi O1。 目录的>
仅为558万美元
6710亿参数体系结构,并已在
Model | Base Model | Download |
DeepSeek-R1-Distill-Qwen-1.5B | Qwen2.5-Math-1.5B | ? HuggingFace |
DeepSeek-R1-Distill-Qwen-7B | Qwen2.5-Math-7B | ? HuggingFace |
DeepSeek-R1-Distill-Llama-8B | Llama-3.1-8B | ? HuggingFace |
DeepSeek-R1-Distill-Qwen-14B | Qwen2.5-14B | ? HuggingFace |
DeepSeek-R1-Distill-Qwen-32B | Qwen2.5-32B | ? HuggingFace |
DeepSeek-R1-Distill-Llama-70B | Llama-3.3-70B-Instruct | ? HuggingFace |
这些蒸馏模型可以灵活地迎合本地部署和API使用。值得注意的是,Llama 33.7b模型在几个基准中优于O1 mini,强调了蒸馏型变体的强度。
Model | #Total Params | #Activated Params | Context Length | Download |
DeepSeek-R1-Zero | 671B | 37B | 128K | ? HuggingFace |
DeepSeek-R1 | 671B | 37B | 128K | ? HuggingFace |
>您可以在此处找到有关OpenAi O1的全部内容。
> 1。强化学习,而不是重大监督的微调
最传统的LLM(例如GPT,Llama等)严重依赖于监督的微调,这需要由人类注释者策划的广泛标记的数据集。 DeepSeek R1采用了不同的方法
deepSeek-r1-Zero: > Qwen,Llama等
通过提炼知识,他们能够创建较小的模型(例如14b),甚至超过了某些最先进的模型(SOTA)模型,例如QWQ-32B。
这个过程实质上将高级推理能力转移到了较小的体系结构上,使其高效而无需牺牲太多的准确性。
稀疏注意机制: >
明显降低。
> DeepSeek R1 vs. Openai O1:价格比较>
> >openai o1 api :输入$ 15,输出$ 60(100万个令牌) llama 33.7b,也提供了令人印象深刻的基准,在类似尺寸的类别中表现优于竞争对手。
实用的用法和可访问性 >虽然某些模型(例如Llama变体)尚未出现在AMA上,但预计它们很快就会可用,进一步扩展了部署选项。
>总体判决: DeepSeek-R1在数学和软件任务方面引导,而OpenAI O1-1217在一般知识和解决问题方面都表现出色。 数学推理和软件工程,DeepSeek-R1可能是一个更好的选择,而对于>通用任务和编程竞赛,则OpenAI O1-1217可能具有优势。
如何使用Ollama访问DeepSeek R1?
这是Ollama,例如DeepSeek R1:Ollama Run DeepSeek-r1
我正在运行Ollama在本地运行DeepSeek-r1:1.5b,下载该模型将需要几分钟。
的代码
输出
,有一些积极的方面和潜在改进的领域:
这将消息列表传递给管道,该列表基于输入生成响应。 输出
Openai O1的代码实现
最终判决 openai o1虽然更简单,更易于初学者,但在功能方面受到限制,因为它仅在不返回值的情况下打印序列,从而使其对高级任务的有用程度降低。
推荐:>如果需要有效且可重复使用的解决方案,请与 DeepSeek R1的方法一起使用。如果您只是想简单地理解斐波那契序列,请使用openai o1的
为您的需求选择理想的AI模型
与传统模型相比,DeepSeek-R1的运营成本低至5%,非常适合初创企业,学术研究和财务资源有限的项目。
的发布标志着AI景观的重大转变,提供了开放量,MIT许可的替代品 >立即开始使用DeepSeek!在我们的“ DeepSeek入门”课程中,了解如何利用DeepSeek的AI和机器学习能力。现在注册,将您的技能提升到一个新的水平!
。
,同时保持了强大的推理能力。
影响:
aime 2024:
DeepSeek R1将其优化重点放在特定的高影响基准上:
>在79.8%
DeepSeek可能会受益于几种建筑和培训优化:
可以处理较低的计算成本的较长上下文。
专家(MOE)的混合物
培训良好的域特异性数据集而没有噪音过多的培训。
为什么它具有成本效益?
由于加强学习而减少了对昂贵监督数据集的需求。
的成本
> deepSeek r1 api
和
1。 Aime 2024(通过@1)
2。 CodeForces(百分比)
>
> deepSeek-r1:
97.3%> OpenAI O1-1217:
5。 mmlu(通过@1)
>说明:此基准测试评估模型在解决软件工程任务时的性能。
Benchmark
DeepSeek-R1 (%)
OpenAI o1-1217 (%)
Verdict
AIME 2024 (Pass@1)
79.8
79.2
DeepSeek-R1 wins (better math problem-solving)
Codeforces (Percentile)
96.3
96.6
OpenAI-o1-1217 wins (better competitive coding)
GPQA Diamond (Pass@1)
71.5
75.7
OpenAI-o1-1217 wins (better general QA performance)
MATH-500 (Pass@1)
97.3
96.4
DeepSeek-R1 wins (stronger math reasoning)
MMLU (Pass@1)
90.8
91.8
OpenAI-o1-1217 wins (better general knowledge understanding)
SWE-bench Verified (Resolved)
49.2
48.9
DeepSeek-R1 wins (better software engineering task handling)
这两个模型总体上的表现非常相似,首先,安装Ollama
> ollama
然后运行模型。curl -fsSL https://ollama.com/install.sh | sh
deepSeek-r1:1.5b的输出质量看起来很
积极方面
如何在Google Colab中使用DeepSeek R1?
最终的迭代解决方案是正确的,并且正确处理基本案例。
使用变压器
curl -fsSL https://ollama.com/install.sh | sh
此命令安装三个python库:变形金刚:通过拥抱面对的图书馆,以使用预训练的语言模型。
这将从变形金刚库导入管道函数。管道函数是一个高级API,简化了使用预训练模型进行文本生成,分类等任务的过程。!pip install transformers accelerate torch
>
from transformers import pipeline
messages = [
{"role": "user", "content": "Give me code for the Fibonacci nth series"},
]
>
pipe = pipeline("text-generation", model="deepseek-ai/DeepSeek-R1-Distill-Qwen-7B")
pipe(messages)
输出Okay, the user is asking for a Fibonacci sequence calculator. I remember<br><br>that the Fibonacci sequence starts with 0 and 1, and each subsequent<br><br>number is the sum of the previous two.<br><br>I should write a function called fib(n) where n is the term number we want<br><br>to find. If n is 0 or 1, it returns 0 since those are the starting points.<br><br>For other values, I'll use recursion because each term depends on the two<br><br>before it, which seems straightforward.<br><br>Wait, but recursion can be inefficient for large n because it recalculates<br><br>many terms repeatedly. Maybe the user wants an iterative approach instead<br><br>to make it faster and more efficient. That way, even if n is big, it<br><br>doesn't take too long.<br><br>I'll structure my function with a loop that starts from 2 up to n. I'll<br><br>keep track of the two previous numbers, prev1 and prev2. Then for each<br><br>step beyond 2, calculate current as the sum of prev1 and prev2. Update<br><br>prev2 to be prev1, and update prev1 to current.<br><br>Wait again, what if n is 0? The function should return 0, same with n=1.<br><br>So I'll add a condition at the beginning of the loop where if it's the<br><br>first term, we handle it correctly.<br><br>Let me test some examples. For fib(5), it should be 5. Let's see: prev1<br><br>starts as 0, prev2 as 1. Then for i=3 to 5:<br><br>i=3: current = 1 (0+1)<br><br>i=4: current = 2 (1+1)<br><br>i=5: current = 3 (1+2) Wait, that's not right. Oh no, I think I messed up the calculation steps.<br><br>Wait, for fib(5), let me recount:<br><br>n=0: 0<br><br>n=1: 1<br><br>n=2: 1<br><br>n=3: 2<br><br>n=4: 3<br><br>n=5: 5. So my previous step-by-step was wrong. I need to make sure each iteration is correct.<br><br>I think in the loop, when i reaches n-2, which for fib(5) is index 5 (since starting at 0), but wait, let me adjust the code correctly.<br><br>Let me write down:<br><br>def fib(n):<br><br>if n == 0:<br><br>return 0<br><br>elif n == 1:<br><br>return 1<br><br>prev1 = 0<br><br>prev2 = 1<br><br>for i in range(2, n+1):<br><br>current = prev1 + prev2<br><br>prev1 = prev2<br><br>prev2 = current<br><br>return prev2<br><br>Testing fib(5) would give:<br><br>i=2: current 1; prev1=1, prev2=1<br><br>i=3: current 2; prev1=1, prev2=2<br><br>i=4: current 3; prev1=2, prev2=3<br><br>i=5: current 5; return 5. Correct.<br><br>Yes, that should work.<br><br></think><br><br>Here’s a simple iterative implementation of the Fibonacci sequence:<br><br>```python<br><br>def fib(n):<br><br>if n == 0:<br><br>return 0<br><br>elif n == 1:<br><br>return 1<br><br>else:<br><br>prev1 = 0<br><br>prev2 = 1<br><br>for i in range(2, n+1):<br><br>current = prev1 + prev2<br><br>prev1 = prev2<br><br>prev2 = current<br><br>return prev2<br><br># Test the function<br><br>print(fib(5)) # Output: 5<br><br>```<br><br>### Explanation:<br><br>- The function `fib(n)` calculates the nth Fibonacci number using an iterative approach.<br><br>- **Base Cases**: If `n` is 0, it returns 0; if `n` is 1, it returns 1.<br><br>- **Iteration**: For values of `n` greater than 1, we initialize two variables (`prev1` and `prev2`) to represent the first two Fibonacci numbers (0 and 1).<br><br>- **Loop**: We loop from 2 up to `n`, updating the values of `prev1` and `prev2` in each iteration. After completing the loop, `prev2` contains the nth Fibonacci number.<br><br>- **Efficiency**: This method is efficient with a time complexity of O(n) since it only iterates once through the sequence.<br><br>### Example<br><br>If you want to calculate the 5th Fibonacci number:<br><br>- The function returns 5 when called as `fib(5)`.<br><br>This implementation avoids the inefficiencies of recursion and is more straightforward for educational purposes.
> DeepSeek-R1:无与伦比
DeepSeek-R1是特定应用程序的最大竞争者,尤其是那些优先考虑负担能力和适应性的竞争者。这就是为什么它可能非常适合您的项目:
预算友好的解决方案
openai的O1:可靠性和高级性能
DeepSeek r1
该模型在CodeForces(2061评级)和GPQA Diamond(75.7%)上的令人印象深刻的性能使其成为处理复杂应用程序或高级推理任务的软件开发团队的首选。
>
以上是DeepSeek R1 vs Openai O1:哪一个更好?的详细内容。更多信息请关注PHP中文网其他相关文章!