ElemedexA pocket encyclopedia of AI architectures
No. 040

LLaMA

Large Language Model Meta AI

Runaway Llama

Meta let it out on a leash, for researchers only and under a noncommercial license. A week later it was roaming free on 4chan, and within weeks it was grazing on laptops all over the world, squeezed into four bits. It never went back to the pen.

Height
32 (7 B) · 40 (13 B) · 60 (33 B) · 80 (65 B)
Weight
≈ 13 GB (7 B) · ≈ 130 GB (65 B) in fp16; ≈ 4 GB (7 B at 4 bits)
Parameters
6.7 B · 13 B · 32.5 B · 65.2 B
Context
2,048 tokens
Training data
1.0 trillion tokens (7 B, 13 B) · 1.4 trillion (33 B, 65 B); public data only
Year
2023
Generation
6 · Assistants, reasoning, and agents
Creators
Touvron, Lavril, Izacard, Martinet, Lachaux, Lacroix, Rozière, Goyal, Hambro, Azhar, Rodriguez, Joulin, Grave & Lample (Meta AI)
Kind
Model

Base stats

Total
369

Approximate, ordinal scales meant for comparing species with each other; the hard numbers are in the data sheet.

Weaknesses

  • It is a base model: it neither follows instructions nor converses without further tuning.
  • A window of only 2,048 tokens.
  • It inherits bias and toxicity from the web; its own authors measure and report it.
  • Only half “open”: the weights circulate, but not the training code or the processed data.

Habitat

It grazed on CommonCrawl (two thirds of its diet), C4, GitHub, Wikipedia in twenty languages, Gutenberg and Books3 books, arXiv and StackExchange. Today it lives on home hard drives, on Hugging Face, and in thousands of fine-tuned variants named after camelids.

Moves

Abilities

Deliberate overtraining
Trains small models on far more tokens than the Chinchilla optimum: costlier to train, but cheaper to use.
Downloadable weights
Anyone with the files can run it, fine-tune it, quantize it or open it up to study its insides.
“Modern” block
Pre-normalization with RMSNorm, SwiGLU activation and rotary positions (RoPE): the recipe inherited by nearly every open model.

Anatomy

Left: the LLaMA-65B decoder, with the three changes it borrowed from other models: RMSNorm pre-normalization (normalization comes before each sublayer, inside the residual connection), SwiGLU, and RoPE, which encodes position inside attention. Right: the path the 7 B version took after the leak, from 13 GB down to about 4 GB.

Evolution chain

040 LLaMA

LLaMA is a family of four transformer decoders, from 7 to 65 billion parameters, that Meta AI introduced in February 2023. Its architecture is conventional; its importance lies in two decisions: training small models for much longer, and using only publicly available data so that the weights could be released to the research community (Touvron, Lavril, et al., 2023).

How it works

It is an autoregressive language model like GPT-3, with three tweaks borrowed from other models: it normalizes the input of each sublayer (pre-normalization, with RMSNorm), uses the SwiGLU activation in the feedforward network, and replaces absolute positional encoding with rotary embeddings (RoPE), applied inside attention (Touvron, Lavril, et al., 2023, sec. 2.2). Alammar & Grootendorst (2024) present exactly these changes as the features of the typical 2024 transformer block, that of Llama 3 (2024, pp. 101–103). The tokenizer is BPE and splits numbers into single digits.

The data add up to 1.4 trillion tokens: two thirds filtered CommonCrawl, plus C4, GitHub, Wikipedia in twenty languages, books, arXiv and StackExchange. The 7B and 13B models saw 1 trillion tokens; the 33B and 65B models, 1.4 trillion. The largest was trained for about 21 days on 2,048 A100 GPUs (Touvron, Lavril, et al., 2023, secs. 2.1 and 2.4).

What changed

Chinchilla had shown how to split a fixed compute budget between parameters and data (Hoffmann et al., 2022). Touvron and colleagues objected that this calculation ignores the cost of using the model: for a given level of performance, a smaller model trained longer is preferable, even if it costs more to train. Where Chinchilla recommended a 10-billion model on 200 billion tokens, they observed that a 7-billion model kept improving after a trillion (Touvron, Lavril, et al., 2023, sec. 1). The upshot: LLaMA-13B beat GPT-3 (175 billion) on most benchmarks while being ten times smaller, and LLaMA-65B was competitive with Chinchilla-70B and PaLM-540B.

The leak

Meta released it on February 24, 2023, under a noncommercial license, on request and case by case. On March 3 someone posted a torrent of the weights on 4chan. What followed was an ecosystem: on March 10 Georgi Gerganov released llama.cpp, whose stated goal was to run the model quantized to 4 bits on a MacBook; on March 13 Stanford presented Alpaca, a LLaMA-7B fine-tuned on 52,000 instructions generated by an OpenAI model, for under 600 dollars. Quantizing means storing each weight with fewer bits, like saying “it's 14:16” without the seconds (Alammar & Grootendorst, 2024, pp. 200–201): the 7-billion model shrinks from about 13 GB to about 4. In July came Llama 2, trained on 2 trillion tokens (Alammar & Grootendorst, 2024, p. 26), with a doubled window and released, in its own paper's words, “for research and commercial use.”

Limits

LLaMA is a base model: it neither follows instructions nor converses. Its window is 2,048 tokens, and the paper itself documents biases and toxicity inherited from the web. Besides, “open” is a contested term: the weights are distributed, but rarely the training code or the data, and licenses impose restrictions (Alammar & Grootendorst, 2024, p. 30). One of its corpora, Books3, came from a pirated-books site and was taken down in July 2023 over copyright claims.

Sources

  • Alammar, J., & Grootendorst, M. (2024). Hands-on large language models: Language understanding and generation. O’Reilly Media. §
  • Hoffmann, J., Borgeaud, S., Mensch, A., Buchatskaya, E., Cai, T., Rutherford, E., de Las Casas, D., Hendricks, L. A., Welbl, J., Clark, A., Hennigan, T., Noland, E., Millican, K., van den Driessche, G., Damoc, B., Guy, A., Osindero, S., Simonyan, K., Elsen, E., . . . Sifre, L. (2022). Training compute-optimal large language models. In Advances in Neural Information Processing Systems (Vol. 35, pp. 30016–30030). Curran Associates. https://doi.org/10.52202/068431-2176 §
  • Millière, R., & Buckner, C. (2024b). A philosophical introduction to language models—Part II: The way forward (arXiv:2405.03207). arXiv. https://doi.org/10.48550/arXiv.2405.03207 §
  • Santelli, M. (2026, August 25). El futuro de la IA: Entre doomers y hyperos. 421.news. https://www.421.news/es/ia-doomers-hyperos/ §
  • Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M.-A., Lacroix, T., Rozière, B., Goyal, N., Hambro, E., Azhar, F., Rodriguez, A., Joulin, A., Grave, E., & Lample, G. (2023). LLaMA: Open and efficient foundation language models (arXiv:2302.13971). arXiv. https://doi.org/10.48550/arXiv.2302.13971 §