Skip to content

hallucinations

LLM Hallucination Prevention Toolkit for Academic Content

View on GitHub


Information

Property Value
Language Python
Stars 0
Forks 0
Watchers 0
Open Issues 26
License No License
Created 2025-12-24
Last Updated 2026-02-19
Last Push 2025-12-25
Contributors 1
Default Branch main
Visibility private

Datasets

This repository includes 13 dataset(s):

Dataset Format Size

| REVIEW_FINDINGS.json | .json | 22.44 KB |

| data | | 0.0 KB |

| init.py | .py | 0.36 KB |

| base.py | .py | 2.17 KB |

| calculations.py | .py | 2.51 KB |

| statistics.py | .py | 5.22 KB |

| design_thinking_results.json | .json | 21.18 KB |

| data | | 0.0 KB |

| init.py | .py | 0.04 KB |

| verify_calculations.py | .py | 5.66 KB |

| verify_statistics.py | .py | 6.08 KB |

| test_plan.json | .json | 9.0 KB |

| test_results.json | .json | 18.56 KB |

Reproducibility

This repository includes reproducibility tools:

  • Python requirements.txt

Status

  • Issues: Enabled
  • Wiki: Enabled
  • Pages: Disabled

README

LLM Hallucination Prevention Toolkit

A comprehensive toolkit with 47 verification tools for preventing and detecting hallucinations when using Large Language Models, specifically Claude.

Contents

  • docs/ - Documentation and guides
  • preventing_hallucinations.md - Complete guide on hallucination patterns and prevention
  • tools/ - Verification tools
  • beamer_validation/ - LaTeX Beamer slide validation (14 tools)
  • academic_book/ - Springer book chapter validation (11 tools)
  • generators/ - Content generation helpers (2 tools)
  • api_verification/ - Standalone API verification (1 tool)
  • hallucination_checks/ - General verification (18 tools)

Quick Start

# Install dependencies
pip install requests

# Run all tests
cd tools && python test_all_tools.py

# Run offline tests only (fast)
cd tools && python test_all_tools.py --offline

# Validate a Beamer presentation
python tools/beamer_validation/validate_beamer.py slides.tex

# Validate a Springer book chapter
python tools/academic_book/validate_book.py chapter.tex

# Verify Python imports exist
python tools/hallucination_checks/code/verify_imports.py script.py

# Check arXiv paper exists
python tools/hallucination_checks/api/verify_arxiv.py 2301.00001

Available Tools

Beamer Validation (14 tools)

  • Slide cross-references (check_slide_refs.py --book for multi-chapter)
  • Figure file existence
  • BibTeX citation matching
  • DOI verification
  • Notation consistency and registry building
  • URL reachability
  • LaTeX syntax checking (braces, environments)
  • Slide overflow detection
  • Chart dependency validation (.py/.pdf pairs)
  • Term definition ordering

Academic Book Validation (11 tools)

  • Environment matching (theorem/proof/definition)
  • Figure numbering sequences
  • Theorem/lemma numbering
  • Cross-reference validation
  • Notation consistency
  • Running example continuity
  • Index/glossary completeness
  • Section ordering
  • Bibliography validation
  • Table formatting (booktabs)

Generators (2 tools)

  • Missing chart stub generation
  • Glossary extraction from .tex files

Code Verification (4 tools)

  • Python import verification (PyPI)
  • npm package verification
  • Regex pattern testing
  • Code block execution

Data Verification (2 tools)

  • Mathematical calculation verification
  • Statistical claim verification

API Verification (7 tools)

  • DOI resolution
  • GitHub repos/users
  • arXiv papers
  • ORCID researcher IDs
  • Semantic Scholar papers
  • HuggingFace models/datasets
  • ISBN validation

Blockchain Verification (5 tools)

  • Blockchain genesis/fork dates
  • Ethereum EIP/ERC validation
  • Protocol status (active/defunct)
  • Crypto market data verification
  • Blockchain claim extraction

Fact Verification (1 tool)

  • Wikipedia article/claim checking

Documentation

See docs/preventing_hallucinations.md for: - Common hallucination patterns (58 documented) - Prevention strategies - Self-check checklists - Tool usage examples - CLAUDE.md integration

License

MIT