SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.16427 · 2023

PromptAgent: Strategic Planning with Language Models Enables Expert-level Prompt Optimization

arXiv · PDF · Open in the Atlas

Code that ran

16 of 19 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, 2 violated it and 12 have no contract verdict; 2 failures of our instrument; 3 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.16427.json · badge: /api/ran/2310.16427.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
xinyuanwangcs/promptagent canonical (classifier label)
classifier basis: census
4 ran · 1 no recorded run
karayanni/structurease community (classifier label)
classifier basis not recorded on the link
12 ran · 2 no recorded run
FunctionStatusWhere it lives
classification_using_llm Ran
ran on a synthesized input
karayanni/structurease/Evaluation/EvaluatePrompt.py
code served (permissive licence) · get_code("5332965d29e0a6d6")
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 coroutine. 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
import time
import random
from unittest.mock import AsyncMock, MagicMock
import asyncio

# Set up logging
logging.basicConfig(level=logging.ERROR)

# Create mock clinical note, system prompt, and user prompt
clinical_note = "Patient presents with fever and cough for 3 days. Temperature 38.5C. Chest X-ray shows bilateral infiltrates. Diagnosed with pneumonia."

system_prompt = "You are a medical classifier. Classify the clinical note into one of the following categories: 1=Pneumonia, 2=Bronchitis, 3=Common Cold, 4=Asthma. Respond with only the number."

user_prompt = "Please classify the following clinical note into the appropriate category based on the diagnosis and symptoms presented."

ARGS = {
    'clinical_note': clinical_note,
    'system_prompt': system_prompt,
    'user_prompt': user_prompt,
}
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 coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
create_logger Ran
ran; our contract draft was wrong, not the code
xinyuanwangcs/promptagent/src/prompt_optim_agent/utils.py
code served (permissive licence) · get_code("ff90ff7b4449ccf2")
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 Logger. 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 tempfile
import shutil

# Create a temporary directory for logging
temp_logging_dir = tempfile.mkdtemp()

ARGS = {
    'logging_dir': temp_logging_dir,
    'name': 'test_logger',
    'log_mode': 'train'
}
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 Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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
evaluate_classification_accuracy Ran
ran on a synthesized input
karayanni/structurease/Evaluation/EvaluateOutputFile.py
code served (permissive licence) · get_code("ea3228b60ee75404")
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 pandas as pd
import tempfile
import os

# Create a temporary CSV file with the required columns
temp_dir = tempfile.mkdtemp()
csv_file_path = os.path.join(temp_dir, "test_classification.csv")

# Create a sample DataFrame with the required columns
data = {
    'CPSC_Case_Number': ['CASE001', 'CASE002', 'CASE003', 'CASE004', 'CASE005'],
    'Helmet_Status': ['Helmet', 'No helmet', 'Unknown (not mentioned)', 'Helmet', 'No helmet'],
    'LLM_number': [1, 0, 2, 1, 0],
    'Narrative_1': [
        'Person was wearing a helmet',
        'Person was not wearing a helmet',
        'No information about helmet',
        'Person was wearing a helmet',
        'Person was not wearing a helmet'
    ]
}

df = pd.DataFrame(data)
df.to_csv(csv_file_path, index=False)

ARGS = {
    'file_path': csv_file_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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
evaluate_classification_accuracy Ran
ran on a synthesized input
karayanni/structurease/Evaluation/temp.py
code served (permissive licence) · get_code("e041cf790e68003b")
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 pandas as pd
import tempfile
import os

# Create temporary CSV files with valid data
temp_dir = tempfile.gettempdir()
file1_path = os.path.join(temp_dir, "neiss_filtered_labeled_output.csv")
file2_path = os.path.join(temp_dir, "neiss_2023_filtered_labeled.csv")

# Create first CSV file (neiss_filtered_labeled_output)
df1_data = {
    'Treatment_Date': ['2023-01-01', '2023-01-02', '2023-01-03', '2023-01-04'],
    'LLM_number': [0, 1, 2, 0]
}
df1 = pd.DataFrame(df1_data)
df1.to_csv(file1_path, index=False)

# Create second CSV file (neiss_2023_filtered_labeled)
df2_data = {
    'Treatment_Date': ['2023-01-01', '2023-01-02', '2023-01-03', '2023-01-04'],
    'Helmet_Status': ['No helmet', 'Helmet', 'Unknown (not mentioned)', 'No helmet']
}
df2 = pd.DataFrame(df2_data)
df2.to_csv(file2_path, index=False)

ARGS = {
    'file1_path': file1_path,
    'file2_path': file2_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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
evaluate_manual_to_llm_df Ran
ran on a synthesized input
karayanni/structurease/Evaluation/EvaluateCurrentPromptOnEntireDS.py
code served (permissive licence) · get_code("725d28343ca4ee57")
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 pandas as pd
import numpy as np

# Create a small DataFrame with the required columns
data = {
    'Sampled Text': [
        'Person wearing helmet',
        'Person without helmet',
        'Person with helmet',
        'Person without protection',
        'Helmet visible',
        'No helmet detected'
    ],
    'Label': [
        'helmet',
        'no_helmet',
        'helmet',
        'no_helmet',
        'helmet',
        'no_helmet'
    ],
    'LLM_number': [
        0,
        1,
        0,
        1,
        0,
        0  # This one will be misclassified
    ]
}

llm_df = pd.DataFrame(data)

# Define the classes list
classes = ['helmet', 'no_helmet']

ARGS = {
    'llm_df': llm_df,
    'classes': classes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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
evaluate_manual_to_llm_df Ran
ran on a synthesized input
karayanni/structurease/PromptCreationFlow/ChooseLabelingData.py
code served (permissive licence) · get_code("0787b09ede80ffb2")
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 pandas as pd
import numpy as np

# Create a sample DataFrame with the required columns
np.random.seed(0)
llm_df = pd.DataFrame({
    'Sampled Text': [
        'Person wearing helmet',
        'Person without helmet',
        'Person with helmet',
        'Person no helmet',
        'Helmet visible',
        'No helmet',
    ],
    'Label': ['helmet', 'no_helmet', 'helmet', 'no_helmet', 'helmet', 'no_helmet'],
    'LLM_number': [1, 0, 1, 0, 1, 0],
})

# Add some misclassifications
llm_df.loc[1, 'LLM_number'] = 1  # Should be 0, but predicted 1
llm_df.loc[4, 'LLM_number'] = 0  # Should be 1, but predicted 0

classes = ['no_helmet', 'helmet']

ARGS = {
    'llm_df': llm_df,
    'classes': classes,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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
exponential_backoff_retry Ran
ran on a synthesized input
karayanni/structurease/Evaluation/EvaluateCurrentPromptOnEntireDS.py
code served (permissive licence) · get_code("d614ff0573a148ab")
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 coroutine. 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 asyncio
import logging
import time
import random

logging.basicConfig(level=logging.ERROR)

# Create a simple async function that fails a few times then succeeds
call_count = 0

async def test_func():
    global call_count
    call_count += 1
    if call_count < 2:
        raise ValueError("Simulated failure")
    return "Success"

# Reset call count before defining ARGS
call_count = 0

ARGS = {
    "func": test_func,
    "max_retries": 4,
    "initial_delay": 0.01,
    "max_delay": 0.16,
    "jitter": 0.01
}
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 coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
exponential_backoff_retry Ran
ran on a synthesized input
karayanni/structurease/PromptCreationFlow/ClassificationPromptGeneration.py
code served (permissive licence) · get_code("acadf8a5b1c39943")
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 random
import time
import logging

# Configure logging to see the retry messages
logging.basicConfig(level=logging.ERROR)

# Create a simple function that fails a few times then succeeds
call_count = 0

def flaky_func():
    global call_count
    call_count += 1
    if call_count < 3:
        raise ValueError(f"Simulated failure {call_count}")
    return "Success!"

# Define arguments for exponential_backoff_retry
ARGS = {
    'func': flaky_func,
    'max_retries': 4,
    'initial_delay': 0.1,
    'max_delay': 1.6,
    'jitter': 0.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 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
exponential_backoff_retry Ran
ran on a synthesized input
karayanni/structurease/PromptCreationFlow/EvaluateCurrentPrompt.py
code served (permissive licence) · get_code("822eda707ef35c73")
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
import time
import random
import torch

logging.basicConfig(level=logging.ERROR)

# Counter to track function calls
call_count = 0

def test_func_succeeds():
    """A function that succeeds on first try"""
    return "success"

def test_func_fails_then_succeeds():
    """A function that fails twice then succeeds"""
    global call_count
    call_count += 1
    if call_count < 3:
        raise RuntimeError(f"Temporary failure {call_count}")
    return "success after retries"

# Use the succeeding function for the main test
func = test_func_succeeds

ARGS = {
    "func": func,
    "max_retries": 4,
    "initial_delay": 1,
    "max_delay": 16,
    "jitter": 0.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 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_classification_number Ran
ran on a synthesized input
karayanni/structurease/Evaluation/EvaluateCurrentPromptOnEntireDS.py
code served (permissive licence) · get_code("f13ea50d50bffac3")
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 coroutine. 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 asyncio
import logging

# Set up logging
logging.basicConfig(level=logging.ERROR)

# Define ARGS dict with the required parameters for extract_classification_number
ARGS = {
    'response': 'The model determined that this sample belongs to class 1 based on the analysis.',
    'system_prompt': 'You are a helpful assistant that extracts classification numbers from text. Return only the digit.'
}
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 coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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_classification_number Ran
ran on a synthesized input
karayanni/structurease/Evaluation/EvaluatePrompt.py
code served (permissive licence) · get_code("1089b70c19023e24")
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 coroutine. 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
import time
import random
from unittest.mock import AsyncMock, MagicMock

logging.basicConfig(level=logging.ERROR)

# Create a mock response object that mimics OpenAI's response structure
mock_completion = MagicMock()
mock_message = MagicMock()
mock_message.content = "1"
mock_choice = MagicMock()
mock_choice.message = mock_message
mock_completion.choices = [mock_choice]

# Create async mock for the OpenAI client
async def mock_chat_completion(*args, **kwargs):
    return mock_completion

ARGS = {
    'response': 'The classification result is 1 based on the analysis of the provided text.',
    'system_prompt': 'You are a helpful assistant that extracts classification numbers from text. The classification number should be 0, 1, or 2.'
}
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 coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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_classification_number Ran
ran on a synthesized input
karayanni/structurease/PromptCreationFlow/ChooseLabelingData.py
code served (permissive licence) · get_code("5270fe06945781dd")
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 coroutine. 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
import asyncio
from unittest.mock import AsyncMock, MagicMock

logging.basicConfig(level=logging.INFO)

# Create mock response object that mimics OpenAI completion response
class MockChoice:
    def __init__(self):
        self.message = MagicMock()
        self.message.content = "1"

class MockCompletion:
    def __init__(self):
        self.choices = [MockChoice()]

# Create a mock async function for the response parameter
async def mock_response_func():
    """Mock function that returns a valid response string"""
    return "The classification number is 1"

# Build arguments
ARGS = {
    "response": "Based on the analysis, the final classification is 1",
    "system_prompt": "You are a helpful assistant that extracts classification numbers from text. Return only the digit 0, 1, or 2."
}
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 coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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_classification_number Ran
ran on a synthesized input
karayanni/structurease/PromptCreationFlow/EvaluateCurrentPrompt.py
code served (permissive licence) · get_code("e0b75026e83eb284")
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 coroutine. 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
import time
import random
from unittest.mock import Mock, MagicMock, AsyncMock, patch

logging.basicConfig(level=logging.ERROR)

# Mock the OpenAI client and its response structure
mock_message = Mock()
mock_message.content = "1"

mock_choice = Mock()
mock_choice.message = mock_message

mock_completion = Mock()
mock_completion.choices = [mock_choice]

mock_client = Mock()
mock_client.chat.completions.create = Mock(return_value=mock_completion)

# Patch OpenAI client before function definition
with patch('openai.OpenAI', return_value=mock_client):
    pass

ARGS = {
    'response': 'The classification number for this sample is 1 based on the analysis.',
    'system_prompt': 'You are a helpful assistant that classifies text into categories 0, 1, or 2.'
}
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 coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
is_chunk_end Ran
ran, violated the contract we drafted
xinyuanwangcs/promptagent/src/tasks/ncbi.py
code served (permissive licence) · get_code("e4736e9992d1de49")
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 bool, 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 torch

# Define test arguments for is_chunk_end function
# The function takes two string parameters: prev_tag and tag
# These represent IOBES chunk tags (e.g., "B-PER", "I-LOC", "O")

# Test case 1: (B-PER, I-PER) -> False (continuation of same chunk)
ARGS = {
    "prev_tag": "B-PER",
    "tag": "I-PER"
}
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 bool, 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
is_chunk_start Ran
ran, violated the contract we drafted
xinyuanwangcs/promptagent/src/tasks/ncbi.py
code served (permissive licence) · get_code("405fd06f23bf2a87")
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 bool, 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 torch

# Define ARGS with test cases for is_chunk_start function
# The function takes two parameters: prev_tag and tag (both strings)

ARGS = {
    "prev_tag": "B-PER",
    "tag": "I-PER"
}
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 bool, 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
split_tag Ran
ran; our contract draft was wrong, not the code
xinyuanwangcs/promptagent/src/tasks/ncbi.py
code served (permissive licence) · get_code("f9a22a5ce23105fd")
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

torch.manual_seed(0)

# Test case 1: Standard IOBES tag with chunk type
chunk_tag_1 = "B-PER"

# Test case 2: O tag (no chunk type)
chunk_tag_2 = "O"

# Test case 3: Other IOBES prefixes
chunk_tag_3 = "I-LOC"

# We'll use the first test case as the argument
ARGS = {
    "chunk_tag": "B-PER"
}
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
ImprovePrompt Not yet run
unverified (harvested, no recorded run)
karayanni/structurease/PromptCreationFlow/PromptImprovementStep.py
code served (permissive licence) · get_code("4f76d3cd1e441183")
How it ran

no invocation recorded.

InitialGenerateClassificationPrompt Not yet run
unverified (harvested, no recorded run)
karayanni/structurease/PromptCreationFlow/ClassificationPromptGeneration.py
code served (permissive licence) · get_code("1d17c85bcc65edb6")
How it ran

no invocation recorded.

parse_model_args Not yet run
unverified (harvested, no recorded run)
xinyuanwangcs/promptagent/src/prompt_optim_agent/utils.py
code served (permissive licence) · get_code("7aff0c6a7e5e52d0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 19 samples lifted from this paper's linked repositories, 19 carry a function identity and 0 do not. Of the 19 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 16 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
is_chunk_end 1 other paper
1 dated earlier
2109.04711 (2021-09)
Pre-train or Annotate? Domain Adaptation with a Constrained Budget
is_chunk_start 1 other paper
1 dated earlier
2109.04711 (2021-09)
Pre-train or Annotate? Domain Adaptation with a Constrained Budget
split_tag 1 other paper
1 dated earlier
2109.04711 (2021-09)
Pre-train or Annotate? Domain Adaptation with a Constrained Budget

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

Highly effective, task-specific prompts are often heavily engineered by experts to integrate detailed instructions and domain insights based on a deep understanding of both instincts of large language models (LLMs) and the intricacies of the target task. However, automating the generation of such expert-level prompts remains elusive. Existing prompt optimization methods tend to overlook the depth of domain knowledge and struggle to efficiently explore the vast space of expert-level prompts. Addressing this, we present PromptAgent, an optimization method that autonomously crafts prompts equivalent in quality to those handcrafted by experts. At its core, PromptAgent views prompt optimization as a strategic planning problem and employs a principled planning algorithm, rooted in Monte Carlo tree search, to strategically navigate the expert-level prompt space. Inspired by human-like trial-and-error exploration, PromptAgent induces precise expert-level insights and in-depth instructions by reflecting on model errors and generating constructive error feedback. Such a novel framework allows the agent to iteratively examine intermediate prompts (states), refine them based on error feedbacks (actions), simulate future rewards, and search for high-reward paths leading to expert prompts. We apply PromptAgent to 12 tasks spanning three practical domains: BIG-Bench Hard (BBH), as well as domain-specific and general NLP tasks, showing it significantly outperforms strong Chain-of-Thought and recent prompt optimization baselines. Extensive analyses emphasize its capability to craft expert-level, detailed, and domain-insightful prompts with great efficiency and generalizability.

For agents

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

get_harvested_code_for_paper("2310.16427")
get_code_for_paper("2310.16427")
have("2310.16427")

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

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

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

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

Connect an agent — have() is free.