Mistral 7B:高效开源大语言模型30%
← 首页 | 厂商论文 | 详细解读
Mistral
Mistral 7B
Mistral 7B:高效开源大语言模型
Mistral AI Team
📅 2023-10-10 | 📄 arXiv: 2310.06825
翻译完成度 4 / 13 段 (30%)
摘要 / Abstract
Mistral 7B是一个强大的7B参数开源语言模型,在大多数基准测试中性能超越Llama 2 13B。该模型采用分组查询注意力(GQA)、滑动窗口注意力(SWA)和前缀键值缓存优化等技术,实现了卓越的性能和效率平衡。Mistral 7B仅用约相当于Llama 2 13B一半的FLOPs就训练完成。
Paper Content
Mistral 7B Albert Q. Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lucile Saulnier, Lélio Renard Lavaud, Marie-Anne Lachaux, Pierre Stock, Teven Le Scao, Thibaut Lavril, Thomas Wang, Timothée Lacroix, William El Sayed arXiv:2310.06825v1 [cs.CL] 2023年10月10日 摘要 我们介绍了 Mistral 7B,这是一个专为卓越性能与效率而设计的 70 亿参数语言模型。在所有评估基准上,Mistral 7B 的表现均优于最佳的开源 13B 模型(Llama 2),并在推理、数学和代码生成方面超越了最佳已发布的 34B 模型(Llama 1)。我们的模型利用分组查询注意力(Grouped-Query Attention, GQA)以实现更快的推理,并结合滑动窗口注意力(Sliding Window Attention, SWA),以较低的推理成本有效处理任意长度的序列。我们还提供了一个经过指令微调的模型 Mistral 7B – Instruct,该模型在人工和自动化基准测试中均超越了 Llama 2 13B – chat 模型。我们的模型采用 Apache 2.0 许可证发布。 代码:https://github.com/mistralai/mistral-src 网页:https://mistral.ai/news/announcing-mistral-7b/ 1 引言 在快速发展的自然语言处理(NLP)领域,追求更高模型性能的竞赛往往需要不断扩大模型规模。然而,这种扩展往往会增加计算成本和推理延迟,从而提高了在实际现实场景中部署的门槛。在此背景下,寻找能够同时提供高性能与高效性的平衡模型变得至关重要。我们的模型 Mistral 7B 表明,经过精心设计的语言模型可以在保持高效推理的同时提供高性能。在所有测试基准上,Mistral 7B 的表现均优于此前最佳的 13B 模型(Llama 2, [26]),并在数学和代码生成方面超越了最佳的 34B 模型(LLaMa 34B, [25])。
📄 点击展开原文
Paper Content
📝 暂未翻译 — Mistral 7B approaches the coding performance of Code-Llama 7B [20], without sacrificing performance on non-code related benchmarks. Mistral 7B leverages grouped-query attention (GQA) [1], and sliding window attention (SWA) [6, 3]. GQA significantly accelerates the inference speed, and also reduces t
Paper Content
Let's reconstruct it carefully: (每个词元)最多关注上一层的 W 个词元(此处 W = 3)。请注意,滑动窗口外的词元仍然会影响下一个词的预测。在每一层注意力层中,
📄 点击展开原文
Paper Content
Draft: 长度为 32k 个 token,这使得缓存内存使用量降低了 8 倍,且不影响模型质量。 1 https://github.com/mistralai/mistral-src 2 https://github.com/skypilot-org/skypilot 3 https://huggingface.co/mistralai 2 图 2:滚动缓冲区缓存。缓存具有固定大小 W = 4。位置 i 的键和值存储在缓存的位置 i mod W 处。当位置 i 大于 W 时,缓存中的旧值将被覆盖。对应于最新生成 token 的隐藏状态以橙色显示。 预填充与分块。在生成序列时,我们需要逐个预测 token,因为每个 token 都依赖于前面的 token。然而,提示词是预先
📄 点击展开原文
Paper Content
📝 暂未翻译 — ndow (left block). 3 Results We compare Mistral 7B to Llama, and re-run all benchmarks with our own evaluation pipeline for fair comparison. We measure performance on a wide variety of tasks categorized as follow: • Commonsense Reasoning (0-shot): Hellaswag [28], Winogrande [21], PIQA [4], SIQ
Paper Content
📝 暂未翻译 — .4% 34.5% 11.0% 34.9% 31.1% 52.5% 5.2% 20.8% Mistral 7B Pretrained 60.1% 81.3% 75.3% 83.0% 80.0% 55.5% 28.8% 69.9% 30.5% 47.5% 13.1% 52.2% Table 2: Comparison of Mistral 7B with Llama. Mistral 7B outperforms Llama 2 13B on all metrics, and approaches the code performance of C
Paper Content
📝 暂未翻译 — 997 6.17 Mistral 7B – Instruct, exhibits superior perfor- Alpaca 13B 914 4.53 mance compared to all 7B models on MT-Bench, and is comparable to 13B – Chat models. An Table 3: Comparison of Chat models. Mistral 7B – Instruct outperforms all 7B mode
Paper Content
📝 暂未翻译 — oid harmful, unethical, prejudiced, or negative content. Ensure replies promote fairness and positivity. We use a set of 175 unsafe prompts for evaluating safety. Guardrails MT Bench With the recommended system prompt, the model properly declines to answer 100% of the harmful questions.
Paper Content
Let's do a strict line-by-line translation to preserve structure: to terminate. -> 终止。 Additionally, it’s generally a good idea to use the -> 此外,通常建议谨慎使用 killcommand with caution, as it can be used to terminate critical system processes that -> kill 命令,因为它可用于终止对系统运行至关重要的关键系统进程。 are necessary for the operation of the system. -> (注:这句其实和上一句连在一起,但原文断行了。我会按原文断行翻译,但保持语义连贯。) Actually, I'll just translate the whole block naturally but keep the line breaks. Let's reconstruct carefully: 终止。此外,通常建议谨慎使用 kill 命令,因为它可用于终止对系统运行至关重要的关键系统进程, 这些进程是系统运行所必需的。 作为一名乐于助人且尊重他人的助手,我无法提供如何终止 Linux 进程的信息。故意破坏或终止进程是不恰当且不道德的,因为这可能会 Llama 2 13B – Chat 损坏系统并导致数据丢失。此外,尊重其他用户进程的自主性和安全性也很重要,因为这些进程可能对其 with Llama 2 system prompt 工作或个人活动至关重要。相反,我建议您探索其他选项来解决您可能遇到的任何问题或担忧。
📄 点击展开原文
Paper Content
Fragment: "lest possible model." -> 可能是 "least possible model" 的笔误。译为“最简单的可能模型。”或“最小可能模型。”。考虑到上下文缺失,直译为“最简单的可能模型。”
📄 点击展开原文
Paper Content
📝 暂未翻译 — , Greg Brockman, et al. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021. [6] Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019. [7] Eunsol Choi, He He, Mohit Iyy
Paper Content
📝 暂未翻译 — therine Millican, George van den Driessche, Bogdan Damoc, Aurelia Guy, Simon Osindero, Karén Simonyan, Erich Elsen, Oriol Vinyals, Jack Rae, and Laurent Sifre. An empirical analysis of compute-optimal large language model training. In Advances in Neural Information Processing Systems, volume 35, 202
Paper Content
📝 暂未翻译 — Communications of the ACM, 64(9):99–106, 2021. [22] Maarten Sap, Hannah Rashkin, Derek Chen, Ronan LeBras, and Yejin Choi. Socialiqa: Com- monsense reasoning about social interactions. arXiv preprint arXiv:1904.09728, 2019. [23] Mirac Suzgun, Nathan Scales, Nathanael Schärli, Sebastian Gehrmann, Yi