ホームページ >テクノロジー周辺機器 >AI >O3-MINIは論理的な推論のためにDeepSeek-R1を置き換えることができますか?
AI駆動の推論モデルは、2025年に世界を席巻しています! DeepSeek-R1とO3-Miniの発売により、AIチャットボットでは前例のないレベルの論理推論機能が見られました。この記事では、これらのモデルにAPIを介してアクセスし、論理的推論スキルを評価して、O3-MINIがDeepSeek-R1を置き換えることができるかどうかを調べます。標準のベンチマークでのパフォーマンスを比較し、論理パズルの解決やテトリスゲームの構築などの実際のアプリケーションを比較します!バックルして乗り心地に参加してください。
ベンチマークの結果は、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 |
ソース:deepseek-r1 | o3-mini
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()
モデルが回答を生成するために時間をかける時間
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 サイトの他の関連記事を参照してください。