SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.13474 · 2022

CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis

arXiv · PDF · Open in the Atlas

Code that ran

10 of 10 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; 1 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 8 failures 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/2203.13474.json · badge: /api/ran/2203.13474.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
salesforce/CodeGen canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
openlmlab/moss community (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
eth-sri/sven extension (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
apply_rotary_pos_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
salesforce/CodeGen/codegen1/jaxformer/hf/codegen/modeling_codegen.py
code served (permissive licence) · get_code("2f6618868885e7ca")
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 4, dtype family float, shape (2, 5, 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
import torch.nn as nn

torch.manual_seed(0)

# x: input tensor with shape (batch, seq_len, ?, dim)
# The function accesses x.shape[1] and performs operations expecting a 4D tensor
# with the last dimension being even (since it does ::2 and 1::2 slicing)
x = torch.randn(2, 5, 3, 4)  # (batch=2, seq_len=5, ?, dim=4)

# sincos: tuple of (sin, cos) tensors
# These are indexed with [None, offset:x.shape[1] + offset, None, :]
# and then repeat_interleave(2, 3) is applied
# So they need shape (seq_len_or_more, feature_dim)
sin = torch.randn(10, 2)  # enough to cover offset + seq_len
cos = torch.randn(10, 2)
sincos = (sin, cos)

# offset: integer offset parameter
offset = 0

ARGS = {
    "x": x,
    "sincos": sincos,
    "offset": offset,
}
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 4, dtype family float, shape (2, 5, 3, 4) — shape (2, 5, 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
apply_rotary_pos_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
openlmlab/moss/models/modeling_moss.py
code served (permissive licence) · get_code("d11e60ed4e63403d")
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 4, dtype family float, shape (2, 3, 5, 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 valid arguments for apply_rotary_pos_emb
# The function expects:
# - tensor: shape (batch, seq_len, ?, dim) - used with *, rotate_every_two
# - sin: shape (batch, seq_len, dim_half) - repeat_interleave to (batch, seq_len, 1, dim)
# - cos: shape (batch, seq_len, dim_half) - repeat_interleave to (batch, seq_len, 1, dim)

batch_size = 2
seq_len = 3
dim = 4
dim_half = dim // 2

# tensor shape: (batch, seq_len, intermediate, dim)
tensor = torch.randn(batch_size, seq_len, 5, dim)

# sin and cos shapes: (batch, seq_len, dim_half)
sin = torch.randn(batch_size, seq_len, dim_half)
cos = torch.randn(batch_size, seq_len, dim_half)

ARGS = {
    "tensor": tensor,
    "sin": sin,
    "cos": cos,
}
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 4, dtype family float, shape (2, 3, 5, 4) — shape (2, 3, 5, 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
create_sinusoidal_positions Ran
ran, honoured the contract we drafted
openlmlab/moss/models/modeling_moss.py
code served (permissive licence) · get_code("c2217cd556fe5607")
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 float, shape (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
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "num_pos": 2,
    "dim": 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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (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
find_layers Ran
ran; our contract draft was wrong, not the code
openlmlab/moss/models/quantization.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from squeezeailab/kvquant, is pointer only (licence: NONE) · get_code("a9e7f2cdf016b88b")
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 squeezeailab/kvquant, 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.

fixed_pos_embedding Ran
ran; our contract draft was wrong, not the code
salesforce/CodeGen/codegen1/jaxformer/hf/codegen/modeling_codegen.py
code served (permissive licence) · get_code("423269b3cef0af9c")
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 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
import torch.nn as nn

torch.manual_seed(0)

# Create a small tensor with shape (batch=2, seq_len=3, dim=4)
# The function uses x.shape[-1] to get dim and x.shape[seq_dim] to get seq_len
x = torch.randn(2, 3, 4)

# seq_dim parameter - specifies which dimension is the sequence dimension
seq_dim = 1

# seq_len parameter - can be None (will use x.shape[seq_dim]) or an explicit value
seq_len = None

ARGS = {
    "x": x,
    "seq_dim": seq_dim,
    "seq_len": seq_len,
}
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 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
get_pairs Ran
ran; our contract draft was wrong, not the code
openlmlab/moss/models/tokenization_moss.py
code served (permissive licence) · get_code("c083e60f5001bd38")
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 set. 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.

# The function expects a word represented as a tuple of symbols (strings)
# It iterates through the word starting from index 0 and 1, creating pairs of consecutive symbols

word = ("h", "e", "ll", "o")

ARGS = {
    "word": word
}
Setup block drafted by
a language model, Claude Sonnet 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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
parse_text Ran
ran; our contract draft was wrong, not the code
openlmlab/moss/moss_web_demo_gradio.py
code served (permissive licence) · get_code("826ceb601fb31250")
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 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.

# Setup code for parse_text function

ARGS = {
    "text": """Here is some code:

def hello():
    print('world')


And here is more text with special chars: < > * _ - . ! ( ) $

javascript
console.log('test');


Final line."""
}
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 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
rotate_every_two Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
salesforce/CodeGen/codegen1/jaxformer/hf/codegen/modeling_codegen.py
code served (permissive licence) · get_code("c66149010337c505")
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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 6) 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 rotate_every_two takes a single parameter 'x' which is a tensor
# It performs slicing operations on dimensions 0, 1, 2, and 3
# So x needs to be a 4D tensor
# Using distinct sizes: batch=2, dim1=3, dim2=4, dim3=6 (even number needed for ::2 slicing)

x = torch.randn(2, 3, 4, 6)

ARGS = {
    "x": x
}
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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 6) — shape (2, 3, 4, 6) 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
rotate_every_two Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
openlmlab/moss/models/modeling_moss.py
code served (permissive licence) · get_code("2e3bec9f0c9b1973")
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 4, dtype family float, shape (2, 3, 4, 6) 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 rotate_every_two takes a single tensor argument x
# It expects a 4D tensor based on the indexing: x[:, :, :, ::2] and x[:, :, :, 1::2]
# The last dimension must be even so it can be split into pairs
# Let's create a small tensor with shape (batch=2, dim1=3, dim2=4, dim3=6)
# where dim3=6 is even so it can be split into pairs

x = torch.randn(2, 3, 4, 6)

ARGS = {
    "x": x
}
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 4, dtype family float, shape (2, 3, 4, 6) — shape (2, 3, 4, 6) 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
trim_code Ran
ran, violated the contract we drafted
eth-sri/sven/scripts/human_eval_gen.py
code served (permissive licence) · get_code("f3ac5c7092505639")
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 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 torch
import numpy as np

def trim_code(completion, stop_tokens):
    for stop_token in stop_tokens:
        if stop_token in completion:
            completion = completion[:completion.find(stop_token)]
    return completion

# Setup code
torch.manual_seed(0)

# The function takes:
# - completion: a string containing code
# - stop_tokens: an iterable of strings to search for and trim at

completion = "def hello():\n    print('world')\n    return 42\n\nEND_OF_CODE\n\nmore stuff"
stop_tokens = ["END_OF_CODE", "STOP", "###"]

ARGS = {
    "completion": completion,
    "stop_tokens": stop_tokens
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — 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

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 8 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 8 later) and 2 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
get_pairs 258 other papers
18 dated earlier, 2 the same month, 237 later, 1 undated · 4 only as an assembly brick
1802.06474 (2018-02)
A Closed-form Solution to Photorealistic Image Stylization
1803.01128 (2018-03)
Seq2Sick: Evaluating the Robustness of Sequence-to-Sequence Models with Adversarial Examples
1809.00125 (2018-09)
Simple Fusion: Return of the Language Model
and 255 more not named here
find_layers 27 other papers
26 later, 1 undated
2023.emnlp-main.892 (2023 (year only))
Z-FOLD: A Frustratingly Easy Post-Training Quantization Scheme for LLMs
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
2307.15290 (2023-07)
ChatHome: Development and Evaluation of a Domain-Specific Language Model for Home Renovation
and 24 more not named here
parse_text 9 other papers
9 later
2305.12524 (2023-05)
TheoremQA: A Theorem-driven Question Answering Dataset ♠
2305.14314 (2023-05)
QLORA: Efficient Finetuning of Quantized LLMs
2305.16355 (2023-05)
PandaGPT: One Model To Instruction-Follow Them All
and 6 more not named here
create_sinusoidal_positions 4 other papers
4 later
2311.13230 (2023-11)
Enhancing Uncertainty-Based Hallucination Detection with Stronger Focus
2403.04945 (2024-03)
MEIT: Multimodal Electrocardiogram Instruction Tuning on Large Language Models for Report Generation
2403.09054 (2024-03)
Keyformer: KV Cache Reduction through Key Tokens Selection for Efficient Generative Inference
and 1 more not named here
rotate_every_two 4 other papers
4 later
2311.13230 (2023-11)
Enhancing Uncertainty-Based Hallucination Detection with Stronger Focus
2403.04945 (2024-03)
MEIT: Multimodal Electrocardiogram Instruction Tuning on Large Language Models for Report Generation
2403.09054 (2024-03)
Keyformer: KV Cache Reduction through Key Tokens Selection for Efficient Generative Inference
and 1 more not named here
rotate_every_two 4 other papers
4 later
2206.06888 (2022-06)
CERT: Continual Pre-Training on Sketches for Library-Oriented Code Generation
2206.13517 (2022-06)
ProGen2: Exploring the Boundaries of Protein Language Models
2309.01327 (2023-09)
Can I Trust Your Answer? Visually Grounded Video Question Answering
and 1 more not named here
apply_rotary_pos_emb 3 other papers
3 later
2206.06888 (2022-06)
CERT: Continual Pre-Training on Sketches for Library-Oriented Code Generation
2206.13517 (2022-06)
ProGen2: Exploring the Boundaries of Protein Language Models
2512.02315 (2025-12)
Few-shot Protein Fitness Prediction via In-context Learning and Test-time Training
apply_rotary_pos_emb 1 other paper
1 later
2404.10933 (2024-04)
LLMem: Estimating GPU Memory Usage for Fine-Tuning Pre-Trained LLMs

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

Program synthesis strives to generate a computer program as a solution to a given problem specification, expressed with input-output examples or natural language descriptions. The prevalence of large language models advances the state-of-the-art for program synthesis, though limited training resources and data impede open access to such models. To democratize this, we train and release a family of large language models up to 16.1B parameters, called CODEGEN, on natural language and programming language data, and open source the training library JAXFORMER. We show the utility of the trained model by demonstrating that it is competitive with the previous state-of-the-art on zero-shot Python code generation on HumanEval. We further investigate the multi-step paradigm for program synthesis, where a single program is factorized into multiple prompts specifying subproblems. To this end, we construct an open benchmark, Multi-Turn Programming Benchmark (MTPB), consisting of 115 diverse problem sets that are factorized into multi-turn prompts. Our analysis on MTPB shows that the same intent provided to CODEGEN in multi-turn fashion significantly improves program synthesis over that provided as a single turn. We make the training library JAXFORMER and model checkpoints available as open source contribution: https://github.com/salesforce/CodeGen.

For agents

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

get_harvested_code_for_paper("2203.13474")
get_code_for_paper("2203.13474")
have("2203.13474")

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

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

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

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

Connect an agent — have() is free.