predictive-coding-information-bottleneck
Predictive Coding & Information Bottleneck Hallucination Detection
This skill enables Claude to build production-grade hallucination detection systems based on the PCIB framework. Instead of relying on expensive 70B+ LLM judges or slow retrieval loops, PCIB extracts four interpretable signals from LLM outputs -- Uptake (prediction error), Stress (semantic stability), Conflict (logical consistency), and Falsifiability (confident contradiction) -- then feeds them into a lightweight Random Forest classifier. The result is a sub-1M-parameter detector achieving 0.87 AUROC at 5ms inference, using 75x less training data than comparable methods.
When to Use
- When building a hallucination detection layer for a RAG pipeline that needs to flag unfaithful answers before they reach users
- When implementing real-time quality gates on LLM-generated content (customer support, medical summaries, legal analysis)
- When the user wants interpretable hallucination scores with per-signal explanations, not just a binary pass/fail
- When designing a two-tier verification system where a fast first-pass filter reduces load on expensive LLM judges
- When creating labeled datasets for hallucination detection with minimal annotation effort (the framework works with as few as 200 balanced samples)
- When auditing an existing LLM system to understand why specific outputs are hallucinated (entity-level analysis, grounding strength, perturbation fragility)
Key Technique
The PCIB framework is grounded in two neuroscience-inspired principles. Predictive Coding treats the LLM as a hierarchical prediction machine: when given context, a grounded answer aligns with the model's updated beliefs, while a hallucination requires the model to suppress provided context in favor of prior biases. This is measured as Uptake -- the KL divergence between the answer distribution conditioned on context+question versus question alone. High Uptake means the context meaningfully shaped the answer (likely factual); low Uptake means the model ignored the context (likely hallucinated).
The Information Bottleneck principle posits that factual claims are robust compressed representations, while hallucinated claims are noise that degrades under perturbation. PCIB tests this by paraphrasing extracted claims at temperature 0.7, then measuring how much the NLI entailment probability shifts (Stress via Jensen-Shannon divergence) and whether contradictions emerge (Conflict via NLI contradiction probability). The insight: a true fact survives rephrasing; a hallucination crumbles.
More from ndpvt-web/arxiv-claude-skills
sparseeval-evaluation-sparse-optimization
Efficiently evaluate LLMs on benchmarks by selecting a small subset of anchor items via sparse optimization, reproducing full-benchmark rankings at a fraction of the cost. Use when: 'reduce evaluation cost for my LLM benchmark', 'select representative test items from a large dataset', 'rank models without running all benchmark samples', 'sparse subset selection for evaluation', 'find anchor items that represent my test suite', 'efficient model comparison on benchmarks'.
1supchain-bench-benchmarking-real-world-supply
Build reliable long-horizon supply chain agents using the SupChain-ReAct pattern: multi-path ReAct trajectories with majority voting for autonomous tool orchestration without handcrafted SOPs. Use when asked to 'build a supply chain agent', 'orchestrate multi-step tool calls for order management', 'diagnose fulfillment issues', 'create an SOP-free agent workflow', 'implement long-horizon tool calling', or 'build an e-commerce order diagnostic system'.
1pcbschemagen-constraint-guided-schematic-design
Generate PCB schematics from natural language using constraint-guided LLM code generation with knowledge-graph verification. Use when the user says 'generate a PCB schematic', 'design a circuit board', 'create a KiCad schematic from description', 'convert circuit requirements to netlist', 'automate schematic design', or 'generate SKiDL code for a circuit'.
1predicting-improving-test-time-scaling
Implement Scaling-Law Guided (SLG) Search for test-time compute optimization. Uses reward tail distribution estimation (GPD fitting) to predict scaling laws and dynamically allocate compute budget across candidate solutions. Trigger phrases: 'optimize test-time compute', 'best-of-N scaling', 'SLG search', 'tail-guided search', 'reward-guided budget allocation', 'test-time scaling law'
1