Prompt Generation Feedback Loop for Language Model Constraint Testing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for testing language models to identify outputs that violate constraints are inefficient and prone to human error, as manual testing is time-consuming and limited by human creativity, while synthetic input generation fails to produce a significant number of inputs that cause the model to deviate from constraints.

Innovation Solution

Utilizing a Q-learning model to generate modified prompts that have a higher probability of causing a language model to violate constraints, combined with scoring and rationale determination for subsequent prompt generation, to efficiently identify and correct potential errors.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Extent of automation

If synthetic inputs are generated using computing devices, then the testing process can be automated, but the number of inputs that cause the model to violate constraints is insufficient

Engineering Contradiction:
Improveautomation of testing processVSAvoidnumber of violating inputs
Core Design Contradiction:
Extent of automationVSQuantity of substance

Solution Approach 1:

The system uses a reinforcement learning agent that receives feedback from the language model's outputs. When the model generates an output that violates constraints, the agent learns from this feedback and modifies its prompt generation strategy to produce more violating inputs in the future, creating a feedback loop that progressively increases the quantity of useful test cases

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The reinforcement learning agent autonomously generates, tests, and refines prompts without human intervention. The agent self-adjusts its prompt generation based on the language model's responses, automatically discovering and producing a large number of inputs that cause constraint violations

Inventive Principle:
Principle #25Self-service

2Reliability

If manual testing is used to identify constraint violations, then human creativity can be leveraged, but the process is time-consuming and limited by human creativity

Engineering Contradiction:
Improveability to identify constraint violationsVSAvoidtesting time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system replaces manual human testing with an automated reinforcement learning agent that uses machine learning algorithms to generate and evaluate prompts. This substitution eliminates human time investment while maintaining the ability to identify constraint violations through the agent's learned patterns and strategies

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

3Productivity

If existing synthetic input generation methods are used, then testing can be performed, but the inputs are unlikely to produce a large number of constraint violations

Engineering Contradiction:
Improvetesting efficiencyVSAvoidnumber of violating inputs
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The reinforcement learning agent dynamically adapts its prompt generation strategy based on the language model's responses. The agent continuously learns from feedback and modifies its approach to maximize the production of violating inputs, making the testing process increasingly efficient over time

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system changes the parameters of prompt generation by using reinforcement learning to optimize prompt features. The agent adjusts prompt structure, wording, and characteristics to maximize the probability of generating outputs that violate constraints, thereby increasing testing productivity

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS20250378274A1Systems for generation of prompts for evaluation of language models
Publication Date: 2025.12.11 AMAZON TECH INC
  • US20250378274A1 patent drawing
  • US20250378274A1 patent drawing
  • US20250378274A1 patent drawing

AI summary

Synthetic prompts are generated for use with a language model by providing an initial prompt to a first machine learning model that is trained to determine modifications to the prompt having an increased probability of causing the language model to generate a response that violates a constraint. The first machine learning model may use a reward function that determines a reward value based on the text of the initial prompt, the modification, the text of the modified prompt, and one or more intervals of time, the reward value being associated with the probability of a response to the prompt deviating from a constraint. One or more additional machine learning models may determine scores based on characteristics of the prompts and responses generated in this manner, and rationales associated with the scores. The scores and rationales may be stored and used to affect future responses generated by the language model.