RAG Output Validation Using Semantic Vectors and Sliding Windows

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current RAG systems face challenges in detecting and preventing hallucinations, where Large Language Models (LLMs) generate text not supported by the source material, and traditional accuracy techniques like BLEU or ROUGE scores are computationally intensive and less precise in capturing semantic congruence.

Innovation Solution

A novel validation framework that employs semantic similarity techniques, using a sliding window approach to convert rephrased text and corresponding document sections into semantic vectors, calculate similarity scores, and rank sentences for contextual alignment, ensuring the generated content is both factually accurate and contextually faithful.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If traditional accuracy techniques (string matching or n-gram comparisons) are used to validate RAG system output, then the validation process can be implemented, but the computational load is intensive and the precision in capturing semantic congruence is insufficient

Engineering Contradiction:
Improvesemantic congruence detection precisionVSAvoidcomputational load
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The patent transforms the validation approach by changing the parameter representation from discrete string tokens to continuous semantic vectors. By converting text into vector embeddings that capture semantic meaning, the system achieves more precise semantic congruence detection while reducing reliance on computationally intensive n-gram comparisons. The vector-based representation allows for more efficient similarity calculations.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent replaces the mechanical string-matching mechanism with a semantic vector comparison mechanism. Instead of manually comparing strings and n-grams, the system uses vector space modeling where semantic similarity is calculated through mathematical operations on vector representations. This substitution enables more accurate semantic congruence detection with reduced computational overhead.

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

2Measurement precision

If traditional string matching methods are used to validate rephrased text, then the validation can be performed, but the methods fail to fully capture semantic congruence leading to potential inaccuracies

Engineering Contradiction:
Improvesemantic congruence accuracyVSAvoidvalidation accuracy
Core Design Contradiction:
Measurement precisionVSReliability

Solution Approach 1:

The patent changes the validation parameter from exact string matching to semantic vector similarity. By representing text in vector space, the system can measure semantic congruence based on vector proximity rather than exact character matches. This parameter change enables the detection of semantically equivalent rephrasings that string matching would miss, thereby improving both measurement precision and validation reliability.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent introduces semantic vectors as an intermediary between the original text and the rephrased text. Instead of directly comparing strings, the system converts both texts into vector representations and compares their semantic proximity. This intermediary representation captures the semantic meaning, allowing for more accurate validation of rephrased content while maintaining reliability.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If comprehensive validation of rephrased text is performed to ensure factual accuracy, then the reliability of generated content improves, but the computational resources and time required increase significantly

Engineering Contradiction:
Improvefactual accuracy of generated contentVSAvoidvalidation throughput
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent changes the validation parameter from exhaustive string comparison to efficient vector similarity calculation. By representing text semantically as vectors, the system can quickly compute similarity scores to assess factual accuracy. This parameter change maintains high reliability in detecting semantic deviations while significantly improving validation throughput through more efficient computational operations.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent replaces the computationally heavy mechanical string-matching system with a more efficient semantic vector comparison system. The vector-based approach allows for rapid similarity calculations that maintain factual accuracy validation while increasing productivity. The substitution enables comprehensive validation without the prohibitive computational costs of traditional methods.

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

Data Source

PatentUS20260030278A1Generalized validation framework for retrieval augmented generation (RAG)
Publication Date: 2026.01.29 INTUIT INC
  • US20260030278A1 patent drawing
  • US20260030278A1 patent drawing
  • US20260030278A1 patent drawing

AI summary

The method involves a process to validate text generated by a RAG system. The method receives text that the RAG system has rephrased in response to a query. The method finds and extracts relevant sections from a source document that match the rephrased text. Both the rephrased text and the source sections are transformed into semantic vectors using NLP techniques. A sliding window technique is applied to the source document vectors, moving sentence by sentence to calculate a semantic similarity score with the rephrased text at each step. Sentences are ranked by similarity, and the ones with the closest match are identified. If the similarity score is above a set threshold, the rephrased text is deemed semantically congruent and validated.