Mistral AI 發佈 Codestral 25.01,程式碼生成及補全速度約提升 2 倍
Codestral 25.01
Mistral AI 發佈程式碼模型 Codestral 25.01,稱其架構和 tokenizer 經改進,生成及補全程式碼的速度約為原版 2 倍。在所列基準中,Codestral-2501 的 HumanEvalFIM 平均分為 85.9%,高於 Codestral-2405 的 82.1%。
文中列出 Codestral 25.01 與舊版及其他模型的程式基準,並交代速度變化和部署入口,便於對照補全表現與採用方式。
過去一年 AI 的各項創新中,程式碼生成可説是影響最大的一項。正如生產線革新製造業、計算機改變數學一樣,程式碼生成模型為軟件開發帶來重大轉變。
Mistral AI 透過今年較早前推出的最先進程式碼模型 Codestral 引領這項轉變。Codestral 輕巧、快速,擅長超過 80 種編程語言,針對低延遲、高頻率用途優化,並支援中間填充(FIM)、程式碼修正和測試生成等任務。數以千計開發者已將 Codestral 作為能力出色的編碼夥伴,定期大幅提升生產力。今天,Codestral 迎來重大升級。
Codestral 25.01 採用更高效架構和改良 tokenizer,生成及補全程式碼的速度約快 2 倍。它現已成為同等模型規模中明顯領先的編碼模型,並在各類 FIM 用途中達到最先進水平。
基準測試
我們使用廣泛認為最適合 FIM 任務的領先、參數少於 100B 的編碼模型,對新版 Codestral 進行基準測試。
概覽
Python | SQL | 多種語言的平均值 | ||||||||
模型 | 上下文長度 | HumanEval | MBPP | CruxEval | LiveCodeBench | RepoBench | Spider | CanItEdit | HumanEval(平均) | HumanEvalFIM(平均) |
Codestral-2501 | 256k | 86.6% | 80.2% | 55.5% | 37.9% | 38.0% | 66.5% | 50.5% | 71.4% | 85.9% |
Codestral-2405 22B | 32k | 81.1% | 78.2% | 51.3% | 31.5% | 34.0% | 63.5% | 50.5% | 65.6% | 82.1% |
Codellama 70B instruct | 4k | 67.1% | 70.8% | 47.3% | 20.0% | 11.4% | 37.0% | 29.5% | 55.3% | - |
DeepSeek Coder 33B instruct | 16k | 77.4% | 80.2% | 49.5% | 27.0% | 28.4% | 60.0% | 47.6% | 65.1% | 85.3% |
DeepSeek Coder V2 lite | 128k | 83.5% | 83.2% | 49.7% | 28.1% | 20.0% | 72.0% | 41.0% | 65.9% | 84.1% |
按語言分類
模型 | HumanEval Python | HumanEval C++ | HumanEval Java | HumanEval Javascript | HumanEval Bash | HumanEval Typescript | HumanEval C# | HumanEval(平均) |
|---|---|---|---|---|---|---|---|---|
Codestral-2501 | 86.6% | 78.9% | 72.8% | 82.6% | 43.0% | 82.4% | 53.2% | 71.4% |
Codestral-2405 22B | 81.1% | 68.9% | 78.5% | 71.4% | 40.5% | 74.8% | 43.7% | 65.6% |
Codellama 70B instruct | 67.1% | 56.5% | 60.8% | 62.7% | 32.3% | 61.0% | 46.8% | 55.3% |
DeepSeek Coder 33B instruct | 77.4% | 65.8% | 73.4% | 73.3% | 39.2% | 77.4% | 49.4% | 65.1% |
DeepSeek Coder V2 lite | 83.5% | 68.3% | 65.2% | 80.8% | 34.2% | 82.4% | 46.8% | 65.9% |
FIM(單行完全匹配)
模型 | HumanEvalFIM Python | HumanEvalFIM Java | HumanEvalFIM JS | HumanEvalFIM(平均) |
|---|---|---|---|---|
Codestral-2501 | 80.2% | 89.6% | 87.96% | 85.89% |
Codestral-2405 22B | 77.0% | 83.2% | 86.08% | 82.07% |
OpenAI FIM API* | 80.0% | 84.8% | 86.5% | 83.7% |
DeepSeek Chat API | 78.8% | 89.2% | 85.78% | 84.63% |
DeepSeek Coder V2 lite | 78.7% | 87.8% | 85.90% | 84.13% |
DeepSeek Coder 33B instruct | 80.1% | 89.0% | 86.80% | 85.3% |
FIM pass@1:
模型 | HumanEvalFIM Python | HumanEvalFIM Java | HumanEvalFIM JS | HumanEvalFIM(平均) |
|---|---|---|---|---|
Codestral-2501 | 92.5% | 97.1% | 96.1% | 95.3% |
Codestral-2405 22B | 90.2% | 90.1% | 95.0% | 91.8% |
OpenAI FIM API* | 91.1% | 91.8% | 95.2% | 92.7% |
DeepSeek Chat API | 91.7% | 96.1% | 95.3% | 94.4% |
* OpenAI 最新可用的 FIM API 是 GPT 3.5 Turbo
即日起供應
Codestral 25.01 正透過我們的 IDE/IDE 外掛合作夥伴,陸續向全球開發者推出。你可在對應的模型選擇器中選取 Codestral 25.01,體驗程式碼補全的回應質素和速度提升。
對企業用途,尤其是要求資料和模型留駐本地的情況,Codestral 25.01 可在本地環境或 VPC 內部署。
觀看下方示範,並在 Continue 中透過 VS Code 或 JetBrains 免費試用。

* Codestral 25.01 聊天示範
Continue 共同創辦人 Ty Dunn 説:「對 AI 編碼助理而言,程式碼補全佔了大量工作,因此需要擅長中間填充(FIM)的模型。Codestral 25.01 在這方面有重大進展。Mistral AI 的新模型能更快提供更精確建議,這是準確、高效軟件開發的關鍵。因此,Codestral 是我們向開發者推薦的自動補全模型。」
如欲使用 Codestral API 構建自己的整合,請前往 la Plateforme 並使用 codestral-latest。API 亦可在 Google Cloud 的 Vertex AI 上使用,並正於 Azure AI Foundry 私人預覽,亦即將登陸 Amazon Bedrock。詳情請參閲 Codestral 文件。
Codestral 25.01 首次登上 LMsys copilot arena 排行榜第 #1 位,期待聽到你的使用體驗!
來源:Mistral AI · mistral.ai