跳到正文
Mistral AI:News·· 2025-01-13精选AI 评分63

Mistral AI 发布 Codestral 25.01,代码生成速度提升约 2 倍

Research Codestral 25.01 January 13, 2025 By Mistral team

AI 导读

Mistral AI 发布 Codestral 25.01,采用更高效的架构和改进的 tokenizer,代码生成与补全速度较原版提升约 2 倍。

推荐理由

官方给出与同类模型的多项基准对比和可用渠道,读者可以据此评估它在代码补全工作流中的替换价值。

正文 · AI 翻译

在过去一年 AI 的所有创新中,代码生成可以说是最重要的。就像流水线简化了制造业、计算器改变了数学一样,编码模型代表着软件开发的一次重大飞跃。

Mistral AI 一直站在这一变革的前沿,今年早些时候发布了 Codestral,这是一款最先进(SOTA)的编码模型。Codestral 轻量、快速,精通 80 多种编程语言,针对低延迟、高频用例进行了优化,并支持填充中间(FIM)、代码纠错和测试生成等任务。Codestral 已被数千名开发者用作能力强大的编码伙伴,经常将生产力提升数倍。而今天,Codestral 迎来了一次重大升级。

Codestral 25.01 采用了比原版更高效的架构和改进的分词器,生成和补全代码的速度约提升 2 倍。该模型现在在其权重级别中明显领先,并在各类 FIM 用例中达到 SOTA。

基准测试

我们将新的 Codestral 与领先的 100B 参数以下编码模型进行了基准测试,这些模型被广泛认为是 FIM 任务中的同类最佳。

概览

Python SQL 多语言平均 模型上下文长度HumanEvalMBPPCruxEvalLiveCodeBenchRepoBenchSpiderCanItEditHumanEval(平均)HumanEvalFIM(平均) Codestral-2501256k86.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% |

GPT 3.5 Turbo 是 OpenAI 提供的最新 FIM API

从今天起可用

Codestral 25.01 正通过我们的 IDE / IDE 插件合作伙伴向全球开发者推出。您可以在各自的模型选择器中选择 Codestral 25.01,感受代码补全在响应质量和速度上的差异。

对于企业用例,尤其是需要数据和模型驻留的场景,Codestral 25.01 可在您的本地环境或 VPC 内部署。

查看下方演示,并在 Continue for 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 排行榜第一。我们迫不及待想听到您的体验!

来源:Mistral AI:News · mistral.ai