GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
arXiv preprint

LLaMA: Open and Efficient Foundation Language Models

Meta trained 7B to 65B models on up to 1.4 trillion public tokens, far past the Chinchilla ratio, so they would be cheap to run. LLaMA-13B beat the 175B GPT-3 on most benchmarks.

Breakdown by FDE Interviews · 12 min read · Updated

About the original · 2023
AUTHORS
Touvron, Lavril, Izacard, Martinet, et al.
FROM
Meta AI
PUBLISHED
Feb 2023 · arXiv preprint
CITED BY
22,597Semantic Scholar · Nov 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 18% of this breakdown.

01

The paper in one minute

Chinchilla showed how to reach a given loss with the least training compute. Meta's LLaMA team pointed out what that objective ignores: a model is trained once and served millions of times, so for a target quality the cheapest model to own is often a smaller one trained much longer. Chinchilla's rule would put a 10B model at about 200B tokens; the LLaMA authors found a 7B model still improving after 1 trillion.

So they trained four models, 6.7B, 13.0B, 32.5B and 65.2B parameters, on 1.0 to 1.4 trillion tokens, using only publicly available data: two-thirds filtered CommonCrawl, plus C4, permissively licensed GitHub code, Wikipedia in 20 languages, public-domain and Books3 books, arXiv LaTeX and Stack Exchange. The architecture is a standard decoder-only Transformer with three borrowed improvements: RMSNorm applied before each sub-layer (from GPT-3), the SwiGLU activation (from PaLM) and rotary position embeddings (from GPT-Neo).

The results made the case. LLaMA-13B beat GPT-3 on most of 20 benchmarks while being more than ten times smaller, small enough to run on a single GPU. LLaMA-65B was competitive with Chinchilla-70B and PaLM-540B, with the best zero- and few-shot closed-book QA scores reported at the time. Its one clear weakness was MMLU, where it trailed Chinchilla by about four points. Meta released the weights to the research community, and LLaMA became the base for many of the open models that followed in 2023.

THE IDEA, VISUALLY
TRAINED FAR PAST THE CHINCHILLA POINT (TABLE 2) training tokens per parameter LLaMA-7B, 1.0T 149 LLaMA-13B, 1.0T 77 LLaMA-33B, 1.4T 43 LLaMA-65B, 1.4T 21 Chinchilla optimum 20 the 7B model's loss was still falling after 1T tokens PUBLIC DATA ONLY (TABLE 1, SAMPLING SHARE) web 82% code, wiki, books, papers, Q&A 18% CommonCrawl via CCNet: line dedup, fastText language ID, n-gram quality filter, and a classifier that keeps pages that look like Wikipedia references. ARCHITECTURE CHANGES (SECTION 2.2) RMSNorm pre-norm from GPT-3 SwiGLU, 2/3 x 4d from PaLM Rotary embeddings from GPT-Neo INFERENCE COST PER GENERATED TOKEN about 2 FLOPs per parameter, in GFLOPs LLaMA-7B 13 LLaMA-13B 26 LLaMA-65B 130 GPT-3 175B 350 13B AGAINST 175B, SAME BENCHMARKS 13B GPT-3 BoolQ (Table 3) 78.1 60.5 HellaSwag (Table 3) 79.2 78.9 MMLU 5-shot (Table 9) 46.9 43.9 NaturalQs 64-shot (Table 4) 31.9 29.9 13.5x fewer FLOPs per token, small enough for one GPU THE 65B TRAINING RUN (SECTION 2.4, TABLE 15) 2,048 A100 80GB, ~380 tokens/s/GPU 1.4T tokens in about 21 days 1,022,362 GPU-hours, 449 MWh arXiv 2302.13971, Meta AI, February 2023
LLaMA spends extra training tokens to buy a cheaper model at inference: 7B and 13B models on 1 trillion tokens, 33B and 65B on 1.4 trillion, all from public data. The 13B model matched or beat the 175B GPT-3 on most benchmarks while needing about 13x less compute per generated token.
Research notes: the problem, approach and results
13B > 175B

LLaMA-13B outperforms GPT-3 on most benchmarks despite being more than ten times smaller (abstract, Table 3)

1.4T tokens

training tokens for LLaMA-33B and 65B; 7B and 13B saw 1.0T (Table 2)

~21 days

to train LLaMA-65B at 380 tokens per second per GPU on 2,048 A100 80GB GPUs (Section 2.4)

THE PROBLEM

Chinchilla's scaling laws say how to minimize training compute for a target quality, but serving cost is paid on every request and falls with model size. The best models in early 2023 were also trained on private or undocumented data and could not be studied or rebuilt.

THE IDEA

Train a family of 7B to 65B decoder-only Transformers far longer than Chinchilla's optimum, on 1.0 to 1.4 trillion tokens from public sources only: filtered CommonCrawl, C4, GitHub, Wikipedia, books, arXiv and Stack Exchange. Use pre-normalization with RMSNorm, SwiGLU and rotary embeddings, and release the weights to researchers.

THE RESULT

LLaMA-13B outperformed GPT-3 (175B) on most benchmarks, and LLaMA-65B was competitive with Chinchilla-70B and PaLM-540B, beating Chinchilla on every common-sense benchmark but BoolQ. It lagged on MMLU (63.4% against 67.5%), which the authors attribute to using only 177 GB of books and papers.

02

Why it matters to an FDE

LLaMA is the paper that made "smaller model, more tokens" the default for anything that serves real traffic, and it is the template for the open-weight models a customer will ask you to deploy.

Design for inference cost. Generating a token costs about 2 FLOPs per parameter. A 13B model that matches a 175B model on the customer's task is roughly thirteen times cheaper per token and fits on hardware they already own. LLaMA put that trade at the center of model choice.

Open weights change the deployment options. With weights in hand a team can run the model inside its own network, fine-tune it with LoRA or QLoRA, quantize it, and audit its behavior. All of that is impossible behind an API. The first LLaMA release was for research use, so check the license of any specific model before planning production.

Public data has gaps. The authors explain their MMLU deficit by the small amount of books and academic text in a purely public corpus. When a customer's domain is underrepresented on the open web, expect a base model to be weaker there whatever its size.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 290 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦2 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    The inference-budget argument, the data mix, three architecture changes and the results that held

    Free account
  2. 04How it works

    Data cleanup per source, the architecture and optimizer, and the efficiency work

    Premium
  3. 05The numbers that matter

    Model shapes, benchmark tables against GPT-3, Chinchilla and PaLM, and the training bill

    Premium
  4. 06Try it yourself

    Rebuild the parameter counts, recompute the training bill, and size the models for inference

    Premium
  5. 07Where it breaks

    Benchmark gaps, base-model limits, bias and toxicity, research-only weights and slips

    Premium
  6. 08Using it on a deployment

    Picking a size, memory planning, fine-tuning and quantization paths, and license checks

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →