Interactive Research Demo

ReGA: Graph-Based RAG Verification

Detect hallucinations in LLM outputs using graph alignment and Sinkhorn normalization. Runs entirely in your browser with Transformers.js — no server required.

Loading Embedding Model
Initializing Transformers.js...

Input Texts

Graph Alignment

Source Node
Hypothesis Node
Alignment Edge

Verification Results

--
Energy Score
Awaiting Input
Why? (White-Box Explanations)
Verify texts to see detailed explanations
Embedding
-- ms
Feature ReGA
-- ms
Deep ReGA
-- ms
Total
-- ms
🌱
-
CO₂ eq.
Cost vs. GPT-4 Judge
ReGA $0.00
GPT-4 ~$0.02

Hyperparameters

Adjust algorithm parameters in real-time

10

Number of doubly-stochastic normalization iterations

1.0

Softmax temperature for alignment sharpness

5

GNN message passing iterations

0.15

Energy threshold for hallucination detection

Preset Examples

Test ReGA on different domains

Batch Performance Demo

Process multiple pairs to measure throughput

Pairs Processed
0 / 0
Throughput
-- pairs/sec
Avg. Latency
-- ms
Accuracy
--%

How ReGA Works

1

Text Embedding

Sentences are encoded using MiniLM-L6-v2 via Transformers.js into 384-dimensional vectors.

2

Pattern-Based Graph Extraction (PBGE)

Extract signed directional triplets (Subject, Verb, Polarity, Object) using regex for rapid structural verification.

3

Graph Construction

Build sentence-level graphs where nodes are sentence embeddings and edges connect sequential sentences.

4

GNN Encoding

Apply message passing to propagate information across the graph structure.

5

Sinkhorn Alignment

Compute doubly-stochastic assignment matrix between source and hypothesis nodes.

6

Energy Computation

Calculate alignment energy score indicating semantic divergence and potential hallucination.