Table of Contents
Fetching ...

Intent-based Prompt Calibration: Enhancing prompt optimization with synthetic boundary cases

Elad Levi, Eli Brosh, Matan Friedmann

TL;DR

Prompt sensitivity in LLMs remains a bottleneck for reliable task execution. The paper introduces Intent-based Prompt Calibration (IPC), which jointly generates synthetic boundary cases and iteratively refines prompts toward user intent, reducing dependence on large benchmarks. IPC extends to generative tasks by learning a ranking prompt and using a learned ranker to optimize the main prompt, enabling efficient tuning under data imbalance. The approach is modular and validated on moderation and generation tasks with strong proprietary models, outperforming state-of-the-art meta-prompt baselines with limited data and iterations. This has practical impact for production systems, lowering annotation costs and making prompt optimization more explainable and transferable.

Abstract

Prompt engineering is a challenging and important task due to the high sensitivity of Large Language Models (LLMs) to the given prompt and the inherent ambiguity of a textual task instruction. Automatic prompt engineering is essential to achieve optimized performance from LLMs. Recent studies have demonstrated the capabilities of LLMs to automatically conduct prompt engineering by employing a meta-prompt that incorporates the outcomes of the last trials and proposes an improved prompt. However, this requires a high-quality benchmark to compare different prompts, which is difficult and expensive to acquire in many real-world use cases. In this work, we introduce a new method for automatic prompt engineering, using a calibration process that iteratively refines the prompt to the user intent. During the optimization process, the system jointly generates synthetic data of boundary use cases and optimizes the prompt according to the generated dataset. We demonstrate the effectiveness of our method with respect to strong proprietary models on real-world tasks such as moderation and generation. Our method outperforms state-of-the-art methods with a limited number of annotated samples. Furthermore, we validate the advantages of each one of the system's key components. Our system is built in a modular way, facilitating easy adaptation to other tasks. The code is available $\href{https://github.com/Eladlev/AutoPrompt}{here}$.

Intent-based Prompt Calibration: Enhancing prompt optimization with synthetic boundary cases

TL;DR

Prompt sensitivity in LLMs remains a bottleneck for reliable task execution. The paper introduces Intent-based Prompt Calibration (IPC), which jointly generates synthetic boundary cases and iteratively refines prompts toward user intent, reducing dependence on large benchmarks. IPC extends to generative tasks by learning a ranking prompt and using a learned ranker to optimize the main prompt, enabling efficient tuning under data imbalance. The approach is modular and validated on moderation and generation tasks with strong proprietary models, outperforming state-of-the-art meta-prompt baselines with limited data and iterations. This has practical impact for production systems, lowering annotation costs and making prompt optimization more explainable and transferable.

Abstract

Prompt engineering is a challenging and important task due to the high sensitivity of Large Language Models (LLMs) to the given prompt and the inherent ambiguity of a textual task instruction. Automatic prompt engineering is essential to achieve optimized performance from LLMs. Recent studies have demonstrated the capabilities of LLMs to automatically conduct prompt engineering by employing a meta-prompt that incorporates the outcomes of the last trials and proposes an improved prompt. However, this requires a high-quality benchmark to compare different prompts, which is difficult and expensive to acquire in many real-world use cases. In this work, we introduce a new method for automatic prompt engineering, using a calibration process that iteratively refines the prompt to the user intent. During the optimization process, the system jointly generates synthetic data of boundary use cases and optimizes the prompt according to the generated dataset. We demonstrate the effectiveness of our method with respect to strong proprietary models on real-world tasks such as moderation and generation. Our method outperforms state-of-the-art methods with a limited number of annotated samples. Furthermore, we validate the advantages of each one of the system's key components. Our system is built in a modular way, facilitating easy adaptation to other tasks. The code is available .
Paper Structure (14 sections, 8 figures, 5 tables)

This paper contains 14 sections, 8 figures, 5 tables.

Figures (8)

  • Figure 1: System diagram. (1) An initial prompt is provided by the user (2) Synthetic challenging cases are generated (3) A user or an LLM annotates the examples (4) After evaluating the prompt performances, an LLM suggest a new prompt given the last prompt's results. (5) This process is repeated iteratively until a certain stop criterion (6) The system outputs a calibrated prompt.
  • Figure 2: Example of a real system flow. The user provides only the task description and initial prompt. The model iteratively generates challenging samples and refines the prompt according to the generated benchmark.
  • Figure 3: Accuracy on the spoiler and the PG classification tasks, with respect to the number of training steps. As shown, IPC outperforms other tested methods and results in lower variance.
  • Figure 4: Histogram of the ranking scores of the IMDB review dataset vs the generated synthetic dataset on the Authentic and enthusiastic generation task. The real data distribution contains very few ranked 5 reviews, whereas the synthetic data contains a more balanced dataset with respect to the top scores.
  • Figure 5: Histogram of the 'Yes' labels density on the parental guidance (PG) and spoiler classification tasks, with respect to the IMDB review dataset and the generated synthetic dataset. The real data exhibits a heavy imbalance in favor of the 'No' label, while the synthetic data approaches an even distribution.
  • ...and 3 more figures