Detect hallucinations in LLM outputs using graph alignment and Sinkhorn normalization. Runs entirely in your browser with Transformers.js — no server required.
Adjust algorithm parameters in real-time
Number of doubly-stochastic normalization iterations
Softmax temperature for alignment sharpness
GNN message passing iterations
Energy threshold for hallucination detection
Test ReGA on different domains
Process multiple pairs to measure throughput
Sentences are encoded using MiniLM-L6-v2 via Transformers.js into 384-dimensional vectors.
Extract signed directional triplets (Subject, Verb, Polarity, Object) using regex for rapid structural verification.
Build sentence-level graphs where nodes are sentence embeddings and edges connect sequential sentences.
Apply message passing to propagate information across the graph structure.
Compute doubly-stochastic assignment matrix between source and hypothesis nodes.
Calculate alignment energy score indicating semantic divergence and potential hallucination.