SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2312.02614 · 2023

Prompt Optimization via Adversarial In-Context Learning

arXiv · PDF · Open in the Atlas

Code that ran

9 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 8 failures of our instrument; 3 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/2312.02614.json · badge: /api/ran/2312.02614.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
zhaoyiran924/adv-in-context-learning canonical (classifier label)
classifier basis: census
9 ran · 3 no recorded run
FunctionStatusWhere it lives
Construct_Message Ran
ran; our contract draft was wrong, not the code
zhaoyiran924/adv-in-context-learning/eval/adversarial/gan_chat.py
pointer only (licence: NONE) · get_code("5057672e50757d3d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhaoyiran924/adv-in-context-learning 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.

Promting Ran
ran; our contract draft was wrong, not the code
zhaoyiran924/adv-in-context-learning/eval/adversarial/gan_chat_bbh.py
pointer only (licence: NONE) · get_code("e11caadab5419fe7")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhaoyiran924/adv-in-context-learning 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.

Promting Ran
ran; our contract draft was wrong, not the code
zhaoyiran924/adv-in-context-learning/eval/adversarial/gan_text.py
pointer only (licence: NONE) · get_code("0b717b355be5e37e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhaoyiran924/adv-in-context-learning 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.

Promting_Dis Ran
ran; our contract draft was wrong, not the code
zhaoyiran924/adv-in-context-learning/eval/adversarial/gan_chat.py
pointer only (licence: NONE) · get_code("b7bf8e50ce067d7c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhaoyiran924/adv-in-context-learning 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.

exact_match Ran
ran, violated the contract we drafted
zhaoyiran924/adv-in-context-learning/eval/automatic/evaluation.py
pointer only (licence: NONE) · get_code("41e978babf390372")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhaoyiran924/adv-in-context-learning 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.

normalize_answer Ran
ran; our contract draft was wrong, not the code
zhaoyiran924/adv-in-context-learning/eval/automatic/evaluation.py
pointer only (licence: NONE) · get_code("0cb6cc3626c8f2ec")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhaoyiran924/adv-in-context-learning 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.

prepare_logits_processor Ran
ran; our contract draft was wrong, not the code
zhaoyiran924/adv-in-context-learning/eval/adversarial/gan_vicuna.py
pointer only (licence: NONE) · get_code("f18271a9ca05a04a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhaoyiran924/adv-in-context-learning 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.

replace_definition Ran
ran; our contract draft was wrong, not the code
zhaoyiran924/adv-in-context-learning/eval/adversarial/gan_text.py
pointer only (licence: NONE) · get_code("accc2a007ee8ed83")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhaoyiran924/adv-in-context-learning 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.

replace_example Ran
ran; our contract draft was wrong, not the code
zhaoyiran924/adv-in-context-learning/eval/adversarial/gan_text.py
pointer only (licence: NONE) · get_code("70885f1fc8d4595b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhaoyiran924/adv-in-context-learning 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.

Promting Not yet run
unverified (harvested, no recorded run)
zhaoyiran924/adv-in-context-learning/eval/adversarial/gan_chat.py
pointer only (licence: NONE) · get_code("3c9c7a834d100f0d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhaoyiran924/adv-in-context-learning 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. No invocation recorded.

Promting_Dis Not yet run
unverified (harvested, no recorded run)
zhaoyiran924/adv-in-context-learning/eval/adversarial/gan_chat_bbh.py
pointer only (licence: NONE) · get_code("e4aa959487e0b100")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhaoyiran924/adv-in-context-learning 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. No invocation recorded.

Promting_Dis Not yet run
unverified (harvested, no recorded run)
zhaoyiran924/adv-in-context-learning/eval/adversarial/gan_vicuna.py
pointer only (licence: NONE) · get_code("8e8a1d1231ad7b48")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zhaoyiran924/adv-in-context-learning 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. No invocation recorded.

Also present in other papers' code

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

FunctionAlso present inEarliest-datedOthers named
prepare_logits_processor 4 other papers
2 dated earlier, 2 later
2305.14233 (2023-05)
Enhancing Chat Language Models by Scaling High-quality Instructional Conversations
2310.16450 (2023-10)
CLEX: Continuous Length Extrapolation for Large Language Models
2401.07324 (2024-01)
Small LLMs Are Weak Tool Learners: A Multi-LLM Agent
and 1 more not named here
exact_match 1 other paper
1 later
2402.12842 (2024-02)
PromptKD: Distilling Student-Friendly Knowledge for Generative Language Models via Prompt Tuning

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 propose a new method, Adversarial In-Context Learning (adv-ICL), to optimize prompt for in-context learning (ICL) by employing one LLM as a generator, another as a discriminator, and a third as a prompt modifier. As in traditional adversarial learning, adv-ICL is implemented as a two-player game between the generator and discriminator, where the generator tries to generate realistic enough output to fool the discriminator. In each round, given an input prefixed by task instructions and several exemplars, the generator produces an output. The discriminator is then tasked with classifying the generator input-output pair as model-generated or real data. Based on the discriminator loss, the prompt modifier proposes possible edits to the generator and discriminator prompts, and the edits that most improve the adversarial loss are selected. We show that adv-ICL results in significant improvements over state-of-the-art prompt optimization techniques for both open and closed-source models on 11 generation and classification tasks including summarization, arithmetic reasoning, machine translation, data-to-text generation, and the MMLU and big-bench hard benchmarks. In addition, because our method uses pre-trained models and updates only prompts rather than model parameters, it is computationally efficient, easy to extend to any LLM and task, and effective in low-resource settings.

For agents

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

get_harvested_code_for_paper("2312.02614")
get_code_for_paper("2312.02614")
have("2312.02614")

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

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

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

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

Connect an agent — have() is free.