SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.06825 · 2023

Mistral 7B

Albert Jiang, Arthur Mensch, Alexandre Sablayrolles, Singh Devendra, Chris Bamford, Diego Chaplot, Florian De Las Casas, Gianna Bressand, Guillaume Lengyel, Lucile Lample, Renard Saulnier, Marie-Anne Lavaud, and 7 more

arXiv · PDF · Open in the Atlas

Code that ran

10 of 11 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 1 has no contract verdict; 5 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2310.06825.json · badge: /api/ran/2310.06825.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
mistralai/mistral-src canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
facebookresearch/fairseq2 community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
FunctionStatusWhere it lives
get_cache_sizes Ran
ran, honoured the contract we drafted
mistralai/mistral-src/src/mistral_inference/cache.py
code served (permissive licence) · get_code("ef46cbe416befd2d")
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 int; 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.nn as nn

torch.manual_seed(0)

# Test case 1: sliding_window is None
ARGS = {
    "n_layers": 12,
    "max_seq_len": 2048,
    "sliding_window": None,
}

# Alternative test cases to verify the function works with different inputs:
# Test case 2: sliding_window is an int
# ARGS = {
#     "n_layers": 12,
#     "max_seq_len": 2048,
#     "sliding_window": 512,
# }

# Test case 3: sliding_window is a list
# ARGS = {
#     "n_layers": 12,
#     "max_seq_len": 2048,
#     "sliding_window": [256, 512, 1024],
# }

# Test case 4: sliding_window is a list with None values
# ARGS = {
#     "n_layers": 6,
#     "max_seq_len": 4096,
#     "sliding_window": [512, None],
# }
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 int — 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
get_log_writer Ran
ran on a synthesized input
facebookresearch/fairseq2/src/fairseq2/logging.py
pointer only (licence: MIT) · get_code("29195f3023e17f2d")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, facebookresearch/fairseq2, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

get_sub_grids Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mistralai/mistral-src/src/mistral_inference/vision_encoder.py
code served (permissive licence) · get_code("b5c578acc311d56e")
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. 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)

# The function expects:
# - x: torch.Tensor - a tensor of shape (total_tokens, d) where total_tokens = sum of h*w for each image
# - image_sizes: list[tuple[int, int]] - list of (height, width) for each image
# - spatial_merge_size: int - kernel size for the unfold operation

# Create a simple example with 2 images
# Image 1: 4x3 (12 tokens), Image 2: 3x2 (6 tokens)
# Total: 18 tokens, dimension 4
d = 4
image_sizes = [(4, 3), (3, 2)]
tokens_per_image = [h * w for h, w in image_sizes]
total_tokens = sum(tokens_per_image)

# Create a tensor of shape (total_tokens, d) = (18, 4)
x = torch.randn(total_tokens, d)

spatial_merge_size = 2

ARGS = {
    "x": x,
    "image_sizes": image_sizes,
    "spatial_merge_size": spatial_merge_size,
}
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 — a list output has no array shape of its own; none is 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
interleave_list Ran
ran; our contract draft was wrong, not the code
mistralai/mistral-src/src/mistral_inference/cache.py
code served (permissive licence) · get_code("c7a274c6f99bd04a")
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. 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)

# Create two lists of tensors with matching lengths
l1 = [
    torch.randn(2, 4),
    torch.randn(2, 3),
    torch.randn(2, 5)
]

l2 = [
    torch.randn(2, 4),
    torch.randn(2, 3),
    torch.randn(2, 5)
]

ARGS = {
    "l1": l1,
    "l2": l2
}
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 — a list output has no array shape of its own; none is 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
position_meshgrid Ran
ran, honoured the contract we drafted
mistralai/mistral-src/src/mistral_inference/vision_encoder.py
code served (permissive licence) · get_code("61a59ec493b9ba5a")
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 Tensor, ndim 2, dtype family int, shape (42, 2) 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)

# The function takes a list of tensors and uses:
# - p.shape[-2] to get second-to-last dimension
# - p.shape[-1] to get last dimension
# - torch.meshgrid with 'ij' indexing
# - torch.stack to stack the meshgrid outputs
# - .reshape(-1, 2) to flatten
# - torch.cat to concatenate results

# Create patch_embeds_list with tensors of varying spatial dimensions
# Using distinct sizes: first tensor 3x4, second tensor 5x6
patch_embeds_list = [
    torch.randn(2, 8, 3, 4),   # batch=2, channels=8, height=3, width=4
    torch.randn(2, 8, 5, 6),   # batch=2, channels=8, height=5, width=6
]

ARGS = {
    "patch_embeds_list": patch_embeds_list,
}
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 Tensor, ndim 2, dtype family int, shape (42, 2) — shape (42, 2) 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
precompute_freqs_cis Ran
ran, violated the contract we drafted
mistralai/mistral-src/src/mistral_inference/rope.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from networks-learning/counterfactual-llms, is pointer only (licence: NONE) · get_code("99e0ca21ba709107")
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 networks-learning/counterfactual-llms, 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.

precompute_freqs_cis_2d Ran
ran, violated the contract we drafted
mistralai/mistral-src/src/mistral_inference/rope.py
code served (permissive licence) · get_code("acf80db8b8e014ad")
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 Tensor, ndim 3, dtype family float, shape (4, 3, 4) 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)

ARGS = {
    "dim": 8,
    "height": 4,
    "width": 3,
    "theta": 10000.0,
}
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 Tensor, ndim 3, dtype family float, shape (4, 3, 4) — shape (4, 3, 4) 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
repeat_kv Ran
ran; our contract draft was wrong, not the code
mistralai/mistral-src/src/mistral_inference/transformer_layers.py
code served (permissive licence) · get_code("a034294fb9d68dfa")
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 tuple, ndim 4, 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)

# Create small tensors for keys and values
# keys shape: (batch=2, seq_len=3, head_dim=4)
keys = torch.randn(2, 3, 4)

# values shape: (batch=2, seq_len=3, head_dim=4)
values = torch.randn(2, 3, 4)

# Number of times to repeat each element
repeats = 2

# Dimension along which to repeat
dim = 1

ARGS = {
    "keys": keys,
    "values": values,
    "repeats": repeats,
    "dim": dim,
}
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 tuple, ndim 4, 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
sample Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mistralai/mistral-src/src/mistral_inference/generate.py
code served (permissive licence) · get_code("8e0352e68edf6866")
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 Tensor, ndim 1, dtype family int, shape (2,) 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 small logits tensor: batch_size=2, vocab_size=4
logits = torch.randn(2, 4)

# Set up parameters
temperature = 0.8
top_p = 0.9

ARGS = {
    "logits": logits,
    "temperature": temperature,
    "top_p": top_p,
}
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 Tensor, ndim 1, dtype family int, shape (2,) — shape (2,) 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
unrotate Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mistralai/mistral-src/src/mistral_inference/cache.py
code served (permissive licence) · get_code("231f8bcb0c0c8bab")
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 Tensor, ndim 3, dtype family float, shape (5, 2, 4) 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)

# Construct a 3D cache tensor with shape (max_position, batch_size, hidden_dim)
# Using distinct sizes: 8 for position dimension, 2 for batch, 4 for hidden
cache = torch.randn(8, 2, 4)

# Test with different seqlen values to exercise different code paths
seqlen = 5

ARGS = {
    "cache": cache,
    "seqlen": seqlen,
}
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 Tensor, ndim 3, dtype family float, shape (5, 2, 4) — shape (5, 2, 4) 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_rotary_emb Not yet run
unverified (harvested, no recorded run)
mistralai/mistral-src/src/mistral_inference/rope.py
code served (permissive licence) · get_code("0539a5035c30fa83")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 9 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
precompute_freqs_cis 1 other paper
1 later
2409.17027 (2024-09)
Counterfactual Token Generation in Large Language Models
precompute_freqs_cis_2d 1 other paper
1 later
2501.03575 (2025-01)
Cosmos World Foundation Model Platform for Physical AI

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

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 introduce Mistral 7B, a 7-billion-parameter language model engineered for superior performance and efficiency. Mistral 7B outperforms the best open 13B model (Llama 2) across all evaluated benchmarks, and the best released 34B model (Llama 1) in reasoning, mathematics, and code generation. Our model leverages grouped-query attention (GQA) for faster inference, coupled with sliding window attention (SWA) to effectively handle sequences of arbitrary length with a reduced inference cost. We also provide a model fine-tuned to follow instructions, Mistral 7B -Instruct, that surpasses Llama 2 13B -chat model both on human and automated benchmarks. Our models are released under the Apache 2.0 license.

For agents

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

get_harvested_code_for_paper("2310.06825")
get_code_for_paper("2310.06825")
have("2310.06825")

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

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

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

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

Connect an agent — have() is free.