TinyLlama: An Open-Source Small Language Model

Peiyuan Zhang, Guangtao Zeng, Tianduo Wang, Wei Lu
1/4/2024
999 citations
cs.CLcs.AI

Official code: jzhang38/TinyLlama (8,997 stars, Python, Apache-2.0, last commit 2024-05-03). Most starred: Lightning-AI/litgpt, a community implementation (13,768 stars, Python, Apache-2.0, last commit 2026-04-25, 1.5× the official stars). 1 more implementation below.

Abstract

We present TinyLlama, a compact 1.1B language model pretrained on around 1 trillion tokens for approximately 3 epochs. Building on the architecture and tokenizer of Llama 2, TinyLlama leverages various advances contributed by the open-source community (e.g., FlashAttention and Lit-GPT), achieving better computational efficiency.

Show full abstract

Despite its relatively small size, TinyLlama demonstrates remarkable performance in a series of downstream tasks. It significantly outperforms existing open-source language models with comparable sizes. Our model checkpoints and code are publicly available on GitHub at https://github.com/jzhang38/TinyLlama.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
jzhang38/TinyLlamaOfficial8,997PythonApache-2.02024-05-03
Lightning-AI/litgptCommunity13,768PythonApache-2.02026-04-25
jzhang38/TinyLlamaOfficial100%
Apache-2.0

The TinyLlama project is an open endeavor to pretrain a 1.1B Llama model on 3 trillion tokens.

8,997635Python, ShellSep 2, 20232 years agoApache-2.0
Lightning-AI/litgptCommunity100%
Apache-2.0

20+ high-performance LLMs with recipes to pretrain, finetune and deploy at scale.

13,7681,555Python, DockerfileMay 4, 20237 months agoApache-2.0
aiartificial-intelligencedeep-learninglarge-language-modelsllm+2 more

Similar Papers

Cite this paper

@article{zhang2024tinyllama,
  title  = {TinyLlama: An Open-Source Small Language Model},
  author = {Peiyuan Zhang and Guangtao Zeng and Tianduo Wang and Wei Lu},
  year   = {2024},
  eprint = {2401.02385},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2401.02385v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2401.02385.svg)](https://codeofpaper.com/paper/2401.02385)

Discussion