---
title: "Discrete Prompt Optimization via Constrained Generation for"
description: "Co-Prompt searches for readable instructions that improve zero-shot passage reranking, using query likelihood to guide the search."
canonical: "https://research.elamur.ai/free/en/papers/cho-2023-discrete-prompt-optimization-constrained-generation/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/cho-2023-discrete-prompt-optimization-constrained-generation/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2023](https://md.research.elamur.ai/free/en/papers/2023/) / Discrete Prompt Optimization via Constrained Generation for Zero-shot Re-ranker

# Discrete Prompt Optimization via Constrained Generation for Zero-shot Re-ranker

Paper · 2023 · Sukmin Cho, Soyeong Jeong, Jeong yeon Seo et al.

**Authors:** [Sukmin Cho](https://md.research.elamur.ai/free/en/authors/sukmin-cho/), [Soyeong Jeong](https://md.research.elamur.ai/free/en/authors/soyeong-jeong/), Jeong yeon Seo and Jong Park · **Year:** 2023 · **Venue:** Findings of the Association for Computational Linguistics: ACL 2023 · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

[Cited by **12** papers in our library of more than 163,000 papers whose bibliographies we read](https://md.research.elamur.ai/free/en/papers/cho-2023-discrete-prompt-optimization-constrained-generation/cited-by/) · Findings of the Association for Computational Linguistics: ACL 2023 · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2023.findings-acl.61/)
- [PDF](https://aclanthology.org/2023.findings-acl.61.pdf)
- [DOI 10.18653/v1/2023.findings-acl.61](https://doi.org/10.18653/v1/2023.findings-acl.61)

## Summary

A search engine can retrieve a useful passage and still bury it below less helpful results. A reranker addresses that problem by scoring the passages the search engine has already found and putting the most promising ones first. Sukmin Cho and colleagues study a way to do this with a pretrained [language model](https://md.research.elamur.ai/free/en/concepts/language-model/) whose weights stay fixed. For each passage, they ask how likely the system would be to produce the user's query after reading the passage and an instruction. A passage earns a higher score if it makes the question easier to predict. The paper asks how to find wording that makes this scoring rule work better.

The authors call their method Constrained Prompt generation, or Co-Prompt. A generator proposes likely continuations of a short prompt. The reranker then checks which continuations help it predict known queries from passages judged relevant to them. The search keeps promising candidates, extends them a token at a time, and can return a shorter prompt if it scores well. This gives the two systems different jobs. The generator narrows the search to plausible text, while the reranker supplies evidence that the wording serves the task. The search uses relevant passage–query examples and leaves the weights of both systems fixed.

The experiments combine the T0 and OPT rerankers with sparse and dense retrieval on MS-MARCO and Natural Questions. On MS-MARCO, for instance, OPT reranking BM25 results records an nDCG@20 of 31.9 with Co-Prompt, compared with 31.5 for a reinforcement-learning prompt and 28.7 for a human-written instruction. On Natural Questions, the human-written instruction remains stronger in several T0 comparisons. Co-Prompt's gains are most consistent with OPT, which can serve as both the prompt generator and the reranker.

The wording Co-Prompt finds often resembles recognizable questions or requests, though some examples are fragments or sound out of place as search instructions. The paper also compares different opening words, generators, and ways to score candidate prompts. A score that explicitly contrasts relevant and irrelevant pairs helps in some Natural Questions settings, while the simpler score based on relevant pairs performs better across the reported MS-MARCO comparisons. Together, the results show that wording is a consequential part of a fixed reranking system and that searching for it can improve the order of retrieved passages.

## Deep dive: Discrete Prompt Optimization via Constrained Generation for Zero-shot Re-ranker

Co-Prompt searches for readable instructions that improve zero-shot passage reranking, using query likelihood to guide the search. · about 34 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### Reranking starts with the passages a search engine finds

In [information retrieval](https://md.research.elamur.ai/free/en/topics/information-retrieval/), a query has to be matched against a collection that can contain millions of passages. The first stage retrieves a manageable list. A reranker then looks more closely at the items on that list and assigns new scores. This arrangement lets the system use a more elaborate comparison on the passages most likely to matter. The position of a relevant passage can change substantially in the second stage, even though the body of text available to the system has stayed the same.

The same arrangement constrains what an experiment can establish. If a relevant passage is absent from the input list, changing the reranker's instruction gives it no opportunity to promote that passage. If the passage is present, a good instruction can help the scoring system move it ahead of plausible but less useful results. The problem Cho and colleagues take on is the ordering of those retrieved candidates. The paper uses both term-based and representation-based initial retrieval so it can observe what happens when the same kind of scoring procedure receives different candidate lists.

The authors describe earlier rerankers trained by [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/) pretrained systems. They cite Passage Re-ranking with BERT as one example of that line of work. The initial weights provide linguistic capabilities, and task training adapts the system used to judge passages. The approach that motivates Co-Prompt keeps those weights fixed at the reranking stage. It changes what text the system sees alongside the passage, so the detail that becomes important is how the desired behavior is expressed.

#### Relevance as a question-generation score

A search begins with a question and looks for text that can answer it. The scoring approach used here reverses that direction. Given a candidate passage, a system estimates how plausible the already known question would be as a continuation. A passage containing information that directly bears on the question should make the words of the query easier to predict. A passage that merely discusses the same broad subject may also make parts of the query predictable, so the usefulness of the approach depends on how well the scores separate competing passages for that particular question.

The paper places this idea in a line of generative ranking work that treats the likelihood of a query as evidence of relevance. It points in particular to Sachan and colleagues, who used prompted systems as zero-shot rerankers and also explored question generation in work on training a dense retriever. The earlier reranking procedure compared human-written instructions using BM25 passages from the Natural Questions development set. Its selected instruction asks the system to formulate a question from the supplied passage. By testing this procedure alongside automated alternatives, Cho and colleagues can ask whether the wording found for one setting remains a good choice in another.

This use of zero-shot refers to how the pretrained reranker is used. It scores passages through a prompt, with its weights fixed. The research question is whether more effective prompts can be found automatically by measuring that behavior on examples. Those examples matter. Selecting a prompt using known relevant passages introduces task evidence even though the system receiving the prompt undergoes no weight update. The distinction makes it possible to compare the cost and behavior of prompt search with approaches that train components specifically to produce prompts.

#### Why search over wording?

A discrete prompt is a sequence of tokens, pieces of text from a fixed vocabulary. Its wording can be inspected and delivered to a system as part of an ordinary text input. A soft prompt instead consists of learned vectors that can be supplied as embeddings. The paper situates its method alongside both traditions. It cites discrete search approaches such as [AutoPrompt](https://md.research.elamur.ai/free/en/papers/shin-2020-autoprompt-eliciting-knowledge-language-models/) and work on few-shot prediction, as well as continuous approaches such as [learning mixtures of soft prompts](https://md.research.elamur.ai/free/en/papers/qin-2021-learning-ask-querying-lms-mixtures/) and [parameter-efficient prompt tuning](https://md.research.elamur.ai/free/en/papers/lester-2021-power-scale-parameter-efficient-prompt/). Co-Prompt works in the discrete space, where the candidate that performs well can also be read as text.

The authors identify a mismatch between much earlier prompt optimization and reranking. Classification and mask filling often offer a designated set of target outcomes. The paper describes an earlier reinforcement-learning approach that extends discrete prompt optimization to generation tasks by designing rewards tied to discrete labels. Passage reranking requires a score capable of ordering many candidates for the same query. Choosing the desired label and measuring how plausible an entire query is under a passage are different kinds of decisions. In the reranking setup, two passages can both receive appreciable scores, and the difference between their scores determines which one appears first.

That makes the score used during prompt search a design choice. One option would be to judge every candidate instruction by running a retrieval evaluation. The authors instead look for an intermediate signal available from document–query examples. Their main proposal uses the average query-generation score for known relevant pairs. The bet is that an instruction which reliably makes appropriate questions predictable will also improve their positions when the system has to sort competing passages. How closely those goals match is an empirical issue that runs through the paper.

The second precedent is constrained [text generation](https://md.research.elamur.ai/free/en/topics/text-generation/). The paper discusses approaches such as [Plug and Play Language Models](https://md.research.elamur.ai/free/en/papers/dathathri-2019-plug-play-language-models-simple/) and [GeDi](https://md.research.elamur.ai/free/en/papers/krause-2021-gedi-generative-discriminator-guided-sequence/), in which a discriminator can guide a generator toward a desired property. Co-Prompt takes that division of labor and gives the discriminator a retrieval-related job. The generator estimates which tokens make plausible continuations. The discriminator estimates which resulting strings work as instructions. The problem becomes how to combine these judgments while keeping the number of prompt evaluations manageable.

### The method, step by step

#### Turning a known query into a passage score

At reranking time, the system already has the query and the passages to compare. For every candidate passage, it constructs an input that includes the passage and the selected instruction and scores the query that follows. The scoring process uses the actual query tokens in order. When calculating the probability of a particular token, it conditions on the earlier tokens of that same query, as well as the passage and prompt. The outcome is a score for the fixed query, so the procedure can compare passages without asking the system to generate and then match a new question for each one.

The paper writes its relevance relation and length-normalized query-generation score as follows.

```
log P(d | q) ∝ log P(q | d, ρ) = (1 / |q|) Σₜ log P(qₜ | q_<t, d, ρ)
```

Here `d` is the candidate document or passage, `q` is the query, and `ρ` is the prompt. `P` denotes a probability, the vertical bar indicates conditioning, and `log` takes its logarithm. `P(d | q)` is the document relevance term on the left. The proportionality sign `∝` expresses the use of query generation as the ranking signal. On the right, `t` indexes query tokens, `qₜ` is the token at position `t`, and `q_<t` is the query prefix before that position. `Σₜ` adds the token log probabilities and `|q|` is the number of query tokens. The `1` in the numerator gives the reciprocal of that length, so the quantity on the right is a mean. The paper uses `log P(q | d, ρ)` to denote this normalized score.

That last convention matters when reading the equations together. The log probability of a sequence formed by multiplying ordinary token probabilities would be a sum of the token log probabilities. The score defined here averages them. For the passages being compared for the same query, the query length is fixed. The normalization also gives the token scores of short and long queries a common averaging convention before the authors use examples from different queries to judge a prompt.

The equation gives the reranker a direction to work in. Suppose the query asks for a piece of information stated in one candidate passage and merely alluded to in another. The scoring system has to decide, one query token at a time, how expected that question is after each passage and the instruction. A prompt asking for a question based on what was read can alter those expectations. The relevant comparison is between passages for the same query, so a change that increases the score of every passage equally would leave their order intact.

In the experimental template the document comes first, after a label indicating that a passage follows. The prompt and query then follow in that order. T0 uses spaces at the boundaries specified by the template, while OPT uses newline delimiters. The prompt is the component the search replaces. The template supplies a consistent position for it, so each candidate can be tested at the same place in the scoring input. An empty prompt can also occupy that position for the baseline.

#### Defining what makes a candidate promising

The idealized objective is to find a prompt that makes the known queries probable when the supplied passages are relevant. The paper expresses the objective over a collection of document–query pairs.

```
ρ* = arg max_ρ E_(dᵢ,qᵢ)∈D [P(qᵢ | dᵢ, ρ)]
```

Here `ρ*` is the desired prompt and `ρ` ranges over candidate prompts. `arg max_ρ` means to return the prompt that gives the largest value of the expression to its right. `D` is the collection of relevant pairs, `i` indexes them, and `(dᵢ,qᵢ) ∈ D` means that passage `dᵢ` and query `qᵢ` form a pair in that collection. `E` is the expectation, implemented as an average over examples when the collection is finite. `P(qᵢ | dᵢ, ρ)` is the query-generation quantity for that example under the candidate prompt. The objective uses likelihood notation, while the introductory scoring equation specifies a token-normalized log score.

This objective explains what the search examines when it has a new piece of prompt text in hand. The same candidate is inserted into the input for every pair in the sample. A candidate can be favored because it helps the system with many examples or because its score changes enough on some examples to affect the average. The procedure produces one score for the prompt across the pairs. It does not choose the prompt independently for each deployment query.

The idealized search space is much larger than the list of instructions a researcher would write by hand. At each position, the vocabulary offers many possible next tokens, and every decision changes the set of meaningful continuations. Evaluating a continuation requires scoring it against the sample of relevant pairs. Repeating that work for every vocabulary item at every step would make the discriminator expensive to use. The authors therefore let a decoder-only generator propose likely next tokens and reserve the sample-based evaluation for those proposals.

How Co-Prompt searches for a reranking instruction The steps in order.

#### Combining proposals with task evidence

The authors motivate constrained generation with a factorization based on Bayes' rule. A good next token should make sense given the prefix and leave the extended prompt well suited to the document–query examples.

```
P(ρₜ | D, ρ₁:ₜ₋₁) ∝ P_MD(Dₛ | ρ₁:ₜ) P_MG(ρₜ | ρ₁:ₜ₋₁)
```

Here `ρₜ` is the token proposed at position `t` and `ρ₁:ₜ₋₁` is the prefix from the beginning of the prompt through the preceding position. `ρ₁:ₜ` is the extended prompt, including the new token. `D` denotes the full pair collection and `Dₛ` is the sample used during search. The probability on the left describes the desired next-token choice conditioned on the task data and the existing prefix. `∝` means proportional to. `P_MD` is the score supplied by the discriminator `MD`, which is the same system used for reranking. `P_MG` is the probability supplied by the decoder-only generator `MG`. The product relates the task evidence for the entire extended prompt to the generator's prior for the new token.

The two factors look at different inputs. The generator asks which token is likely after the prompt prefix. Its proposal probability comes from the words already in the prompt. The discriminator asks how well the completed or partial prompt behaves when placed between a passage and its query. It has access to the sampled pairs when making that assessment. A phrase may sound natural as ordinary text and still give a poor score on the examples. Conversely, a prompt with a strong average score can be a fragment, because the task evidence concerns the query that follows it rather than whether the instruction stands alone.

The discriminator uses an average over relevant pairs as its base measure.

```
P_MD(Dₛ | ρ) = E_(dᵢ,qᵢ)∈Dₛ [P_MD(qᵢ | dᵢ, ρ)]
```

`MD` identifies the discriminator, and `P_MD` means a score obtained using that system. On the left the score is for sample `Dₛ` given prompt `ρ`. On the right it is for query `qᵢ` given its paired document `dᵢ` and the same prompt. `i` identifies an example, `∈` indicates membership in the sample, and `E` averages the scores across those examples. The left-hand side is thus the paper's measure of how useful the prompt is on the sample. It uses likelihood notation for an average of pair scores.

The average gives the search a way to compare incomplete phrases with complete ones. A suffix might turn a general request into something much more specific, and the new prefix is tested from scratch on the same kind of examples. Each round therefore evaluates the actual text that would be inserted into the reranking template. The score reflects a candidate's effect on query prediction in that position, regardless of whether a human would consider it a complete instruction.

#### What the beam search actually keeps

The implementation uses beam search, which retains a limited number of prefixes at each length. It begins with a designated token. From each retained prefix it takes the generator's highest-probability next tokens, up to the beam width. Appending these tokens creates a pool of extensions. The discriminator scores the extensions on the sampled pairs, and the beam for the next round contains the strongest extensions from the combined pool. The round repeats until the search reaches its length limit.

This algorithm gives practical meaning to the paper's probability expression. The generator prior determines which continuations enter the pool. The algorithm then shows the discriminator score being used to choose among those candidates. In that sense the factorization motivates the division of work, while the displayed beam procedure specifies the shortlisting and selection operations. A high task score can save a continuation that the generator ranked lower within its shortlist. A continuation outside that shortlist never reaches the discriminator at that step.

The procedure preserves retained candidates from different lengths for the final selection. After the search, it takes the requested number of highest-scoring prompts from that collection according to the discriminator. A prefix can therefore become a final instruction if extending it fails to improve the score. That explains why the maximum length acts as a stopping point for exploration and why a returned result can end in wording that appears to invite further text. The experimental input supplies the query immediately afterward.

The main search starts with `Please`, the same opening word as the manual comparator, and sets both the beam width and the maximum prompt length to 10. The shared opening makes it easier to attribute differences to the wording subsequently chosen by the system. The paper also varies the opening in a separate analysis. An opening word has two effects at once. It becomes part of the text presented to the reranker, and it changes the generator's distribution over what comes next. With a fixed shortlist, different openings can give the discriminator quite different options to evaluate.

Beam search can lose a candidate whose early wording scores poorly even if its later completion would do well. That follows from choosing prefixes by their current scores. It also makes the procedure much more tractable. Once a weak prefix is discarded, the search stops paying for its possible continuations. The procedure can return the highest-scoring prompt among those it retained. The ideal objective describes the best prompt over a wider space, and the beam is the practical approximation that makes the search feasible.

#### Which systems and examples do the work?

The generator must continue the prompt from left to right. With T0 as both discriminator and eventual reranker, the authors use GPT2-Large as the generator in the main configuration. T0 uses an encoder–decoder design in the [T5](https://md.research.elamur.ai/free/en/papers/raffel-2019-exploring-limits-transfer-learning-unified/) family. The paper describes its preparation as multitask training with prompted datasets, as studied in [Multitask Prompted Training Enables Zero-Shot Task Generalization](https://md.research.elamur.ai/free/en/papers/sanh-2021-multitask-prompted-training-enables-zero/). [OPT](https://md.research.elamur.ai/free/en/papers/zhang-2022-opt-open-pre-trained-transformer/) is decoder-only, so the authors use it in both roles. The main rerankers are T0-3B and OPT-2.7B.

Sharing the same system between the generator and discriminator still leaves the operations distinct. For proposal generation, OPT sees a partly written prompt and supplies possible continuations. For discrimination, OPT receives the expanded prompt in the passage-and-query template and supplies the evidence used to rank prompt candidates. With T0, the proposing system's preference for a sequence and the scoring system's response to that sequence come from separate pretrained systems. The generator comparison later in the paper changes the proposer while leaving T0 in the reranking role.

For prompt optimization, the authors use 1,500 document–query pairs from the MS-MARCO test split and 1,500 from the Natural Questions development split. The base measure needs examples of relevant pairs, since it rewards prompts for helping to reconstruct the associated queries from their passages. The corpus searched in retrieval is much larger than this sample. The sample is used to evaluate a common piece of text, and retrieval evaluation subsequently puts that text to work on candidate lists. The experiment describes an example-guided search over inputs to pretrained systems, with no training step for Co-Prompt's components.

The authors release the implementation under the name Co-Prompt. The paper reports using BEIR for retrieval and evaluation and V100 32GB GPUs for both prompt search and reranking. These details distinguish the absence of parameter updates from the computational work of the search. Every evaluated prompt requires query scoring over the sample, and later reranking requires query scoring over the retrieved passages. The search moves the work into inference and selection.

#### An objective that includes irrelevant pairs

The paper also tries penalizing a candidate prompt when it assigns high scores to irrelevant document–query pairs. This alternative uses the same base calculation separately for positive and negative examples and then combines the results.

```
P_cont(Dₛ | ρ) = P_base(Dₛ⁺ | ρ) / [P_base(Dₛ⁺ | ρ) + P_base(Dₛ⁻ | ρ)]
```

`P_cont` is the contrastive prompt score and `P_base` is the average query-generation measure used by the main method. `Dₛ` denotes the sample, `Dₛ⁺` is its set of positive document–query pairs, and `Dₛ⁻` is its set of negative pairs. `ρ` is the candidate prompt and the vertical bar indicates that both sets are scored under that prompt. The numerator is the positive-pair score. The denominator adds the positive- and negative-pair scores. The expression measures the positive contribution relative to the combined score.

The motivation comes from the decision that reranking ultimately makes. For a given query, the system should prefer relevant passages when there are believable alternatives. The base objective directly rewards stronger scores for relevant examples. The contrastive objective introduces evidence from irrelevant examples, so it can respond to a prompt that makes the query more predictable from both kinds of passage. The comparison tests whether this additional information is better aligned with final ranking on the benchmarks.

### Experiments and results

#### Collections, candidate lists, and cutoffs

The experiments use [MS-MARCO](https://md.research.elamur.ai/free/en/papers/bajaj-2016-ms-marco-human-generated/) and [Natural Questions](https://md.research.elamur.ai/free/en/papers/kwiatkowski-2019-natural-questions-benchmark-question-answering/), abbreviated NQ in the paper's results. The MS-MARCO setup has about 8M passages and 6,980 queries in the development split. The queries come from Bing search logs. The Natural Questions setup has about 2M passages from Wikipedia and 3,452 queries in the test split, with questions originating from Google searches. The paper describes its evaluation as using the document data. These are benchmarks with origins in reading comprehension and [question answering](https://md.research.elamur.ai/free/en/concepts/question-answering/), used here to judge the ordering of passages.

The optimization splits run in the opposite order from the listed evaluation splits for the two collections. MS-MARCO uses test-split pairs to choose prompts and reports ranking evaluation on the development queries. NQ uses development-split pairs to choose prompts and reports ranking evaluation on the test queries. These roles matter because a prompt's score on the optimization examples is the basis for retaining it, while the ranking results measure its behavior with retrieved candidates on other queries. A prompt can be a successful search candidate and still perform less well in the ranking evaluation.

Each benchmark is run with BM25 and [Dense Passage Retrieval](https://md.research.elamur.ai/free/en/papers/karpukhin-2020-dense-passage-retrieval-open-domain/), or DPR. BM25 is the sparse retriever and scores term evidence using term frequency and inverse document frequency. DPR is the dense retriever. It uses a bi-encoder initialized with [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/) and learns from positive and negative passages associated with queries. Those different retrieval mechanisms give the reranker different starting orders and different passages to work with. A system can improve one list by a different amount from another even with the same prompt, because the difficulty of the comparisons depends on which documents are present and where they start.

The paper reports cutoffs of 20 and 100. At each cutoff, it compares the results with the original retriever order and with the order produced by a reranker under different prompts. To read any of the comparisons, keep the dataset, retriever, reranker, metric, and cutoff together. An improvement with BM25 at the shorter cutoff says that the prompt worked with that candidate pool and scoring system. The corresponding experiment with DPR is a separate test, even when it uses exactly the same instruction.

#### What the baselines measure

The retriever-only results show the quality of the starting order. The Null Prompt adds the query-generation reranker with an empty instruction. This comparison helps distinguish the value of the reranking score itself from the value of adding words to steer it. When a null prompt already improves on the original list, the passage provides enough signal for the query-generation score to do useful work. The remaining prompt comparisons measure what can be gained by steering how that score is produced.

The Manual Prompt is the instruction selected by Sachan and colleagues. It requests a question based on the passage and was selected from hand-written candidates using BM25 results on the NQ development set. It gives the experiment a strong comparison against a human-readable instruction designed for the same scoring mechanism. Its selection setting also matters when interpreting transfer. The paper can compare it against the automatically optimized prompts when retrieval conditions or datasets change.

P-Tuning and RL-Prompt offer comparisons against automated search procedures. The authors adapt [P-Tuning](https://md.research.elamur.ai/free/en/papers/liu-2021-gpt-understands-too/) to learn continuous prompt embeddings for query generation. Its recurrent prompt encoder is trained on passage–query pairs for 10 epochs and produces a prompt of length 10. This comparison tests whether text found by constrained generation can compete with task-specific vectors learned by a prompt encoder.

RL-Prompt yields ordinary vocabulary tokens, placing it in the same broad output category as Co-Prompt. For reranking, the authors give its policy network a reward based on query-generation log likelihood under the passage and prompt. Their configuration produces a 5-token prompt after 12,000 training steps. The procedure therefore uses task feedback like Co-Prompt does, while the mechanism that turns feedback into candidate prompts is a trained policy. The authors compare both ranking scores and the appearance of the resulting token strings.

The length settings and the objects being optimized differ across these procedures. P-Tuning gets continuous input positions, RL-Prompt trains a policy to generate a short token sequence, and Co-Prompt searches for token sequences using a generator with a length limit. As comparisons of complete procedures, the results show how these choices perform in the reported configurations. An isolated test of one design choice would keep the other differences fixed.

#### How to read the reported metrics

ACC is the paper's accuracy measure for relevant documents in the retrieved results. It associates the reported values with the cutoff of the evaluated list. The description characterizes ACC in percentage terms, although it leaves the exact query-level aggregation less explicit than the table headings. The safest reading of a number is as the reported ACC for the stated retrieval and reranking setting at the stated cutoff.

Normalized discounted cumulative gain, or nDCG, gives more credit when relevant items occur higher in the ranking. The discount accounts for the greater value of useful passages near the beginning, and normalization relates the score to an ideal ordering. Mean average precision, or MAP, also uses the positions where relevant items occur and aggregates average precision across queries. The detailed results give all these measures for both cutoffs. Agreement among them strengthens the evidence that a prompt's improvement extends beyond one choice of measure. Where they diverge, the differing judgments help describe what changed about the ranking.

#### MS-MARCO across BM25 and DPR

The comparison with OPT and BM25 on MS-MARCO illustrates the gains and the strength of the automated baselines. Co-Prompt leads on nDCG@20, and RL-Prompt is close. The null instruction and the human-written one give separate reference points for how much useful ordering comes from the query-generation reranker and how much the optimized instructions add.

MS-MARCO nDCG@20 for BM25 and OPT with different prompts Co-Prompt has the highest score, with RL-Prompt close behind.

**The numbers**

| System or setting | nDCG |
| --- | --- |
| BM25 alone | 25.2 |
| Null Prompt | 25.4 |
| P-Tuning | 29.4 |
| Manual Prompt | 28.7 |
| RL-Prompt | 31.5 |
| Co-Prompt (this paper) | 31.9 |

The longer-cutoff results for the same configuration show Co-Prompt at 35.2 nDCG@100 and RL-Prompt at 34.8. The corresponding MAP@100 values are 24.4 and 23.9. The main accuracy comparison reports 59.3 ACC@20 and 77.2 ACC@100 for Co-Prompt, with RL-Prompt at 59.2 and 76.7. The agreement in ordering across these measures gives a fuller account of the comparison. The gap between the automated discrete methods is small in the reported ACC@20 figures, even though both place above the manual instruction in that setting.

The pattern with OPT also extends to DPR. On MS-MARCO the retriever alone records 37.5 ACC@20, compared with 50.1 after OPT reranking with the null instruction. Co-Prompt records 56.4, and RL-Prompt records 56.3. On nDCG@20, the detailed comparison puts Co-Prompt at 31.4 and RL-Prompt at 31.1. The large change from the starting DPR order comes from adding reranking. Optimizing the instruction adds a further improvement in this experiment, with the discrete optimization methods again close to each other on the reported scores.

Co-Prompt with T0 is also competitive on MS-MARCO. In the main BM25 accuracy comparison it records 61.9 ACC@20 and 78.0 ACC@100, compared with 60.6 and 77.9 for the manual prompt. RL-Prompt records 60.9 and 77.4. The detailed results give Co-Prompt 33.7 nDCG@20 and 36.8 nDCG@100 in this configuration. In the corresponding DPR setting, the main T0 accuracy comparison favors Co-Prompt at 20, with 58.0 against 57.7 for the manual instruction. At 100, the manual instruction records 72.0 and Co-Prompt 71.7. The shorter and longer lists therefore give different winners for this combination.

#### Natural Questions and the strength of the manual instruction

In Natural Questions, the manual prompt is an especially informative comparison because it was originally selected using that collection's development set. With BM25 and T0, the main results give the manual prompt 75.7 ACC@20 and Co-Prompt 75.0. At ACC@100, both record 83.8. With DPR and T0, the main comparison again favors the manual prompt at both cutoffs. The detailed nDCG figures show that this is a setting in which choosing the human-written instruction remains competitive with, and can outperform, the automatically generated alternatives.

Natural Questions nDCG@20 for DPR and T0 with different prompts The manual prompt leads, and Co-Prompt improves on the empty instruction.

**The numbers**

| System or setting | nDCG |
| --- | --- |
| DPR alone | 34.0 |
| Null Prompt | 31.4 |
| P-Tuning | 32.1 |
| RL-Prompt | 34.1 |
| Manual Prompt | 36.6 |
| Co-Prompt (this paper) | 34.5 |

The chart uses the Co-Prompt variant whose ACC@20 agrees with the main comparison for this configuration. The other Co-Prompt variants in the detailed results have nDCG@20 values of 34.8 and 34.8. The DPR-only score is also worth noticing. With T0, adding the null-prompt reranker lowers nDCG@20 from 34.0 to 31.4. Co-Prompt recovers that loss and finishes above the original retriever on this measure. The manual instruction produces the strongest improvement among the configurations in the chart. Thus an empty-prompt reranker can be weaker than the upstream order it receives, and the prompt can matter to whether using that reranker helps.

With OPT, the Natural Questions comparison favors Co-Prompt more consistently. The main BM25 results give it 75.2 ACC@20 and 84.1 ACC@100, with the manual instruction at 73.1 and 83.3. With DPR, OPT and Co-Prompt record 80.2 ACC@20 and 88.1 ACC@100. The retriever alone records 79.2 and 85.7. The detailed results for DPR show a selected Co-Prompt variant reaching 34.1 nDCG@20, with another variant at 34.6. The contrast with T0 concerns the full configurations, including the generator used in finding prompts.

The broad claim in the paper is that Co-Prompt works across the combinations of rerankers, retrievers, and datasets and is particularly effective with OPT. The displayed accuracy comparisons support that reading. They show settings with a clear advantage over the manual instruction, settings with a narrow margin over an automated baseline, and settings where the manual instruction ties or leads. The detailed results also vary the generated wording within a configuration. Taken together, these comparisons make a case for searching for an instruction and for evaluating the resulting wording under the intended retrieval conditions.

### What the ablations show

#### The opening word changes the search

The authors compare prompts beginning with `Please`, `Score`, and `This`, along with another question-like opening in the same analysis. The initial word matters because the generator conditions on it before any task-based filtering has taken place. Starting with a polite request directs the generator toward one set of continuations. Starting with a scoring term or a demonstrative changes the fragments the system considers. The comparison lets the authors examine whether the main configuration depends on its particular first token.

For OPT on the top 20 passages retrieved by BM25, the principal `Please` variant reaches 31.9 nDCG on MS-MARCO. In the same comparison, a prompt beginning with `Score` reaches 30.2 and one beginning with `This` reaches 30.5. All these outcomes exceed the manual instruction's 28.7 in that table. The RL-Prompt result of 31.5 sits above the other two openings and below the principal one. The changes in ordering illustrate that the procedure can find useful instructions from multiple starting points and that the starting point can still affect which baseline it beats.

On Natural Questions, the same analysis reports 30.6 nDCG for the principal `Please` variant and 31.2 for the `This` variant. The manual instruction records 27.9. The leading variant consequently changes between the datasets. Since the final strings differ across openings, the experiment evaluates a change to the whole path of the search. It cannot attribute the ranking difference to the first token in isolation. That token influences both the text that eventually enters the reranker and the alternatives that the generator gives the discriminator a chance to see.

#### The generator changes the proposals available to T0

The generator analysis holds the reranker fixed at T0 and varies the GPT-2 generator used during prompt search. It evaluates the resulting prompts on MS-MARCO passages retrieved by BM25. This comparison isolates the choice of proposer more directly than the main comparison between OPT and T0, where the reranker itself also changes.

MS-MARCO nDCG@100 for T0 prompts from different generators GPT2-Large yields the strongest prompt in the generator comparison.

**The numbers**

| System or setting | nDCG |
| --- | --- |
| BM25 alone | 28.70 |
| Co-Prompt with GPT2-Base | 36.44 |
| Co-Prompt with GPT2-Large (this paper) | 36.79 |
| Co-Prompt with GPT2-XL | 35.71 |

At the shorter cutoff, GPT2-Large gives 31.11 nDCG@20, compared with 30.76 for GPT2-Base and 29.86 for GPT2-XL. The detailed generator table reports 30.31 nDCG@20 for the manual instruction. In this comparison, Large and Base lead the manual result, while XL falls below it. The generator name alone gives no simple rule for performance. What matters in this test is which candidate strings the proposer supplies and how T0 responds to the selected one.

The prompt examples help explain what varying the proposer can change. One selected fragment links several question words in quick succession. Another resembles a request for more detailed information. The XL example is phrased more like an instruction to enter message content and includes line breaks. These are different kinds of continuation from the same opening. Their differences are relevant even though the discriminator and evaluation task stay fixed, because the prompt pool depends on the proposal probabilities.

The authors point to compatibility between generator and discriminator as a possible explanation and discuss vocabulary differences. The experiment establishes that changing the proposal system can change the prompt and the final scores. Several properties of the generators vary at once. The ranking data alone therefore leave open how much of the effect comes from vocabulary, pretraining, or the particular choices made early in the beam search.

#### Comparing the positive-only and contrastive objectives

The objective comparison changes what the discriminator rewards. The base measure scores how well a candidate prompt handles relevant examples. The contrastive measure adds information from irrelevant pairs to judge how specific that behavior is. Both are evaluated through final reranking accuracy, so the comparison checks whether the extra information helps the retrieval outcome under the tested setup.

For MS-MARCO, the base measure is stronger across the reported comparisons. With BM25 and T0, the base prompt records 61.9 ACC@20 and 78.0 ACC@100. The contrastive version gives 59.6 and 76.2. With DPR and OPT, the numbers are 56.4 and 71.3 for the base measure, compared with 53.3 and 68.9 for the contrastive one. These examples show that using negative pairs in the displayed objective can yield prompts that rank less effectively on the held-out retrieval evaluation.

Natural Questions gives a more mixed picture. With BM25 and T0, the contrastive objective reaches 76.2 ACC@20, compared with 75.0 for the base objective. Both give 83.8 ACC@100. With DPR and T0, the contrastive objective gives 80.6 and 87.9, while the base objective gives 80.4 and 87.7. With BM25 and OPT, the base objective records 75.2 ACC@20 and the contrastive objective 74.4. With DPR and OPT, they tie at 80.2 ACC@20, and the base version leads at ACC@100 with 88.1 against 87.9.

The positive-only average is the more consistent choice across those reported conditions. The contrastive test is still important because it probes the relation between the score used to select a prompt and the ranking rule used to evaluate it. The contrastive measure compares aggregate scores for sets of pairs. Final reranking compares passages within individual queries. A change to the aggregate contrast can therefore be useful in some settings and fail to produce the desired local ordering in others. The experiment compares the objectives as used in the paper and leaves the reason for the dataset difference open.

#### Relevance scores move, and readable wording survives

The authors plot score distributions for relevant and irrelevant document–query pairs. For each query, the irrelevant passages come from BM25 results, so they can be topically related while failing to supply the answer directly. This makes them more informative for examining the reranker than completely unrelated text would be. The positive and negative score distributions differ and overlap, and a difference is visible even under the null prompt. The query-generation setup itself supplies some evidence about which passages are useful.

With discrete prompt optimization, the authors observe a shift towards higher mean and variance in the relevance scores. The distribution plot describes changes in the pooled scores. The ranking metrics answer a different question about how those scores order candidates for each query. A higher mean can accompany an improved ranking, but the improvement depends on which scores rise relative to competitors. The overlapping distributions help explain why success in prompt optimization can coexist with difficult individual comparisons.

The displayed prompts give a qualitative view of what the generator prior contributes. Several Co-Prompt examples contain recognizable directions to ask a question, seek information, or supply a title. The word “question” recurs across the examples from the two datasets. Some of the selected continuations resemble instructions from an online discussion or an unfinished sentence. The RL-Prompt examples are generally more compressed sequences of related or repeated terms, rather than ordinary requests. P-Tuning produces vectors that do not yield a directly readable instruction. These observations concern the forms that the procedures return, alongside their ranking results.

The generator makes the difference in form intelligible. Its shortlist originates in predictions about what words can naturally follow the current prefix. The reranker then chooses among those proposals using evidence from the passage–query sample. The combined procedure can retain a sentence-like form while favoring a string whose wording sounds unusual when read outside the template. The prompt examples support the authors' claim of greater readability relative to RL-Prompt. They also show that a recognizable sentence pattern gives only a partial account of why some prompts work.

### Limitations

#### Limits identified by the authors

The authors restrict their experimental claim to T0 and OPT and describe OPT as the better fit for Co-Prompt in their tests. OPT can continue the prompt and score the resulting instruction. The T0 configuration needs a separate decoder-only generator, so it depends on an additional system's vocabulary and training. The authors suggest this as an explanation for the difference between the two reranking configurations. Since both the proposing and scoring arrangements change between them, the comparison cannot determine whether sharing a generator and discriminator is itself responsible for the stronger OPT results.

A second limit is the tradeoff between search time and the chance of finding a stronger candidate. A wider beam permits the search to evaluate and retain more possibilities. A larger pair sample allows the discriminator to judge each one using more task examples. Both increase the amount of query scoring during the search. The paper describes the cost as growing with beam size and the number of pairs. The fixed settings show a workable configuration in the reported experiments. They do not establish the performance a wider search could reach or the best use of an equivalent computational budget.

The ethics discussion identifies the possibility that the generator could produce offensive or upsetting language as a consequence of its biases. The authors report seeing no such prompts in their experiments. The search leaves the underlying systems fixed and optimizes for a retrieval-related measure, so it has limited ability to remove the source of those biases. The absence of offensive strings among the reported observations is evidence about the run conditions the authors examined. The procedure itself offers no independent safeguard through its prompt score.

The paper proposes extending the method to additional open-ended generation tasks. That is a direction for future study. The evidence here is about using generation scores to rerank passages. The prompt objective, the available pairs, and the final metric all have a particular meaning in this setting. Extending the method would require a task score that can guide candidate search and an evaluation that can show whether the generated prompt improves the intended outcome.

#### Limits visible in the experimental setup

The central search measure is an approximation to the actual ranking goal. The base objective rewards an average computed on known relevant examples. The deployment decision compares a relevant result with other results for the same query. A prompt could improve the absolute score of the relevant example and leave it at the same rank if the other scores increase by similar amounts. Even with the contrastive variant, the signal comes from a summary across sets of examples. The benchmark results show that the proxy can work, while the NQ and MS-MARCO contrastive comparisons show that an intuitively closer objective can still have variable effects.

The approach also depends on the first-stage retriever. BM25 and DPR offer distinct tests, yet both provide fixed candidate pools for the subsequent reranker. The experiments measure what the prompt does within the reported pools and cutoffs. A better score under reranking therefore gives evidence about placing retrieved relevant material, with no corresponding evidence about recovering relevant passages the first stage missed. The results likewise concern benchmark measures of passage ordering. The setup stops before any assessment of the quality of answers written from those passages.

The comparison mixes differences in procedure and budget. A hand-written prompt selected through earlier validation, a learned continuous prompt, a policy-generated discrete prompt, and a beam-searched prompt begin from different representations and use different search or training settings. The reported numbers tell a reader how those implementations compare. They leave open how the methods would behave if given comparable search budgets, matched lengths where meaningful, or other initializations. The main experiments also give Co-Prompt access to labeled relevant pairs for each benchmark. The performance figures therefore measure prompt optimization with task examples, leaving the weights of the reranker fixed.

The reported precision of the values should be read alongside the evidence about variability. The main comparisons give point values for the tested configurations. The generator and starting-word analyses provide examples of how results can move when the configuration changes. They give a different kind of evidence from uncertainty estimates across repeated searches or samples. Close values, such as Co-Prompt and RL-Prompt for OPT on MS-MARCO, are best treated as the observed order in those experiments. The data support a pattern across conditions more directly than a claim about the reliability of every narrow margin.

The tables also present multiple prompts for some conditions, and changing the prompt variant can change the scores within a fixed setup. For instance, on NQ with BM25 and OPT, the detailed comparison gives Co-Prompt nDCG@20 results of 30.4, 30.6, and 29.6. The main and detailed tables sometimes report slightly different baseline figures, such as 73.1 and 73.2 ACC@20 for the NQ BM25 manual prompt with OPT. Individual comparisons are clearest when the values come from the same table and describe the same setup. The variation among displayed prompt candidates reinforces the distinction between finding a promising region of the search space and guaranteeing that every candidate from it will perform equally well.

Readability is assessed using examples. The paper shows that the strings often have elements familiar from ordinary requests and questions. Its evidence comes from qualitative inspection, and it offers no measured rate at which human readers agree on the meaning or quality of the instructions. Some examples mention settings that play no explicit role in the reranking task, and some look like incomplete clauses. A reader can inspect those phrases more directly than learned vectors, but recognizing their form gives limited evidence about the reasons for any individual relevance score.

Finally, the generator's shortlist and the chosen opening create boundaries on the kinds of prompts the method can discover. The successful variants are examples of what was reachable from particular starts with particular generators and a limited beam. Within those boundaries, the discriminator can guide selection towards useful text. The experiments do not establish a globally best instruction or show that the same prompt would remain optimal for another retriever, template, or benchmark. The sensitivity the paper measures is itself part of the result.

### What came after

The later citations place Co-Prompt in discussions at different levels. Two are surveys. One is about large language systems broadly, and the other is specifically about their role in retrieval. The third is a research paper on improving rerankers with feedback and reinforcement learning. Those scopes make it possible to describe how the problem of improving a reranker appears in later work. The citation relationships establish a connection, while the titles give different amounts of information about what each work does with it.

The broad survey brings together work on large language systems. Within that scope, Co-Prompt is an example of a procedure that changes the text supplied to a pretrained system in order to change downstream behavior. Its application is more specific than the survey's subject. It searches for an instruction judged by how well a fixed reranker can predict queries from relevant passages. The citation connects that concrete procedure to a broader account of the technology. The survey's exact treatment of the method, including which of its findings it discusses, is unspecified. [A Survey of Large Language Models](https://md.research.elamur.ai/free/en/papers/zhao-2023-survey-large-language-models/)

The retrieval survey places the citation in a setting closer to Co-Prompt's experiments. The relevant connection is between initial retrieval and downstream ranking. Co-Prompt changes the prompt that a generative reranker uses to evaluate the first stage's outputs. A survey of large language systems in retrieval has room to consider that application as one way of using language prediction in a search pipeline. The citation establishes that the method appears in the survey's account. A replication, an extension to another collection, or a particular interpretation of the results cannot be inferred from that connection alone. [Large Language Models for Information Retrieval: A Survey](https://md.research.elamur.ai/free/en/papers/zhu-2023-large-language-models-information-retrieval/)

The later reranker paper takes up optimization in [retrieval-augmented generation](https://md.research.elamur.ai/free/en/concepts/retrieval-augmented-generation/). Its title identifies language-model feedback and reinforcement learning as the means of improving the reranker. The connection to Cho and colleagues is the use of feedback to improve how a system orders retrieved material. In Co-Prompt the decision being optimized is a discrete instruction, and the feedback comes from scoring queries under candidate prompts. The later paper's title locates its own optimization at the reranker level in a retrieval-augmented generation system. The citation establishes the link, while the available description leaves open the particular objective, the component that receives updates, and whether it uses Co-Prompt's constrained search. [Optimizing RAG Rerankers with LLM Feedback via Reinforcement Learning](https://md.research.elamur.ai/free/en/papers/wu-2026-optimizing-rag-rerankers-llm-feedback/)

## Cite

Cite as Sukmin Cho, Soyeong Jeong, Jeong yeon Seo and Jong Park. 2023. Discrete Prompt Optimization via Constrained Generation for Zero-shot Re-ranker. Findings of the Association for Computational Linguistics: ACL 2023.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/2023.findings-acl.61](https://doi.org/10.18653/v1/2023.findings-acl.61)

```bibtex
@inproceedings{cho2023discrete,
  title = {{Discrete Prompt Optimization via Constrained Generation for Zero-shot Re-ranker}},
  author = {Sukmin Cho, Soyeong Jeong, Jeong yeon Seo and Jong Park},
  booktitle = {Findings of the Association for Computational Linguistics: ACL 2023},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.61},
  url = {https://doi.org/10.18653/v1/2023.findings-acl.61}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
