Contrastive In-Context Learning for LLM Personalization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Large language models are unable to generate context-specific and user-specific responses, as they are trained on comprehensive datasets that result in overly generic outputs, failing to accommodate user preferences such as answer length or context-dependent responses.

Innovation Solution

The implementation of contrastive in-context learning using both positive and negative examples allows the large language model to learn user preferences and generate responses accordingly, by differentiating between desired and undesired outputs.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If large language models are trained using comprehensive training sets, then the models have millions of optimized parameters and broad knowledge base, but the models become overly genericized and cannot generate context-specific or user-specific responses

Engineering Contradiction:
Improvecontext-specific response capabilityVSAvoidmodel personalization complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent segments the training process into two distinct phases: (1) comprehensive pre-training on large-scale datasets to build general knowledge, and (2) contrastive in-context learning on user-specific positive and negative examples to enable personalization. This segmentation allows the model to maintain both broad knowledge and context-specific adaptability without requiring complete retraining.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies preliminary action by pre-training the model on comprehensive datasets before deploying it for user-specific tasks. The model is preliminarily equipped with general language understanding and knowledge, which then serves as a foundation for subsequent contrastive learning on user preferences and context-specific requirements.

Inventive Principle:
Principle #10Preliminary action

2Duration of action of stationary object

If conventional in-context learning is used, then the model can learn some context for a session, but the learning does not transport to subsequent sessions and must start from scratch

Engineering Contradiction:
Improvecontextual learning durationVSAvoidretraining time between sessions
Core Design Contradiction:
Duration of action of stationary objectVSLoss of time

Solution Approach 1:

The patent implements feedback mechanisms where user responses and interactions are continuously fed back into the contrastive learning process. Positive examples (desired responses) and negative examples (undesired responses) from previous sessions are incorporated into the training protocol, allowing the model to retain and build upon contextual learning across multiple sessions rather than starting from scratch.

Inventive Principle:
Principle #23Feedback

3Adaptability or versatility

If large language models are designed to be comprehensive, then they can handle various topics, but they cannot accommodate user preferences such as answer length or context-dependent response styles

Engineering Contradiction:
Improveuser preference adaptationVSAvoidmodel customization ease
Core Design Contradiction:
Adaptability or versatilityVSEase of operation

Solution Approach 1:

The patent changes the learning parameters by introducing contrastive learning with explicit positive and negative examples that encode user preferences. Instead of modifying the model's fundamental architecture or retraining on massive datasets, the approach changes the input examples to include desired response characteristics (e.g., answer length, style, detail level), allowing the model to adapt to user preferences through parameter adjustments in the learning process.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS20250139445A1Contrastive in-context learning for large language models
Publication Date: 2025.05.01 INTUIT INC
  • US20250139445A1 patent drawing
  • US20250139445A1 patent drawing
  • US20250139445A1 patent drawing

AI summary

A contrastive in-context learning protocol for large language models. The protocol includes inputting positive and negative examples to a large language model. Additionally, the large language model may be instructed to analyze the reasons behind the positive examples being positive and the negative examples being negative. The large language model with such contrastive in-context learning can generate specific responses/answers based on user preferences, generally not possible using conventional models.