SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.24198 · NeurIPS · 2024

SelfCodeAlign: Self-Alignment for Code Generation

Yuxiang Wei, Jiawei Liu, Yifeng Ding, Lingming Zhang, Federico Cassano, Naman Jain, Zachary Mueller, Arjun Guha, H. D. Vries, L. V. Werra

arXiv · PDF · Open in the Atlas

Code that ran

30 of 37 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 16 have no contract verdict; 12 failures of our instrument; 7 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/2410.24198.json · badge: /api/ran/2410.24198.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
bigcode-project/selfcodealign canonical (classifier label)
classifier basis: classifier_2025
9 ran · 3 no recorded run
bigcode-project/starcoder2-self-align community (classifier label)
classifier basis not recorded on the link
18 ran · 4 no recorded run
sahil280114/codealpaca extension (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
Args Ran
ran on a synthesized input · constructed an object; no result was computed
bigcode-project/selfcodealign/src/star_align/self_ossinstruct.py
code served (permissive licence) · get_code("ae0b66e2959a4a8b")
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 an instance of its own class, Args: the run constructed the object and did not call it, so no result was computed. 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 types as _types

def compute_fingerprint(*args, hash_length=5):
    """Stub fingerprint function"""
    import hashlib
    content = str(args)
    return hashlib.md5(content.encode()).hexdigest()[:hash_length]

star_align = _types.SimpleNamespace(**{'utils': _types.SimpleNamespace(compute_fingerprint=compute_fingerprint)})

ARGS = {
    'seed_data_files': ['path/to/seed1.py', 'path/to/seed2.py'],
    'max_new_data': 100,
    'model': 'gpt-3.5-turbo',
    'instruct_mode': 'I->R',
    'use_vllm_server': True,
    'seed_code_start_index': 0,
    'continue_from': None,
    'seed': 3407,
    'temperature': 0.7,
    'max_output_tokens': 1536,
    'prompting_mode': 'completion',
    'num_fewshots': 8,
    'async_micro_batch_size': 1,
    'num_batched_requests': 1,
    'num_sample_per_request': 32,
    'sleep': None,
    'delay': None,
    'tag': '',
    'save_dir': './',
}
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 Args — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Args 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
Example Ran
ran on a synthesized input · constructed an object; no result was computed
bigcode-project/selfcodealign/src/star_align/self_ossinstruct.py
code served (permissive licence) · get_code("ce4e9324e38a0ddf")
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 an instance of its own class, Example: the run constructed the object and did not call it, so no result was computed. 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 os
import random
from dataclasses import dataclass

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

# Set environment variable for LLAMA3
os.environ['LLAMA3'] = '1'

@dataclass(frozen=True)
class Property:
    category: str
    language: str
    concepts: list[str]
    difficulty: str

    @staticmethod
    def random_exercise(concepts: list[str], language: str) -> 'Property':
        category = random.choice(['function implementation', 'function implementation', 'class implementation', 'program implementation'])
        difficulty = random.choice(['easy', 'medium', 'hard'])
        return Property(category=category, language=language, concepts=concepts, difficulty=difficulty)

    def concepts_prompt(self) -> str:
        return ', '.join(self.concepts)

    def prompt(self) -> str:
        category = f'category: {self.category}'
        language = f'language: {self.language}'
        difficulty = f'difficulty: {self.difficulty}'
        concepts = f'concepts: {self.concepts_prompt()}'
        return '\n'.join([category, language, difficulty, concepts])

    def to_json(self) -> dict[str, str | list[str]]:
        return dict(category=self.category, language=self.language, concepts=self.concepts, difficulty=self.difficulty)

    @staticmethod
    def from_json(data: dict) -> 'Property':
        assert all((isinstance(data[key], str) for key in ['category', 'language', 'difficulty']))
        assert isinstance(data['concepts'], list)
        return Property(category=data['category'], language=data['language'], concepts=data['concepts'], difficulty=data['difficulty'])

@dataclass(frozen=True)
class Example:
    property: Property
    snippet: str
    instruction: str
    response: str
    tests: str

    @staticmethod
    def prefix_template(mode: str) -> str:
        if mode == 'I->R':
            if os.getenv('LLAMA3') is not None:
                template = '### Instruction {index} \n{instruction}\n\n### Response {index}\n'
            else:
                template = '<instruction>\n{instruction}\n</instruction>\n\n<response>\n'
            return template
        elif mode == 'S->C':
            return '### Snippet\n{snippet}\n\n### Concepts\n'
        elif mode == 'C->I':
            return '### Properties\n{property}\n\n### Task\n'
        elif mode == 'S->I':
            return '### Snippet\n{snippet}\n\n### Task\n'
        else:
            assert False

    def prompt(self, mode: str, return_in_separate: bool=False, index: int | None=None) -> str | tuple[str, str]:
        assert index is None or (mode == 'I->R' and os.getenv('LLAMA3') is not None)
        if mode == 'I->R':
            kwargs = dict(instruction=self.instruction)
            if os.getenv('LLAMA3') is not None:
                assert index is not None
                kwargs['index'] = str(index)
                suffix = f'{self.response}\n\n### Tests {index}\n{self.tests}'
            else:
                suffix = f'{self.response}\n</response>\n\n<tests>\n{self.tests}\n</tests>'
        elif mode == 'S->C':
            kwargs = dict(snippet=self.snippet)
            suffix = self.property.concepts_prompt()
        elif mode == 'C->I':
            property_prompt = self.property.prompt()
            kwargs = dict(property=property_prompt)
            suffix = self.instruction
        elif mode == 'S->I':
            kwargs = dict(snippet=self.snippet)
            suffix = self.instruction
        else:
            assert False
        prefix = self.prefix_template(mode).format(**kwargs)
        if return_in_separate:
            return (prefix, suffix)
        else:
            return prefix + suffix

# Create a Property instance
test_property = Property(
    category='function implementation',
    language='python',
    concepts=['loops', 'conditionals'],
    difficulty='easy'
)

# Create an Example instance with all required arguments
ARGS = {
    'property': test_property,
    'snippet': 'def calculate_sum(numbers):\n    total = 0\n    for num in numbers:\n        total += num\n    return total',
    'instruction': 'Write a function that calculates the sum of a list of numbers.',
    'response': 'def calculate_sum(numbers):\n    return sum(numbers)',
    'tests': 'assert calculate_sum([1, 2, 3]) == 6\nassert calculate_sum([]) == 0'
}
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 Example — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Example 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
Property Ran
ran on a synthesized input · constructed an object; no result was computed
bigcode-project/selfcodealign/src/star_align/self_ossinstruct.py
code served (permissive licence) · get_code("5b83b230eb85881a")
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 an instance of its own class, Property: the run constructed the object and did not call it, so no result was computed. 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 random
from dataclasses import dataclass, field

@dataclass(frozen=True)
class Property:
    category: str
    language: str
    concepts: list[str]
    difficulty: str

    @staticmethod
    def random_exercise(concepts: list[str], language: str) -> 'Property':
        category = random.choice(['function implementation', 'function implementation', 'class implementation', 'program implementation'])
        difficulty = random.choice(['easy', 'medium', 'hard'])
        return Property(category=category, language=language, concepts=concepts, difficulty=difficulty)

    def concepts_prompt(self) -> str:
        return ', '.join(self.concepts)

    def prompt(self) -> str:
        category = f'category: {self.category}'
        language = f'language: {self.language}'
        difficulty = f'difficulty: {self.difficulty}'
        concepts = f'concepts: {self.concepts_prompt()}'
        return '\n'.join([category, language, difficulty, concepts])

    def to_json(self) -> dict[str, str | list[str]]:
        return dict(category=self.category, language=self.language, concepts=self.concepts, difficulty=self.difficulty)

    @staticmethod
    def from_json(data: dict) -> 'Property':
        assert all((isinstance(data[key], str) for key in ['category', 'language', 'difficulty']))
        assert isinstance(data['concepts'], list)
        return Property(category=data['category'], language=data['language'], concepts=data['concepts'], difficulty=data['difficulty'])


ARGS = {
    'category': 'function implementation',
    'language': 'python',
    'concepts': ['loops', 'recursion', 'data structures'],
    'difficulty': 'medium'
}
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 Property — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Property 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
benchmark_name_to_filter_reason Ran
ran on a synthesized input
bigcode-project/starcoder2-self-align/src/star_align/decontamination/find_substrings.py
code served (permissive licence) · get_code("a349a736c168650a")
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 torch

def benchmark_name_to_filter_reason(benchmark_name: str):
    return f'{benchmark_name}_match'

ARGS = {
    'benchmark_name': 'test_benchmark'
}
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 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
build_kwargs Ran
ran; our contract draft was wrong, not the code
bigcode-project/selfcodealign/src/star_align/self_ossinstruct.py
code served (permissive licence) · get_code("8dd50472f41a7528")
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 random
from dataclasses import dataclass, field
from typing import Any, Literal, cast

InstructMode = Literal['I->R', 'S->C', 'C->I', 'S->I']

LANGUAGE_MAP = {'cpp': 'C++', 'java': 'Java', 'php': 'PHP', 'python': 'Python', 'rust': 'Rust', 'typescript': 'TypeScript'}

@dataclass(frozen=True)
class Property:
    category: str
    language: str
    concepts: list[str]
    difficulty: str

    @staticmethod
    def random_exercise(concepts: list[str], language: str) -> 'Property':
        category = random.choice(['function implementation', 'function implementation', 'class implementation', 'program implementation'])
        difficulty = random.choice(['easy', 'medium', 'hard'])
        return Property(category=category, language=language, concepts=concepts, difficulty=difficulty)

    def concepts_prompt(self) -> str:
        return ', '.join(self.concepts)

    def prompt(self) -> str:
        category = f'category: {self.category}'
        language = f'language: {self.language}'
        difficulty = f'difficulty: {self.difficulty}'
        concepts = f'concepts: {self.concepts_prompt()}'
        return '\n'.join([category, language, difficulty, concepts])

    def to_json(self) -> dict[str, str | list[str]]:
        return dict(category=self.category, language=self.language, concepts=self.concepts, difficulty=self.difficulty)

    @staticmethod
    def from_json(data: dict) -> 'Property':
        assert all((isinstance(data[key], str) for key in ['category', 'language', 'difficulty']))
        assert isinstance(data['concepts'], list)
        return Property(category=data['category'], language=data['language'], concepts=data['concepts'], difficulty=data['difficulty'])

def build_kwargs(instruct_mode: InstructMode, example: dict) -> dict[str, str]:
    kwargs = dict[str, str]()
    if instruct_mode == 'I->R':
        kwargs['instruction'] = example['instruction']
    elif instruct_mode in ['S->C', 'S->I']:
        kwargs['snippet'] = example['seed']
    elif instruct_mode == 'C->I':
        lang = example.get('data_dir', 'dummy_key_not_in_example')
        language = LANGUAGE_MAP.get(lang, 'Python')
        property = Property.random_exercise(example['concepts'], language=language)
        property_prompt = property.prompt()
        kwargs['property'] = property_prompt
        kwargs['property_obj'] = property
    else:
        assert False
    return kwargs


# Test case 1: I->R mode
example_ir = {
    'instruction': 'Write a function that adds two numbers'
}

# Test case 2: S->C mode
example_sc = {
    'seed': 'def hello():\n    print("world")'
}

# Test case 3: C->I mode with language in data_dir
example_ci = {
    'data_dir': 'cpp',
    'concepts': ['recursion', 'dynamic programming']
}

ARGS = {
    'instruct_mode': 'I->R',
    'example': example_ir
}
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
chunked Ran
ran; our contract draft was wrong, not the code
bigcode-project/starcoder2-self-align/src/star_align/utils.py
code served (permissive licence) · get_code("a6974ed3c2ddb7eb")
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 generator. 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
from typing import Sequence, TypeVar

torch.manual_seed(0)

_T = TypeVar('_T')

# Create a simple sequence to chunk
seq = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
n = 3

ARGS = {
    'seq': seq,
    'n': n
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator 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
encode_prompt Ran
ran; our contract draft was wrong, not the code
sahil280114/codealpaca/generate_instruction.py
code served (permissive licence) · get_code("9b2dd0265fc6e6b6")
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 re
import tempfile
import os

# Create a temporary prompt.txt file
temp_dir = tempfile.mkdtemp()
prompt_file = os.path.join(temp_dir, 'prompt.txt')
with open(prompt_file, 'w') as f:
    f.write('You are a helpful assistant.\n')

# Change to temp directory so the function can find prompt.txt
original_dir = os.getcwd()
os.chdir(temp_dir)

# Define the prompt_instructions parameter
prompt_instructions = [
    {
        'instruction': 'Classify  the   sentiment',
        'input': 'This movie is great!',
        'output': 'Positive'
    },
    {
        'instruction': 'Translate to French',
        'input': 'Hello world',
        'output': 'Bonjour le monde'
    },
    {
        'instruction': 'Summarize the text',
        'input': '',
        'output': 'This is a summary'
    }
]

ARGS = {
    'prompt_instructions': prompt_instructions
}
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
extract_and_concat_function_names Ran
ran on a synthesized input
bigcode-project/starcoder2-self-align/src/star_align/clean_data.py
code served (permissive licence) · get_code("ab5fa2503ae7af82")
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 ast

def extract_and_concat_function_names(python_content):
    """
    Extracts all function names from a given Python content string and concatenates them into a single string.

    Parameters:
    - python_content: A string containing the Python code to analyze.

    Returns:
    - A string containing all function names defined in the content, concatenated.
    """
    tree = ast.parse(python_content)
    function_names = []

    class FunctionDefVisitor(ast.NodeVisitor):

        def visit_FunctionDef(self, node):
            function_names.append(node.name)
            self.generic_visit(node)

        def visit_AsyncFunctionDef(self, node):
            function_names.append(node.name)
            self.generic_visit(node)
    visitor = FunctionDefVisitor()
    visitor.visit(tree)
    return ' '.join(function_names)


# Setup code to construct valid arguments
python_content = """
def add(x, y):
    return x + y

def multiply(a, b):
    return a * b

async def fetch_data():
    pass

class MyClass:
    def method(self):
        pass
"""

ARGS = {
    "python_content": python_content
}
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_code_with_indentation Ran
ran on a synthesized input
bigcode-project/starcoder2-self-align/src/star_align/collect_snippets.py
code served (permissive licence) · get_code("5483cff90bd19eb8")
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 torch
import numpy as np

# Create a mock node class that mimics tree-sitter's Node interface
class MockNode:
    def __init__(self, start_byte, end_byte):
        self.start_byte = start_byte
        self.end_byte = end_byte

# Define sample source code with indentation
source_code = """def hello():
    x = 1
    if True:
        y = 2
        print(y)
    z = 3
"""

# Create a node that corresponds to "y = 2" which is indented
# First, find where "y = 2" starts in the source code
target_line = "        y = 2"
start_byte = source_code.find(target_line)
end_byte = start_byte + len("y = 2")

node = MockNode(start_byte, end_byte)

ARGS = {
    "node": node,
    "source_code": source_code
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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
extract_docstring Ran
ran; our contract draft was wrong, not the code
bigcode-project/starcoder2-self-align/src/star_align/decontamination/benchmark_data.py
code served (permissive licence) · get_code("0edeacd7a9034f53")
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 torch
import torch.nn as nn

# This function extracts docstrings from Python code prompts
# It looks for triple-quoted strings and returns the content between them

# Test case 1: docstring with """ delimiters (2 occurrences)
prompt_1 = '''def foo():
    """This is a docstring"""
    pass
'''

# Test case 2: docstring with """ delimiters (4 occurrences - nested or multiple)
prompt_2 = '''def bar():
    """First docstring"""
    x = """some string literal"""
    """Second docstring"""
    pass
'''

# Test case 3: docstring with ''' delimiters
prompt_3 = """def baz():
    '''This is another docstring'''
    pass
"""

# Use the first prompt as the main test case
ARGS = {
    "prompt": prompt_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 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_ds_1000_prompt Ran
ran on a synthesized input
bigcode-project/starcoder2-self-align/src/star_align/decontamination/benchmark_data.py
code served (permissive licence) · get_code("2160a71414dde9a6")
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 torch

# The function extract_ds_1000_prompt takes a single string parameter 'prompt'
# It checks if 'SOLUTION START' or 'BEGIN SOLUTION' is in the prompt
# and splits the prompt accordingly, or raises ValueError if neither is found

# Test case 1: prompt with 'SOLUTION START'
prompt_1 = "This is the problem statement\nSOLUTION START\nHere is the solution"

ARGS = {
    'prompt': prompt_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 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
filter_reason_to_benchmark_name Ran
ran on a synthesized input
bigcode-project/starcoder2-self-align/src/star_align/decontamination/find_substrings.py
code served (permissive licence) · get_code("9c5b01ef26d74c74")
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 torch

# Setup
torch.manual_seed(0)

# The function takes a filter_reason string that must end with '_match'
# and removes the last 6 characters ('_match') to return the benchmark name
filter_reason_value = "accuracy_match"

ARGS = {
    "filter_reason": filter_reason_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 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
find_word_in_string Ran
ran; our contract draft was wrong, not the code
sahil280114/codealpaca/generate_instruction.py
code served (permissive licence) · get_code("8ca6a5f9f77053c2")
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 Match. 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

# The function find_word_in_string takes two parameters:
# w: a word (string) to search for
# s: a string to search in
# It uses re.compile with word boundary matching and case-insensitive flag

ARGS = {
    "w": "hello",
    "s": "Hello world, this is a test string with HELLO in it"
}
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 Match — a Match output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Match 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
flatten_openai_responses Ran
ran; our contract draft was wrong, not the code
bigcode-project/selfcodealign/src/star_align/self_ossinstruct.py
code served (permissive licence) · get_code("1fc3a1bcc54c9a56")
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.

from openai.types import CompletionChoice, Completion

# Create minimal CompletionChoice instances
choice1 = CompletionChoice(
    index=0,
    message=None,
    text="Sample response 1",
    finish_reason="stop",
    logprobs=None
)

choice2 = CompletionChoice(
    index=1,
    message=None,
    text="Sample response 2",
    finish_reason="stop",
    logprobs=None
)

choice3 = CompletionChoice(
    index=0,
    message=None,
    text="Sample response 3",
    finish_reason="stop",
    logprobs=None
)

# Create Completion instances with multiple choices
completion1 = Completion(
    id="completion-1",
    object="text_completion",
    created=1234567890,
    model="gpt-3.5-turbo",
    choices=[choice1, choice2],
    usage=None,
    system_fingerprint="fp-123"
)

completion2 = Completion(
    id="completion-2",
    object="text_completion",
    created=1234567891,
    model="gpt-3.5-turbo",
    choices=[choice3],
    usage=None,
    system_fingerprint="fp-124"
)

ARGS = {
    "responses": [completion1, completion2]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — 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
form_starcoder_infill Ran
ran; our contract draft was wrong, not the code
bigcode-project/starcoder2-self-align/src/star_align/llm_wrapper.py
code served (permissive licence) · get_code("971c70adc27358da")
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 torch

ARGS = {
    "prefix": "def hello():\n    print(",
    "suffix": ")\n    return True"
}
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 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
make_python_membound_code_prefix Ran
ran on a synthesized input
bigcode-project/starcoder2-self-align/src/star_align/execution_filter.py
code served (permissive licence) · get_code("8c087c3185ff5fab")
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 resource
import platform

def make_python_membound_code_prefix(limit_mb):
    maximum_memory_bytes = limit_mb * 1024 * 1024
    _magic_splitter_ = '### -- what do you think? -- ###'
    return f'import resource\nimport platform\n\nresource.setrlimit(\n    resource.RLIMIT_AS, ({maximum_memory_bytes}, {maximum_memory_bytes})\n)\nresource.setrlimit(\n    resource.RLIMIT_DATA, ({maximum_memory_bytes}, {maximum_memory_bytes})\n)\nif not platform.uname().system == "Darwin":\n    resource.setrlimit(\n        resource.RLIMIT_STACK, ({maximum_memory_bytes}, {maximum_memory_bytes})\n    )\n{_magic_splitter_}\n'

ARGS = {
    'limit_mb': 256
}
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
ngrams Ran
ran on a synthesized input
bigcode-project/starcoder2-self-align/src/star_align/minhash_dedup.py
code served (permissive licence) · get_code("a0d7edeceb109990")
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 zip. 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
from typing import List

torch.manual_seed(0)

# The function ngrams takes:
# - sequence: List[str]
# - n: int
# - min_length: int (optional, default=5)

# Create a simple sequence of strings
sequence = ["hello", "world", "this", "is", "a", "test", "string"]

# Create an n value for generating n-grams
n = 2

# Create a min_length value
min_length = 5

ARGS = {
    "sequence": sequence,
    "n": n,
    "min_length": min_length,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type zip — a zip output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a zip 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
pad_sequences Ran
ran, honoured the contract we drafted
bigcode-project/starcoder2-self-align/src/star_align/llm_wrapper.py
code served (permissive licence) · get_code("7b178c461482e3f6")
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 (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 = {
    "sequences": [[1, 2, 3], [4, 5], [6, 7, 8, 9]],
    "pad_value": 0,
    "padding_side": "right",
    "dtype": torch.long,
    "padding_length": 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 Tensor, ndim 2, dtype family int, shape (3, 4) — shape (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
parse_generated_content Ran
ran; our contract draft was wrong, not the code
bigcode-project/selfcodealign/src/star_align/self_ossinstruct.py
code served (permissive licence) · get_code("a75703b3e4e8a6a7")
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 numpy as np
from typing import Literal

# Set seed for reproducibility
torch.manual_seed(0)

# Define ARGS with valid arguments for parse_generated_content
ARGS = {
    'content': 'This is a test response with some content',
    'instruct_mode': 'I->R'
}

# Test with different modes to verify all paths work
# Additional test cases (not in ARGS, just for reference):
test_cases = [
    {'content': 'concept1, concept2, concept3', 'instruct_mode': 'S->C'},
    {'content': 'Generate a summary of the text', 'instruct_mode': 'C->I'},
    {'content': 'Write instructions for making tea', 'instruct_mode': 'S->I'},
]
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
parse_property Ran
ran; our contract draft was wrong, not the code
bigcode-project/selfcodealign/src/star_align/self_ossinstruct.py
code served (permissive licence) · get_code("fba12f4a4a9f3c28")
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 Property. 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 random
from dataclasses import dataclass, field

@dataclass(frozen=True)
class Property:
    category: str
    language: str
    concepts: list[str]
    difficulty: str

    @staticmethod
    def random_exercise(concepts: list[str], language: str) -> 'Property':
        category = random.choice(['function implementation', 'function implementation', 'class implementation', 'program implementation'])
        difficulty = random.choice(['easy', 'medium', 'hard'])
        return Property(category=category, language=language, concepts=concepts, difficulty=difficulty)

    def concepts_prompt(self) -> str:
        return ', '.join(self.concepts)

    def prompt(self) -> str:
        category = f'category: {self.category}'
        language = f'language: {self.language}'
        difficulty = f'difficulty: {self.difficulty}'
        concepts = f'concepts: {self.concepts_prompt()}'
        return '\n'.join([category, language, difficulty, concepts])

    def to_json(self) -> dict[str, str | list[str]]:
        return dict(category=self.category, language=self.language, concepts=self.concepts, difficulty=self.difficulty)

    @staticmethod
    def from_json(data: dict) -> 'Property':
        assert all((isinstance(data[key], str) for key in ['category', 'language', 'difficulty']))
        assert isinstance(data['concepts'], list)
        return Property(category=data['category'], language=data['language'], concepts=data['concepts'], difficulty=data['difficulty'])

def parse_property(content: str) -> Property | None:
    content = content.strip()
    lines = content.split('\n')
    if len(lines) != 4:
        return None
    try:
        lines = [line[line.index(':') + 1:].strip() for line in lines]
    except ValueError:
        return None
    category, language, difficulty, concepts_str = lines
    concepts = list(map(str.strip, concepts_str.split(',')))
    return Property(category, language, concepts, difficulty)

# Valid test content that will parse correctly
test_content = """category: function implementation
language: python
difficulty: easy
concepts: loops, conditionals, string manipulation"""

ARGS = {
    'content': test_content
}
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 Property — a Property output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Property 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
post_process_gpt3_response Ran
ran, honoured the contract we drafted
sahil280114/codealpaca/generate_instruction.py
code served (permissive licence) · get_code("a5e4ad4e11cf2143")
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 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 re
import string

# Construct valid arguments for post_process_gpt3_response
ARGS = {
    'num_prompt_instructions': 2,
    'response': {
        'text': '\n### 3. Instruction: Write a summary of the text\nInput: The quick brown fox jumps over the lazy dog\nOutput: A fast fox jumps over a slow dog\n### 4. Instruction: Translate to Spanish\nInput: Hello world\nOutput: Hola mundo',
        'finish_reason': 'stop'
    }
}
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 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
postprocess Ran
ran; our contract draft was wrong, not the code
bigcode-project/selfcodealign/evaluation/ds_1000.py
code served (permissive licence) · get_code("1173d57fe1b4d158")
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

torch.manual_seed(0)

ARGS = {
    "text": "some code here\n```\nmore code"
}
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 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
preprocess_completion_prompt Ran
ran; our contract draft was wrong, not the code
bigcode-project/selfcodealign/evaluation/ds_1000.py
code served (permissive licence) · get_code("956cd0aa1cec0821")
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 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.

# Analyze the function to understand what it needs
# The function takes a single parameter: prompt (str)
# It processes DS-1000 prompts in completion mode

# Let's create a valid prompt that matches one of the code paths
# The function has multiple branches based on prompt structure

# Path 1: prompt contains 'SOLUTION START' (simplest case)
prompt_with_solution_start = """def solve(x):
    return x * 2

# SOLUTION START"""

# Path 2: prompt with '### BEGIN SOLUTION' (has <code> tags)
prompt_with_begin_solution_v1 = """Problem: Write a function that doubles the input
A: <code>
def solve(x):
    return x * 2
### BEGIN SOLUTION
# return result
# result
</code>"""

# Path 3: prompt with 'BEGIN SOLUTION' (has 2 <code> tags, 1 </code>)
prompt_with_begin_solution_v2 = """Problem: Write a function that doubles the input
A: <code>
def solve(x):
    pass
</code>
Some explanation
<code>
def solve(x):
    return x * 2
BEGIN SOLUTION
# Solution code
<code>"""

# Use the simplest valid case
ARGS = {
    "prompt": prompt_with_solution_start
}
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 tuple, ndim 1, 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
read_jsonl Ran
ran; our contract draft was wrong, not the code
bigcode-project/starcoder2-self-align/src/star_align/utils.py
code served (permissive licence) · get_code("b0fdb2b203090d2e")
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 json
import tempfile
from pathlib import Path

# Create a temporary JSONL file with test data
temp_dir = tempfile.TemporaryDirectory()
temp_path = Path(temp_dir.name) / "test.jsonl"

# Write some test JSONL data
test_data = [
    {"id": 1, "text": "hello"},
    {"id": 2, "text": "world"},
    {"id": 3, "name": "test", "values": [1, 2, 3]}
]

with open(temp_path, 'w') as f:
    for item in test_data:
        f.write(json.dumps(item) + '\n')

# Define arguments for read_jsonl
ARGS = {
    "path": temp_path
}
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 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
retry Ran
ran on a synthesized input
bigcode-project/starcoder2-self-align/src/star_align/utils.py
code served (permissive licence) · get_code("e10de9c97d0ec5c5")
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 function. 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 tenacity

# Define the errors parameter - can be a single exception type or tuple of exception types
errors_arg = (ValueError, RuntimeError, TypeError)

# Define max_attempts parameter
max_attempts_arg = 5

# Construct the ARGS dictionary
ARGS = {
    "errors": errors_arg,
    "max_attempts": max_attempts_arg,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tenacity, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
sha1_hash Ran
ran on a synthesized input
bigcode-project/starcoder2-self-align/src/star_align/minhash_dedup.py
code served (permissive licence) · get_code("e5358426087cdd76")
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 int, ndim 0, dtype family int, 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 hashlib
import struct

def sha1_hash(data: bytes, d: int=32) -> int:
    """
    Generate a d-bit hash value from the given data.
    """
    if d == 32:
        return struct.unpack('<I', hashlib.sha1(data, usedforsecurity=False).digest()[:4])[0]
    if d == 64:
        return struct.unpack('<Q', hashlib.sha1(data, usedforsecurity=False).digest()[:8])[0]
    return int.from_bytes(hashlib.sha1(data, usedforsecurity=False).digest()[:d // 8], byteorder='little')


ARGS = {
    "data": b"hello world",
    "d": 32
}
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 int, ndim 0, dtype family int, 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
split_llama3_response_tests Ran
ran on a synthesized input
bigcode-project/starcoder2-self-align/src/star_align/sanitize_data.py
code served (permissive licence) · get_code("13b161a5bbc15829")
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 re

LLAMA3_DEFAULT_TEST_SPLIT = '### Tests \\d\\n'

LLAMA3_ADDITIONAL_PATTERNS = ['We can verify the functionality', 'We can verify the correctness', 'You can verify the correctness', 'You can verify the functionality', 'To ensure the correctness', 'To verify the correctness', 'To test the', 'To test this', 'To test this', 'You can test the', 'We can test the', 'We can test this', "Now, we'll test"]

def split_llama3_response_tests(response: str) -> list[str]:
    splits = re.split(LLAMA3_DEFAULT_TEST_SPLIT, response)
    if len(splits) > 2:
        return []
    if len(splits) == 2:
        return splits
    for pattern in LLAMA3_ADDITIONAL_PATTERNS:
        index = response.find(pattern)
        if index != -1:
            return [response[:index], response[index:]]
    return []

# Test case 1: response with matching pattern
response_1 = "Here is some code. To test the function:\nprint('hello')"

# Test case 2: response that matches the default split pattern
response_2 = "Some code here\n### Tests 1\ntest code here"

# Test case 3: response with no matches
response_3 = "Just some random response with no special patterns"

ARGS = {
    "response": response_1
}
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 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
suppress_output Ran
ran on a synthesized input
bigcode-project/starcoder2-self-align/src/star_align/execution_filter.py
code served (permissive licence) · get_code("d2c4d113d519cc11")
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 function. 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 os
import sys
import torch
import torch.nn as nn

torch.manual_seed(0)

# The suppress_output decorator takes a function as its only parameter
# Let's create a simple test function to be decorated
def test_function(x, y):
    """A simple function that will be wrapped by suppress_output"""
    return x + y

# Create the ARGS dictionary
# The suppress_output function takes one parameter: func
ARGS = {
    "func": test_function
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
update_benchmark_dict Ran
ran on a synthesized input
bigcode-project/starcoder2-self-align/src/star_align/decontamination/find_substrings.py
code served (permissive licence) · get_code("303bc7228b4758e6")
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. 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 json
import tempfile
import os
from copy import deepcopy

# Create temporary files for the cache JSONs
temp_dir = tempfile.mkdtemp()
benchmark_cache_path = os.path.join(temp_dir, 'benchmark_cache.json')
excluded_data_cache_path = os.path.join(temp_dir, 'excluded_data_cache.json')

# Create benchmark cache file
benchmark_cache_data = {
    'benchmark_1': ['sample_1', 'sample_2'],
    'benchmark_2': ['sample_3']
}
with open(benchmark_cache_path, 'w') as f:
    json.dump(benchmark_cache_data, f)

# Create excluded data cache file
excluded_data_cache_data = [
    {'filter_reason': 'benchmark_1_match', 'matched_substring': 'sample_1', 'file': 'data_1.txt'},
    {'filter_reason': 'benchmark_1_match', 'matched_substring': 'sample_2', 'file': 'data_2.txt'},
    {'filter_reason': 'benchmark_2_match', 'matched_substring': 'sample_3', 'file': 'data_3.txt'},
    {'filter_reason': 'other_reason', 'matched_substring': 'sample_4', 'file': 'data_4.txt'}
]
with open(excluded_data_cache_path, 'w') as f:
    json.dump(excluded_data_cache_data, f)

# Create filter_out dict
filter_out = {
    'benchmark_1': ['sample_1', 'sample_2', 'sample_5'],
    'benchmark_2': ['sample_3', 'sample_6'],
    'benchmark_3': ['sample_7']
}

ARGS = {
    'filter_out': filter_out,
    'benchmark_cache': benchmark_cache_path,
    'excluded_data_cache': excluded_data_cache_path
}
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 tuple — a tuple 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
xxh3_16hash Ran
ran on a synthesized input
bigcode-project/starcoder2-self-align/src/star_align/minhash_dedup.py
code served (permissive licence) · get_code("b85036e1fe10ab3b")
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 int, ndim 0, dtype family int, 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 xxhash

# The function takes two parameters:
# 1. data: bytes - the data to hash
# 2. seed: int - optional seed (default 0)

# Create simple test data
test_data = b"hello world"
test_seed = 42

ARGS = {
    "data": test_data,
    "seed": test_seed,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
xxhash — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
Fewshot Not yet run
unverified (harvested, no recorded run)
bigcode-project/selfcodealign/src/star_align/self_ossinstruct.py
code served (permissive licence) · get_code("69d27e542d70e540")
How it ran

no invocation recorded.

containerized_run Not yet run
unverified (harvested, no recorded run)
bigcode-project/starcoder2-self-align/src/star_align/execution_filter.py
code served (permissive licence) · get_code("17b4339501de907f")
How it ran

no invocation recorded.

extract_snippets_with_constraints Not yet run
unverified (harvested, no recorded run)
bigcode-project/starcoder2-self-align/src/star_align/collect_snippets.py
code served (permissive licence) · get_code("465ba803e1fe81b9")
How it ran

no invocation recorded.

get_model_context Not yet run
unverified (harvested, no recorded run)
bigcode-project/starcoder2-self-align/src/star_align/llm_wrapper.py
code served (permissive licence) · get_code("1415e89bd7265711")
How it ran

no invocation recorded.

get_ossinstruct_fewshots Not yet run
unverified (harvested, no recorded run)
bigcode-project/selfcodealign/src/star_align/self_ossinstruct.py
code served (permissive licence) · get_code("d063f1765c316bac")
How it ran

no invocation recorded.

load_dataset_column Not yet run
unverified (harvested, no recorded run)
bigcode-project/starcoder2-self-align/src/star_align/decontamination/benchmark_data.py
code served (permissive licence) · get_code("9c7f0c27b8d08b0f")
How it ran

no invocation recorded.

main Not yet run
unverified (harvested, no recorded run)
bigcode-project/selfcodealign/src/star_align/self_ossinstruct.py
code served (permissive licence) · get_code("5c02c0de38a6ae98")
How it ran

no invocation recorded.

Also present in other papers' code

Of 37 samples lifted from this paper's linked repositories, 37 carry a function identity and 0 do not. Of the 37 distinct functions with an identity, 10 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 1 the same month, 8 later) and 27 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
find_word_in_string 11 other papers
9 dated earlier, 2 later
2212.10560 (2022-12)
SELF-INSTRUCT: Aligning Language Models with Self-Generated Instructions
2023.findings-emnlp.836 (2023 (year only))
Ensemble-Instruct: Generating Instruction-Tuning Data with a Heterogeneous Mixture of LMs
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
and 8 more not named here
extract_docstring 10 other papers
5 dated earlier, 2 the same month, 3 later
2405.14734 (2024-05)
SimPO: Simple Preference Optimization with a Reference-Free Reward
2406.08414 (2024-06)
Discovering Preference Optimization Algorithms with and for Large Language Models
2406.19371 (2024-06)
Suri: Multi-constraint Instruction Following for Long-form Text Generation
and 7 more not named here
encode_prompt 7 other papers
5 dated earlier, 2 later
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
2305.14825 (2023-05)
Large Language Models are In-Context Semantic Reasoners rather than Symbolic Reasoners
2308.04948 (2023-08)
Extrapolating Large Language Models to Non-English by Aligning Languages
and 4 more not named here
post_process_gpt3_response 7 other papers
5 dated earlier, 2 later
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
2305.14825 (2023-05)
Large Language Models are In-Context Semantic Reasoners rather than Symbolic Reasoners
2308.04948 (2023-08)
Extrapolating Large Language Models to Non-English by Aligning Languages
and 4 more not named here
chunked 3 other papers
1 dated earlier, 2 later
2406.01006 (2024-06)
SEMCODER: Training Code Language Models with Comprehensive Semantics Reasoning
2412.21199 (2024-12)
HumanEval Pro and MBPP Pro: Evaluating Large Language Models on Self-invoking Code Generation
2609.12584 (2026-09)
Clustering-Based Balanced Sampling and Allocation with Data Parallelism for High-Performance Fine-Tuning
pad_sequences 2 other papers
1 dated earlier, 1 later
2406.01006 (2024-06)
SEMCODER: Training Code Language Models with Comprehensive Semantics Reasoning
2609.12584 (2026-09)
Clustering-Based Balanced Sampling and Allocation with Data Parallelism for High-Performance Fine-Tuning
form_starcoder_infill 1 other paper
1 later
2609.12584 (2026-09)
Clustering-Based Balanced Sampling and Allocation with Data Parallelism for High-Performance Fine-Tuning
postprocess 1 other paper
1 dated earlier
2404.15247 (2024-04)
XFT: Unlocking the Power of Code Instruction Tuning by Simply Merging Upcycled Mixture-of-Experts
preprocess_completion_prompt 1 other paper
1 dated earlier
2404.15247 (2024-04)
XFT: Unlocking the Power of Code Instruction Tuning by Simply Merging Upcycled Mixture-of-Experts
read_jsonl 1 other paper
1 later
2609.12584 (2026-09)
Clustering-Based Balanced Sampling and Allocation with Data Parallelism for High-Performance Fine-Tuning

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

Instruction tuning is a supervised fine-tuning approach that significantly improves the ability of large language models (LLMs) to follow human instructions. For programming tasks, most models are finetuned with costly human-annotated instruction-response pairs or those generated by large, proprietary LLMs, which may not be permitted. We propose SelfCodeAlign, the first fully transparent and permissive pipeline for self-aligning code LLMs without extensive human annotations or distillation. SelfCodeAlign employs the same base model for inference throughout the data generation process. It first extracts diverse coding concepts from high-quality seed snippets to generate new tasks. It then samples multiple responses per task, pairs each with test cases, and validates them in a sandbox environment. Finally, passing examples are selected for instruction tuning. In our primary experiments, we use SelfCodeAlign with CodeQwen1.5-7B to generate a dataset of 74k instruction-response pairs. Finetuning on this dataset leads to a model that achieves a 67.1 pass@1 on HumanEval+, surpassing CodeLlama-70B-Instruct despite being ten times smaller. Across all benchmarks, this finetuned model consistently outperforms the original version trained with OctoPack, the previous state-of-the-art method for instruction tuning without human annotations or distillation. Additionally, we show that SelfCodeAlign is effective across LLMs of various sizes, from 3B to 33B, and that the base models can benefit more from alignment with their own data distribution. We further validate each component's effectiveness in our pipeline, showing that SelfCodeAlign outperforms both direct distillation from GPT-4o and leading GPT-3.5-based distillation methods, such as OSS-Instruct and Evol-Instruct. SelfCodeAlign has also led to the creation of StarCoder2-Instruct, the first fully transparent, permissively licensed, and selfaligned code LLM that achieves state-of-the-art coding performance. Overall, SelfCodeAlign shows for the first time that a strong instruction-tuned code LLM can result from self-alignment rather than distillation.

For agents

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

get_harvested_code_for_paper("2410.24198")
get_code_for_paper("2410.24198")
have("2410.24198")

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

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

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

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

Connect an agent — have() is free.