SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2411.14503 · 2024

Planning-Driven Programming: A Large Language Model Programming Workflow

arXiv · PDF · Open in the Atlas

Code that ran

9 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 9 failures of our instrument; 0 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/2411.14503.json · badge: /api/ran/2411.14503.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
you68681/lpw canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
FunctionStatusWhere it lives
capture_import_statements Ran
ran; our contract draft was wrong, not the code
you68681/lpw/programming/utils.py
code served (permissive licence) · get_code("61ed12a417c6a29c")
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

def capture_import_statements(code: str) -> list:
    """
    Capture all import statements from the given Python code.

    Args:
    code (str): The string containing the Python code.

    Returns:
    list: A list of import statements found in the code.
    """
    matches = re.findall('^\\s*(import\\s+\\w+(\\s*,\\s*\\w+)*|from\\s+\\w+(\\.\\w+)*\\s+import\\s+\\w+(\\s*,\\s*\\w+)*)', code, re.MULTILINE)
    return [match[0] for match in matches]


# Setup code
code_sample = """
import os
import sys, json
from collections import defaultdict
from pathlib import Path
import numpy as np
from typing import List, Dict

def hello():
    pass
"""

ARGS = {
    "code": code_sample
}
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
change_messages Ran
ran; our contract draft was wrong, not the code
you68681/lpw/programming/generators/model.py
code served (permissive licence) · get_code("649c4f119862d2c3")
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

class StandInTokenizer:
    """Minimal tokenizer that implements the tokenize method."""
    def tokenize(self, text):
        # Simple tokenization: split by whitespace
        return text.split()

class StandInMessage:
    """Minimal message class with content attribute."""
    def __init__(self, content):
        self.content = content

# Test case 1: string input
tokenizer = StandInTokenizer()
messages_str = "hello world\nthis is a test\nmore content here"
max_len = 10

# Test case 2: list of message objects
msg1 = StandInMessage("initial message with some content")
msg2 = StandInMessage("second message here")
msg3 = StandInMessage("third message")
messages_list = [msg1, msg2, msg3]

# We'll use the string case for ARGS as it's simpler
ARGS = {
    "tokenizer": tokenizer,
    "messages": messages_str,
    "max_len": max_len
}
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
exec_ast_fn Ran
ran; our contract draft was wrong, not the code
you68681/lpw/programming/executors/executor_utils.py
code served (permissive licence) · get_code("bcf25e8f2313460d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import ast as ast_module

torch.manual_seed(0)

# Simple test function that works with exec
def simple_func():
    x = 1 + 1
    return x

# Create valid arguments for exec_ast_fn
code = """
def test_function():
    result = 42
    return result
"""

ast_code = """
test_function()
"""

timeout_value = 5

ARGS = {
    'code': code,
    'ast': ast_code,
    'timeout': timeout_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 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
extract_docstring Ran
ran; our contract draft was wrong, not the code
you68681/lpw/programming/utils.py
code served (permissive licence) · get_code("754f358cc101b37c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def extract_docstring(function_str: str) -> str:
    docstring_pattern = re.compile('""".*?"""', re.DOTALL)
    match = docstring_pattern.search(function_str)
    if match:
        docstring = match.group(0)
        docstring = docstring.strip('"""')
        return docstring.strip()
    else:
        return ''

ARGS = {
    "function_str": '''def example_function():
    """
    This is a docstring.
    It can span multiple lines.
    """
    pass
'''
}
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
function_with_timeout Ran
ran; our contract draft was wrong, not the code
you68681/lpw/programming/executors/executor_utils.py
code served (permissive licence) · get_code("f49aba0898ea577d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from threading import Thread

class PropagatingThread(Thread):

    def run(self):
        self.exc = None
        try:
            if hasattr(self, '_Thread__target'):
                self.ret = self._Thread__target(*self._Thread__args, **self._Thread__kwargs)
            else:
                self.ret = self._target(*self._args, **self._kwargs)
        except Exception as e:
            self.exc = e

    def join(self, timeout=None):
        super(PropagatingThread, self).join(timeout)
        if self.exc:
            raise self.exc
        if self.is_alive():
            return None
        return self.ret

    def terminate(self):
        self._stop()

def function_with_timeout(func, args, timeout):
    result_container = []

    def wrapper():
        result_container.append(func(*args))
    try:
        thread = PropagatingThread(target=wrapper)
        thread.start()
        thread.join(timeout)
        if thread.is_alive():
            return (-1, None)
        else:
            return (0, result_container[0])
    except Exception as e:
        return (-2, e)

torch.manual_seed(0)

def simple_add(x, y):
    return x + y

ARGS = {
    'func': simple_add,
    'args': (5, 3),
    'timeout': 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_call_str Ran
ran; our contract draft was wrong, not the code
you68681/lpw/programming/executors/executor_utils.py
code served (permissive licence) · get_code("893d75cf140dbc4b")
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
import astunparse

# The function parses an assert statement string and extracts the call string
# It uses ast.parse to parse the string, then accesses body[0].test
# and either .left or the test itself, then uses astunparse.unparse on it

# Test cases for assert statements
assert_stmt_simple = "assert x > 5"
assert_stmt_comparison = "assert foo(a, b) == bar(c)"
assert_stmt_with_left = "assert result.method() != expected"

ARGS = {
    "assert_statement": "assert some_function(x, y) == 42"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
astunparse — 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
message_to_str Ran
ran; our contract draft was wrong, not the code
you68681/lpw/programming/generators/model.py
code served (permissive licence) · get_code("a067a230397d97aa")
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 dataclasses
from typing import Literal

MessageRole = Literal['system', 'user', 'assistant']

@dataclasses.dataclass()
class Message:
    role: MessageRole
    content: str

def message_to_str(message: Message) -> str:
    return f'{message.role}: {message.content}'

# Create a valid Message instance
test_message = Message(
    role='user',
    content='Hello, how are you?'
)

ARGS = {
    'message': test_message
}
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
messages_to_str Ran
ran; our contract draft was wrong, not the code
you68681/lpw/programming/generators/model.py
code served (permissive licence) · get_code("4e0f76b9ec8bd13a")
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 dataclasses
from typing import List, Literal

MessageRole = Literal['system', 'user', 'assistant']

@dataclasses.dataclass()
class Message:
    role: MessageRole
    content: str

def message_to_str(message: Message) -> str:
    return f'{message.role}: {message.content}'

def messages_to_str(messages: List[Message]) -> str:
    return '\n'.join([message_to_str(message) for message in messages])

# Construct valid arguments
messages = [
    Message(role='system', content='You are a helpful assistant.'),
    Message(role='user', content='What is 2+2?'),
    Message(role='assistant', content='The answer is 4.')
]

ARGS = {
    'messages': messages
}
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
prepare_function_from_generated_code Ran
ran; our contract draft was wrong, not the code
you68681/lpw/programming/utils.py
code served (permissive licence) · get_code("2062ffea418270db")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re
import torch
import torch.nn as nn
import numpy as np
from typing import Any, Dict, List

# The function signature is incomplete in the provided code, but based on the
# function name and context, we can infer the parameters needed:
# prepare_function_from_generated_code(dataset_type, prompt, generated_program, entry_point, add_header=True)

# Create minimal valid arguments for the function
dataset_type = "HumanEval"

prompt = '''def solve(n):
    """
    Solve the problem with input n.
    """
    return n * 2
'''

generated_program = '''from typing import *
import math
from heapq import *
import itertools
import re
import typing
import heapq

def solve(n):
    """
    Solve the problem with input n.
    """
    return n * 2
'''

entry_point = "solve"

add_header = True

ARGS = {
    "dataset_type": dataset_type,
    "prompt": prompt,
    "generated_program": generated_program,
    "entry_point": entry_point,
    "add_header": add_header
}
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

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 0 later) and 6 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
message_to_str 4 other papers
4 dated earlier
2310.04406 (2023-10)
Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Models
2402.16906 (2024-02)
Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step-by-step
2404.02183 (2024-04)
Self-Organized Agents: A LLM Multi-Agent Framework toward Ultra Large-Scale Code Generation and Optimization
and 1 more not named here
messages_to_str 4 other papers
4 dated earlier
2310.04406 (2023-10)
Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Models
2402.16906 (2024-02)
Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step-by-step
2404.02183 (2024-04)
Self-Organized Agents: A LLM Multi-Agent Framework toward Ultra Large-Scale Code Generation and Optimization
and 1 more not named here
get_call_str 1 other paper
1 dated earlier
2402.16906 (2024-02)
Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step-by-step

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

The strong performance of large language models (LLMs) raises extensive discussion on their application to code generation. Recent research suggests continuous program refinements through visible tests to improve code generation accuracy in LLMs. However, these methods suffer from LLMs' inefficiency and limited reasoning capacity. In this work, we propose an LLM programming workflow (LPW) designed to improve both initial code generation and subsequent refinements within a structured two-phase workflow. Specifically, the solution generation phase formulates a solution plan, which is then verified through visible tests to specify the intended natural language solution. Subsequently, the code implementation phase drafts an initial code according to the solution plan and its verification. If the generated code fails the visible tests, the plan verification serves as the intended solution to consistently inform the refinement process for correcting bugs. Compared to state-of-the-art methods across various existing LLMs, LPW significantly improves the Pass@1 accuracy by up to 16.4% on well-established text-to-code generation benchmarks. LPW also sets new state-of-the-art Pass@1 accuracy, achieving 98.2% on HumanEval, 84.8% on MBPP, 59.3% on LiveCode, 62.6% on APPS, and 34.7% on CodeContest, using GPT-4o as the backbone. Our code is publicly available at: https://github.com/you68681/lpw

For agents

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

get_harvested_code_for_paper("2411.14503")
get_code_for_paper("2411.14503")
have("2411.14503")

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

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

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

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

Connect an agent — have() is free.