截至目前2025年5月Meta 发布的 LLaMA (Large Language Model Meta AI) 系列共经历了4个大版本、7个主要迭代下面逐一介绍。一、LLaMA 12023年2月第一版 LLaMA有时也称 LLaMA 1于 2023 年 2 月 24 日通过博客和论文正式发布。[6]它包含四个文本模型参数量分别为 7B、13B、33B 和 65B。[6]架构特点LLaMA 1 的核心是标准 Transformer Decoder-Only 架构但在此基础上集成了多项当时最优的改进技术Pre-norm RMSNormLLaMA 1 在标准 Transformer 架构上进行了若干改造包括使用 RMSNorm 对输入进行预归一化Pre-normalization、使用 SwiGLU 激活函数和旋转位置编码RoPE。[1]SwiGLU 激活函数LLaMA 使用 SwiGLU 激活函数而非 GPT-3 的 GeLU。[6]RoPE 位置编码LLaMA 使用旋转位置编码RoPE代替绝对位置编码并以 RMSNorm 代替 Layer Normalization。[6]上下文长度这些模型使用标准 Transformer Decoder 架构训练时的上下文窗口为 2048 个 token。[6]效果亮点LLaMA-13B 在大多数基准测试上超越了 GPT-3175BLLaMA-65B 可与 Chinchilla-70B 和 PaLM-540B 媲美。[6]这背后的核心设计理念是开发团队专注于通过扩大训练数据量来提升性能而非一味增加参数数量。[6]二、LLaMA 22023年7月2023 年 7 月 18 日Meta 联合微软发布了 LLaMA 2提供 7B、13B 和 70B 三种参数规模。[6]架构特点LLaMA 2 大体上保留了 LLaMA 1 的架构但在更多 token 上进行预训练、将上下文长度翻倍并在 70B 模型中引入了分组查询注意力GQA以提升推理效率。[3]GQAGrouped Query Attention与标准多头注意力MHA不同GQA 在保留多个 Query head 的同时减少了 Key/Value head 的数量是 MQA 与 MHA 之间的折中方案。[1]上下文扩展LLaMA 2 将上下文长度从 LLaMA 1 的 2K token 扩展到了 4K token。[2]更多训练数据LLaMA 2 更新了预训练数据组成对高质量和事实性强的数据来源进行了更多采样并将预训练数据集规模增加了 40%。[2]关键升级——对齐训练RLHFLLaMA 2 采用了 RLHF、SFT 以及迭代奖励建模等微调方法。[2]LLaMA 2 是唯一一个分别为「安全性」和「有用性」训练独立 RLHF 模型的版本。[5]此外Meta 还发布了专门针对对话的微调版本LLaMA 2-Chat以及代码专用变体Code LLaMA。三、LLaMA 32024年4月2024 年 4 月 18 日Meta 发布了 LLaMA 3提供 8B 和 70B 两种参数规模。[6]架构特点GQA 全面推广尽管整体架构相比 LLaMA 2 没有根本改变但所有规模的 LLaMA 3 变体均采用了 GQA此前仅限于较大模型GQA 通过更紧凑地表示注意力机制中的 Key/Value大幅缩减了推理时的 KV 缓存占用。[5]更大词汇表与更强分词器LLaMA 3 将 GQA 扩展到小模型引入了更高效的分词器并扩大了词汇表规模。[5]上下文长度提升LLaMA 3 的上下文窗口扩展至 8192 个 token高于 LLaMA 2 的 4096 和 LLaMA 1 的 2048。[5]更大规模训练数据LLaMA 3 的训练数据规模大幅提升至 15 万亿 token远超 LLaMA 2 的 2 万亿 token。[5]四、LLaMA 3.12024年7月LLaMA 3.1 于 2024 年 7 月发布新增了 405B 参数规模的模型。[3]主要升级LLaMA 3.1 并未改变核心架构更大的变化在于训练数据的清洗流程、更长的上下文长度以及新增支持的语言。[5]超长上下文LLaMA 3.1 支持高达 128K token 的上下文窗口使其能够在长时间交互中保持连贯并显著提升了复杂推理能力。[6]里程碑式规模405B 是该版本的重要亮点在此之前开放大语言模型通常不超过 100B 参数规模。[10]多语言支持新增对 8 种语言的支持。五、LLaMA 3.22024年9月/10月LLaMA 3.2 于 2024 年 10 月发布是 Meta 第一个完全多模态的 LLM。[3]主要升级多模态视觉能力LLaMA 3.2 系列引入了支持视觉的多模态模型包括 11B 和 90B 参数的视觉模型它们同时接受图片和文本输入。[6]轻量化边缘部署1B 和 3B 的小型模型专为边缘设备和低功耗微调场景设计。[6]所有 LLaMA 3 系列模型均支持 128K token 的超长上下文。六、LLaMA 3.32024年12月LLaMA 3.3 于 2024 年 12 月发布是一个 70B 参数的文本模型针对多语言对话进行了指令微调支持 8 种语言及 128K 上下文。[6]主要升级Meta 声称LLaMA 3.3 的 70B 变体能够在更低算力需求下达到与 3.1 的 405B 变体相当的性能。[3]本质上是对 LLaMA 3 系列较小模型的后期训练Post-training进行了大幅提升。七、LLaMA 42025年4月2025 年 4 月 5 日Meta 发布了 LLaMA 4 系列模型。[3]这是迄今为止架构变化最大的一次迭代堪称全面重构。核心架构革命——MoE混合专家架构LLaMA 4 是 Llama 家族中首批采用混合专家MoE架构的模型每次处理输入 token 时只有一部分参数被激活兼顾了能力与效率。[3]LLaMA 4 采用交替的 Dense 层与 MoE 层来提升推理效率MoE 层使用 128 个路由专家和一个共享专家每个 token 会被发送给共享专家以及 128 个路由专家中的一个虽然所有参数都存储在内存中但实际推理时只有一部分参数被激活。[1]iRoPE 架构LLaMA 4 架构的关键创新是使用了交错的、不含位置编码的注意力层并在推理时对注意力进行温度缩放以增强长度泛化能力。Meta 将其称为 iRoPE 架构其中i代表交错注意力层暗示着支持无限上下文长度的长期目标而RoPE则指大多数层中使用的旋转位置编码。[1]三款子模型LLaMA 4 系列推出了两款高效模型LLaMA 4 Scout17B 激活参数、16 个专家和 LLaMA 4 Maverick17B 激活参数、128 个专家。[2]此外还有 LLaMA 4 Behemoth拥有 2880 亿激活参数、16 个专家总参数量接近 2 万亿。[9]原生多模态LLaMA 4 支持多模态输入文本与图像输入文本输出以及 12 种语言的多语言能力。[6]超长上下文LLaMA 4 Scout 提供 1000 万 token 的上下文窗口Maverick 提供 100 万 token远超此前 128K token 的主流标准。[8]总结对比版本发布时间参数规模架构类型上下文长度关键技术LLaMA 12023.027B~65BDense Transformer2KRMSNorm, SwiGLU, RoPELLaMA 22023.077B~70BDense Transformer4KGQA (70B), RLHFLLaMA 32024.048B~70BDense Transformer8KGQA全面应用, 15T训练数据LLaMA 3.12024.078B~405BDense Transformer128K超大规模(405B), 多语言LLaMA 3.22024.091B~90BDense 视觉编码器128K原生多模态轻量化LLaMA 3.32024.1270BDense Transformer128K后期训练优化LLaMA 42025.0417B激活~2T总参MoE iRoPE1M~10MMoE、原生多模态、iRoPE总体来看LLaMA 4 引入了混合专家MoE和原生多模态等根本性架构变化与 LLaMA 1~3 时代有了显著区别。[8]整个系列从最初的纯研究用途 Dense 模型逐步演进为面向生产部署的高效多模态 MoE 系统。The Llama 4 herd: The beginning of a new era of natively multimodal AI innovationThe LLaMA Family of Models, Model Architecture, Size, and Scaling LawsLLaMA 2: Open Foundation and Fine-Tuned Chat Models - ZHAOHONG LIU’s Homepagemeta-llama (Meta Llama)LLaMA Components: RMSNorm, SwiGLU, and RoPE - Interactive | Michael Brenndoerfer | Michael BrenndoerferLlama 2 — KluMeta Llama 4 explained: Everything you need to knowMeta Llama 4 MaverickLLaMA Architecture: Design Philosophy and Training Efficiency - Interactive | Michael Brenndoerfer | Michael BrenndoerferLlama 2 - Transformers documentationUnmatched Performance and Efficiency | Llama 4LLaMA: Concepts Explained (Summary) | by Anshu Kumar | MediumLLaMA 2 | AI WikiThe Evolution of Llama: From Llama 1 to Llama 3.1Llama 4 Scout: A Technical Analysis of Native Multimodality, Sparse Architecture, and the 10-Million Token Context Frontier | Uplatz BlogAman’s AI Journal • Models • LLaMALlama 2: Meta AI’s Advanced Open-Source LLM ModelLlama (language model) - WikipediaEvolution of Meta’s LLaMA Models and Parameter-Efficient Fine-Tuning of Large Language Models: A SurveyChoosing the Best Llama Model: Llama 3 vs 3.1 vs 3.2GitHub - aju22/LLaMA2: This repository contains an implementation of the LLaMA 2 (Large Language Model Meta AI) model, a Generative Pretrained Transformer (GPT) variant. The implementation focuses on the model architecture and the inference process. The code is restructured and heavily commented to facilitate easy understanding of the key parts of the architecture. · GitHubLlama 4: Did Meta just push the panic button?Meta Unleashes New Llama 4 AI Models - AIwireBuilding LLaMA from Scratch: A Step-by-Step GuideLlama 2 · Hugging FaceThe Evolution of Meta’s Llama LLMs - by Ram KomarrajuArchitecture, MoE, Multimodal Power - Meta LLama 4LLaMA: Efficient Language Models 2023 | PDF | CognitionLLaMA-2 from the Ground Up - by Cameron R. Wolfe, Ph.D.The Big LLM Architecture Comparison - Ahead of AIMeta releases Llama 4, a new crop of flagship AI models | TechCrunchPaper Study: LLaMA Open and Efficient Foundation Language Models | Mun Hou’s BlogLLAMA Series. — technical evolution of LLAMA models | by Ankit kumar | MediumThe Evolution of Llama: From Llama 1 to Llama 3.1 | Towards Data ScienceAll Meta AI models available in 2025: complete list for web, mobile, and developer APIs including Llama 4, 3.3, 3.2, and 3.1Transformer Design Guide (Part 2: Modern Architecture) | Rohit BandaruThoughts from LLama-2 paper. Meta recently launched LLama-2… | by Manav Gupta | Medium