SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.09014 · 2023

ART: Automatic multi-step reasoning and tool-use for large language models

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 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 3 have no contract verdict; 0 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/2303.09014.json · badge: /api/ran/2303.09014.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
guidance-ai/guidance canonical (classifier label)
classifier basis not recorded on the link
3 ran · 1 no recorded run
FunctionStatusWhere it lives
bytes_from Ran
ran on a synthesized input
guidance-ai/guidance/guidance/_utils.py
code served (permissive licence) · get_code("033556b7164ece93")
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 bytes. 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 pathlib
import tempfile
import os

# Create a temporary file with some test data
temp_dir = tempfile.mkdtemp()
temp_file_path = os.path.join(temp_dir, "test_file.bin")
with open(temp_file_path, 'wb') as f:
    f.write(b"test data content")

ARGS = {
    'src': temp_file_path,
    'allow_local': True,
    'allowed_schemes': ('https',),
    'allow_private': False,
    'max_bytes': 16 * 1024 * 1024,
    'timeout': 120,
}
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 bytes — a bytes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a bytes 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
load_template_class Ran
ran on a synthesized input
guidance-ai/guidance/guidance/chat.py
code served (permissive licence) · get_code("c46a047369ef391b")
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 type. 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 inspect
import warnings

class ChatTemplate:
    """Contains template for all chat and instruct tuned models."""

    def get_role_start(self, role_name: str, **kwargs):
        raise NotImplementedError('You need to use a ChatTemplate subclass that overrides the get_role_start method')

    def get_role_end(self, role_name: str | None=None):
        raise NotImplementedError('You need to use a ChatTemplate subclass that overrides the get_role_start method')

class ChatTemplateCache:

    def __init__(self) -> None:
        self._cache: dict[str, ChatTemplate] = {}

    def __getitem__(self, key: str) -> ChatTemplate:
        key_compact = key.replace(' ', '')
        return self._cache[key_compact]

    def __setitem__(self, key: str, value):
        key_compact = key.replace(' ', '')
        self._cache[key_compact] = value

    def __contains__(self, key: str):
        key_compact = key.replace(' ', '')
        return key_compact in self._cache

CHAT_TEMPLATE_CACHE = ChatTemplateCache()

chatml_template = "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}"

class ChatMLTemplate(ChatTemplate):
    template_str = chatml_template

    def get_role_start(self, role_name):
        return f'<|im_start|>{role_name}\n'

    def get_role_end(self, role_name=None):
        return '<|im_end|>\n'

def load_template_class(chat_template=None):
    """Utility method to find the best chat template.

    Order of precedence:
    - If it's a chat template class, use it directly
    - If it's a string, check the cache of popular model templates
    - If it's a string and not in the cache, try to create a class dynamically
    - [TODO] If it's a string and can't be created, default to ChatML and raise a warning
    - If it's None, default to ChatML and raise a warning
    """
    if inspect.isclass(chat_template) and issubclass(chat_template, ChatTemplate):
        if chat_template is ChatTemplate:
            raise Exception("You can't use the base ChatTemplate class directly. Create or use a subclass instead.")
        return chat_template
    elif isinstance(chat_template, str):
        if chat_template in CHAT_TEMPLATE_CACHE:
            return CHAT_TEMPLATE_CACHE[chat_template]
    if chat_template is not None:
        warnings.warn(f'Chat template {chat_template} was unable to be loaded directly into guidance.\n                        Defaulting to the ChatML format which may not be optimal for the selected model. \n                        For best results, create and pass in a `guidance.ChatTemplate` subclass for your model.', stacklevel=2)
    return ChatMLTemplate

ARGS = {
    'chat_template': ChatMLTemplate
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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_weak_bound_method Ran
ran on a synthesized input
guidance-ai/guidance/guidance/_utils.py
code served (permissive licence) · get_code("a57daecf6c38000d")
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 functools
import inspect
import types
import weakref
import torch


class SimpleClass:
    """A simple instance to bind a method to."""
    def __init__(self, value):
        self.value = value
    
    def __repr__(self):
        return f"SimpleClass(value={self.value})"


def sample_function(self, x, y):
    """A sample function to be bound as a weak method."""
    return self.value + x + y


ARGS = {
    "f": sample_function,
    "instance": SimpleClass(42)
}
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
strip_multiline_string_indents Not yet run
unverified (harvested, no recorded run)
guidance-ai/guidance/guidance/_utils.py
code served (permissive licence) · get_code("7229c1c8ee90348f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 4 the same month, 0 later) and 0 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
bytes_from 1 other paper
1 the same month
2303.12712 (2023-03)
Sparks of Artificial General Intelligence: Early experiments with GPT-4
load_template_class 1 other paper
1 the same month
2303.12712 (2023-03)
Sparks of Artificial General Intelligence: Early experiments with GPT-4
make_weak_bound_method 1 other paper
1 the same month
2303.12712 (2023-03)
Sparks of Artificial General Intelligence: Early experiments with GPT-4
strip_multiline_string_indents 1 other paper
1 the same month
2303.12712 (2023-03)
Sparks of Artificial General Intelligence: Early experiments with GPT-4

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) can perform complex reasoning in few- and zero-shot settings by generating intermediate chain of thought (CoT) reasoning steps. Further, each reasoning step can rely on external tools to support computation beyond the core LLM capabilities (e.g. search/running code). Prior work on CoT prompting and tool use typically requires hand-crafting task-specific demonstrations and carefully scripted interleaving of model generations with tool use. We introduce Automatic Reasoning and Tool-use (ART), a framework that uses frozen LLMs to automatically generate intermediate reasoning steps as a program. Given a new task to solve, ART selects demonstrations of multi-step reasoning and tool use from a task library. At test time, ART seamlessly pauses generation whenever external tools are called, and integrates their output before resuming generation. ART achieves a substantial improvement over few-shot prompting and automatic CoT on unseen tasks in the BigBench and MMLU benchmarks, and matches performance of hand-crafted CoT prompts on a majority of these tasks. ART is also extensible, and makes it easy for humans to improve performance by correcting errors in task-specific programs or incorporating new tools, which we demonstrate by drastically improving performance on select tasks with minimal human intervention.

For agents

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

get_harvested_code_for_paper("2303.09014")
get_code_for_paper("2303.09014")
have("2303.09014")

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

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

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

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

Connect an agent — have() is free.