Contrastive Pre-training for Text and Code Embeddings

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing technologies for generating and working with text and code embeddings require significant computational resources at test time and do not effectively leverage contrastive pre-training methods to improve performance.

Innovation Solution

A method and system that utilize hardware processors to convert training data sets into vector representations by encoding paired data samples, accessing negative example pairs, and training an artificial machine learning model to generate additional vectors, based on both positive and negative example pairs, reducing computational load and improving performance through contrastive pre-training.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If existing technologies are used for generating text and code embeddings, then embeddings can be generated, but significant computational resources are required at test time

Engineering Contradiction:
Improveembedding generation capabilityVSAvoidcomputational resources at test time
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The patent applies contrastive pre-training during the training phase to learn robust embedding representations before test time. By pre-training the model to distinguish between positive and negative example pairs, the system prepares the model weights and embedding space in advance, so that at test time only lightweight inference is needed without requiring significant computational resources for contrastive computation.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If contrastive pre-training is implemented, then performance of text and code embeddings is enhanced, but training computational load increases

Engineering Contradiction:
Improveembedding performanceVSAvoidtraining computational load
Core Design Contradiction:
ReliabilityVSPower

Solution Approach 1:

The system performs contrastive pre-training in advance during the training phase, where the model learns to differentiate between positive example pairs (semantically similar) and negative example pairs (semantically different). This preliminary learning establishes robust embedding representations and optimal model parameters before deployment, so that the enhanced performance is achieved without proportionally increased ongoing computational load.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent utilizes pre-trained language model parameters as initialization for the embedding model, transferring learned linguistic representations to the embedding task. This parameter transfer approach allows the model to leverage existing computational investments in pre-trained models while adapting to the specific contrastive embedding task, thereby improving performance efficiency.

Inventive Principle:
Principle #35Parameter changes

3Use of energy by moving object

If unsupervised embedding models are used, then computational requirements are reduced, but performance may be limited without supervised fine-tuning

Engineering Contradiction:
Improvecomputational requirementsVSAvoidembedding accuracy
Core Design Contradiction:
Use of energy by moving objectVSReliability

Solution Approach 1:

The system performs unsupervised contrastive pre-training as a preliminary step to learn general embedding patterns and semantic relationships from large corpora. This pre-training establishes a foundation of robust representations that can be efficiently applied to downstream tasks, reducing the need for extensive supervised fine-tuning while maintaining high embedding accuracy.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent initializes the embedding model with parameters from pre-trained language models, transferring learned linguistic knowledge and representations. This parameter initialization allows the model to start with strong semantic understanding, reducing the computational cost of training while achieving high accuracy in embedding generation for text and code.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS20240370779A1Systems and methods for using contrastive pre-training to generate text and code embeddings
Publication Date: 2024.11.07 OPENAI OPCO LLC
  • US20240370779A1 patent drawing
  • US20240370779A1 patent drawing
  • US20240370779A1 patent drawing

AI summary

Embodiments of the present disclosure may include systems, methods, and computer readable media for generating a vector representation, including receiving a training data set, the training data set including a plurality of paired data samples corresponding to positive example pairs, each positive example pair including a first data unit and a second data unit. Embodiments may also include converting the training data set into at least one first vector of a vector representation. Embodiments may further include accessing one or more negative example pairs to contrast against the positive example pairs. Embodiments may also include converting the one or more negative example pairs into one or more second vectors of the vector representation. Embodiments may further include training an artificial machine learning model to generate additional vectors of the vector representation. Further embodiments may include systems, methods, and media for determining semantic similarity based on one or more vector representations.