Prompt Optimization in NLP Has a Benchmarking Problem

Analysis by the aitrendblend editorial team • Practical AI Tools and Prompt Engineering • 13 minute read

prompt optimization prompt engineering large language models soft prompts reinforcement learning prompting evolutionary prompt search in context learning benchmark datasets
Diagram style illustration of forty five prompt optimization strategies organized into soft prompt and hard prompt branches for large language models
A field that grew fast enough to need its own map, image generated for editorial illustration.
A researcher at RPTU Kaiserslautern spends a week rewriting the same instruction to a language model forty different ways, tracking which phrasing nudges accuracy up by two points and which one tanks it by ten. That is not a hypothetical. It is roughly what happened across the field between 2020 and 2024, and a new review from Summra Saleem, Muhammad Nabeel Asim, Shaista Zulfiqar, and Andreas Dengel, published in Computer Science Review, tries to make sense of the mess by collecting forty five distinct prompt optimization strategies into one place.

Key points

  • The review sorts forty five prompt optimization strategies into eleven working paradigms, split across soft prompts and hard prompts.
  • Only three of the forty five strategies use soft, continuous prompt vectors. The other forty two work with discrete, human readable text.
  • Methods are tested across nine NLP task families, from classification to reasoning, but on wildly inconsistent dataset sizes and splits.
  • A full training run of a large model can emit around 9000 kilograms of carbon dioxide. Prompt optimization runs closer to 10 to 100 kilograms per cycle, according to the paper’s own cost table.
  • The authors propose a minimum viable benchmark to make future comparisons fair, something the field has not had until now.

The problem prompt engineering was never going to solve alone

Large language models learn in two stages. First they absorb huge amounts of unlabeled text during pretraining, a process so resource heavy that training BERT once required 16 Google TPUs running for four straight days, and training Megatron Turing NLG 530B took 2000 NVIDIA A100 GPUs for over nine days. Then comes fine tuning, where a labeled dataset nudges the model toward a specific task. Fine tuning is cheaper than pretraining, but it still demands careful data curation, and it carries real environmental weight. One estimate cited in the paper puts the carbon output of training a single large model at around 600,000 pounds of carbon dioxide, roughly equal to 125 round trip flights between New York and Beijing.

That cost is exactly why prompt based models such as GPT Neo, OPT, and Flan T5 became attractive starting in 2021. Instead of retraining anything, you write an instruction, the prompt, and the frozen model does the rest. The catch, and it is a real one, is that output quality swings wildly with prompt quality. A well built prompt lifts performance. A careless one tanks it. That gap is what turned prompt engineering, the initial act of writing a prompt, into prompt optimization, the ongoing discipline of refining prompts against measured feedback until they reliably perform.

Where this fits among a decade of language model research

The review is not the first to notice that prompting matters. Earlier work has already shown that thoughtful prompt design reduces bias, curbs hallucination, and improves trustworthiness in sensitive applications like sexism recognition, where subtle discriminatory language is easy for a careless prompt to miss. Prompting has also crept into engineering contexts far from typical NLP benchmarks. Domain specific prompting has been used to schedule household appliances around energy tariffs, and structured prompt frameworks have been proposed to keep large models reliable inside engineering design workflows, where a wrong answer is not just an inconvenience.

What none of that prior work did, according to the authors, was sit down and systematically compare the strategies against each other. Reviews existed on prompt engineering broadly. A dedicated, structured comparison of optimization strategies specifically, the techniques that take a starting prompt and iteratively improve it, did not. That is the gap this paper tries to close, and the methodology behind it is worth walking through because it explains why the final count landed at forty five.

The authors started from 379 candidate papers pulled from Google Scholar, ACM Digital Library, IEEE Xplore, ScienceDirect, Elsevier, Springer, and Wiley Online Library, plus snowball searching through reference lists. Title and abstract screening cut that to 232. A full text pass, checking whether each paper actually contributed a distinct optimization strategy rather than just discussing prompting in general, brought the final set down to 45. Twenty five of those forty five came out of Association for Computational Linguistics venues, and OpenReview contributed another ten, which tells you where this research community mostly publishes.

Soft prompts and hard prompts, the split that organizes everything

Every one of the forty five strategies falls into one of two broad camps. Soft prompts are learnable continuous vectors, numbers tuned by gradient descent, that get fed into the model alongside the input embeddings. They work well but you cannot read them. Hard prompts are ordinary, human readable text that gets edited, searched, or rewritten by some optimization process. You can read a hard prompt and reason about why it works. Of the forty five methods in the review, only three fall into the soft prompt category. The remaining forty two are hard prompt methods, which tells you where most of the field’s energy has actually gone, toward prompts a person can inspect and explain rather than opaque vectors a person cannot.

Inside those two camps, the authors identify eleven distinct working paradigms based on how each method actually searches for a better prompt.

Gradient based and layer based soft prompting

AutoPrompt, from 2020, was the first method to use gradient signals to pick which tokens in a prompt template should change, essentially treating prompt search like a discrete version of backpropagation. FluentPrompt followed in 2023 and fixed AutoPrompt’s biggest flaw, prompts that scored well but read like gibberish, by adding linguistic constraints so the output stayed coherent. Single layer methods like the original Prompt Tuning method from 2021 insert a learnable vector only at the input layer, while multi layer methods such as Prefix Tuning and P Tuning v2 inject trainable vectors at every transformer layer, giving the model more surface area to adapt without touching its actual weights.

Evolutionary search, reinforcement learning, and LLM as optimizer

Evolutionary methods borrow biology’s playbook. PROMPTBREEDER runs mutation and crossover on a population of candidate prompts and keeps the fittest ones, the same logic natural selection uses on organisms. EvoPrompt does something similar but ties mutation strength directly to task specific performance scores. Reinforcement learning approaches like RLPrompt treat prompt writing as a trainable policy, rewarded by how well the resulting prompt performs, while newer entries like StablePRompt add reward smoothing to stop training from collapsing. A separate and increasingly popular paradigm just hands the whole job to another language model. OPRO literally prompts a model to optimize prompts, using chain of thought style reasoning to propose better instructions, and Automatic Prompt Engineer treats the search as a scoring task where an LLM both writes and grades candidate prompts.

Bayesian optimization and human model collaboration

Two smaller but conceptually interesting paradigms round out the list. Bayesian optimization methods like InstructZero build a probabilistic model of how well a prompt configuration will perform, then use that model to pick the next configuration worth testing, which matters when every evaluation costs real money on an API. Human LLM collaboration, represented in the review by a single method called Bayesian Prompt Optimization, starts with prompts a person actually wrote based on domain knowledge, then lets Bayesian search refine them while an LLM scores the candidates. It is the one paradigm in the review that treats human judgment as a starting ingredient rather than something to route around entirely.

Key takeaway

Eleven paradigms sounds like a lot until you notice the pattern. Almost every method in this review is trying to answer one question with a different tool. Given a way to score a prompt, how do you search a huge space of possible prompts efficiently. Gradient signals, evolution, reinforcement learning, Bayesian models, and even another language model are all just different search strategies wrapped around the same core problem.

What a soft prompt actually optimizes

Soft prompt tuning is the easiest paradigm to make mathematically concrete, so it is worth pausing on the mechanics. The pretrained model stays frozen. What gets trained is a small set of continuous vectors, call them the soft prompt, that get concatenated onto the input embeddings before anything reaches the transformer layers.

\( \hat{y} = f_\theta\big([\,P_1, P_2, \dots, P_k,\ x_1, x_2, \dots, x_n\,]\big) \)

Here \( \theta \) represents the frozen pretrained weights, \( x_1 \) through \( x_n \) are the fixed input token embeddings, and \( P_1 \) through \( P_k \) are the trainable soft prompt vectors, typically somewhere between five and a few hundred of them depending on the method. Only the \( P \) vectors receive gradient updates during training.

$$ \mathcal{L}(P) = -\sum_{(x,y) \in \mathcal{D}} \log P_\theta\big(y \mid [\,P_1,\dots,P_k,\ x\,]\big) $$

Training simply minimizes this loss with respect to the prompt vectors alone, using ordinary cross entropy over the labeled dataset \( \mathcal{D} \). That is the entire trick behind Prompt Tuning, and it is why the parameter count for these methods stays tiny while the frozen model underneath can be enormous. The review notes that Prompt Tuning paired with a T5-xxl model hit 96.2 percent accuracy on the WSC coreference resolution benchmark, essentially matching full fine tuning while updating a sliver of the parameters.

What forty five strategies actually deliver across nine task families

The review evaluates these methods across nine broad NLP task categories, classification, question answering, natural language inference, natural language generation, semantic similarity, information extraction, semantic parsing, linguistic and semantic understanding, and reasoning. The performance numbers are genuinely useful, but the more revealing story is how inconsistently those numbers were produced.

Take sentiment classification on the SST-2 dataset, tested by twenty two different approaches in the review. Waywardness, AutoPrompt, and FluentPrompt all used large amounts of training data and landed near 90 percent accuracy. BBT, BBTv2, and CLAPS used far less training data and still matched or beat that mark, which the authors flag as a real signal of generalization strength rather than just data volume. Meanwhile RLPrompt, TEMPERA, StablePRompt, and MAPO all trained on the same small amount of data but tested on more, and still cleared 90 percent, which is its own kind of evidence.

Task familyRepresentative datasetNotable method and scoreWhat the number actually shows
ClassificationSST-2 sentimentWaywardness, GPT-2, 98.5% accuracyLarge training data drove a strong score, not the prompt strategy alone
Question answeringSQuAD 1.1P tuning v2, DeBERTa-xlarge, 95.7 F1Larger encoder models consistently outscored smaller ones on extractive QA
Natural language inferenceRTEP tuning v2, GLM-xxlarge, 93.1% accuracyBest result on RTE, while BDPL on GPT-3 Davinci scored only 57.2%
Reasoning, mathMultiArithPROMPTBREEDER, PaLM2-L, 100% accuracySame method dropped to roughly 65% on the harder AQuA-RAT dataset
Word level understandingAntonyms (IIT)Several methods near 85 to 90%Semantic tasks consistently score lower than morphological ones like pluralization

That last row matters more than it looks. Across the word level understanding tasks, methods that nail pluralization, first letter extraction, and rhyming with close to perfect scores fall to well under 50 percent on antonyms and synonyms. The pattern is consistent across PROMPTBREEDER, APE, EASE, and StablePRompt alike, which suggests the gap is about the task, capturing genuine semantic relationships, rather than about any single prompting method being weak.

The same optimization technique can look brilliant on one dataset and mediocre on the next, and the difference often has more to do with training data size and split than with anything the prompt itself is doing. Paraphrased from the review’s discussion of classification benchmark disparities

The benchmark size problem, in numbers

This is where the review earns its keep as more than a catalogue. The authors count thirty different classification benchmarks in use across the field and find dataset sizes ranging from ETHOS at 998 samples to Amazon Polarity at roughly two million. On the natural language inference side, MNLI, SNLI, and QNLI are frequently tested with just 48 training and validation samples combined, then evaluated against a 9,800 sample test set, a few shot setup that makes cross study comparison close to meaningless unless everyone reports the same split.

Key takeaway

A method that looks state of the art on one paper’s version of SST-2 might be trained on a completely different slice of that dataset than the method it is being compared against. The review’s own tables repeatedly flag this, noting that direct comparison is not possible when approaches use different splits of nominally the same dataset.

The compute and carbon bill nobody wants to itemize

Prompt optimization gets marketed as the cheap alternative to fine tuning, and on a per cycle basis that is true. The review’s own cost comparison estimates GPT-4 scale dense training at 8.2 times ten to the eighteenth floating point operations, 60 days of training time, around $12,000 per cycle, and roughly 9,000 kilograms of carbon dioxide. Prompt optimization, by contrast, sits at 0.05 to 0.5 times ten to the eighteenth floating point operations, hours to days of wall clock time, $50 to $500 per run, and 10 to 100 kilograms of emissions.

That is a real efficiency win. But the authors are careful to note it is not a free lunch. Iterative prompt search means running many cycles, not one, and each API call during that search still burns energy at inference time. A search that runs for days across thousands of candidate prompts accumulates cost the same way any repeated process does, and the paper points out that inconsistent reporting of compute and energy usage across studies makes it hard to know how large that accumulated cost actually is in practice.

What this means if you are building with a language model right now

If you are choosing a prompting strategy for a real project, the practical read from this review is less about picking the single best method and more about matching a paradigm to your constraints. Evolutionary and LLM based search methods tend to shine when you have a capable model to call repeatedly and a clear scoring function, but they cost more queries. Bayesian and human model collaboration approaches make more sense when every evaluation is expensive, since they are explicitly built to squeeze information out of fewer trials. Reinforcement learning based methods bring more instability and implementation complexity, which the authors rank as high across nearly every method in that category, so they suit teams with the engineering capacity to tune the tuning process itself.

The review’s proposed minimum viable benchmark, summarized in its own Table 12, is the most immediately reusable artifact here. For each of the ten task families it names the most frequently used dataset, the dominant model architecture, and the standard evaluation metric, essentially giving any team a default comparison setup rather than inventing one from scratch. Classification defaults to something like SST-2 with RoBERTa-large and accuracy. Reasoning defaults to BBH style tasks with PaLM2-L scale models and accuracy or exact match. It will not settle every methodological argument, but it gives the field a shared starting line that has been conspicuously missing.

Honest limitations

The review is upfront about where its own analysis runs thin, and it is worth repeating those limits rather than glossing over them. Model diversity is narrow. GPT-2, GPT-3, and BERT family variants dominate the evaluations, while multilingual, instruction tuned, domain specific, and lightweight models remain largely untested across this literature, so it is genuinely unclear how well any of these forty five strategies generalize to architectures with different tokenization or training objectives.

Task coverage skews toward classification, question answering, and sentiment analysis, with far less rigorous testing on generation, dialogue, or cross lingual settings. And because the underlying studies used different datasets, splits, and metrics, the review itself cannot always produce a clean apples to apples ranking, a limitation the authors state directly rather than paper over with an aggregate score. Finally, only one method in the entire survey, PROPANE, was evaluated at genuinely large scale benchmarking, meaning the field’s confidence in these results still rests heavily on smaller, less exhaustive test conditions.

Conclusion

What this review actually accomplishes is less about crowning a winning prompt strategy and more about giving the field a shared map of a landscape that had grown too large to hold in one person’s head. Forty five methods, eleven paradigms, nine task families, and a genuinely useful cost accounting all in one place is not a small organizational feat, and it is the kind of unglamorous synthesis work that tends to get undervalued relative to any single flashy new method.

The conceptual shift worth sitting with is that prompt optimization has quietly become a parallel track to fine tuning, not a replacement for it and not a lesser cousin of it. Methods like Prompt Tuning close nearly the entire performance gap with full fine tuning while touching a tiny fraction of the parameters, and that changes the calculus for teams without the budget or the data to fine tune a large model outright.

The transferability question is the one to watch going forward. Most of what has been tested so far lives comfortably inside English language, single turn, text classification style benchmarks. Whether these same paradigms, evolutionary search, reinforcement learning, Bayesian optimization, hold up in multi turn dialogue, low resource languages, or genuinely open ended generation is still mostly an open question, and the review says as much rather than assuming the results transfer cleanly.

The honest remaining limitation is the one the authors keep returning to. Without a standardized benchmark, it is genuinely hard to know whether a reported performance gain reflects a better optimization strategy or simply a more generous training split. That is not a knock against the researchers who built these forty five methods. It is a structural problem with how the field has grown, method by method, paper by paper, without anyone stopping to agree on a shared measuring stick.

Read against that backdrop, this review is less a victory lap for prompt optimization and more an invitation to slow down and standardize before the next forty five methods show up. Given how quickly this space moves, that invitation has a short shelf life.

A working example, soft prompt tuning in PyTorch

The clearest way to understand soft prompt tuning is to build a small, runnable version of it. The implementation below follows the mechanism the review describes for methods like Prompt Tuning, a frozen base encoder plus a small set of trainable prompt vectors prepended to the input embeddings, trained with ordinary cross entropy on a classification objective. It runs on random dummy data as a smoke test, since no pretrained weights or proprietary API access are needed to demonstrate the mechanism itself.

import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader

# ---------------------------------------------------------------
# Soft Prompt Tuning, a small runnable implementation
# Mirrors the mechanism described in Lester et al. 2021, as
# summarized in the reviewed paper's single layer prompting section.
# The base encoder is frozen. Only the soft prompt vectors and a
# lightweight classification head are trained.
# ---------------------------------------------------------------

class SoftPromptEmbedding(nn.Module):
    """Learnable continuous prompt vectors prepended to input embeddings."""
    def __init__(self, num_prompt_tokens: int, hidden_dim: int):
        super().__init__()
        # Initialize from a small random normal, a common practical choice
        init = torch.randn(num_prompt_tokens, hidden_dim) * 0.02
        self.prompt_embeddings = nn.Parameter(init)

    def forward(self, batch_size: int):
        # Expand the shared prompt across the batch
        return self.prompt_embeddings.unsqueeze(0).expand(batch_size, -1, -1)


class FrozenToyEncoder(nn.Module):
    """
    A small transformer encoder standing in for a large frozen
    pretrained model. In a real deployment this would be a loaded
    checkpoint with requires_grad set to False on every parameter.
    """
    def __init__(self, hidden_dim: int = 128, num_layers: int = 2, num_heads: int = 4):
        super().__init__()
        layer = nn.TransformerEncoderLayer(
            d_model=hidden_dim,
            nhead=num_heads,
            dim_feedforward=hidden_dim * 4,
            batch_first=True,
        )
        self.encoder = nn.TransformerEncoder(layer, num_layers=num_layers)
        for p in self.encoder.parameters():
            p.requires_grad = False  # the base model stays frozen

    def forward(self, x):
        return self.encoder(x)


class PromptTunedClassifier(nn.Module):
    """
    Wraps a frozen encoder with a trainable soft prompt and a small
    classification head, following the concatenation pattern
    P_1 ... P_k, x_1 ... x_n described in the equation above.
    """
    def __init__(self, vocab_size: int, hidden_dim: int = 128,
                 num_prompt_tokens: int = 10, num_classes: int = 2):
        super().__init__()
        self.token_embed = nn.Embedding(vocab_size, hidden_dim)
        self.soft_prompt = SoftPromptEmbedding(num_prompt_tokens, hidden_dim)
        self.encoder = FrozenToyEncoder(hidden_dim=hidden_dim)
        self.classifier = nn.Linear(hidden_dim, num_classes)

    def forward(self, input_ids):
        batch_size = input_ids.size(0)
        token_embeds = self.token_embed(input_ids)               # [B, n, H]
        prompt_embeds = self.soft_prompt(batch_size)              # [B, k, H]
        full_input = torch.cat([prompt_embeds, token_embeds], dim=1)
        encoded = self.encoder(full_input)
        pooled = encoded.mean(dim=1)                          # mean pool over prompt and tokens
        return self.classifier(pooled)


class DummyTextDataset(Dataset):
    """Random token id sequences with random binary labels, smoke test only."""
    def __init__(self, num_samples: int, seq_len: int, vocab_size: int):
        self.input_ids = torch.randint(0, vocab_size, (num_samples, seq_len))
        self.labels = torch.randint(0, 2, (num_samples,))

    def __len__(self):
        return self.input_ids.size(0)

    def __getitem__(self, idx):
        return self.input_ids[idx], self.labels[idx]


def train_one_epoch(model, dataloader, optimizer, device):
    model.train()
    total_loss = 0.0
    for input_ids, labels in dataloader:
        input_ids, labels = input_ids.to(device), labels.to(device)
        optimizer.zero_grad()
        logits = model(input_ids)
        loss = F.cross_entropy(logits, labels)
        loss.backward()
        optimizer.step()
        total_loss += loss.item() * input_ids.size(0)
    return total_loss / len(dataloader.dataset)


def evaluate(model, dataloader, device):
    model.eval()
    correct, total = 0, 0
    with torch.no_grad():
        for input_ids, labels in dataloader:
            input_ids, labels = input_ids.to(device), labels.to(device)
            logits = model(input_ids)
            preds = logits.argmax(dim=-1)
            correct += (preds == labels).sum().item()
            total += labels.size(0)
    return correct / total


def smoke_test():
    """Runs a few epochs on random data to confirm the pipeline executes end to end."""
    torch.manual_seed(0)
    device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

    vocab_size, seq_len, hidden_dim = 500, 16, 64
    train_ds = DummyTextDataset(num_samples=200, seq_len=seq_len, vocab_size=vocab_size)
    val_ds = DummyTextDataset(num_samples=50, seq_len=seq_len, vocab_size=vocab_size)
    train_loader = DataLoader(train_ds, batch_size=16, shuffle=True)
    val_loader = DataLoader(val_ds, batch_size=16)

    model = PromptTunedClassifier(
        vocab_size=vocab_size, hidden_dim=hidden_dim,
        num_prompt_tokens=8, num_classes=2,
    ).to(device)

    # Only the soft prompt and the classification head are trainable
    trainable_params = [p for p in model.parameters() if p.requires_grad]
    optimizer = torch.optim.AdamW(trainable_params, lr=1e-3)

    for epoch in range(3):
        train_loss = train_one_epoch(model, train_loader, optimizer, device)
        val_acc = evaluate(model, val_loader, device)
        print(f"epoch {epoch} train_loss {train_loss:.4f} val_acc {val_acc:.4f}")

    print("smoke test complete, soft prompt shape", model.soft_prompt.prompt_embeddings.shape)


if __name__ == "__main__":
    smoke_test()

Frequently asked questions

What is the difference between prompt engineering and prompt optimization

Prompt engineering is the initial act of writing an effective instruction for a model. Prompt optimization is the ongoing process of refining that prompt against measured feedback, using search techniques like reinforcement learning, evolutionary algorithms, or gradient signals, until performance stabilizes on a given task.

What percentage of the forty five strategies use soft prompts

Only three of the forty five reviewed strategies are soft prompt methods. The remaining forty two rely on hard, human readable prompts, which the review attributes to the field’s preference for interpretable and transferable prompting over opaque continuous vectors.

Does prompt optimization use less energy than fine tuning a large model

Per cycle, yes. The review’s cost table estimates a full GPT-4 scale training run at roughly 9,000 kilograms of carbon dioxide against 10 to 100 kilograms for a typical prompt optimization run. The caveat is that optimization runs iterate many times, so the total footprint across a full search is not automatically small.

Why do different papers report such different accuracy numbers for the same dataset

Mostly because they use different training and test splits of the same nominal dataset. The review flags this repeatedly, noting cases where two methods evaluated on SST-2 or MNLI cannot be directly compared because the underlying sample sizes and splits differ.

Which prompt optimization paradigm is generally considered the strongest

The review avoids naming a single winner, and for good reason given the benchmarking inconsistency it documents. Evolutionary and LLM based search methods tend to score well on classification and reasoning tasks, while Bayesian and human model collaboration approaches are better suited to settings where every evaluation is expensive.

What is the minimum viable benchmark the authors propose

It is a table, presented in the paper as Table 12, that assigns one commonly used dataset, one dominant model family, and one standard evaluation metric to each of ten task families. The goal is to give researchers a shared, repeatable starting point instead of each study choosing its own inconsistent setup.

Read the full review

The complete paper covers all forty five methods, eleven paradigms, and every benchmark table referenced here in far more depth than one article can hold.

Saleem, S., Asim, M. N., Zulfiqar, S., and Dengel, A. The evolution of natural language processing. How prompt optimization and language models are shaping the future. Computer Science Review, 61, 100938. Published by Elsevier under a CC BY open access license.

This analysis is based on the published paper and an independent evaluation of its claims.

Related reading

Leave a Comment

Your email address will not be published. Required fields are marked *