DeepSeek V3-0324:トップAIモデルを粉砕する "マイナー・アップデート"

  • Engineering
March 25, 2025
Lumina Wang

DeepSeekは昨晩、ひっそりと爆弾発言をした。彼らの最新リリースである DeepSeek v3-0324は、公式発表ではAPIに変更のない単なる「マイナー・アップグレード」であると軽視されていた。このアップデートは、特に論理的推論、プログラミング、数学的問題解決におけるパフォーマンスの飛躍的な向上を意味する。

このアップデートは、特に論理的推論、プログラミング、数学的問題解決において、飛躍的なパフォーマンスの向上を示しています。私たちが目にしているのは、単なる漸進的な改善ではなく、DeepSeek v3-0324を言語モデルのエリート層に位置づける根本的な変化です。しかもオープンソースです。

このリリースは、AIを搭載したアプリケーションを構築する開発者や企業にとって、早急な注目に値するものです。

DeepSeek v3-0324の新機能とその実力は?

DeepSeek v3-0324は、その前身であるDeepSeek v3と比較して、3つの大きな改善を導入しています:

  • より大規模なモデル、より強力なパワー:パラメータ数が6710億から6850億に増加し、モデルがより複雑な推論を処理し、より微妙な応答を生成できるようになりました。

  • 膨大なコンテキスト・ウィンドウ:128K トークンのコンテキスト長がアップグレードされた DeepSeek v3-0324 は、1 回のクエリで大幅に多くの情報を保持および処理できるため、長文の会話、文書分析、検索ベースの AI アプリケーションに最適です。

  • 推論、コーディング、数学の強化:今回のアップデートにより、ロジック、プログラミング、数学的能力が顕著に向上し、AIによるコーディング、科学研究、企業レベルの問題解決において強力な候補となる。

しかし、生の数字がすべてを物語っているわけではない。真に印象的なのは、ディープシークが推論能力と生成効率を同時に高めることに成功したことである。

秘密のソース:アーキテクチャの革新

DeepSeek v3-0324は、推論中のメモリ使用量と計算オーバーヘッドを削減するために、潜在ベクトルを使用してキー・バリュー(KV)キャッシュを圧縮する効率的なメカニズムであるMulti-head Latent Attention(MLA) アーキテクチャを維持しています。さらに、従来のFeed-Forward Networks(FFN)をMixture of Experts(MoE)レイヤーに置き換え、各トークンに対して最適なエキスパートを動的にアクティブにすることで、計算効率を最適化している。

しかし、最もエキサイティングなアップグレードはマルチトークン予測(MTP)であり、各トークンが将来の複数のトークンを同時に予測できるようになりました。これは従来の自己回帰モデルにおける重要なボトルネックを克服し、精度と推論速度の両方を向上させる。

これらの技術革新により、単に拡張性が高いだけでなく、インテリジェントに拡張できるモデルが生まれ、より多くの開発チームがプロ級のAI機能を利用できるようになりました。

MilvusとDeepSeek v3-0324でRAGシステムを5分で構築

DeepSeek v3-0324の強力な推論機能は、RAG (Retrieval-Augmented Generation) システムに最適です。このチュートリアルでは、DeepSeek v3-0324とMilvusベクトルデータベースを使用して、完全なRAGパイプラインをわずか5分で構築する方法を紹介します。最小限のセットアップで効率的に知識を取得し、合成する方法を学びます。

環境のセットアップ

まず、必要な依存関係をインストールしましょう:

! pip install --upgrade pymilvus[model] openai requests tqdm

注:Google Colabを使用している場合、これらのパッケージをインストールした後、ランタイムを再起動する必要があります。画面上部の "Runtime" メニューをクリックし、ドロップダウンメニューから "Restart session" を選択します。

DeepSeek は OpenAI 互換の API を提供しているため、API キーが必要です。API キーは、 DeepSeek プラットフォームにサインアップすることで取得できます:

import os

os.environ[“DEEPSEEK_API_KEY”] = “***********”

データの準備

このチュートリアルでは、Milvus ドキュメント 2.4.xの FAQ ページをナレッジソースとして使用します:

! wget https://github.com/milvus-io/milvus-docs/releases/download/v2.4.6-preview/milvus_docs_2.4.x_en.zip
! unzip -q milvus_docs_2.4.x_en.zip -d milvus_docs

それでは、マークダウン・ファイルから FAQ コンテンツをロードして準備します:

from glob import glob

# Load all markdown files from the FAQ directory text_lines = [] for file_path in glob(“milvus_docs/en/faq/*.md”, recursive=True): with open(file_path, “r”) as file: file_text = file.read() # Split on headings to separate content sections text_lines += file_text.split("# ")

言語の設定とモデルの埋め込み

OpenRouter を使用して DeepSeek v3-0324 にアクセスします。OpenRouterは、DeepSeekやClaudeなどの複数のAIモデル用の統一されたAPIを提供します。OpenRouterで無料のDeepSeek V3 APIキーを作成することで、簡単にDeepSeek V3 0324を試すことができます。

https://assets.zilliz.com/Setting_Up_the_Language_and_Embedding_Models_8b00595a6b.png

from openai import OpenAI

deepseek_client = OpenAI( api_key=, base_url=“https://openrouter.ai/api/v1”, )

テキスト埋め込みには、軽量で効果的なMilvusの組み込み埋め込みモデルを使用します:

from pymilvus import model as milvus_model

# Initialize the embedding model embedding_model = milvus_model.DefaultEmbeddingFunction()

# Test the embedding model test_embedding = embedding_model.encode_queries([“This is a test”])[0] embedding_dim = len(test_embedding) print(f"Embedding dimension: {embedding_dim}") print(f"First 10 values: {test_embedding[:10]}")

Milvusコレクションの作成

それでは、Milvusを使ってベクターデータベースをセットアップしましょう:

from pymilvus import MilvusClient

# Initialize Milvus client (using Milvus Lite for simplicity) milvus_client = MilvusClient(uri=“./milvus_demo.db”) collection_name = “my_rag_collection”

# Remove existing collection if it exists if milvus_client.has_collection(collection_name): milvus_client.drop_collection(collection_name)

# Create a new collection milvus_client.create_collection( collection_name=collection_name, dimension=embedding_dim, metric_type=“IP”, # Inner product distance consistency_level=“Strong”, # See https://milvus.io/docs/consistency.md for details )

Pro Tip:Pro Tip: 異なるデプロイシナリオのために、Milvusのセットアップを調整することができます:

  • ローカル開発の場合:Milvus Liteで uri="./milvus.db"

  • より大きなデータセットの場合:Docker/Kubernetes経由でMilvusサーバをセットアップして使用する。uri="http://localhost:19530"

  • 本番用:クラウドエンドポイントとAPIキーを使用して Zilliz Cloudを使用します。

Milvusへのデータロード

テキストデータを埋め込みデータに変換し、Milvusに保存しましょう:

from tqdm import tqdm

# Create embeddings for all text chunks data = [] doc_embeddings = embedding_model.encode_documents(text_lines)

# Create records with IDs, vectors, and text for i, line in enumerate(tqdm(text_lines, desc=“Creating embeddings”)): data.append({“id”: i, “vector”: doc_embeddings[i], “text”: line})

# Insert data into Milvus milvus_client.insert(collection_name=collection_name, data=data)

Creating embeddings:   0%|          | 0/72 [00:00<?, ?it/s]huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...
To disable this warning, you can either:
    - Avoid using `tokenizers` before the fork if possible
    - Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)
Creating embeddings: 100%|██████████| 72/72 [00:00<00:00, 246522.36it/s]

{‘insert_count’: 72, ‘ids’: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71], ‘cost’: 0}

RAGパイプラインの構築

ステップ 1: 関連情報の取得

一般的な質問でRAGシステムをテストしてみましょう:

question = "How is data stored in milvus?"

# Search for relevant information search_res = milvus_client.search( collection_name=collection_name, data=embedding_model.encode_queries([question]), # Convert question to embedding limit=3, # Return top 3 results search_params={“metric_type”: “IP”, “params”: {}}, # Inner product distance output_fields=[“text”], # Return the text field )

# Examine search results import json retrieved_lines_with_distances = [ (res[“entity”][“text”], res[“distance”]) for res in search_res[0] ] print(json.dumps(retrieved_lines_with_distances, indent=4))

[
    [
        " Where does Milvus store data?\n\nMilvus deals with two types of data, inserted data and metadata. \n\nInserted data, including vector data, scalar data, and collection-specific schema, are stored in persistent storage as incremental log. Milvus supports multiple object storage backends, including [MinIO](https://min.io/), [AWS S3](https://aws.amazon.com/s3/?nc1=h_ls), [Google Cloud Storage](https://cloud.google.com/storage?hl=en#object-storage-for-companies-of-all-sizes) (GCS), [Azure Blob Storage](https://azure.microsoft.com/en-us/products/storage/blobs), [Alibaba Cloud OSS](https://www.alibabacloud.com/product/object-storage-service), and [Tencent Cloud Object Storage](https://www.tencentcloud.com/products/cos) (COS).\n\nMetadata are generated within Milvus. Each Milvus module has its own metadata that are stored in etcd.\n\n###",
        0.6572665572166443
    ],
    [
        "How does Milvus flush data?\n\nMilvus returns success when inserted data are loaded to the message queue. However, the data are not yet flushed to the disk. Then Milvus' data node writes the data in the message queue to persistent storage as incremental logs. If `flush()` is called, the data node is forced to write all data in the message queue to persistent storage immediately.\n\n###",
        0.6312146186828613
    ],
    [
        "How does Milvus handle vector data types and precision?\n\nMilvus supports Binary, Float32, Float16, and BFloat16 vector types.\n\n- Binary vectors: Store binary data as sequences of 0s and 1s, used in image processing and information retrieval.\n- Float32 vectors: Default storage with a precision of about 7 decimal digits. Even Float64 values are stored with Float32 precision, leading to potential precision loss upon retrieval.\n- Float16 and BFloat16 vectors: Offer reduced precision and memory usage. Float16 is suitable for applications with limited bandwidth and storage, while BFloat16 balances range and efficiency, commonly used in deep learning to reduce computational requirements without significantly impacting accuracy.\n\n###",
        0.6115777492523193
    ]
]

ステップ2:DeepSeekで回答を生成する

次に、DeepSeekを使用して、取得した情報に基づいてレスポンスを生成します:

# Combine retrieved text chunks
context = "\n".join(
    [line_with_distance[0] for line_with_distance in retrieved_lines_with_distances]
)

# Define prompts for the language model SYSTEM_PROMPT = “"” You are an AI assistant. You are able to find answers to the questions from the contextual passage snippets provided. “"”

USER_PROMPT = f""" Use the following pieces of information enclosed in tags to provide an answer to the question enclosed in tags.

{context}

{question} “"”

# Generate response with DeepSeek response = deepseek_client.chat.completions.create( model=“deepseek-chat”, messages=[ {“role”: “system”, “content”: SYSTEM_PROMPT}, {“role”: “user”, “content”: USER_PROMPT}, ], )

print(response.choices[0].message.content)

In Milvus, data is stored in two main categories: inserted data and metadata.

1. Inserted Data: This includes vector data, scalar data, and collection-specific schema. The inserted data is stored in persistent storage as incremental logs. Milvus supports various object storage backends for this purpose, such as MinIO, AWS S3, Google Cloud Storage (GCS), Azure Blob Storage, Alibaba Cloud OSS, and Tencent Cloud Object Storage (COS).

  1. Metadata: Metadata is generated within Milvus and is specific to each Milvus module. This metadata is stored in etcd, a distributed key-value store.

Additionally, when data is inserted, it is first loaded into a message queue, and Milvus returns success at this stage. The data is then written to persistent storage as incremental logs by the data node. If the <span class="hljs-title">flush</span>() function is called, the data node is forced to write all data in the message queue to persistent storage immediately.

これで完了です!これで、DeepSeek v3-0324とMilvusを使用した完全なRAGパイプラインの構築が完了しました。このシステムでは、Milvusのドキュメントに基づく質問に、高い精度とコンテキスト認識で回答できるようになりました。

DeepSeek-V3-0324の比較:オリジナルとRAG強化バージョンの比較

理論も重要ですが、実際のパフォーマンスが重要です。同じプロンプトで、標準の DeepSeek v3-0324 (「Deep Thinking」は無効) と RAG 拡張バージョンの両方をテストしました:Milvusに関する豪華なウェブサイトを作成するためにHTMLコードを記述してください。

標準モデルの出力コードで作られたウェブサイト

ウェブサイトはこんな感じだ:

ビジュアル的には魅力的だが、内容は一般的な説明に頼っており、Milvusの核となる技術的特徴の多くが欠けている。

RAG強化版で生成されたコードで作られたウェブサイト

Milvusをナレッジベースとして統合すると、結果は劇的に変わった:

後者のウェブサイトは、単に見栄えが良くなっただけでなく、Milvusのアーキテクチャ、使用例、技術的優位性を真に理解していることがわかります。

DeepSeek v3-0324は専用の推論モデルを置き換えることができるか?

DeepSeek v3-0324を、Claude 3.7 SonnetやGPT-4 Turboのような専用の推論モデルと、数学的、論理的、およびコード推論タスクにわたって比較したとき、私たちは最も驚くべき発見をしました。

専用の推論モデルは、多段階の問題解決に優れていますが、多くの場合、効率を犠牲にしています。私たちのベンチマークは、推論を多用するモデルが単純なプロンプトを頻繁に過剰分析し、必要以上に2~3倍のトークンを生成し、レイテンシとAPIコストを大幅に増加させることを示しました。

DeepSeek v3-0324 は異なるアプローチを採用しています。論理的な一貫性は同等ですが、簡潔性が著しく高く、多くの場合、40~60%少ないトークンで正しいソリューションを生成します。この効率性は、正確さを犠牲にするものではありません。コード生成テストでは、DeepSeek のソリューションは、推論に特化した競合他社のソリューションと同等またはそれ以上の機能を備えていました。

パフォーマンスと予算制約のバランスを取る開発者にとって、この効率性の優位性は、APIコストの削減と応答時間の短縮に直接つながります。

AIモデルの未来:推論の溝を埋める

DeepSeek v3-0324の性能は、AI業界における中核的な仮定、すなわち推論と効率性は避けられないトレードオフであるという仮定に挑戦しています。このことは、推論モデルと非推論モデルの区別が曖昧になり始める変曲点に近づいている可能性を示唆している。

主要なAIプロバイダーは、最終的にはこの区別を完全になくし、タスクの複雑さに基づいて推論の深さを動的に調整するモデルを開発するかもしれない。このような適応型推論は、計算効率と応答品質の両方を最適化し、AIアプリケーションの構築と展開方法に革命をもたらす可能性がある。

RAGシステムを構築する開発者にとって、この進化は、計算オーバーヘッドなしにプレミアムモデルの推論の深さを提供する、より費用対効果の高いソリューションを約束する。

    Try Managed Milvus for Free

    Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

    Get Started

    Like the article? Spread the word

    続けて読む