SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.02385 · 2024

TinyLlama: An Open-Source Small Language Model

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 2 violated it and 0 have no contract verdict; 4 failures of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2401.02385.json · badge: /api/ran/2401.02385.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
jzhang38/tinyllama canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
adapter_filter Ran
ran, violated the contract we drafted
jzhang38/tinyllama/lit_gpt/adapter_v2.py
code served (permissive licence) · get_code("e05d85cc898c445c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function adapter_filter takes two parameters:
# 1. key: str - a string to check against adapter substrings
# 2. value: Any - can be any value (not actually used in the function body)

# Create test arguments
test_key = "adapter_wte_layer"
test_value = {"some": "data"}

ARGS = {
    "key": test_key,
    "value": test_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
apply_rope Ran
ran; our contract draft was wrong, not the code
jzhang38/tinyllama/lit_gpt/model.py
code served (permissive licence) · get_code("5728c74084e12d35")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, ndim 3, dtype family float, shape (2, 3, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create input tensor x with shape (batch=2, seq_len=3, head_size=8)
# head_size must be even since it's split in half
x = torch.randn(2, 3, 8)

# Create cos and sin tensors with same shape as x for RoPE
# These represent the rotary position embeddings
cos = torch.randn(2, 3, 8)
sin = torch.randn(2, 3, 8)

ARGS = {
    'x': x,
    'cos': cos,
    'sin': sin
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 3, 8) — shape (2, 3, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_rope_cache Ran
ran, honoured the contract we drafted
jzhang38/tinyllama/lit_gpt/model.py
code served (permissive licence) · get_code("a30c7463cb6330d7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned tuple, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    "seq_len": 8,
    "n_elem": 6,
    "dtype": torch.float32,
    "device": torch.device("cpu"),
    "base": 10000,
    "condense_ratio": 1
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
code Ran
ran, honoured the contract we drafted
jzhang38/tinyllama/lit_gpt/packed_dataset.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from hrtan/fastmix, is pointer only (licence: NONE) · get_code("fa298642043e1282")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from hrtan/fastmix, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

extract_alpaca_dataset Ran
ran; our contract draft was wrong, not the code
jzhang38/tinyllama/sft/finetune.py
code served (permissive licence) · get_code("b5445674ab17410f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Setup code for extract_alpaca_dataset

ARGS = {
    'example': {
        'instruction': 'What is the capital of France?',
        'input': 'France is a country in Europe.',
        'output': 'The capital of France is Paris.'
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
extract_unnatural_instructions_data Ran
ran; our contract draft was wrong, not the code
jzhang38/tinyllama/sft/finetune.py
code served (permissive licence) · get_code("f82430123a91cf21")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    'examples': {
        'instances': [
            [
                {
                    'instruction_with_input': 'What is 2+2?',
                    'output': '4'
                },
                {
                    'instruction_with_input': 'What is 3+3?',
                    'output': '6'
                }
            ],
            [
                {
                    'instruction_with_input': 'What is 5+5?',
                    'output': '10'
                }
            ]
        ],
        'reformulations': [
            [
                {
                    'instruction_with_input': 'Calculate 2+2',
                    'output': '4'
                }
            ],
            None
        ]
    },
    'extract_reformulations': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
lora_filter Ran
ran, violated the contract we drafted
jzhang38/tinyllama/lit_gpt/lora.py
code served (permissive licence) · get_code("efd8acd4de8ba2a8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function lora_filter takes two parameters:
# - key: str - a string to check
# - value: Any - can be anything since it's not used in the function body

# The function simply checks if 'lora_' is in the key string and returns a boolean
# So we need to provide a key that contains 'lora_' and any value

ARGS = {
    "key": "lora_weight",
    "value": torch.randn(2, 4)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
maybe_align Ran
ran; our contract draft was wrong, not the code
jzhang38/tinyllama/lit_gpt/rmsnorm.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from hrtan/fastmix, is pointer only (licence: NONE) · get_code("c6283b7a1a1785ba")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from hrtan/fastmix, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

adapter_filter Not yet run
unverified (harvested, no recorded run)
jzhang38/tinyllama/lit_gpt/adapter.py
code served (permissive licence) · get_code("38ffb0df89b0d01f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 9 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 9 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
build_rope_cache 8 other papers
8 later
2408.03506 (2024-08)
1.5-Pints Technical Report: Pretraining in Days, Not Months -- Your Language Model Thrives on Quality Data
2409.17115 (2024-09)
Programming Every Example: Lifting Pre-training Data Quality Like Experts at Scale
2410.10781 (2024-10)
When Attention Sink Emerges in Language Models: An Empirical View
and 5 more not named here
extract_alpaca_dataset 8 other papers
4 dated earlier, 4 later
2305.14314 (2023-05)
QLORA: Efficient Finetuning of Quantized LLMs
2305.16300 (2023-05)
Random-Access Infinite Context Length for Transformers
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
and 5 more not named here
apply_rope 7 other papers
7 later
2405.20340 (2024-05)
MotionLLM: Understanding Human Behaviors from Human Motions and Videos
2408.03506 (2024-08)
1.5-Pints Technical Report: Pretraining in Days, Not Months -- Your Language Model Thrives on Quality Data
2409.17115 (2024-09)
Programming Every Example: Lifting Pre-training Data Quality Like Experts at Scale
and 4 more not named here
extract_unnatural_instructions_data 7 other papers
5 dated earlier, 2 later
2305.14314 (2023-05)
QLORA: Efficient Finetuning of Quantized LLMs
2305.16300 (2023-05)
Random-Access Infinite Context Length for Transformers
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
and 4 more not named here
code 5 other papers
5 later
2406.06046 (2024-06)
MATES : Model-Aware Data Selection for Efficient Pretraining with Data Influence Models
2410.08102 (2024-10)
Efficient Pretraining Data Selection for Language Models via Multi-Actor Collaboration
2410.17891 (2024-10)
Scaling Diffusion Language Models via Adaptation from Autoregressive Models
and 2 more not named here
maybe_align 5 other papers
5 later
2407.05483 (2024-07)
Just read twice: closing the recall gap for recurrent language models
2410.05363 (2024-10)
Towards World Simulator: Crafting Physical Commonsense-Based Benchmark for Video Generation
2412.06464 (2024-12)
Gated Delta Networks: Improving Mamba2 with Delta Rule
and 2 more not named here
adapter_filter 3 other papers
3 later
2025.acl-industry.15 (2025 (year only))
Run LoRA Run: Faster and Lighter LoRA Implementations
2503.15450 (2025-03)
SkyLadder: Better and Faster Pretraining via Context Window Scheduling
2504.11393 (2025-04)
How to Predict Best Pretraining Data with Small Experiments
adapter_filter 3 other papers
3 later
2025.acl-industry.15 (2025 (year only))
Run LoRA Run: Faster and Lighter LoRA Implementations
2503.15450 (2025-03)
SkyLadder: Better and Faster Pretraining via Context Window Scheduling
2504.11393 (2025-04)
How to Predict Best Pretraining Data with Small Experiments
lora_filter 3 other papers
3 later
2403.20320 (2024-03)
MTLoRA: A Low-Rank Adaptation Approach for Efficient Multi-Task Learning
2407.02013 (2024-07)
DIGRAF: Diffeomorphic Graph-Adaptive Activation Function
2503.15450 (2025-03)
SkyLadder: Better and Faster Pretraining via Context Window Scheduling

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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. 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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2401.02385")
get_code_for_paper("2401.02385")
have("2401.02385")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2401.02385.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2401.02385.svg)](https://syntology.ai/paper/2401.02385)

Connect an agent — have() is free.