Contrastive Neural Network Training with Off-Diagonal Positives

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional contrastive learning methods for training encoder neural networks fail to account for off-diagonal positive pairs, leading to inaccurate training signals and suboptimal retrieval performance due to treating all other target items as negatives, despite their potential relevance to the query.

Innovation Solution

Incorporate off-diagonal positive pairs into the training process by masking them out from the contrastive loss function, ensuring that neural networks receive a more accurate training signal by distinguishing relevant items across different training pairs.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If conventional contrastive loss treats all other target items as negatives, then the training signal emphasizes discrimination between pairs, but the retrieval accuracy deteriorates due to ignoring relevant items from different pairs

Engineering Contradiction:
Improvetraining signal accuracyVSAvoidretrieval accuracy
Core Design Contradiction:
ReliabilityVSMeasurement precision

Solution Approach 1:

The patent applies local quality by differentiating the treatment of different target items based on their relevance to the query. Instead of uniformly treating all off-diagonal targets as negatives, the system identifies and masks off-diagonal positive pairs (where the target is relevant to the query) to provide differentiated training signals. This resolves the contradiction by ensuring relevant items receive appropriate positive treatment while maintaining discrimination for irrelevant items.

Inventive Principle:
Principle #3Local quality

2Productivity

If all off-diagonal target items are treated as negatives, then the contrastive loss simplifies computation, but the training quality deteriorates due to inaccurate labels

Engineering Contradiction:
Improvetraining efficiencyVSAvoidtraining quality
Core Design Contradiction:
ProductivityVSManufacturing precision

Solution Approach 1:

The patent applies partial action by selectively masking only the off-diagonal positive pairs from the contrastive loss computation, rather than treating all off-diagonal items as negatives. This partial modification maintains computational efficiency while improving training quality by correcting the labels for relevant off-diagonal items. The system computes loss only for truly negative pairs after masking, preserving efficiency while enhancing precision.

Inventive Principle:
Principle #16Partial or excessive action

3Adaptability or versatility

If conventional contrastive learning is used, then the encoder networks are trained to maximize pair discrimination, but the system fails to capture cross-pair relevance relationships

Engineering Contradiction:
Improvecross-pair relevance captureVSAvoidtraining signal accuracy
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent implements feedback by using a similarity model to evaluate off-diagonal pairs and provide feedback on their relevance. The system computes similarity scores for off-diagonal pairs and uses this feedback to identify true positives that should be masked from the loss function. This feedback mechanism enables the system to capture cross-pair relevance relationships while maintaining accurate training signals, resolving the contradiction between adaptability and reliability.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS20260050789A1Contrastive training of neural networks with off-diagonal positives
Publication Date: 2026.02.19 GOOGLE LLC
  • US20260050789A1 patent drawing
  • US20260050789A1 patent drawing
  • US20260050789A1 patent drawing

AI summary

Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for training neural networks through contrastive learning. In particular, the contrastive learning is modified to account for off-diagonal positives within batches of training pairs that are used for the training.