Zero-Shot Classification Using Dynamic Text Prompt Weighting

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing zero-shot classifiers simply average encoded text prompts, which may not effectively capture the similarity between data and class queries, leading to suboptimal classification performance.

Innovation Solution

The method employs a weighted average of encoded text prompts, where weights are automatically determined based on the similarity between the data embedding and the embeddings of the text prompts, enhancing the classification process.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If a simple average of encoded text prompts is used, then the computation is fast and simple, but the classification performance is suboptimal because it does not capture similarity between data and class queries

Engineering Contradiction:
Improveclassification performanceVSAvoidcomputation complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent transforms the uniform weighting parameter into dynamic similarity-based weights. Instead of using equal weights for all text prompts, the system computes cosine similarity between the encoded sensor data and each text prompt embedding, then uses these similarity scores as weights in the averaging process. This parameter change allows the system to adaptively emphasize more relevant prompts while maintaining computational efficiency through the use of standard embedding operations.

Inventive Principle:
Principle #35Parameter changes

2Measurement precision

If weighted averaging with similarity-based weights is used, then the classification accuracy improves, but the inference time increases

Engineering Contradiction:
Improveclassification accuracyVSAvoidinference time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent implements a balanced approach by computing similarity weights for all text prompts but using them in a computationally efficient manner. Rather than performing complex iterative optimization or multiple passes, the system computes a single round of cosine similarities and applies them directly to the weighted averaging. This partial action approach achieves most of the performance benefit without the full computational cost of more elaborate weighting schemes.

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentEP4530885A1Device and method to improve zero-shot classification
Publication Date: 2025.04.02 ROBERT BOSCH GMBH
  • EP4530885A1 patent drawingFigure 1
  • EP4530885A1 patent drawingFigure 2
  • EP4530885A1 patent drawingFigure 3

AI summary

A computer-implemented method of classifying a sensor signal (30) by a sensor signal encoder and a text encoder, wherein said encoders are configured to encoder their inputs into a latent representation, comprising the steps of: Encoding the sensor signal (30) to a first latent representation (e(x)) by the sensor signal encoder. Generating a plurality of text prompts (tij), wherein for each class (cj) several text prompts characterizing the corresponding class are instantiated (ti ← cj). Encoding the generated text prompts (tij) into second latent representations ( eijt) by the text encoder. Determining a class query (qj) for each class by weighted averaging over the second representations ( eijt) corresponding to the same class (ci). Computing a similarity between the first latent representation (e(x)) and each of the class queries (qj). Assigning the sensor signal (30) to the class with the highest similarity.