SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.21783 · 2024

The Llama 3 Herd of Models

Llama Team, Ai Meta

arXiv · PDF · Open in the Atlas

Code that ran

9 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; 0 honoured the contract we drafted, 1 violated it and 7 have no contract verdict; 1 failure of our instrument; 0 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/2407.21783.json · badge: /api/ran/2407.21783.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
wenet-e2e/west community (classifier label)
classifier basis not recorded on the link
7 ran · 0 no recorded run
zhuzilin/ring-flash-attention extension (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
FunctionStatusWhere it lives
check_params Ran
ran, violated the contract we drafted
zhuzilin/ring-flash-attention/ring_flash_attn/adapters/hf_adapter.py
code served (permissive licence) · get_code("a72091af26599f15")
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 inspect

def f1(a, b, c):
    return a + b + c

def f2(x, y, z):
    return x * y * z

def f3(p, q):
    return p - q

ARGS = {
    "f1": f1,
    "f2": f2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 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
convert_to_west_state_dict Ran
ran on a synthesized input
wenet-e2e/west/west/models/fireredasr_llm/convert_fireredasr_llm_weights_to_west.py
code served (permissive licence) · get_code("31547d9807111968")
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 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
import tempfile
import os

torch.manual_seed(0)

# Create a temporary checkpoint file with a valid state dict
temp_dir = tempfile.mkdtemp()
checkpoint_path = os.path.join(temp_dir, "pretrained_checkpoint.pt")

# Build a minimal state dict that the function will process
# Include various layer types that the function handles
firered_state_dict = {
    # LLM base model (passed through unchanged)
    'llm.base_model.layer.0.weight': torch.randn(4, 4),
    
    # Input preprocessor (converted to embed)
    'input_preprocessor.out.weight': torch.randn(4, 4),
    'input_preprocessor.out.bias': torch.randn(4),
    
    # Encoder layers
    'encoder.layer_stack.0.self_attn.w_qs.weight': torch.randn(4, 4),
    'encoder.layer_stack.0.self_attn.w_ks.weight': torch.randn(4, 4),
    'encoder.layer_stack.0.self_attn.w_vs.weight': torch.randn(4, 4),
    'encoder.layer_stack.0.self_attn.fc.weight': torch.randn(4, 4),
    'encoder.layer_stack.0.self_attn_norm.weight': torch.randn(4),
    'encoder.layer_stack.0.mlp.w_1.weight': torch.randn(4, 4),
    'encoder.layer_stack.0.mlp.w_2.weight': torch.randn(4, 4),
    
    # Decoder layers
    'decoder.token_embedding.weight': torch.randn(4, 4),
    'decoder.layer_stack.0.self_attn.w_qs.weight': torch.randn(4, 4),
    'decoder.layer_stack.0.cross_attn.w_qs.weight': torch.randn(4, 4),
    'decoder.layer_stack.0.cross_attn.w_ks.weight': torch.randn(4, 4),
    'decoder.layer_stack.0.cross_attn.w_vs.weight': torch.randn(4, 4),
    'decoder.layer_stack.0.cross_attn.fc.weight': torch.randn(4, 4),
    'decoder.layer_stack.0.cross_attn_norm.weight': torch.randn(4),
    'decoder.layer_stack.0.mlp_ln.weight': torch.randn(4),
    
    # Special decoder params
    'decoder.tgt_word_emb.weight': torch.randn(4, 4),
    'decoder.tgt_word_prj.weight': torch.randn(4, 4),
    'decoder.layer_norm_out.weight': torch.randn(4),
    
    # Encoder projector
    'encoder_projector.weight': torch.randn(4, 4),
    
    # Positional encoding (kept as is)
    'encoder.positional_encoding.weight': torch.randn(4, 4),
}

# Save as a checkpoint with model_state_dict key
checkpoint = {'model_state_dict': firered_state_dict}
torch.save(checkpoint, checkpoint_path)

ARGS = {
    'pretrained_checkpoint': checkpoint_path
}
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 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
create_ring_flash_attention_forward Ran
ran; our contract draft was wrong, not the code
zhuzilin/ring-flash-attention/ring_flash_attn/adapters/hf_adapter.py
code served (permissive licence) · get_code("b8c37e1fe564ff30")
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 list, ndim 1, 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
import torch.distributed as dist
import os

torch.manual_seed(0)

# Mock the global DATA_PARAMS that the function uses
DATA_PARAMS = {
    'cu_seqlens_q': torch.tensor([0, 4], dtype=torch.int32),
    'cu_seqlens_k': torch.tensor([0, 4], dtype=torch.int32),
    'max_seqlen_q': 4,
    'max_seqlen_k': 4,
    'local_k_slice': slice(0, 4),
}

# Mock the llama3_flash_attn_varlen_func function
def llama3_flash_attn_varlen_func(
    query_states,
    key_states,
    value_states,
    cu_seqlens_q,
    cu_seqlens_k,
    max_seqlen_q,
    max_seqlen_k,
    heads_k_stride,
    local_k_slice,
    dropout_p=0.0,
    softmax_scale=None,
    causal=False,
    **kwargs
):
    # Return a tensor with same shape as query_states
    return torch.zeros_like(query_states)

# Mock is_flash_attn_greater_or_equal_2_10
is_flash_attn_greater_or_equal_2_10 = True

# Create a mock process group for distributed training
class MockProcessGroup:
    pass

process_group = MockProcessGroup()

ARGS = {
    'process_group': process_group,
    'heads_k_stride': 1,
}
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 list, ndim 1, dtype family float — a list 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
extract_answer Ran
ran on a synthesized input
wenet-e2e/west/west/bin/decode_mmau.py
code served (permissive licence) · get_code("0a0d3ec6fb8f3c46")
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 str. 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 re

def extract_answer(output_str: str) -> str:
    """Extract content from <answer> tags in the model output."""
    match = re.search('<answer>(.*?)</answer>', output_str, re.DOTALL)
    return match.group(1) if match else output_str

# Test case 1: output with answer tags
output_with_tags = "Some text before <answer>This is the extracted answer</answer> some text after"

# Test case 2: output without answer tags (should return the full string)
output_without_tags = "This is just plain text without any tags"

# Construct ARGS for the function
ARGS = {
    "output_str": output_with_tags
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_answer Ran
ran on a synthesized input
wenet-e2e/west/west/bin/decode_mmsu.py
code served (permissive licence) · get_code("d7b280c2f396affc")
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 str. 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 re

def extract_answer(output_str: str) -> str:
    """Extract content from <answer> tags in the model output."""
    match = re.search('<answer>(.*?)</answer>', output_str, re.DOTALL)
    return match.group(1).strip() if match else output_str.strip()

# Test case 1: output with answer tags
output_with_tags = "Some text <answer>This is the answer</answer> more text"

# Test case 2: output without answer tags
output_without_tags = "Just some plain output text"

# Test case 3: output with multiline answer tags
output_multiline = """Some preamble
<answer>
This is a multiline
answer with newlines
and spaces
</answer>
Some epilogue"""

ARGS = {
    "output_str": output_with_tags
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_think Ran
ran on a synthesized input
wenet-e2e/west/west/bin/decode_mmau.py
code served (permissive licence) · get_code("d16acd286647d6ab")
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 str. 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 re

def extract_think(output_str: str) -> str:
    """Extract content from <think> tags in the model output."""
    match = re.search('<think>(.*?)</think>', output_str, re.DOTALL)
    return match.group(1) if match else ''

# Test case 1: output with think tags
output_str_with_tags = "Some text <think>This is the thinking content</think> more text"

# Test case 2: output without think tags
output_str_without_tags = "Some text without think tags"

# Test case 3: multiline think content
output_str_multiline = """
Some preamble
<think>
Line 1 of thinking
Line 2 of thinking
Line 3 of thinking
</think>
Some conclusion
"""

ARGS = {
    'output_str': output_str_with_tags
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_think Ran
ran on a synthesized input
wenet-e2e/west/west/bin/decode_mmsu.py
code served (permissive licence) · get_code("3703b995167253d1")
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 str. 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 re

def extract_think(output_str: str) -> str:
    """Extract content from <think> tags in the model output."""
    match = re.search('<think>(.*?)</think>', output_str, re.DOTALL)
    return match.group(1).strip() if match else ''

# Test case 1: output with think tags
output_with_think = "Some prefix <think>This is thinking content</think> Some suffix"

# Test case 2: output without think tags
output_without_think = "Just some regular output without tags"

# Test case 3: multiline thinking content
output_multiline = """
Before
<think>
Line 1 of thinking
Line 2 of thinking
Line 3 of thinking
</think>
After
"""

ARGS = {
    'output_str': output_with_think
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
is_url Ran
ran on a synthesized input
wenet-e2e/west/west/bin/train_knowledge_distillation.py
code served (permissive licence) · get_code("be1d08f1068144c4")
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

# The function is_url checks if a path (string) starts with 'http://' or 'https://'
# It takes only one parameter: path (a string)

ARGS = {
    'path': 'https://example.com/resource'
}
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
parse_category Ran
ran on a synthesized input
wenet-e2e/west/west/bin/decode_mmsu.py
code served (permissive licence) · get_code("326096e0f8beeffd")
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 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 parse_category function

ARGS = {
    'category_str': 'Perception-Linguistics-Phonology-Prosody'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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

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, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 7 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
check_params 1 other paper
1 dated earlier
2311.09431 (2023-11)
Striped Attention: Faster Ring Attention for Causal Transformers
create_ring_flash_attention_forward 1 other paper
1 dated earlier
2311.09431 (2023-11)
Striped Attention: Faster Ring Attention for Causal Transformers

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

Modern artificial intelligence (AI) systems are powered by foundation models. This paper presents a new set of foundation models, called Llama 3. It is a herd of language models that natively support multilinguality, coding, reasoning, and tool usage. Our largest model is a dense Transformer with 405B parameters and a context window of up to 128K tokens. This paper presents an extensive empirical evaluation of Llama 3. We find that Llama 3 delivers comparable quality to leading language models such as GPT-4 on a plethora of tasks. We publicly release Llama 3, including pre-trained and post-trained versions of the 405B parameter language model and our Llama Guard 3 model for input and output safety. The paper also presents the results of experiments in which we integrate image, video, and speech capabilities into Llama 3 via a compositional approach. We observe this approach performs competitively with the state-of-the-art on image, video, and speech recognition tasks. The resulting models are not yet being broadly released as they are still under development.

For agents

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

get_harvested_code_for_paper("2407.21783")
get_code_for_paper("2407.21783")
have("2407.21783")

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

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

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

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

Connect an agent — have() is free.