Transformers
PyTorch
rag

VORTEXRAG: 7-Layer RAG — Causal Drift Filtering + Context Poison Guard [paper + code + demo]

#3
by vigneshwar234 - opened

Quick share for anyone building RAG pipelines with this model.

I ran into a problem that I suspect others hit too: even with good retrieval, the LLM hallucinates when the context window contains chunks that are topically similar but causally wrong. Standard cosine similarity can't distinguish between a chunk that caused something and one that's merely associated with it.

I built VORTEXRAG to fix this — a 7-layer pipeline that adds causal filtering on top of retrieval:

  • SDC layer: scores every chunk's causal drift from the query (SDS = 1−tanh(‖D‖/τ))
  • CPG layer: purges the context window until signal/noise ≥ 3.5 (provably optimal)
  • FV layer: post-generation faithfulness check — rejects if ΔR > 0.15

Results: EM 74.8 (+13.6 vs Naive RAG), Faithfulness 0.94, 185ms latency.

Paper (Zenodo v3.0): https://doi.org/10.5281/zenodo.20579702
Code + 229 tests (MIT): https://github.com/vignesh2027/VORTEXRAG
Live demo: https://huggingface.co/spaces/vigneshwar234/VORTEXRAG

Sign up or log in to comment