Contrastive Prompt Analysis for Interpreting LLM Behavior

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Determining the basis for behavior of large language models (LLMs) is difficult due to their complexity, making it challenging to understand how they generate responses and adjust their operations effectively.

Innovation Solution

A system monitors LLM behavior by generating and analyzing modified prompts to identify changes in responses, using greedy and intelligent search techniques to provide contrastive explanations that explain how prompts affect LLM responses, allowing for refinement of the models.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If LLMs are trained on massive datasets to achieve general representations, then adaptability to downstream tasks is improved, but complexity of the model increases making behavior determination difficult

Engineering Contradiction:
Improveadaptability to downstream tasksVSAvoidmodel complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent segments the complex LLM behavior analysis into manageable components by generating modified prompts systematically and comparing responses. This breaks down the black-box model into observable input-output relationships that can be analyzed without understanding the full model complexity.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces an intermediary analysis layer that generates contrastive explanations between original and modified prompt responses. This intermediary mechanism translates complex model behavior into human-interpretable explanations without requiring direct inspection of the model's internal complex structures.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Ease of operation

If contrastive explanations are generated to explain LLM behavior, then interpretability is improved, but computational resources and time are consumed

Engineering Contradiction:
ImproveinterpretabilityVSAvoidcomputational time
Core Design Contradiction:
Ease of operationVSLoss of time

Solution Approach 1:

The patent applies partial action by generating modifications to only specific tokens or words in prompts rather than analyzing entire prompts. This selective modification approach reduces the computational burden while still providing meaningful contrastive explanations for model behavior.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The patent performs preliminary generation of modified prompts using templates and systematic variations before actual model inference. This pre-processing step organizes the analysis space and reduces the number of required model evaluations, saving computational time.

Inventive Principle:
Principle #10Preliminary action

3Loss of information

If modified prompts are generated to identify behavior changes, then understanding of model responses is improved, but device complexity increases

Engineering Contradiction:
Improveunderstanding of model responsesVSAvoidsystem complexity
Core Design Contradiction:
Loss of informationVSDevice complexity

Solution Approach 1:

The patent changes parameters of prompts systematically by modifying specific tokens, words, or structural elements. This parameter-based approach to prompt modification provides a structured way to explore model behavior without creating overly complex analysis systems.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS20250390705A1Refining machine learning models based on contrastive explanations of model behavior
Publication Date: 2025.12.25 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US20250390705A1 patent drawing
  • US20250390705A1 patent drawing
  • US20250390705A1 patent drawing

AI summary

According to one embodiment of the present invention, a system monitors behavior of machine learning models and comprises one or more memories and at least one processor coupled to the one or memories. The system generates a set of modified prompts from an identified prompt. A machine learning model produces responses for the identified prompt and the set of modified prompts. A modified prompt is selected from the set of modified prompts based on a change to a response for the selected prompt relative to a response for the identified prompt satisfying a change threshold associated with a change category. The selected prompt and corresponding response are presented and indicate changes to the identified prompt affecting behavior of the machine learning model. Embodiments of the present invention further include a method and computer program product for monitoring behavior of machine learning models in substantially the same manner described above.