AI State of the Art
Ecosystem/Annotated Foundational Papers/12 min
Section 303

"LLaMA: Open and Efficient Foundation LMs" (2023)

Listen as a podcast →

The Equalizer: David Beats Goliath

LLaMA 13B vs GPT-3 (175B). Same performance. Or better.

13 billion parameters against 175 billion. How can a model 13x smaller rival a giant?

The answer fits in one word: data. LLaMA directly applies the lessons of Chinchilla. Instead of stacking parameters and feeding them sparingly (like GPT-3: 175B parameters, 300 billion tokens), LLaMA does the opposite: a compact model, stuffed with data (13B parameters, 1 trillion tokens).

GPT-3's token/parameter ratio? About 1.7. LLaMA's? About 77. That's 45x more data per parameter. And it changes everything.

The impact: open-source becomes real

Before LLaMA, the best LLMs were proprietary. OpenAI, Google, and Anthropic kept their models behind paid APIs. LLaMA made open-source viable for world-class models. Thousands of researchers, developers, and startups could experiment. Innovation accelerated overnight. The industry's structure changed.

Public Data Only: Reproducibility First

A remarkable aspect of LLaMA: Meta only uses publicly accessible data:

  • Common Crawl (67%): web pages filtered and cleaned with a quality classifier
  • C4 (15%): Common Crawl cleaned following Google's methodology
  • GitHub (4.5%): open-source code
  • Wikipedia (4.5%): in 20 languages
  • Books (4.5%): Gutenberg corpus and Books3
  • ArXiv (2.5%): scientific papers in LaTeX
  • StackExchange (2%): technical Q&A

No proprietary data. No inaccessible secret corpora. This matters for reproducibility: in theory, anyone could reconstitute the training dataset (even if in practice, it's considerable work).

Horizontal bar chart titled LLaMA Training Data Composition (1.4T Tokens Total). CommonCrawl 67 percent or 0.94 trillion tokens, C4 15 percent or 0.21 trillion, GitHub 4.5 percent or 63 billion, Wikipedia 4.5 percent or 63 billion, Books 4.5 percent or 63 billion, ArXiv 2.5 percent or 35 billion, StackExchange 2 percent or 28 billion. The horizontal axis shows the percentage of training data from 0 to 80.
The data mix described above, seen as proportions. Two thirds of the corpus is filtered raw web; the curated sources (Wikipedia, books, code, scientific papers) all fit in the last fifth. Every source on this list is public, which is exactly the paper's reproducibility argument.Source : LLaMA paper (table 1), re-plotted by Michael Brenndoerfer

Architectural Choices: Nothing New, but the Best of Everything

LLaMA didn't invent any new technique. Its strength lies in the judicious combination of existing best practices:

  • Pre-norm with RMSNorm: normalize the input of each sub-layer (instead of the output). More stable for large-scale training.
  • SwiGLU (activation function): replaces ReLU in feed-forward layers. Improves performance without significant overhead.
  • Rotary Positional Embeddings (RoPE): a relative positional encoding that allows generalization to sequence lengths never seen during training.
  • No bias in linear layers: a simplification that doesn't affect performance.

This exact recipe has become the industry standard. Mistral, LLaMA 2/3, Gemma, Qwen, Yi: they all copy this architecture, sometimes identically. LLaMA defined the archetype of the modern LLM.

Vertical diagram of a LLaMA Transformer block. Input x passes through a green RMSNorm box, a blue Multi-Head Self-Attention box with RoPE, then a residual addition marked with a red plus; then a second green RMSNorm box, a purple SwiGLU Feed-Forward box, and a second residual addition, before output y. Two dashed grey lines show the residual connections bypassing each sub-layer. A blue annotation notes that position is encoded via RoPE rotation, a purple annotation notes that SwiGLU is a gated activation.
The four choices listed above, assembled into a single block. Note that the RMSNorms sit before each sub-layer (pre-norm), that RoPE acts inside attention rather than at the model input, and that the feed-forward layer is a SwiGLU. This is the block Mistral, Gemma and Qwen would later reuse almost unchanged.Source : Michael Brenndoerfer, LLaMA Architecture: Design Philosophy and Training Efficiency

Results: Data Beats Parameters

ModelParametersTraining tokensPerformance
LLaMA-7B7B1TOutperforms GPT-3 (175B) on some benchmarks
LLaMA-13B13B1TOutperforms GPT-3 overall
LLaMA-33B33B1.4TCompetitive with Chinchilla (70B)
LLaMA-65B65B1.4TRivals PaLM (540B) on several tasks

The evidence is overwhelming: brute size doesn't reign. What matters is the parameter/data ratio and training quality. A well-sized and properly trained model outperforms a giant model that's poorly calibrated.

Plot of training loss against billions of tokens seen, with four curves: LLaMA 7B in blue, 13B in orange, 33B in green, 65B in red. All drop sharply at first then descend slowly. The 7B and 13B curves stop at 1000 billion tokens, around 1.80 and 1.73; the 33B and 65B curves continue to 1400 billion, around 1.62 and 1.56. None of the curves is flat where it stops.
The paper figure behind the table above. At the end of training none of the four curves has flattened: even after 1 trillion tokens, the 7B was still improving. In other words the models of that era were not too small, they were underfed, which is exactly what LLaMA fixed.Source : LLaMA paper (Touvron et al., figure 1), via ar5iv

The Leak and the Ecosystem Acceleration

LLaMA was initially reserved for academic researchers, with an access request form. But a few days after publication, the weights leaked onto the internet. Torrents, forums, GitHub: everyone had instant access.

Meta was "surprised." Or maybe not so upset. The leak massively accelerated adoption. And the resulting ecosystem gave Meta enormous influence over the direction of open-source AI.

The Explosion of Derivatives: One Week Is Enough

The ecosystem of LLaMA-derived models exploded in a matter of weeks:

Alpaca (Stanford, March 2023): LLaMA-7B fine-tuned with 52,000 instructions generated by GPT-4. Total fine-tuning cost: $600. Performance close to GPT-3.5 for certain tasks. Revelation: you can create a competent conversational assistant for the price of a restaurant dinner.

Vicuna: fine-tuned on ShareGPT conversations (users were sharing their ChatGPT dialogues). 90% of ChatGPT's quality, as estimated by GPT-4.

WizardLM: uses Evol-Instruct, a technique that progressively increases instruction complexity. The model learns to handle increasingly sophisticated requests.

Code Llama: specialized for programming. Fine-tuned on source code, supports infilling (completing code in the middle of a file).

Dozens of other variants followed. LLaMA became the "Linux" of AI: a foundation on which everyone builds.

The Evolution of the LLaMA Family

LLaMA 2 (July 2023): going commercial. Permissive license (unless you have more than 700 million users). Sizes 7B/13B/70B. Chat versions fine-tuned with RLHF. 4,096-token context.

LLaMA 3 (April 2024): the qualitative leap. 8B and 70B parameters. Trained on 15 trillion tokens (15x LLaMA 1). 8K token context. Performance close to GPT-4 for the 70B.

LLaMA 3.1 (July 2024): the major extension. Addition of the 405B model (the largest open-weight model ever published). 128K token context. 8 languages. The 405B rivals GPT-4 and Claude 3.5 Sonnet.

LLaMA 4 (2025): adoption of the Mixture of Experts (MoE) architecture. Scout (10M token context) and Maverick models. Routing efficiency joins open-source.

Each generation progresses significantly. LLaMA remains the undisputed king of open-source.

The industry's structural turning point

LLaMA demonstrated that open-source is viable for cutting-edge LLMs. Before, AI was a proprietary monopoly. After, it's a thriving open ecosystem. The industrial structure of AI has changed irreversibly. Proprietary models must now justify their price against open-source alternatives of comparable quality.

Open-weight, not open-source in the strict sense

Let's be precise: LLaMA is open-weight (public weights), not open-source in the strict sense. The training data remains secret. The full training code isn't shared. Infrastructure and engineering details are absent. Reproducibility is therefore partial. Projects like OLMo (Allen AI) and Pythia (EleutherAI) go further by publishing data, code, and intermediate checkpoints.