TL;DR
Curative Prompt Refinement (CPR) is a lightweight, plug-and-play framework that uses a fine-tuned Small Language Model (SLM) to clean up poorly written user prompts and enrich them with contextual task descriptions before they reach a downstream Large Language Model (LLM). By fixing "garbage in" at the input stage, CPR significantly mitigates LLM hallucinations and improves response quality, achieving up to a 96% win rate over raw, ill-formed prompts without requiring external knowledge bases or heavy computational overhead.
What Problem Does This Paper Address?
While large language models (LLMs) are incredibly fluent, they suffer from a well-known vulnerability: hallucination. While substantial research focuses on fixing hallucinations by altering model architectures or post-processing outputs, this paper highlights a frequently overlooked culprit—the user.
Non-expert users often provide vague, ungrammatical, or poorly structured prompts. These "ill-formed" inputs act as out-of-distribution examples, forcing LLMs to guess user intent and frequently leading to plausible-sounding but entirely fabricated responses. Existing input-correction methods are often computationally expensive, rely on massive models, or require real-time access to external knowledge graphs. CPR addresses this gap by providing an efficient, model-agnostic input sanitizer.
Methods
The CPR framework introduces a three-step pipeline powered by a Small Language Model (SLM) fine-tuned using Low-Rank Adaptation (LoRA):
- Prompt Cleaning and Paraphrasing: The SLM corrects grammatical errors, typos, and syntax issues, transforming ambiguous phrases into clear, well-formed questions.
- Informative Description Generation: Merely cleaning a prompt isn't always enough. The SLM generates multiple supplementary contextual descriptions to flesh out the prompt's underlying intent.
- Description Reranking: To ensure accuracy, the framework filters out low-quality descriptions using a perplexity threshold ($\tau$). The remaining descriptions are sorted by perplexity, and the top-$k$ candidates are appended to the cleaned prompt to form a comprehensive input for the downstream inference LLM.
Datasets
The authors constructed a specialized instruction fine-tuning dataset combining three distinct sources to train the SLM:
- WikiEn Dataset: 10,000 high-quality English text entries from Wikipedia. The authors used the GPT-3.5 API to introduce artificial punctuation and grammatical errors, creating a paired dataset for text correction.
- MQR (Multi-domain Question Rewriting) Dataset: 2,114 pairs of paraphrased questions used to train the model in nuanced linguistic transformations and word substitution.
- WikiD (Wikidata Description) Dataset: 10,000 pairs of keywords and concise descriptions, selected by lookup frequency, to teach the SLM how to generate contextually relevant expansions from minimal inputs.
For evaluation, the authors utilized 8,000 suboptimal queries (scoring below 0.5) from the Google Well-formed Query dataset.
Key Insights and Ideas
- SLMs as Effective Gatekeepers: Instead of using massive, expensive models to optimize prompts, lightweight SLMs (such as Gemma-2B or Phi-2) can be highly effective at preprocessing text when properly fine-tuned.
- Context Matters More Than Grammar: The ablation studies show that simply cleaning a prompt ("CPR w/o Descriptions") yields minor improvements. The real drop in hallucinations occurs when the SLM injects generated contextual descriptions into the prompt.
- Synergy with Post-Processing: CPR operates entirely at the front-end, meaning it can be stacked with existing backend hallucination defense mechanisms (like SelfCheckGPT) for compounding benefits.
Key Results
The authors evaluated CPR across several inference models, including Llama-2 (7B) and GPT-3.5, measuring the Hallucination Index (HI), Content Quality Score (CQS), and Win Rate (WR).
- Substantial Win Rates: When using GPT-3.5 as the inference engine, prompts refined by CPR achieved a 96% win rate over the original, ill-formed user prompts.
- Hallucination Reduction: For Llama-2 (7B), CPR reduced the Hallucination Index from 0.51 down to 0.13, while simultaneously boosting the Content Quality Score from 0.38 to 0.75.
- The Power of Combination: When CPR was combined with SelfCheckGPT on highly ill-formed prompts, the Hallucination Index plummeted to an impressive 0.05, outperforming either method used in isolation.
Limitations and Future Work
Despite its strong performance, the authors note a few limitations:
- Heuristic Dataset Creation: The training dataset relied on automated error injection via GPT-3.5, meaning a more rigorously curated, human-vetted dataset could potentially yield even cleaner prompt refinements.
- Evaluation Scale: Due to hardware and resource constraints, the framework was primarily tested on smaller open-source models and GPT-3.5. Future work aims to evaluate CPR's efficacy on a broader, more diverse array of ultra-large frontier models.
Summary updated