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, with traditional accuracy techniques being 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 original 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 string matching or n-gram comparisons are used to validate RAG system output, then the validation process can be implemented, but it becomes computationally intensive and less precise in capturing semantic congruence

Engineering Contradiction:
Improvesemantic congruence detection accuracyVSAvoidcomputational 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 raw text strings to semantic vectors. By converting both the rephrased text and source document sections into vector representations using NLP techniques, the system enables efficient semantic similarity calculation that is both computationally manageable and highly accurate in capturing meaning congruence.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent replaces the mechanical string matching and n-gram comparison methods with a semantic vector-based similarity calculation system. This substitution eliminates the computational intensity and imprecision of character-level operations by operating in a semantic vector space where meaning is inherently captured, providing both efficiency and accuracy.

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

2Reliability

If traditional accuracy techniques are used to validate rephrased text, then validation can be performed, but they fail to fully capture semantic congruence leading to potential inaccuracies

Engineering Contradiction:
Improvevalidation accuracyVSAvoidsemantic congruence detection
Core Design Contradiction:
ReliabilityVSMeasurement precision

Solution Approach 1:

The patent fundamentally changes the validation parameter from string similarity to semantic vector similarity. By representing text in vector space where dimensionality captures linguistic meaning, the system achieves reliable validation that accurately reflects semantic congruence between rephrased output and source material.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The patent introduces semantic vectors as an intermediary representation between the rephrased text and the source document. This intermediary vector space serves as a bridge that captures the semantic relationship between the two texts, enabling accurate comparison of meaning rather than mere surface-level string matching.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If comprehensive validation of rephrased text is performed to ensure factual accuracy, then hallucination detection improves, but the process becomes more complex

Engineering Contradiction:
Improvehallucination detection capabilityVSAvoidvalidation framework complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent segments the validation process into distinct, manageable components: extracting source sections, converting to semantic vectors, applying sliding window for sentence-level comparison, calculating similarity scores, and threshold-based validation. This segmentation reduces overall complexity by breaking down the comprehensive validation task into systematic, modular steps.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent uses semantic vectors as an intermediary that simplifies the validation framework. Instead of implementing complex rules-based validation systems, the vector representation provides a unified, mathematically tractable approach to measuring semantic congruence, thereby reducing framework complexity while maintaining high hallucination detection capability.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentEP4682741A1Generalized validation framework for retrieval augmented generation (RAG)
Publication Date: 2026.01.21 INTUIT INC
  • EP4682741A1 patent drawingFigure 1
  • EP4682741A1 patent drawingFigure 2
  • EP4682741A1 patent drawingFigure 3

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.