NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Prompt Waywardness: The Curious Case of Discretized Interpretation of Continuous Prompts

Daniel Khashabi, Xinxi Lyu, Sewon Min, Lianhui Qin, Kyle Richardson, Sean Welleck, Hannaneh Hajishirzi, Tushar Khot, Ashish Sabharwal, Sameer Singh, Yejin Choi

Introduction

In the evolving landscape of Large Language Models (LLMs), "prompt tuning" has emerged as a computationally efficient alternative to full model fine-tuning. Instead of updating billions of model weights, researchers learn a sequence of continuous vectors—known as "soft prompts"—that are prepended to the input. While highly effective, these soft prompts are essentially "black boxes": sequences of high-dimensional numbers that lack inherent human readability.

To interpret these prompts, the standard practice is to project them back into discrete text by identifying the nearest-neighbor words in the model's vocabulary. However, this paper introduces the phenomenon of Prompt Waywardness: a significant disconnect where continuous prompts can solve a task with high accuracy while their nearest-neighbor textual interpretations remain completely arbitrary, unrelated, or even contradictory to the task at hand.

Conceptual overview of Prompt Waywardness: a continuous prompt optimized for sentiment classification can project to arbitrary discrete text.

Methodology

The researchers investigated the faithfulness of these projections by attempting to "force" waywardness through a constrained optimization objective. They modified the standard prompt tuning loss function to balance two competing goals:

  1. Task Utility: Minimizing the standard cross-entropy loss for a specific classification task.
  2. Target Projection: Minimizing the distance between the continuous prompt and a pre-selected, arbitrary discrete target prompt ($p_d$).

By adjusting a hyperparameter ($\gamma$), the authors controlled the trade-off between task performance and the prompt's similarity to the arbitrary target text. The study utilized the GPT-2 model family (Small to XL) and evaluated performance across five diverse classification datasets, including SST-2 (sentiment), AGNews (topic classification), and TREC (question type). To test the limits of waywardness, they used target strings ranging from random snippets of the PILE corpus to orthogonal task descriptions from Natural-Instructions.

Empirical Results

The experiments revealed that LLMs are remarkably flexible in how they process input embeddings. Across most datasets, the authors identified prompts that achieved over 90% token overlap (F1) with arbitrary target strings while suffering less than a 2% drop in task accuracy compared to unconstrained prompts.

Trade-off between task accuracy and prompt F1 similarity to an arbitrary target string across different values of the constraint hyperparameter gamma for SST-2 and AGNews.

Key findings from the empirical analysis include:

  • The Many-to-One Mapping: The continuous embedding space is infinite, while the discrete vocabulary is finite. This creates large "Voronoi regions" where a prompt can be significantly modified to change its behavior without ever altering its nearest-neighbor textual projection.
  • Model Scale and Expressivity: Larger models, such as GPT-2 XL, exhibit higher degrees of waywardness. Their increased capacity allows them to "correct" or re-interpret wayward prompts in subsequent layers, maintaining high task performance even when the input layer is forced to resemble gibberish.
  • The Role of Prompt Length: Waywardness becomes significantly easier to achieve as the prompt length increases. Once a prompt exceeds approximately 7 tokens, finding a high-performing but wayward solution becomes trivial.
  • Ineffectiveness of "True" Definitions: Interestingly, forcing a prompt to project to a manually authored, honest description of the task provided no performance benefit over forcing it to project to random text. This suggests that the model does not rely on the "semantic meaning" of the projected text to solve the task.

Discussion and Implications

The discovery of Prompt Waywardness has profound implications for AI interpretability and safety. It demonstrates that discrete projections are not a reliable window into the internal logic of soft prompts. This disconnect creates a significant adversarial risk: a developer could deploy a soft prompt that appears benign and ethical upon inspection (e.g., "Provide fair medical advice") while the underlying vector is optimized to trigger biased or malicious behavior.

Ultimately, the authors conclude that the perceived correspondence between continuous prompts and their nearest-neighbor text is often an illusion. Future research must focus on developing more faithful interpretation methods or designing architectures where the connection between continuous and discrete spaces is fundamentally more robust. Ensuring the transparency of prompt-based systems is a critical step toward the safe deployment of large-scale language models.

Summary updated

BibTeX
@inproceedings{khashabi2022prompt,
  author = {Daniel Khashabi and Xinxi Lyu and Sewon Min and Lianhui Qin and Kyle Richardson and Sean Welleck and Hannaneh Hajishirzi and Tushar Khot and Ashish Sabharwal and Sameer Singh and Yejin Choi},
  title = {{Prompt Waywardness: The Curious Case of Discretized Interpretation of Continuous Prompts}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.naacl-main.266},
}
Figure