In-Context Demonstration Selection Using Difficulty-Based Repetition

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Traditional in-context learning (ICL) strategies for long-context generative neural networks (LLMs) are ineffective when utilizing a large number of demonstrations, as the effectiveness of increasing the number of examples varies greatly depending on how the demonstrations are selected, and simply increasing the number does not guarantee improved performance.

Innovation Solution

The system strategically repeats difficult demonstration examples within the context input and incorporates zero-shot predictions as error signals to enhance LLM attention, improving performance without further training.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Quantity of substance

If the number of demonstration examples is increased, then the model can learn more from in-context learning, but the effectiveness decreases when using traditional selection strategies

Engineering Contradiction:
Improvenumber of demonstration examplesVSAvoideffectiveness of in-context learning
Core Design Contradiction:
Quantity of substanceVSReliability

Solution Approach 1:

The patent applies local quality by differentiating the treatment of demonstration examples based on their difficulty level. Instead of uniform treatment, difficult examples are repeated multiple times while easy examples are included once, creating localized emphasis on critical learning patterns that the model struggles with, thereby improving overall in-context learning effectiveness

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent segments the demonstration examples into distinct categories based on difficulty classification (easy, medium, difficult). This segmentation allows the system to apply different repetition strategies to different segments, with difficult examples receiving multiple repetitions and easy examples receiving single inclusion, optimizing the learning process

Inventive Principle:
Principle #1Segmentation

2Adaptability or versatility

If traditional ICL selection strategies are used, then similarity and diversity are balanced, but performance does not improve when using a large number of demonstrations

Engineering Contradiction:
Improvebalance of similarity and diversityVSAvoidtask performance
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent changes the selection parameter from traditional similarity-based scoring to difficulty-based classification. By evaluating examples through difficulty metrics rather than solely relying on similarity scores, the system identifies which examples provide the most learning value and repeats those, thereby improving task performance while maintaining diversity

Inventive Principle:
Principle #35Parameter changes

3Loss of information

If more demonstration examples are included in the context input, then the model has more information to process, but the model cannot effectively focus on challenging examples

Engineering Contradiction:
Improveinformation availabilityVSAvoidmodel attention to challenging examples
Core Design Contradiction:
Loss of informationVSDifficulty of detecting and measuring

Solution Approach 1:

The patent implements feedback by using zero-shot predictions as error signals. The model generates predictions for difficult examples without training data, and these errors are fed back into the context input where they are repeated. This feedback mechanism ensures the model pays attention to challenging examples by highlighting where it fails, thereby improving detection and measurement of difficult patterns

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS20250384666A1Selecting in-context demonstration examples using difficulty classifications
Publication Date: 2025.12.18 GOOGLE LLC
  • US20250384666A1 patent drawing
  • US20250384666A1 patent drawing
  • US20250384666A1 patent drawing

AI summary

Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for performing in-context learning using a generative neural network. In one aspect, a method comprises obtaining a plurality of demonstration examples for a task; obtaining a respective difficulty classification for each of the demonstration examples; generating a context input that includes one or more instances of at least a subset of the demonstration examples, the generating comprising, for each of the demonstration examples, determining how many instances of the demonstration example to include in the context input based on the respective difficulty classification for the demonstration example; receiving a new input for the task; and processing an input that includes the context input and the new input using the first generative neural network to generate a new output.