Semantic Code Embeddings for Non-Literal Plagiarism Detection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Traditional methods for detecting copyrighted source code struggle to identify non-literal copies due to modifications like renaming variables or rearranging code blocks, are computationally intensive, and require direct access to source code, posing privacy and security risks.

Innovation Solution

A computer-automated system using semantic analysis techniques transforms source code into high-dimensional vectors for comparison via cosine similarity or L2 distance, operating without direct access to the full code and including a compression module for efficiency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If traditional text comparison or hash-based comparison methods are used, then exact copies or near-exact copies can be identified, but modifications such as renaming variables, altering formatting, or rearranging code blocks can easily evade detection

Engineering Contradiction:
Improvedetection accuracyVSAvoidability to detect non-literal copies
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The patent transforms source code from its original textual form into semantic embeddings (vector representations) that capture the meaning and functionality of the code. This parameter transformation allows the system to compare code based on semantic similarity rather than literal text matching, enabling detection of non-literal copies where variables are renamed, formatting is altered, or code structure is rearranged while preserving functionality.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent replaces traditional mechanical text comparison mechanisms with semantic analysis using large language models. Instead of comparing characters, words, or hash values, the system uses neural network-based semantic embeddings to understand and compare the meaning of code segments, enabling detection of functionally equivalent code that has been obfuscated through various transformations.

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

2Measurement precision

If traditional text comparison methods are used on large codebases, then copyright infringement can be detected, but the process becomes computationally intensive and time-consuming

Engineering Contradiction:
Improvecopyright detection capabilityVSAvoidprocessing speed
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent extracts only the essential semantic information from source code by transforming it into compact vector embeddings. This extraction process removes redundant textual details (such as comments, whitespace, variable names) while preserving the core functional meaning, resulting in a more efficient representation that can be compared much faster than full text comparison while maintaining detection accuracy.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent changes the representation parameter of code from verbose text to compact semantic vectors. This parameter transformation reduces the dimensionality and complexity of the data being compared, enabling faster computational processing while preserving the ability to detect semantic similarity and potential copyright infringement.

Inventive Principle:
Principle #35Parameter changes

3Measurement precision

If complete source code is accessed for comparison, then accurate plagiarism detection can be performed, but privacy and security risks increase due to potential data exposure

Engineering Contradiction:
Improveplagiarism detection accuracyVSAvoidprivacy and security risks
Core Design Contradiction:
Measurement precisionVSObject-affected harmful factors

Solution Approach 1:

The patent extracts only the semantic essence of source code into vector embeddings without requiring access to or storage of the complete original code. This extraction approach allows plagiarism detection to be performed on compressed semantic representations, significantly reducing the risk of data exposure while maintaining detection accuracy. The full source code never needs to be transmitted or stored in the comparison system.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent introduces semantic embeddings as an intermediary between the original source code and the comparison process. Instead of directly comparing full source code texts, the system compares these intermediary vector representations that capture semantic meaning. This intermediary layer protects the original code from exposure while enabling accurate plagiarism detection through semantic similarity comparison.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS20250378267A1Computer-automated systems and methods for detecting source code plagiarism
Publication Date: 2025.12.11 STARTOS INC
  • US20250378267A1 patent drawing
  • US20250378267A1 patent drawing
  • US20250378267A1 patent drawing

AI summary

One embodiment of the present invention relates to a computer-automated system and method for identifying copyrighted source code embedded within other source code files, utilizing advanced semantic analysis techniques. This embodiment of the invention addresses the challenge of detecting both literal and non-literal copies of copyrighted code, including instances where the code has been modified in non-semantic ways, such as through renaming variables, changing formatting, or rearranging code blocks. This embodiment creates semantic embeddings of source code using a large language model (LLM). Each segment of source code is transformed into a high-dimensional vector that captures its semantic essence, rather than its literal text. These vectors are then compared using sophisticated similarity metrics, such as cosine similarity or L2 distance, to determine the likelihood of copyright infringement. This embodiment can operate without direct access to the full source code, thereby enhancing privacy and security. Instead, the system works with embeddings that represent the semantic information of the code, significantly reducing the risk of data exposure. Additionally, this embodiment of the invention includes an optional compression module that further minimizes the data footprint by compressing the semantic vectors, enhancing the system's efficiency and scalability. This embodiment of the invention is particularly suited for use in environments where large volumes of code need to be analyzed quickly and accurately, such as in continuous integration/continuous deployment (CI/CD) pipelines. It provides a robust, scalable, and secure solution for managing copyright compliance in software development, offering significant improvements over traditional text-based or hash-based comparison methods.