Multiphase Prompt Refinement for Accurate LLM Responses
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Large language models (LLMs) generate suboptimal or hallucinated responses due to ineffective prompts, which are prone to ambiguity and version-specific issues, and lack sufficient data privacy and privacy, exacerbated by the widespread deployment in enterprises.
Innovation Solution
A multiphase optimization approach involving an evolutionary algorithm to iteratively refine instructions and example selectors, alternating between optimizing the instruction and updating the example selector, utilizing an LLM to enhance the effectiveness of prompts, enhancing the responsiveness of the LLMs, and enhancing the responsiveness of the LLMs, and improving the example selector.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If prompts are designed manually for LLMs, then implementation is simple, but response accuracy deteriorates due to ambiguity and version-specific issues
Solution Approach 1:
The system enables self-service by allowing the LLM to automatically generate and optimize its own prompts through iterative evolution. The prompt optimization process is autonomous, with the model refining instructions and examples without manual intervention, thus improving response accuracy while managing complexity through automation.
Solution Approach 2:
The system implements feedback mechanisms where test results from LLM responses are continuously fed back into the evolutionary algorithm. This feedback loop allows the system to compare actual responses against expected outcomes and iteratively improve prompt instructions, resolving the accuracy-complexity contradiction through data-driven optimization.
2Measurement precision
If evolutionary algorithm is applied to optimize instructions, then response accuracy improves, but computational time increases due to iterative testing
Solution Approach 1:
The system performs preliminary actions by pre-defining the structure of prompts, example formats, and evaluation criteria before the evolutionary process begins. This preparation reduces the computational overhead during iterative optimization, allowing the system to achieve high response accuracy while minimizing time loss through advance planning.
Solution Approach 2:
The system applies partial action by focusing optimization efforts on specific critical components of prompts rather than exhaustively optimizing every element. The evolutionary algorithm targets key instructions and examples that have the greatest impact on response accuracy, reducing overall optimization time while maintaining high performance.
3Reliability
If multiple training examples are used in prompts, then model performance improves, but data privacy risks increase
Solution Approach 1:
The system uses synthetic or anonymized training examples that can be freely generated and discarded. Instead of relying on sensitive real-world data, the prompt optimization process creates artificial examples that maintain instructional value without containing private information, thus improving model performance while eliminating data privacy risks.
Solution Approach 2:
The system introduces an intermediary layer of anonymization and synthesis between raw data and training examples. This intermediary process transforms potentially sensitive information into privacy-preserving representations that maintain the instructional utility needed for high model performance while protecting underlying data privacy.
Data Source
AI summary
A method further includes performing the following phases for at least two iterations. In a first phase, the method includes, iteratively, applying an evolutionary algorithm to a current instruction to generate a revised instruction, testing, by applying a large language model (LLM), prompts including the current instruction and the revised instruction, respectively, training examples selected by the example selector to obtain test results, comparing the test results to obtain a comparison result, setting the revised instruction as the current instruction, and exiting the first phase when the comparison result satisfies a first phase stop condition. In a second phase, the method further includes selecting, by the example selector, training examples, testing, using the current instruction, the training examples to obtain a test result, and modifying, after executing the first phase, the example selector based on the test result.


