Detecting Hallucinations in Large Language Models via Internal Attention Divergence Signals
Paper β’ 2605.05025 β’ Published
ChimeraRouter + TWAVE + ERNIE Integration
Upgraded with 2024β2026 SOTA findings: LEAD, EDT, EPR, LED, CK-PLUG, Attention Divergence, TECP, AutoDeco.
βββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Prompt ββββββΆβ ChimeraRouterV2 ββββββΆβ RoutingDecision β
βββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β ERNIE β β PromptAnalyzer β β QwaveAllocator β
β (agent) β β + PolicySelect β β Budget tokens β
βββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TWAVE v2.0 β Landau-Ginzburg β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β EDT (entropyβtemperature) β LEAD (latentβdiscrete) β
β EPR (black-box detection) β LED (layer-wise explore) β
β CK-PLUG (retrieval ΞΌ_ret) β Attention Divergence probe β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| File | Purpose |
|---|---|
twave/landau_ginzburg_tracker_v2.py |
TWAVE v2.0 β token-level phase control |
nexus_os/chimera_router_v2.py |
ChimeraRouter v2 β tiered routing + ERNIE hooks |
nexus_os/demo_e2e_v2.py |
End-to-end unified demo |
README_v2.md |
This file |
# ChimeraRouter v2 demo
python nexus_os/chimera_router_v2.py
# TWAVE v2 demo
python twave/landau_ginzburg_tracker_v2.py
# Full E2E demo
python nexus_os/demo_e2e_v2.py --prompt "Explain quantum entanglement step by step." --category R2.2 --quality 0.85
ERNIE is your external agent that provides suggestions via callback:
from nexus_os.chimera_router_v2 import ERNIEInterface, ERNIESuggestion, TemperaturePolicy
def ernie_callback(prompt, analysis):
if "quantum" in prompt.lower():
return ERNIESuggestion(
suggested_policy=TemperaturePolicy.EAD,
confidence=0.85,
reasoning="Quantum prompts need annealed exploration",
override_router=False,
)
return None
router = ChimeraRouterV2(ernie_interface=ERNIEInterface(callback=ernie_callback))
ERNIE suggestions are blended with router logic (default 30% ERNIE, 70% router) unless override_router=True.
| Policy | When | Reference |
|---|---|---|
fixed |
Default | Baseline |
edt |
White/black-box with logprobs | arXiv:2403.14541 |
ead |
Multi-step reasoning | arXiv:2510.05251 |
lead |
High-entropy uncertainty | arXiv:2603.13366 |
ernie |
External agent suggestion | Your ERNIE pipeline |
MIT β developed for the NEXUS OS project.
This model repository was generated by ML Intern, an agent for machine learning research and development on the Hugging Face Hub.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = 'specimba/nexus-os-v2'
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
For non-causal architectures, replace AutoModelForCausalLM with the appropriate AutoModel class.