SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.03710 · ICML · 2024

Agent Instructs Large Language Models to be General Zero-Shot Reasoners

Nicholas Crispino, Kyle Montgomery, Fankun Zeng, Chenguang Wang, D. Song

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 1 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/2310.03710.json · badge: /api/ran/2310.03710.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
wang-research-lab/agentinstruct canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
FunctionStatusWhere it lives
format_instructions Ran
ran; our contract draft was wrong, not the code
wang-research-lab/agentinstruct/src/agentinstruct/reasoning/helm_updates/src/helm/benchmark/run_specs.py
code served (permissive licence) · get_code("b8502db7194d7cfe")
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 format_instructions(instructions: str) -> str:
    if len(instructions) > 0:
        instructions += '\n'
    return instructions

ARGS = {
    'instructions': 'This is a sample instruction'
}
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
get_dataset_phrase Ran
ran; our contract draft was wrong, not the code
wang-research-lab/agentinstruct/src/agentinstruct/agent/utils/dataset_preprocessing.py
code served (permissive licence) · get_code("fd276022adc1ad3b")
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 get_dataset_phrase(dataset_name):
    dataset_phrase = re.sub('(^(.*?):)', 'The dataset name is \\1', dataset_name)
    if 'The dataset name is' not in dataset_phrase:
        dataset_phrase = 'The dataset name is ' + dataset_phrase
    pattern = '(,|:)(.*?)=(.*?)(,|$)'
    while re.search(pattern, dataset_phrase) is not None:
        dataset_phrase = re.sub(pattern, ' and the \\2 is \\3,', dataset_phrase)
    dataset_name = re.sub(':$', '', dataset_name)
    dataset_phrase = re.sub('(,|:)$', '', dataset_phrase)
    return dataset_phrase


ARGS = {
    "dataset_name": "ImageNet:split=train,version=1.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 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_float Ran
ran, honoured the contract we drafted
wang-research-lab/agentinstruct/src/agentinstruct/reasoning/serve/custom_handler/llama-2-13b-chat-handler.py
code served (permissive licence) · get_code("26f037502faf788d")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import logging

def get_float(input_: str, default=0.0) -> float:
    try:
        my_num = float(input_)
        return my_num
    except ValueError:
        logging.debug(f'Invalid float {input_} set to default: {default}')
        return default

ARGS = {
    'input_': '3.14',
    'default': 0.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 float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_int Ran
ran, honoured the contract we drafted
wang-research-lab/agentinstruct/src/agentinstruct/reasoning/serve/custom_handler/llama-2-13b-chat-handler.py
code served (permissive licence) · get_code("283c64914efa0e6f")
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 logging

# Configure logging to see debug messages
logging.basicConfig(level=logging.DEBUG)

# The function takes:
# - input_: str (required)
# - default: int (optional, defaults to 0)

ARGS = {
    'input_': '42',
    'default': 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 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_links Ran
ran; our contract draft was wrong, not the code
wang-research-lab/agentinstruct/src/agentinstruct/agent/agent_instr_generation.py
code served (permissive licence) · get_code("59ed242ba642876f")
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 torch

# Construct search_metadata: a list of dicts, each with a 'link' key
search_metadata = [
    {'link': 'https://example.com/page1', 'title': 'Example 1'},
    {'link': 'https://example.com/page2', 'title': 'Example 2'},
    {'link': 'https://example.com/page3', 'title': 'Example 3'},
]

ARGS = {
    'search_metadata': search_metadata
}
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 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
letter_eval Ran
ran, honoured the contract we drafted
wang-research-lab/agentinstruct/src/agentinstruct/eval/letter_eval.py
code served (permissive licence) · get_code("a7687052123da6b0")
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 json
import os
import tempfile
import string

# Create a temporary directory with the required scenario_state.json file
temp_dir = tempfile.mkdtemp()

# Create the scenario_state.json structure
scenario_data = {
    "adapter_spec": {
        "prompt_list": {
            "agentinstruct": True
        }
    },
    "request_states": [
        {
            "instance": {
                "references": [
                    {
                        "output": {
                            "text": "hello world"
                        }
                    }
                ]
            },
            "result": {
                "full_text": "The answer is: Answer: HW"
            }
        },
        {
            "instance": {
                "references": [
                    {
                        "output": {
                            "text": "test case"
                        }
                    }
                ]
            },
            "result": {
                "full_text": "Some reasoning here Answer: tc"
            }
        }
    ]
}

# Write the JSON file
with open(os.path.join(temp_dir, 'scenario_state.json'), 'w') as f:
    json.dump(scenario_data, f)

ARGS = {
    'path': temp_dir
}
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, 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
parse_helm_name Ran
ran; our contract draft was wrong, not the code
wang-research-lab/agentinstruct/src/agentinstruct/reasoning/helm_updates/src/helm/benchmark/run_expander.py
code served (permissive licence) · get_code("bbd4f51304c18a78")
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 parse_helm_name(name):
    """Given a name, will parse the name to be used in the dict."""
    description = name
    rest_of_description = re.sub('model=.*?,', '', description)
    rest_of_description = re.sub('(,|:)model=.*?(,|$)', '', description)
    rest_of_description = re.sub(',?max_train_instances=.*?(,|$)', '', rest_of_description)
    rest_of_description = re.sub('(,|:)(level|k)=.*?(,|$)', ',', rest_of_description)
    rest_of_description = re.sub('(,|:)(device|timeout|temperature|method)=.*?$', '', rest_of_description)
    rest_of_description = re.sub(',use_official_examples=False', '', rest_of_description)
    rest_of_description = re.sub(',use_chain_of_thought=False', '', rest_of_description)
    rest_of_description = re.sub('_sampled', '', rest_of_description)
    rest_of_description = re.sub('(:|_)num_parenthesis_pairs', '_np', rest_of_description)
    rest_of_description = re.sub('disinformation:capability', 'disinfo:type', rest_of_description)
    dataset_phrase = re.sub('(^(.*?):)', 'The dataset name is \\1', rest_of_description)
    pattern = '(,|:)(.*?)=(.*?)(,|$)'
    while re.search(pattern, dataset_phrase) is not None:
        dataset_phrase = re.sub(pattern, ' and the \\2 is \\3,', dataset_phrase)
    rest_of_description = re.sub(':$', '', rest_of_description)
    dataset_phrase = re.sub('(,|:)$', '', dataset_phrase)
    return rest_of_description

ARGS = {
    "name": "mmlu:model=text-davinci-003,num_train_instances=5,max_train_instances=100,level=5,device=cpu,temperature=0.7,use_official_examples=False,use_chain_of_thought=False"
}
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
post_processing_text Ran
ran; our contract draft was wrong, not the code
wang-research-lab/agentinstruct/src/agentinstruct/reasoning/serve/custom_handler/llama-2-13b-chat-handler.py
code served (permissive licence) · get_code("e1a3a72ca5c64a6a")
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 logging

logging.basicConfig(level=logging.DEBUG)

ARGS = {
    "output_text": "The quick brown fox jumps over the lazy dog. This is the end.",
    "stop_tokens": [".", "!", "?", ""],
    "denylist": ["forbidden", "banned"]
}
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
read_scenario_state Ran
ran; our contract draft was wrong, not the code
wang-research-lab/agentinstruct/src/agentinstruct/agent/utils/dataset_preprocessing.py
code served (permissive licence) · get_code("4eb9af73c57c297b")
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

# Create a temporary JSON file with the required structure
scenario_state = {
    "adapter_spec": {
        "prompt_list": {
            "dataset_name": "test_dataset"
        },
        "method": "generation"
    },
    "request_states": [
        {
            "request": {
                "prompt": "What is 2+2?"
            },
            "instance": {
                "references": [
                    {
                        "output": {
                            "text": "4"
                        }
                    }
                ]
            }
        },
        {
            "request": {
                "prompt": "What is 3+3?"
            },
            "instance": {
                "references": [
                    {
                        "output": {
                            "text": "6"
                        }
                    }
                ]
            }
        }
    ]
}

# Write to temporary file
temp_file = tempfile.NamedTemporaryFile(mode='w', suffix='.json', delete=False)
json.dump(scenario_state, temp_file)
temp_file.close()

ARGS = {
    "scenario_state_path": temp_file.name
}
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
truncate_instances Not yet run
unverified (harvested, no recorded run)
wang-research-lab/agentinstruct/src/agentinstruct/agent/utils/dataset_preprocessing.py
code served (permissive licence) · get_code("2ba15317bdf1e40f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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.

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

We introduce a method to improve the zero-shot reasoning abilities of large language models on general language understanding tasks. Specifically, we build an autonomous agent to instruct the reasoning process of large language models. To enable this, our agent only needs to generate a single set of instructions for each task. These instructions turn out to be extremely effective for improving the reasoning process of different large language models across all task instances. We show this approach further unleashes the zeroshot reasoning abilities of large language models to more tasks. We study the performance of our method on a wide set of datasets spanning generation, classification, and reasoning. We show that our method generalizes to most tasks and obtains state-of-the-art zero-shot performance on 20 of the 29 datasets that we evaluate. For instance, our method boosts the performance of state-of-the-art large language models by a large margin, including Vicuna-13b, Llama-2-70b-chat, and GPT-3.5 Turbo. Compared to zero-shot chain of thought, our improvement in reasoning is striking. With our method, Llama-2-70b-chat outperforms zeroshot GPT-3.5 Turbo significantly.

For agents

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

get_harvested_code_for_paper("2310.03710")
get_code_for_paper("2310.03710")
have("2310.03710")

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

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

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

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

Connect an agent — have() is free.