SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.16906 · 2024

Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step-by-step

arXiv · PDF · Open in the Atlas

Code that ran

11 of 12 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; 11 failures of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2402.16906.json · badge: /api/ran/2402.16906.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
floridsleeves/llmdebugger canonical (classifier label)
classifier basis: census
11 ran · 1 no recorded run
FunctionStatusWhere it lives
add_code_block Ran
ran; our contract draft was wrong, not the code
floridsleeves/llmdebugger/programming/generators/parse.py
code served (permissive licence) · get_code("8eef2232a5acc7f9")
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 add_code_block(string: str, lang: str) -> str:
    return f'```{lang}\n{string}\n```'

ARGS = {
    "string": "print('Hello, World!')",
    "lang": "python"
}
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
fix_func_impl_comments Ran
ran; our contract draft was wrong, not the code
floridsleeves/llmdebugger/programming/utils.py
code served (permissive licence) · get_code("e2c95b0b2c04dbcf")
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

# Analyze the function to understand what it needs:
# - func_impl: str - a string containing function implementation code
# - prompt: str - a string that may contain docstring with """ or '''
# - entry: str - a string to match in a function definition line

# Create valid test arguments

func_impl = '''def calculate_sum(a, b):
    return a + b

def helper_func(x):
    return x * 2
'''

prompt = '''"""
This function adds two numbers together.
Returns the sum of a and b.
"""
def calculate_sum(a, b):
    pass
'''

entry = 'calculate_sum'

ARGS = {
    'func_impl': func_impl,
    'prompt': prompt,
    'entry': entry
}
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
function_with_timeout Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
floridsleeves/llmdebugger/programming/executors/executor_utils.py
code served (permissive licence) · get_code("21ce1caad7419f74")
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 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))
    thread = PropagatingThread(target=wrapper)
    thread.start()
    thread.join(timeout)
    if thread.is_alive():
        thread.terminate()
        raise TimeoutError()
    else:
        return result_container[0]


# Setup code
torch.manual_seed(0)

def simple_func(x, y):
    """A simple function that completes quickly"""
    return x + y

ARGS = {
    'func': simple_func,
    'args': (42, 58),
    '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 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
get_call_str Ran
ran; our contract draft was wrong, not the code
floridsleeves/llmdebugger/programming/executors/py_executor.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
get_output Ran
ran; our contract draft was wrong, not the code
floridsleeves/llmdebugger/programming/executors/py_executor.py
code served (permissive licence) · get_code("a29cddda11d00bfe")
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 ast
import astunparse

torch.manual_seed(0)

def function_with_timeout(func, args, timeout):
    """Simple mock implementation that just calls the function"""
    return func(*args)

def simple_function():
    """A simple test function to use in get_output"""
    def add(a, b):
        return a + b
    return add

# Create a simple function string
func_code = """
def add(a, b):
    return a + b
"""

# Create an assert statement that will be parsed
assert_stmt = "assert add(2, 3) == 5"

ARGS = {
    'func': func_code,
    'assert_statement': assert_stmt,
    'timeout': 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
astunparse, 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
insert_comment Ran
ran; our contract draft was wrong, not the code
floridsleeves/llmdebugger/programming/utils.py
code served (permissive licence) · get_code("42393bbefa5a1cd7")
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

# Construct valid arguments for insert_comment function
func_impl = """def helper():
    x = 1

def entry(a, b):
    return a + b

def another():
    pass
"""

comment = "This is a docstring comment"

entry = "entry"

ARGS = {
    "func_impl": func_impl,
    "comment": comment,
    "entry": entry,
}
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
message_to_str Ran
ran; our contract draft was wrong, not the code
floridsleeves/llmdebugger/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
floridsleeves/llmdebugger/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
parse_code_block Ran
ran; our contract draft was wrong, not the code
floridsleeves/llmdebugger/programming/generators/parse.py
code served (permissive licence) · get_code("b4401818078b6b05")
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
from typing import Optional

ARGS = {
    'string': '''Here is some code:

def hello_world():
    x = 42
    return x

def goodbye():
    return None

End of code.''',
    'lang': 'python'
}
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
parse_first_func Ran
ran; our contract draft was wrong, not the code
floridsleeves/llmdebugger/programming/generators/parse.py
code served (permissive licence) · get_code("276cbea7969c5ddd")
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

# Construct valid arguments for parse_first_func

# Test case 1: Simple Python code with a function definition and return
code_1 = """def hello(x):
    result = x + 1
    return result

"""

# Test case 2: Multiple functions, should parse only the first
code_2 = """def first_func(a, b):
    sum_val = a + b
    return sum_val

def second_func(c):
    return c * 2
"""

# Test case 3: Function with no return statement
code_3 = """def no_return_func():
    x = 5
"""

# Test case 4: No function definition at all
code_4 = """x = 10
y = 20
"""

# Test case 5: Function with return and blank line after
code_5 = """def simple():
    return 42

"""

# Use the first test case as the main argument
ARGS = {
    'code': code_1,
    'lang': 'python'
}
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
prepare_function_from_seed Ran
ran; our contract draft was wrong, not the code
floridsleeves/llmdebugger/programming/utils.py
code served (permissive licence) · get_code("f23c44a8032805cd")
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

torch.manual_seed(0)

ARGS = {
    'dataset_type': 'HumanEval',
    'prompt': '''def add(a, b):
    """Add two numbers together"""
    pass''',
    'seed': '''def add(a, b):
    """Add two numbers together"""
    return a + b''',
    'entry_point': 'add'
}
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
gpt_completion Not yet run
unverified (harvested, no recorded run)
floridsleeves/llmdebugger/programming/generators/model.py
code served (permissive licence) · get_code("e755ffd0c5efc22b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 3 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 3 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
message_to_str 4 other papers
1 dated earlier, 3 later
2310.04406 (2023-10)
Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Models
2404.02183 (2024-04)
Self-Organized Agents: A LLM Multi-Agent Framework toward Ultra Large-Scale Code Generation and Optimization
2407.11770 (2024-07)
Robust Utility-Preserving Text Anonymization Based on Large Language Models
and 1 more not named here
messages_to_str 4 other papers
1 dated earlier, 3 later
2310.04406 (2023-10)
Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Models
2404.02183 (2024-04)
Self-Organized Agents: A LLM Multi-Agent Framework toward Ultra Large-Scale Code Generation and Optimization
2407.11770 (2024-07)
Robust Utility-Preserving Text Anonymization Based on Large Language Models
and 1 more not named here
get_call_str 1 other paper
1 later
2411.14503 (2024-11)
Planning-Driven Programming: A Large Language Model Programming Workflow

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Large language models (LLMs) are leading significant progress in code generation. Beyond one-pass code generation, recent works further integrate unit tests and program verifiers into LLMs to iteratively refine the generated programs. However, these works consider the generated programs as an indivisible entity, which falls short for LLMs in debugging the programs, especially when the programs contain complex logic flows and data operations. In contrast, when human developers debug programs, they typically set breakpoints and selectively examine runtime execution information. The execution flow and the intermediate variables play a crucial role in the debugging process, yet they are underutilized in the existing literature on code generation. In this study, we introduce Large Language Model Debugger (LDB), a novel debugging framework that enables LLMs to refine their generated programs with the runtime execution information. Specifically, LDB segments the programs into basic blocks and tracks the values of intermediate variables after each block throughout the runtime execution. This allows LLMs to concentrate on simpler code units within the overall execution flow, verify their correctness against the task description block by block, and efficiently pinpoint any potential errors. Experiments demonstrate that LDB consistently enhances the baseline performance by up to 9.8% across the HumanEval, MBPP, and TransCoder benchmarks, archiving new state-of-the-art performance in code debugging for various LLM selections.

For agents

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

get_harvested_code_for_paper("2402.16906")
get_code_for_paper("2402.16906")
have("2402.16906")

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

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

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

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

Connect an agent — have() is free.