# LLaMA (2023)

> Smaller models trained longer on public data alone, matching models many times their size, with the weights given to researchers.

Page: https://mralbu.github.io/ai-datasets/p/llama

## Key facts

- Title: LLaMA: Open and Efficient Foundation Language Models
- Authors: Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al.
- Venue: arXiv 2023
- Category: LLMs
- Paper: https://www.alphaxiv.org/abs/2302.13971

## Why it matters

The weights went to researchers and leaked to everyone within a week. Open models took off from there: Alpaca, Vicuna and most fine-tuning work of 2023 started from LLaMA, and training small models far past the Chinchilla optimum became the standard way to build models meant to be served.

## The idea

Choose model size for the cost of running it, not of training it, and train well past the compute-optimal point: 1 trillion tokens for the 7B and 13B models, 1.4 trillion for 33B and 65B. Use only publicly available data: web crawls (C4 among them), GitHub, Wikipedia, books, arXiv and Stack Exchange.

## The result

LLaMA-13B beat the 175B GPT-3 on most benchmarks, and LLaMA-65B was competitive with Chinchilla and PaLM-540B: 50.9% on GSM8K (69.7% with majority voting, above Minerva-62B's 68.5%) and 23.7% pass@1 on HumanEval, though 63.4% on MMLU trailed Chinchilla's 67.5%.

## The data

- [MMLU (2020)](https://mralbu.github.io/ai-datasets/d/mmlu.md): 15,908 four-option exam questions, from high-school math to law and medicine.
- [GSM8K (2021)](https://mralbu.github.io/ai-datasets/d/gsm8k.md): 8.5k grade-school math word problems with step-by-step solutions.
- [HumanEval (2021)](https://mralbu.github.io/ai-datasets/d/humaneval.md): 164 hand-written Python problems graded by unit tests.
- [MATH (2021)](https://mralbu.github.io/ai-datasets/d/math.md): 12,500 competition problems (AMC, AIME and others) in 7 subjects and 5 difficulty levels.
- [HellaSwag (2019)](https://mralbu.github.io/ai-datasets/d/hellaswag.md): Pick the most plausible ending for a video caption or how-to step. Easy for people, hard for 2019 models.
- [AI2 ARC (2018)](https://mralbu.github.io/ai-datasets/d/ai2-arc.md): 7,787 real science exam questions; the Challenge set is the 2,590 that simple methods fail.
- [Natural Questions (2019)](https://mralbu.github.io/ai-datasets/d/natural-questions.md): Real Google search questions, each answered by an annotator with a paragraph and a short span from Wikipedia.
- [TruthfulQA (2021)](https://mralbu.github.io/ai-datasets/d/truthfulqa.md): 817 questions written so that the popular answer is false.
- [C4 (2019)](https://mralbu.github.io/ai-datasets/d/c4.md): The Colossal Clean Crawled Corpus: 365 million English web pages, filtered with simple rules.

## Builds on

- [Chinchilla (2022)](https://mralbu.github.io/ai-datasets/p/chinchilla.md)

## Part of

- [Scaling language models](https://mralbu.github.io/ai-datasets/t/llm-scaling.md) (step 5 of 5)
