AI駆動の推論モデルは、2025年に世界を席巻しています! DeepSeek-R1とO3-Miniの発売により、AIチャットボットでは前例のないレベルの論理推論機能が見られました。この記事では、これらのモデルにAPIを介してアクセスし、論理的推論スキルを評価して、O3-MINIがDeepSeek-R1を置き換えることができるかどうかを調べます。標準のベンチマークでのパフォーマンスを比較し、論理パズルの解決やテトリスゲームの構築などの実際のアプリケーションを比較します!バックルして乗り心地に参加してください。
目次
- deepseek-r1 vs o3-mini:論理的推論ベンチマーク
- deepseek-r1 vs o3-mini:api価格の比較
- deepseek-r1およびo3-miniにアクセスする方法比較
タスク1:テトリスゲームの構築- タスク2:リレーショナル不平等の分析
- タスク3:数学の論理的推論
- 論理的推論の比較概要deepseek-r1 vs o3-mini:論理的推論ベンチマーク
deepseek-r1とo3-miniは、構造化された思考と控除に対するユニークなアプローチを提供し、さまざまな種類の複雑な問題解決タスクに適しています。彼らのベンチマークパフォーマンスについて話す前に、まずこれらのモデルのアーキテクチャをこっそり覗いてみましょう。
o3-miniは、Openaiの最も高度な推論モデルです。密な変圧器アーキテクチャを使用して、各トークンをすべてのモデルパラメーターで処理して、パフォーマンスが強いが高いリソースの消費を加えます。対照的に、Deepseekの最も論理的なモデルであるR1は、Experts(MOE)の混合(MOE)フレームワークを採用しており、効率を高めるために入力あたりのパラメーターのサブセットのみをアクティブにします。これにより、DeepSeek-R1がよりスケーラブルになり、堅実なパフォーマンスを維持しながら計算的に最適化されます。
詳細:OpenaiのO3-MiniはDeepSeek-R1よりも優れていますか?
今、私たちが見る必要があるのは、これらのモデルが論理的推論タスクでどれだけうまく機能するかです。まず、ライブベンチベンチマークテストでのパフォーマンスを見てみましょう。
ソース:livebench.ai
ベンチマークの結果は、OpenaiのO3-Miniが、数学を除くほぼすべての側面でDeepSeek-R1を上回ることを示しています。 Deepseekの71.38と比較して、世界平均スコアは73.94であるため、O3-Miniは全体的なパフォーマンスがわずかに強いことを示しています。特に推論に優れており、Deepseekの83.17に対して89.58を達成し、優れた分析および問題解決機能を反映しています。
また読む:Google Gemini 2.0 Pro vs Deepseek-R1:コーディングは誰ですか?
deepseek-r1 vs o3-mini:API価格の比較
これらのモデルをAPIを通じてテストしているので、これらのモデルの費用を見てみましょう。
Model |
Context length |
Input Price |
Cached Input Price |
Output Price |
o3-mini |
200k |
.10/M tokens |
.55/M tokens |
.40/M tokens |
deepseek-chat |
64k |
.27/M tokens |
.07/M tokens |
.10/M tokens |
deepseek-reasoner |
64k |
.55/M tokens |
.14/M tokens |
.19/M tokens |
テーブルに見られるように、OpenaiのO3-Miniは、APIコストの点でDeepSeek R1のほぼ2倍高価です。 Deepseek R1は、入力に1.10ドル、出力に4.40ドルを請求しますが、DeepSeek R1は入力で100万ドル、出力に2.19ドルのより費用対効果の高いレートを提供しているため、大規模なアプリケーションでは予算向けのオプションになります。
ソース:deepseek-r1 | o3-mini
deepseek-r1およびo3-miniにアクセスする方法
ハンズオンパフォーマンスの比較に足を踏み入れる前に、APIを使用してDeepSeek-R1およびO3-Miniにアクセスする方法を学びましょう。
あなたがこれのためにしなければならないのは、必要なライブラリとAPIキーをインポートすることだけです:
from openai import OpenAI
from IPython.display import display, Markdown
import time
ログイン後にコピー
ログイン後にコピー
ログイン後にコピー
with open("path_of_api_key") as file:
openai_api_key = file.read().strip()
ログイン後にコピー
ログイン後にコピー
deepseek-r1 vs o3-mini:論理的推論の比較
with open("path_of_api_key") as file:
deepseek_api = file.read().strip()
ログイン後にコピー
APIアクセスを取得したので、論理的推論機能に基づいてDeepSeek-R1とO3-Miniを比較しましょう。このために、両方のモデルに同じプロンプトを提供し、これらのメトリックに基づいてそれらの応答を評価します:
モデルが回答を生成するために時間をかける時間
生成された応答の品質、および-
応答を生成するために発生した
コスト。-
その後、パフォーマンスに応じて、各タスクのモデル0または1をスコアリングします。それでは、タスクを試して、deepseek-r1 vs o3-mini推論戦で勝者として誰が現れるかを見てみましょう!
- タスク1:テトリスゲームの構築
このタスクでは、モデルがPythonを使用して完全に機能するテトリスゲームを実装する必要があります。ゲームロジック、ピースの動き、衝突検出、および外部ゲームエンジンに依存せずにレンダリングする必要があります。
プロンプト:
「この問題についてPythonコードを書く:TetrisゲームのPythonコードを生成する「
deepseek-r1 api への入力
DeepSeek-R1
による 応答
INPUT_COST_CACHE_HIT = 0.14 / 1_000_000 # <pre class="brush:php;toolbar:false">task1_start_time = time.time()
client = OpenAI(api_key=api_key)
messages = messages=[
{
"role": "system",
"content": """You are a professional Programmer with a large experience ."""
},
{
"role": "user",
"content": """write a python code for this problem: generate a python code for Tetris game.
"""
}
]
# Use a compatible encoding (cl100k_base is the best option for new OpenAI models)
encoding = tiktoken.get_encoding("cl100k_base")
# Calculate token counts
input_tokens = sum(len(encoding.encode(msg["content"])) for msg in messages)
completion = client.chat.completions.create(
model="o3-mini-2025-01-31",
messages=messages
)
output_tokens = len(encoding.encode(completion.choices[0].message.content))
task1_end_time = time.time()
input_cost_per_1k = 0.0011 # Example: <pre class="brush:php;toolbar:false">INPUT_COST_CACHE_HIT = 0.14 / 1_000_000 # <pre class="brush:php;toolbar:false">task2_start_time = time.time()
client = OpenAI(api_key=api_key)
messages = [
{
"role": "system",
"content": """You are an expert in solving Reasoning Problems. Please solve the given problem"""
},
{
"role": "user",
"content": """In the following question, assuming the given statements to be true, find which of the conclusions among given conclusions is/are definitely true and then give your answers accordingly.
Statements: H > F ≤ O ≤ L; F ≥ V < D
Conclusions:
I. L ≥ V
II. O > D
The options are:
A. Only I is true
B. Only II is true
C. Both I and II are true
D. Either I or II is true
E. Neither I nor II is true
"""
}
]
# Use a compatible encoding (cl100k_base is the best option for new OpenAI models)
encoding = tiktoken.get_encoding("cl100k_base")
# Calculate token counts
input_tokens = sum(len(encoding.encode(msg["content"])) for msg in messages)
completion = client.chat.completions.create(
model="o3-mini-2025-01-31",
messages=messages
)
output_tokens = len(encoding.encode(completion.choices[0].message.content))
task2_end_time = time.time()
input_cost_per_1k = 0.0011 # Example: <pre class="brush:php;toolbar:false">INPUT_COST_CACHE_HIT = 0.14 / 1_000_000 # <pre class="brush:php;toolbar:false">task3_start_time = time.time()
client = OpenAI(api_key=api_key)
messages = [
{
"role": "system",
"content": """You are a Expert in solving Reasoning Problems. Please solve the given problem"""
},
{
"role": "user",
"content": """
Study the given matrix carefully and select the number from among the given options that can replace the question mark (?) in it.
__________________
| 7 | 13 | 174|
| 9 | 25 | 104|
| 11 | 30 | ? |
|_____|_____|____|
The options are:
A 335
B 129
C 431
D 100
Please mention your approch that you have taken at each step
"""
}
]
# Use a compatible encoding (cl100k_base is the best option for new OpenAI models)
encoding = tiktoken.get_encoding("cl100k_base")
# Calculate token counts
input_tokens = sum(len(encoding.encode(msg["content"])) for msg in messages)
completion = client.chat.completions.create(
model="o3-mini-2025-01-31",
messages=messages
)
output_tokens = len(encoding.encode(completion.choices[0].message.content))
task3_end_time = time.time()
input_cost_per_1k = 0.0011 # Example: .005 per 1,000 input tokens
output_cost_per_1k = 0.0044 # Example: .015 per 1,000 output tokens
# Calculate cost
input_cost = (input_tokens / 1000) * input_cost_per_1k
output_cost = (output_tokens / 1000) * output_cost_per_1k
total_cost = input_cost + output_cost
# Print results
print(completion.choices[0].message)
print("----------------=Total Time Taken for task 3:----------------- ", task3_end_time - task3_start_time)
print(f"Input Tokens: {input_tokens}, Output Tokens: {output_tokens}")
print(f"Estimated Cost: ${total_cost:.6f}")
# Display result
from IPython.display import Markdown
display(Markdown(completion.choices[0].message.content))
ログイン後にコピー
.14 per 1M tokens
INPUT_COST_CACHE_MISS = 0.55 / 1_000_000 # .55 per 1M tokens
OUTPUT_COST = 2.19 / 1_000_000 # .19 per 1M tokens
# Start timing
task3_start_time = time.time()
# Initialize OpenAI client for DeepSeek API
client = OpenAI(api_key=api_key, base_url="https://api.deepseek.com")
messages = [
{
"role": "system",
"content": """You are a Expert in solving Reasoning Problems. Please solve the given problem"""
},
{
"role": "user",
"content": """
Study the given matrix carefully and select the number from among the given options that can replace the question mark (?) in it.
__________________
| 7 | 13 | 174|
| 9 | 25 | 104|
| 11 | 30 | ? |
|_____|_____|____|
The options are:
A 335
B 129
C 431
D 100
Please mention your approch that you have taken at each step
"""
}
]
# Get token count using tiktoken (adjust model name if necessary)
encoding = tiktoken.get_encoding("cl100k_base") # Use a compatible tokenizer
input_tokens = sum(len(encoding.encode(msg["content"])) for msg in messages)
# Call DeepSeek API
response = client.chat.completions.create(
model="deepseek-reasoner",
messages=messages,
stream=False
)
# Get output token count
output_tokens = len(encoding.encode(response.choices[0].message.content))
task3_end_time = time.time()
total_time_taken = task3_end_time - task3_start_time
# Assume cache miss for worst-case pricing (adjust if cache info is available)
input_cost = (input_tokens / 1_000_000) * INPUT_COST_CACHE_MISS
output_cost = (output_tokens / 1_000_000) * OUTPUT_COST
total_cost = input_cost + output_cost
# Print results
print("Response:", response.choices[0].message.content)
print("------------------ Total Time Taken for Task 3: ------------------", total_time_taken)
print(f"Input Tokens: {input_tokens}, Output Tokens: {output_tokens}")
print(f"Estimated Cost: ${total_cost:.6f}")
# Display result
from IPython.display import Markdown
display(Markdown(response.choices[0].message.content)).005 per 1,000 input tokens
output_cost_per_1k = 0.0044 # Example: .015 per 1,000 output tokens
# Calculate cost
input_cost = (input_tokens / 1000) * input_cost_per_1k
output_cost = (output_tokens / 1000) * output_cost_per_1k
total_cost = input_cost + output_cost
# Print results
print(completion.choices[0].message)
print("----------------=Total Time Taken for task 2:----------------- ", task2_end_time - task2_start_time)
print(f"Input Tokens: {input_tokens}, Output Tokens: {output_tokens}")
print(f"Estimated Cost: ${total_cost:.6f}")
# Display result
from IPython.display import Markdown
display(Markdown(completion.choices[0].message.content)).14 per 1M tokens
INPUT_COST_CACHE_MISS = 0.55 / 1_000_000 # .55 per 1M tokens
OUTPUT_COST = 2.19 / 1_000_000 # .19 per 1M tokens
# Start timing
task2_start_time = time.time()
# Initialize OpenAI client for DeepSeek API
client = OpenAI(api_key=api_key, base_url="https://api.deepseek.com")
messages = [
{"role": "system", "content": "You are an expert in solving Reasoning Problems. Please solve the given problem."},
{"role": "user", "content": """ In the following question, assuming the given statements to be true, find which of the conclusions among given conclusions is/are definitely true and then give your answers accordingly.
Statements: H > F ≤ O ≤ L; F ≥ V < D
Conclusions:
I. L ≥ V
II. O > D
The options are:
A. Only I is true
B. Only II is true
C. Both I and II are true
D. Either I or II is true
E. Neither I nor II is true
"""}
]
# Get token count using tiktoken (adjust model name if necessary)
encoding = tiktoken.get_encoding("cl100k_base") # Use a compatible tokenizer
input_tokens = sum(len(encoding.encode(msg["content"])) for msg in messages)
# Call DeepSeek API
response = client.chat.completions.create(
model="deepseek-reasoner",
messages=messages,
stream=False
)
# Get output token count
output_tokens = len(encoding.encode(response.choices[0].message.content))
task2_end_time = time.time()
total_time_taken = task2_end_time - task2_start_time
# Assume cache miss for worst-case pricing (adjust if cache info is available)
input_cost = (input_tokens / 1_000_000) * INPUT_COST_CACHE_MISS
output_cost = (output_tokens / 1_000_000) * OUTPUT_COST
total_cost = input_cost + output_cost
# Print results
print("Response:", response.choices[0].message.content)
print("------------------ Total Time Taken for Task 2: ------------------", total_time_taken)
print(f"Input Tokens: {input_tokens}, Output Tokens: {output_tokens}")
print(f"Estimated Cost: ${total_cost:.6f}")
# Display result
from IPython.display import Markdown
display(Markdown(response.choices[0].message.content)).005 per 1,000 input tokens
output_cost_per_1k = 0.0044 # Example: .015 per 1,000 output tokens
# Calculate cost
input_cost = (input_tokens / 1000) * input_cost_per_1k
output_cost = (output_tokens / 1000) * output_cost_per_1k
total_cost = input_cost + output_cost
print(completion.choices[0].message)
print("----------------=Total Time Taken for task 1:----------------- ", task1_end_time - task1_start_time)
print(f"Input Tokens: {input_tokens}, Output Tokens: {output_tokens}")
print(f"Estimated Cost: ${total_cost:.6f}")
# Display result
from IPython.display import Markdown
display(Markdown(completion.choices[0].message.content)).14 per 1M tokens
INPUT_COST_CACHE_MISS = 0.55 / 1_000_000 # .55 per 1M tokens
OUTPUT_COST = 2.19 / 1_000_000 # .19 per 1M tokens
# Start timing
task1_start_time = time.time()
# Initialize OpenAI client for DeepSeek API
client = OpenAI(api_key=api_key, base_url="https://api.deepseek.com")
messages = [
{
"role": "system",
"content": """You are a professional Programmer with a large experience."""
},
{
"role": "user",
"content": """write a python code for this problem: generate a python code for Tetris game."""
}
]
# Get token count using tiktoken (adjust model name if necessary)
encoding = tiktoken.get_encoding("cl100k_base") # Use a compatible tokenizer
input_tokens = sum(len(encoding.encode(msg["content"])) for msg in messages)
# Call DeepSeek API
response = client.chat.completions.create(
model="deepseek-reasoner",
messages=messages,
stream=False
)
# Get output token count
output_tokens = len(encoding.encode(response.choices[0].message.content))
task1_end_time = time.time()
total_time_taken = task1_end_time - task1_start_time
# Assume cache miss for worst-case pricing (adjust if cache info is available)
input_cost = (input_tokens / 1_000_000) * INPUT_COST_CACHE_MISS
output_cost = (output_tokens / 1_000_000) * OUTPUT_COST
total_cost = input_cost + output_cost
# Print results
print("Response:", response.choices[0].message.content)
print("------------------ Total Time Taken for Task 1: ------------------", total_time_taken)
print(f"Input Tokens: {input_tokens}, Output Tokens: {output_tokens}")
print(f"Estimated Cost: ${total_cost:.6f}")
# Display result
from IPython.display import Markdown
display(Markdown(response.choices[0].message.content))
DeepSeek-R1の完全な応答をここで見つけることができます。
出力トークンコスト:
入力トークン:28 |出力トークン:3323 |推定コスト:0.0073ドル
コード出力
o3-mini api
への入力
以上がO3-MINIは論理的な推論のためにDeepSeek-R1を置き換えることができますか?の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。