Few-Shot Example Sequencing Using Contrastive Embedding Selection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing techniques for determining an optimal combination of few-shot examples in few-shot learning processes are inefficient and often fail to consider the sequence of examples, leading to ineffective and erroneous responses, while automated methods do not reliably identify the most semantically similar sequences for language processing models.

Innovation Solution

A sequence optimization model is trained through a contrastive learning process to determine an optimal combination of few-shot examples by generating embedding representations of queries and sequences, comparing their similarity, and adjusting model parameters based on ground-truth labels to select the most optimized sequence for a given query.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If brute force testing is used to determine optimal few-shot examples, then response quality may be improved, but computing resources and time consumption increase significantly

Engineering Contradiction:
Improveresponse qualityVSAvoidcomputing resources
Core Design Contradiction:
ReliabilityVSLoss of energy

Solution Approach 1:

The patent pre-computes and stores embedding representations for training examples and sequences before actual query processing. This preliminary action allows the system to quickly retrieve and compare embeddings during inference without performing computationally intensive operations at query time, thus reducing real-time computing resource consumption while maintaining response quality.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces embedding representations as an intermediary between raw training examples and query processing. Instead of directly testing all possible example combinations (brute force), the system uses these intermediate embedding vectors to enable efficient similarity-based filtering and selection, significantly reducing computational complexity while preserving the ability to identify optimal examples.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Loss of time

If automated techniques are used to determine few-shot examples, then processing time is reduced, but accuracy in identifying optimal sequences deteriorates

Engineering Contradiction:
Improveprocessing timeVSAvoidaccuracy in identifying optimal sequences
Core Design Contradiction:
Loss of timeVSMeasurement precision

Solution Approach 1:

The patent transforms the problem from discrete example selection to continuous embedding space operations. By converting training examples into embedding representations and using similarity metrics in this transformed space, the system achieves both speed (through efficient vector operations) and accuracy (through semantic similarity preservation), resolving the trade-off between processing time and identification precision.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent replaces mechanical brute force testing with a semantic-based vector comparison system. Instead of systematically testing all combinations (mechanical approach), the system uses embedding representations and similarity metrics to intelligently identify optimal sequences, achieving both speed and accuracy through this substitution.

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

3Productivity

If few-shot learning is used, then training efficiency is improved, but the model's ability to handle complex queries deteriorates

Engineering Contradiction:
Improvetraining efficiencyVSAvoidability to handle complex queries
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The patent performs preliminary embedding computation for training examples and sequences, storing these representations for rapid retrieval. This pre-processing enables the model to efficiently handle complex queries by quickly matching them against pre-computed embeddings, thus maintaining both training efficiency and query handling capability.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent adds the dimension of embedding representations to the few-shot learning process. By operating in the embedding space rather than just raw example space, the model gains enhanced capability to handle complex queries while preserving the efficiency benefits of few-shot learning, as the embedding dimensionality enables more sophisticated similarity matching.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

Data Source

PatentUS20260004120A1Optimizing sequences of few-shot examples for large language models
Publication Date: 2026.01.01 INTUIT INC
  • US20260004120A1 patent drawing
  • US20260004120A1 patent drawing
  • US20260004120A1 patent drawing

AI summary

Aspects of the present disclosure relate to automated determination of an optimized sequence of examples for few-shot learning. Embodiments include generating, via a text encoder of an embedding model, embedding representations of training examples and a query. Embodiments further include generating, via a sequence encoder of the embedding model, embedding representations of two or more sequences of the training examples based on the training example embeddings. Embodiments further include determining, based on comparing the embedding representations of the sequences to the embedding representation of the query, probabilities that each sequence of the two or more sequences is a most optimized sequence for the query. Embodiments further include modifying parameters of the embedding model through a supervised contrastive learning process that involves evaluating the determined probabilities based on a label that indicates the most optimized sequence of the two or more sequences for the query.