SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.11520 · 2023

Guiding Large Language Models via Directional Stimulus Prompting

arXiv · PDF · Open in the Atlas

Code that ran

9 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 1 violated it and 2 have no contract verdict; 5 failures of our instrument; 0 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/2302.11520.json · badge: /api/ran/2302.11520.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
leezekun/directional-stimulus-prompting canonical (classifier label)
classifier basis not recorded on the link
9 ran · 0 no recorded run
FunctionStatusWhere it lives
clean_text Ran
ran on a synthesized input
leezekun/directional-stimulus-prompting/sft4lms/MultiWOZ/clean_dataset.py
code served (permissive licence) · get_code("ea3e5b726884db6d")
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 tempfile
import os

# Create a temporary mapping file for the clean_text function
temp_dir = tempfile.mkdtemp()
mapping_file = os.path.join(temp_dir, 'mapping.txt')

# Write some sample mappings to the file
with open(mapping_file, 'w') as f:
    f.write('hello\thello there\n')
    f.write('world\tuniverse\n')
    f.write('test\ttesting\n')

ARGS = {
    'text': "Don't forget at 3pm, call me at 01223358966. It's a b&b with a swimming pool. Departure: 2:30am.",
    'mapping_pair_path': mapping_file
}
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
clean_time Ran
ran; our contract draft was wrong, not the code
leezekun/directional-stimulus-prompting/sft4lms/MultiWOZ/clean_dataset.py
code served (permissive licence) · get_code("4c62f23ce8135bda")
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 clean_time(utter):
    utter = re.sub('(\\d+) ([ap]\\.?m)', lambda x: x.group(1) + x.group(2), utter)
    utter = re.sub('((?<!\\d)\\d:\\d+)(am)?', '0\\1', utter)
    utter = re.sub('((?<!\\d)\\d)am', '0\\1:00', utter)
    utter = re.sub('((?<!\\d)\\d)pm', lambda x: str(int(x.group(1)) + 12) + ':00', utter)
    utter = re.sub('(\\d+)(:\\d+)pm', lambda x: str(int(x.group(1)) + 12) + x.group(2), utter)
    utter = re.sub('(\\d+)a\\.?m', '\\1', utter)
    return utter

ARGS = {
    'utter': 'The meeting is at 3 p.m. tomorrow at 2:30am'
}
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
conjugate_gradient_solver Ran
ran; our contract draft was wrong, not the code
leezekun/directional-stimulus-prompting/rl4lms/algorithms/common/algo_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from tedmoskovitz/constrainedrl4lms, is pointer only (licence: NONE) · get_code("92e1118e4e5f774c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from tedmoskovitz/constrainedrl4lms, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

find_products Ran
ran; our contract draft was wrong, not the code
leezekun/directional-stimulus-prompting/rl4lms/core_components/sweep.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from tedmoskovitz/constrainedrl4lms, is pointer only (licence: NONE) · get_code("91200094734b3131")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from tedmoskovitz/constrainedrl4lms, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

flat_grad Ran
ran, honoured the contract we drafted
leezekun/directional-stimulus-prompting/rl4lms/algorithms/common/algo_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from tedmoskovitz/constrainedrl4lms, is pointer only (licence: NONE) · get_code("206123801663c69f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from tedmoskovitz/constrainedrl4lms, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_dict_obj Ran
ran; our contract draft was wrong, not the code
leezekun/directional-stimulus-prompting/rl4lms/core_components/sweep.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from tedmoskovitz/constrainedrl4lms, is pointer only (licence: NONE) · get_code("e38b5971551fdee2")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from tedmoskovitz/constrainedrl4lms, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

my_clean_text Ran
ran on a synthesized input
leezekun/directional-stimulus-prompting/sft4lms/MultiWOZ/clean_dataset.py
code served (permissive licence) · get_code("7f5a7dafc8e4429c")
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 my_clean_text(text):
    text = re.sub('([a-zT]+)\\.([a-z])', '\\1 . \\2', text)
    text = re.sub('(\\w+)\\.\\.? ', '\\1 . ', text)
    return text

ARGS = {
    'text': 'Hello.world. This is a test.. More text.T.here'
}
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
quantile_huber_loss Ran
ran; our contract draft was wrong, not the code
leezekun/directional-stimulus-prompting/rl4lms/algorithms/common/algo_utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from tedmoskovitz/constrainedrl4lms, is pointer only (licence: NONE) · get_code("821b0061bc694ddf")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from tedmoskovitz/constrainedrl4lms, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

to_expand Ran
ran, violated the contract we drafted
leezekun/directional-stimulus-prompting/rl4lms/core_components/sweep.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from tedmoskovitz/constrainedrl4lms, is pointer only (licence: NONE) · get_code("b41d462e09610b1c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from tedmoskovitz/constrainedrl4lms, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 9 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 8 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
clean_time 7 other papers
5 dated earlier, 1 the same month, 1 later
2009.12005 (2020-09)
MinTL: Minimalist Transfer Learning for Task-Oriented Dialogue Systems
2021.findings-emnlp.112 (2021 (year only))
Improving End-to-End Task-Oriented Dialogue System with A Simple Auxiliary Task
2109.14739 (2021-09)
Multi-Task Pre-Training for Plug-and-Play Task-Oriented Dialogue System
and 4 more not named here
my_clean_text 3 other papers
2 dated earlier, 1 later
2109.14739 (2021-09)
Multi-Task Pre-Training for Plug-and-Play Task-Oriented Dialogue System
2210.08692 (2022-10)
A Generative User Simulator with GPT-based Architecture and Goal State Tracking for Reinforced Multi-Domain Dialog Systems
2305.02468 (2023-05)
Task-Optimized Adapters for an End-to-End Task-Oriented Dialogue System
conjugate_gradient_solver 2 other papers
2 later
2305.08844 (2023-05)
RL4F: Generating Natural Language Feedback with Reinforcement Learning for Repairing Model Outputs
2310.04373 (2023-10)
Confronting Reward Model Overoptimization with Constrained RLHF
find_products 2 other papers
2 later
2305.08844 (2023-05)
RL4F: Generating Natural Language Feedback with Reinforcement Learning for Repairing Model Outputs
2310.04373 (2023-10)
Confronting Reward Model Overoptimization with Constrained RLHF
flat_grad 2 other papers
2 later
2305.08844 (2023-05)
RL4F: Generating Natural Language Feedback with Reinforcement Learning for Repairing Model Outputs
2310.04373 (2023-10)
Confronting Reward Model Overoptimization with Constrained RLHF
get_dict_obj 2 other papers
2 later
2305.08844 (2023-05)
RL4F: Generating Natural Language Feedback with Reinforcement Learning for Repairing Model Outputs
2310.04373 (2023-10)
Confronting Reward Model Overoptimization with Constrained RLHF
quantile_huber_loss 2 other papers
2 later
2305.08844 (2023-05)
RL4F: Generating Natural Language Feedback with Reinforcement Learning for Repairing Model Outputs
2310.04373 (2023-10)
Confronting Reward Model Overoptimization with Constrained RLHF
to_expand 2 other papers
2 later
2305.08844 (2023-05)
RL4F: Generating Natural Language Feedback with Reinforcement Learning for Repairing Model Outputs
2310.04373 (2023-10)
Confronting Reward Model Overoptimization with Constrained RLHF
clean_text 1 other paper
1 dated earlier
2109.14739 (2021-09)
Multi-Task Pre-Training for Plug-and-Play Task-Oriented Dialogue System

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

We introduce Directional Stimulus Prompting, a novel framework for guiding black-box large language models (LLMs) toward specific desired outputs. Instead of directly adjusting LLMs, our method employs a small tunable policy model (e.g., T5) to generate an auxiliary directional stimulus prompt for each input instance. These directional stimulus prompts act as nuanced, instance-specific hints and clues to guide LLMs in generating desired outcomes, such as including specific keywords in the generated summary. Our approach sidesteps the challenges of direct LLM tuning by optimizing the policy model to explore directional stimulus prompts that align LLMs with desired behaviors. The policy model can be optimized through 1) supervised fine-tuning using labeled data and 2) reinforcement learning from offline or online rewards based on the LLM's output. We assess our method across summarization, dialogue response generation, and chain-of-thought reasoning tasks. Our experiments demonstrate that the framework consistently improves LLMs' (e.g., ChatGPT, Codex, InstructGPT) performance on these supervised tasks using minimal labeled data. Notably, using just 80 dialogues on the MultiWOZ dataset, our approach enhances ChatGPT's performance by an impressive 41.4%, matching or surpassing some fully supervised start-of-the-art models. Additionally, the instance-specific chain-of-thought prompt generated by our approach improves InstructGPT's reasoning accuracy compared to human-crafted or automatically generated prompts. The code and data are publicly available at \url{https://github.com/Leezekun/Directional-Stimulus-Prompting}.

For agents

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

get_harvested_code_for_paper("2302.11520")
get_code_for_paper("2302.11520")
have("2302.11520")

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

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

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

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

Connect an agent — have() is free.