Code Repository Similarity via Embedding Comparison

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing code repository management systems face challenges in efficiently identifying and comparing code repositories that perform similar or identical tasks, leading to duplication of work, increased complexity, and resource inefficiency due to the large amount of content and difficulty in manual analysis.

Innovation Solution

A system that generates similarity scores for code repositories by creating embeddings for documents within the repositories and comparing these embeddings to determine document and code repository similarity scores, allowing for automated identification of similar repositories and enabling actions such as consolidation or collaboration.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If manual analysis of code repositories is performed, then identification accuracy may be improved, but time consumption and resource usage increase significantly

Engineering Contradiction:
Improveidentification accuracyVSAvoidtime consumption
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent replaces manual mechanical analysis of code repositories with an automated embedding-based comparison system. The system converts code documents into vector embeddings and uses computational similarity scoring to automatically identify similar repositories, eliminating the need for manual review while maintaining identification accuracy through mathematical similarity metrics.

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

Solution Approach 2:

The patent introduces embeddings as an intermediary representation between raw code documents and similarity comparison. By converting code documents into vector embeddings that capture semantic meaning, the system enables efficient automated comparison without losing the nuanced information needed for accurate identification of similar repositories.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If comprehensive code repository analysis is performed, then similarity identification accuracy is improved, but system complexity increases

Engineering Contradiction:
Improvesimilarity identification accuracyVSAvoidsystem complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent replaces complex manual analysis processes with a standardized embedding-based comparison system. By using pre-trained language models to generate embeddings and applying simple similarity metrics like cosine similarity, the system achieves comprehensive analysis capability without the operational complexity of manual review procedures.

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

Solution Approach 2:

The patent transforms the complexity of code analysis into a manageable parameter space by converting code documents into fixed-dimensional vector embeddings. This parameter transformation allows comprehensive comparison through simple mathematical operations on embedding vectors, reducing system complexity while maintaining analysis thoroughness.

Inventive Principle:
Principle #35Parameter changes

3Use of energy by moving object

If code repository comparison is performed without embeddings, then resource usage may be lower, but comparison accuracy and efficiency decrease

Engineering Contradiction:
Improveresource usageVSAvoidcomparison efficiency
Core Design Contradiction:
Use of energy by moving objectVSProductivity

Solution Approach 1:

The patent performs preliminary conversion of code documents into embeddings before comparison operations. By pre-processing documents into compact vector representations that capture essential semantic information, the system enables efficient similarity calculations that are both resource-effective and highly productive, avoiding the need for repeated full-document analysis.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS12164867B1Comparing code repositories
Publication Date: 2024.12.10 CAPITAL ONE SERVICES LLC
  • US12164867B1 patent drawing
  • US12164867B1 patent drawing
  • US12164867B1 patent drawing

AI summary

In some implementations, a device may obtain a first document set associated with a first code repository. The device may generate a first embedding set of one or more embeddings for respective documents included in the first document set. The device may obtain a second embedding set of one or more embeddings for respective documents included in a second document set associated with a second code repository. The device may compare the first embedding set to the second embedding set. The device may generate a code repository similarity score that indicates a similarity between the first code repository and the second code repository. The device may perform, based on the code repository similarity score satisfying a threshold, an action associated with the first code repository and/or the second code repository.