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

Conversational Prompt Engineering

Liat Ein-Dor, Orith Toledo-Ronen, Artem Spector, Shai Gretz, Lena Dankin, Alon Halfon, Yoav Katz, Noam SlonimarXiv 2024

TL;DR

Conversational Prompt Engineering (CPE) is a new human-in-the-loop framework that turns prompt engineering into a collaborative chat between a user and an LLM. By leveraging a small set of unlabeled data, CPE guides users to articulate their specific preferences and automatically generates high-performing zero-shot and few-shot prompts, eliminating the need for manual seed prompts or scarce labeled datasets.

What Problem Does This Paper Address?

Crafting the perfect prompt for a Large Language Model (LLM) is notoriously difficult. It requires a deep understanding of how LLMs interpret instructions, making prompt engineering (PE) a tedious, time-consuming process of trial and error.

While researchers have tried to automate this process, existing automatic PE methods suffer from two major flaws: they typically require users to provide a manually written "seed prompt" to start, and they rely heavily on high-quality labeled data to evaluate and optimize prompt iterations. In real-world enterprise scenarios—like summarizing internal emails or generating niche marketing copy—labeled data is rarely available, and users often struggle to clearly articulate their exact formatting and stylistic constraints upfront.

Methods

The authors introduce Conversational Prompt Engineering (CPE), an agentic workflow implemented as a "three-party chat" involving the User, the System (which orchestrates the backend logic), and the Model (powered by Llama-3-70B).

Instead of asking the user to write a prompt from scratch, CPE walks the user through a structured, multi-stage workflow:

Figure 1: CPE Workflow from the user’s perspective. Each step can be a multi-turn conversation between the user and CPE.
  1. Initialization: The user selects a target LLM and uploads a small sample of unlabeled data (at least three examples).
  2. Initial Discussion & First Instruction Creation: The model analyzes three data samples and asks the user data-driven questions to uncover hidden preferences (e.g., "Do you want to focus on the movie's plot or the reviewer's opinion?"). It then drafts an initial instruction.
  3. Instruction Refinement: The system generates outputs using the target model via context-isolated "side-chats." The user reviews these outputs and provides natural language feedback.
  4. Output Enhancement & Convergence: The model uses Chain-of-Thought (CoT) reasoning to analyze user feedback, refines the instruction, and updates the outputs until the user approves. The final output is a optimized prompt, which can include the approved outputs as few-shot (FS) examples.

Datasets

To evaluate CPE, the authors conducted a user study focused on text summarization tasks using samples from a diverse catalog of unlabeled datasets:

  • Space class of 20 Newsgroups: Niche, technical forum discussions.
  • TL;DR: A dataset of Reddit posts commonly used for training abstractive summarization models.
  • Debate Speeches: Complex, argumentative spoken text.
  • Wikipedia Collections: Curated articles spanning two distinct categories: movies and animals.

Key Insights and Ideas

  • Unlabeled Data is Enough to Bootstrap Prompts: By analyzing just three unlabeled examples, an advanced LLM can successfully identify key dimensions of the data and prompt the user with highly relevant, clarifying questions.
  • Zero-Shot Can Match Few-Shot Performance: Surprisingly, the study revealed that the optimized zero-shot prompts generated by CPE performed just as well as their few-shot counterparts. This is a massive win for production environments, as removing few-shot examples drastically cuts down on token consumption and inference costs for high-volume tasks.
  • Iterative Refinement Yields Nuance: As shown in the authors' analysis of the chat histories, instructions grew significantly more precise over multiple turns, successfully capturing complex negative constraints (e.g., "without specific examples", "avoiding redundant claims") that users rarely think to include in an initial draft.

Key Results

The authors evaluated CPE through a user study with 12 prompt-engineering experts across 112 test examples. They compared CPE-generated prompts against a generic baseline prompt generated by Llama-3.

Figure 3: Evaluation results. The frequency of the three generated summaries across the three ranking categories: Best/Middle/Worst.
  • Massive Win Over Baselines: The baseline prompt was overwhelmingly ranked as the "worst" in nearly 90% of cases, while CPE-generated prompts dominated the "best" category.
  • Zero-Shot vs. Few-Shot: The CPE Zero-Shot (ZS) prompt was ranked as the best in 53% of instances, compared to 47% for the Few-Shot (FS) prompt. This minor difference was found to be statistically insignificant, proving that the instruction alone successfully absorbed the user's preferences.
  • High User Satisfaction: Users gave the final CPE instructions a score of 4.6/5 and rated the overall pleasantness of the chat interaction at 4.8/5.

Limitations and Future Work

While highly effective, CPE is not yet instantaneous. On average, it took users 32 conversational turns and roughly 25 minutes to reach convergence on a final prompt. The authors note that this time investment is driven by the complexity of the user's criteria, but they plan to focus on optimizing convergence speed in future iterations.

Additionally, the current user study was restricted to summarization tasks. Future work includes expanding CPE to other complex generation tasks and exploring whether CPE-generated prompts can be used as high-quality "seed prompts" for fully automated prompt optimization algorithms.

Summary updated

BibTeX
@misc{eindor2024conversational,
  author = {Liat Ein-Dor and Orith Toledo-Ronen and Artem Spector and Shai Gretz and Lena Dankin and Alon Halfon and Yoav Katz and Noam Slonim},
  title = {{Conversational Prompt Engineering}},
  year = {2024},
  eprint = {2408.04560},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.04560},
}
Figure