The Death and Life of Great Prompts: Analyzing the Evolution of LLM Prompts from the Structural Perspective

Yihan Ma, Xinyue Shen, Yixin Wu, Boyang Zhang, Michael Backes, Yang ZhangEMNLP 2024

Abstract

Effective utilization of large language models (LLMs), such as ChatGPT, relies on the quality of input prompts. This paper explores prompt engineering, specifically focusing on the disparity between experimentally designed prompts and real-world “in-the-wild” prompts. We analyze 10,538 in-the-wild prompts collected from various platforms and develop a framework that decomposes the prompts into eight key components. Our analysis shows that Role and Requirement are the most prevalent two components. Roles specified in the prompts, along with their capabilities, have become increasingly varied over time, signifying a broader range of application scenarios for LLMs. However, from the response of GPT-4, there is a marginal improvement with a specified role, whereas leveraging less prevalent components such as Capability and Demonstration can result in a more satisfying response. Overall, our work sheds light on the essential components of in-the-wild prompts and the effectiveness of these components on the broader landscape of LLM prompt engineering, providing valuable guidelines for the LLM community to optimize high-quality prompts.

Introduction

As Large Language Models (LLMs) like ChatGPT become ubiquitous, the art of "prompt engineering" has moved from academic curiosity to a critical skill. However, most research in this field relies on "toy" prompts—simple, researcher-designed queries that do not reflect the complexity of real-world usage. On platforms like Discord and FlowGPT, users are crafting "mega-prompts" that function more like complex programs than simple questions. This study bridges the gap by performing the first large-scale structural analysis of over 10,000 "in-the-wild" prompts, identifying how they are built and which components actually drive performance.

The Anatomy of a Prompt

To understand the structure of complex prompts, we developed a framework consisting of eight recurring components identified through open-coding of real-world data. These components range from simple instructions to complex persona-building and context-clearing mechanisms.

Figure 1: Structural decomposition of two example prompts into eight key components, illustrating the complexity of real-world LLM interactions.
  1. Preliminary: Commands to clear previous context (e.g., "Ignore all previous instructions").
  2. Role: Assigning a specific persona (e.g., "Act as a professional manager").
  3. Capability: Defining the model's expertise or history (e.g., "You have 20 years of experience").
  4. Requirement: The core instructions and constraints of the task.
  5. Command: Specific triggers or UI-like commands (e.g., "/jailbroken").
  6. Demonstration: Few-shot examples providing desired input/output patterns.
  7. Confirmation: Asking the model to verify its understanding before proceeding.
  8. Query: The specific question or input to be processed.

Our analysis of 10,538 prompts collected between December 2022 and August 2023 reveals distinct patterns between different user communities. Discord users, for instance, tend to write significantly longer and more complex prompts compared to users on prompt-sharing websites. These "sweaty" Discord prompts often incorporate "jailbreak" language and multiple structural layers to bypass safety filters or achieve highly specific outputs.

Figure 2: Prevalence of the eight structural components across Discord and Website sources, highlighting the dominance of Requirement and Role.

As shown in the data, Requirement is nearly universal (>98%), while Role-playing has become a standard practice, appearing in over 50% of prompts. Interestingly, while the use of roles has exploded, the types of roles have shifted from general personas (like "Writer") to highly specialized, customized roles.

The Role Paradox and Performance Insights

One of the most surprising findings of this study is the "Role Paradox." While assigning a persona is one of the most popular prompting techniques, its actual impact on state-of-the-art models like GPT-4 is diminishing. In ablation studies involving SEO writing tasks, removing the Role component resulted in a negligible drop in quality (from a score of 24.38 to 24.27).

In contrast, less frequently used components like Capability and Demonstration proved to be much more impactful:

  • Capability: Removing descriptions of the model's expertise led to a 22% drop in response quality (scoring 19.14).
  • Demonstration: Removing few-shot examples resulted in a 17% drop in quality.

These results suggest that as models become better aligned with human instructions, the "flavor" of a persona becomes less important than the specific definition of expertise and the provision of concrete examples.

Conclusion

Real-world prompt engineering is evolving toward greater structural complexity. While users have gravitated toward persona-based prompting, our findings suggest that the community should pivot toward underutilized but high-impact components like Capability and Demonstration. By understanding these structural drivers, users can move beyond "flavor text" to create more efficient, high-performance prompts for advanced LLMs.

Summary updated

BibTeX
@inproceedings{ma2024death,
  author = {Yihan Ma and Xinyue Shen and Yixin Wu and Boyang Zhang and Michael Backes and Yang Zhang},
  title = {{The Death and Life of Great Prompts: Analyzing the Evolution of LLM Prompts from the Structural Perspective}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  url = {https://openreview.net/forum?id=6DgSyMO8gs},
}
Figure