Transformer Clause Comparison Using Segmented Embeddings

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current natural language processing techniques, particularly transformer models, face limitations in comparing long texts due to quadratic complexity and attention mechanism constraints, which restrict input sequence lengths and accuracy in semantic textual similarity tasks, especially when dealing with arbitrarily long documents like contracts divided into clauses.

Innovation Solution

A transformer architecture is used for document ingestion, converting natural language text into embeddings and storing them in a database, allowing for comparison of query clauses with document clauses by generating query-conditioned embeddings and calculating similarity scores, enabling scalable and accurate comparison of clauses across varying lengths.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If transformer models with attention mechanism are used for semantic textual similarity, then accuracy in understanding contextual meaning is improved, but input sequence length is limited to 512 tokens due to quadratic complexity

Engineering Contradiction:
Improvesemantic similarity accuracyVSAvoidinput sequence length
Core Design Contradiction:
Measurement precisionVSLength of moving object

Solution Approach 1:

The patent divides long documents into multiple clauses, each clause being processed independently by the transformer model. This segmentation allows the model to maintain the 512-token input limit while handling arbitrarily long documents by processing them in manageable chunks that preserve semantic meaning.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces a new dimension of comparison by generating multiple candidate clauses from different documents and comparing them against a query clause. This multi-dimensional approach allows the system to handle long documents without requiring the entire document to fit within the 512-token window, as only relevant clauses are compared.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

2Reliability

If transformer models process pairwise comparisons across billions of documents, then comprehensive text comparison is achieved, but time complexity becomes prohibitively expensive

Engineering Contradiction:
Improvecomprehensive comparison coverageVSAvoidcomputation time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

By segmenting documents into clauses and only comparing relevant clauses rather than entire documents, the patent dramatically reduces the number of pairwise comparisons needed. This segmentation approach maintains comprehensive comparison coverage while reducing computation time from billions of document-level comparisons to a manageable number of clause-level comparisons.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent generates multiple candidate clauses (excessive action) to ensure comprehensive coverage, but only performs detailed similarity comparisons on the most relevant candidates rather than all possible pairs. This partial action approach balances thoroughness with computational efficiency.

Inventive Principle:
Principle #16Partial or excessive action

3Length of moving object

If document-level transformer models aggregate input sentence embeddings to handle arbitrarily long documents, then scalability to long texts is improved, but information preservation deteriorates as the model forgets beginning information

Engineering Contradiction:
Improvedocument length scalabilityVSAvoidinformation preservation
Core Design Contradiction:
Length of moving objectVSLoss of information

Solution Approach 1:

The patent segments long documents into multiple clauses and processes each clause independently through the transformer model. This segmentation prevents information loss by ensuring that no clause exceeds the 512-token window, thereby preserving all information without requiring the model to retain memory of beginning information across entire long documents.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary processing by dividing documents into clauses before transformation, ensuring that each clause is within the optimal input window. This preliminary action prevents information loss by structuring the input data in a way that the transformer can process each segment with full contextual awareness.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS20240427822A1Document Clause Comparison Using Transformers and Neural Vector Embeddings
Publication Date: 2024.12.26 COGNIZER INC
  • US20240427822A1 patent drawing
  • US20240427822A1 patent drawing
  • US20240427822A1 patent drawing

AI summary

System, method, apparatus, and program instruction for comparing an input query clause with a collection of document clauses to determine which document clause is most similar to the query clause is provided. The disclosed invention includes an improved process of storing a collection of natural language data, improving both the generalizability and accuracy of searching and comparison of natural language data.