SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.10314 · 2023

LeTI: Learning to Generate from Textual Interactions

arXiv · PDF · Open in the Atlas

Code that ran

6 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; 1 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 3 failures of our instrument; 5 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/2305.10314.json · badge: /api/ran/2305.10314.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
xingyaoww/leti canonical (classifier label)
classifier basis: census
6 ran · 5 no recorded run
FunctionStatusWhere it lives
apply_rotary_pos_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xingyaoww/leti/leti/models/codegen/modeling_flax_codegen.py
code served (permissive licence) · get_code("0f14840c40641281")
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 ArrayImpl, ndim 4, dtype family float, shape (2, 3, 1, 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 jax.numpy as jnp
import torch

torch.manual_seed(0)

# Create a small tensor with shape (batch=2, seq=3, heads=1, dim=4)
# The function expects tensor[:, :, :, 1::2] and tensor[:, :, :, ::2] to work
# so we need the last dimension to be even
tensor = jnp.ones((2, 3, 1, 4))

# Create sincos tuple with sin_pos and cos_pos
# The function does sin_pos[:, :, None, :].repeat(2, 3)
# so sin_pos and cos_pos should have shape (seq, batch, dim)
# After indexing [:, :, None, :] it becomes (seq, batch, 1, dim)
# After repeat(2, 3) it becomes (seq, batch, 2, dim)
# We need it to broadcast with tensor of shape (batch, seq, heads, dim)
# So sin_pos and cos_pos should have shape (batch, seq, dim//2) before repeat
sin_pos = jnp.ones((2, 3, 2))
cos_pos = jnp.ones((2, 3, 2))

sincos = (sin_pos, cos_pos)

ARGS = {
    "tensor": tensor,
    "sincos": sincos,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 4, dtype family float, shape (2, 3, 1, 4) — shape (2, 3, 1, 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
bce_loss_weighted_fn Ran
ran on a synthesized input
xingyaoww/leti/leti/utils/algo/common.py
code served (permissive licence) · get_code("aefddbe85377ea68")
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 ArrayImpl, 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 jax.numpy as jnp
import numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Create small test tensors
batch_size = 2
seq_length = 5
vocab_size = 4

# logits: shape (batch, seq_length, vocab_size)
# These are raw model outputs before softmax
logits = jnp.ones((batch_size, seq_length, vocab_size), dtype=jnp.float32)

# labels: shape (batch, seq_length)
# Integer class indices for each position
labels = jnp.array([[0, 1, 2, 3, 1],
                    [2, 0, 1, 2, 0]], dtype=jnp.int32)

# weights: shape (batch, seq_length)
# Importance weights for each label position
weights = jnp.array([[1.0, 1.0, 0.5, 1.0, 0.0],
                     [1.0, 0.5, 1.0, 1.0, 0.0]], dtype=jnp.float32)

# mask: optional, can be None or a boolean array
# If None, the function computes it from weights
mask = None

ARGS = {
    "logits": logits,
    "labels": labels,
    "weights": weights,
    "mask": mask,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flax, jax, numpy, optax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
create_sinusoidal_positions Ran
ran, honoured the contract we drafted
xingyaoww/leti/leti/models/codegen/modeling_flax_codegen.py
code served (permissive licence) · get_code("ff574bc6676f34f1")
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 ArrayImpl, 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 numpy as np
import jax.numpy as jnp

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
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
get_pairs Ran
ran; our contract draft was wrong, not the code
xingyaoww/leti/leti/models/codegen/tokenization_codegen.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
mse_loss_fn Ran
ran on a synthesized input
xingyaoww/leti/leti/utils/algo/common.py
code served (permissive licence) · get_code("34d602c3086874a6")
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 ArrayImpl, 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 jax.numpy as jnp
import numpy as np

# Create small test tensors with distinct shapes to probe dimensions
batch_size = 2
feature_dim = 4

# predicted_val: shape (2, 4)
predicted_val = jnp.array(
    [[1.5, 2.3, 0.8, -1.2],
     [0.5, 1.1, 2.0, 0.3]],
    dtype=jnp.float32
)

# target_val: shape (2, 4) with some NaN values to test nan_to_num
target_val = jnp.array(
    [[1.0, 2.5, 1.0, -1.0],
     [0.8, jnp.nan, 1.9, 0.5]],
    dtype=jnp.float32
)

# mask: shape (2, 4) as boolean indicator
mask = jnp.array(
    [[1, 1, 0, 1],
     [1, 0, 1, 1]],
    dtype=jnp.int32
)

ARGS = {
    "predicted_val": predicted_val,
    "target_val": target_val,
    "mask": mask,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
rotate_every_two Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xingyaoww/leti/leti/models/codegen/modeling_flax_codegen.py
code served (permissive licence) · get_code("768565e8f56c5fb0")
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 ArrayImpl, ndim 4, dtype family float, shape (2, 3, 4, 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 jax.numpy as jnp
import numpy as np

# Create a small tensor with shape (batch, height, width, channels)
# Using distinct dimensions: batch=2, height=3, width=4, channels=8
tensor_data = np.random.randn(2, 3, 4, 8).astype(np.float32)
tensor = jnp.array(tensor_data)

ARGS = {
    "tensor": tensor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 4, dtype family float, shape (2, 3, 4, 8) — shape (2, 3, 4, 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
bce_loss_fn Not yet run
unverified (harvested, no recorded run)
xingyaoww/leti/leti/utils/algo/common.py
code served (permissive licence) · get_code("61055d376b415759")
How it ran

no invocation recorded.

gae_advantages Not yet run
unverified (harvested, no recorded run)
xingyaoww/leti/leti/utils/algo/ppo.py
code served (permissive licence) · get_code("8203f70a8d1a3a21")
How it ran

no invocation recorded.

gae_advantages_jax Not yet run
unverified (harvested, no recorded run)
xingyaoww/leti/leti/utils/algo/ppo.py
code served (permissive licence) · get_code("b035bf1f5d63df47")
How it ran

no invocation recorded.

ppo_objective Not yet run
unverified (harvested, no recorded run)
xingyaoww/leti/leti/utils/algo/ppo.py
code served (permissive licence) · get_code("217714c5bbe2b144")
How it ran

no invocation recorded.

reward_weighted_finetuning Not yet run
unverified (harvested, no recorded run)
xingyaoww/leti/leti/utils/algo/rw_finetune.py
code served (permissive licence) · get_code("2c596ae865c6c476")
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, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 1 the same month, 4 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
get_pairs 258 other papers
54 dated earlier, 3 the same month, 193 later, 7 same year, order not determinable, 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
apply_rotary_pos_emb 2 other papers
1 dated earlier, 1 later
2302.02676 (2023-02)
Chain of Hindsight Aligns Language Models with Feedback
2406.09279 (2024-06)
Unpacking DPO and PPO: Disentangling Best Practices for Learning from Preference Feedback
create_sinusoidal_positions 2 other papers
1 dated earlier, 1 later
2302.02676 (2023-02)
Chain of Hindsight Aligns Language Models with Feedback
2406.09279 (2024-06)
Unpacking DPO and PPO: Disentangling Best Practices for Learning from Preference Feedback
rotate_every_two 2 other papers
1 dated earlier, 1 later
2302.02676 (2023-02)
Chain of Hindsight Aligns Language Models with Feedback
2406.09279 (2024-06)
Unpacking DPO and PPO: Disentangling Best Practices for Learning from Preference Feedback

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

Fine-tuning pre-trained language models (LMs) is essential for enhancing their capabilities. Existing techniques commonly fine-tune on input-output pairs (e.g., instruction tuning) or with numerical rewards that gauge the output quality (e.g., RLHF). We explore LMs' potential to learn from textual interactions (LETI) that not only check their correctness with binary labels but also pinpoint and explain errors in their outputs through textual feedback. Our focus is the code generation task, where the model produces code based on natural language instructions. This setting invites a natural and scalable way to acquire textual feedback: the error messages and stack traces from code execution using a Python interpreter. LETI iteratively fine-tunes the model, using the LM objective, on a concatenation of natural language instructions, LM-generated programs, and textual feedback. Prepended to this fine-tuning text, a binary reward token is used to differentiate correct and buggy solutions. LETI requires no ground-truth outputs for training and even outperforms a fine-tuned baseline that does. LETI not only improves the performance of LMs on a code generation dataset MBPP, but also generalizes to other datasets. Trained on MBPP, it achieves comparable or better performance than the base LMs on unseen problems in HumanEval. Furthermore, compared to binary feedback, we observe that textual feedback leads to improved generation quality and sample efficiency, achieving the same performance with fewer than half of the gradient steps. LETI is equally applicable in natural language tasks when they can be formulated as code generation, which we empirically verified on event argument extraction.

For agents

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

get_harvested_code_for_paper("2305.10314")
get_code_for_paper("2305.10314")
have("2305.10314")

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

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

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

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

Connect an agent — have() is free.