A Python tool that checks .bib file entries against academic databases (CrossRef and Semantic Scholar) to flag potentially fabricated or hallucinated references — a common problem when using LLMs to generate bibliographies.
For each entry in a BibTeX file, the tool:
- Queries CrossRef by title (and by DOI if present)
- Queries Semantic Scholar by title
- Scores each candidate match using a weighted composite:
- Title similarity: 40%
- Author overlap: 25%
- Year match: 20%
- Venue similarity: 15%
- Classifies the entry into one of:
VERIFIED(score >= 0.80) — likely a real paperPLAUSIBLE(0.50 - 0.80) — probably real but metadata may differSUSPICIOUS(0.30 - 0.50) — needs manual reviewLIKELY_HALLUCINATED(< 0.30) — probably fabricatedNOT_FOUND— no results from either APISKIPPED— entry types like@misc,@phdthesis,@techreportthat are hard to verify automatically
pip install bibtexparser requests# Check all entries in a .bib file
python verify_bib.py main.bib
# Check only the first N entries
python verify_bib.py main.bib --top 50
# Resume a previously interrupted run (uses cached results)
python verify_bib.py main.bib --resume
# Regenerate the report from cached results without re-querying APIs
python verify_bib.py main.bib --report-only
# Provide your email for CrossRef's polite pool (faster access)
python verify_bib.py main.bib --email you@example.com| File | Description |
|---|---|
verify_results.json |
Full machine-readable results with match details |
verify_report.txt |
Human-readable summary sorted by suspicion level |
verify_cache.json |
Incremental cache for resuming interrupted runs |
python test_verify_bib.pyUnit tests cover the offline logic: text normalization, title similarity, author parsing, author overlap, and scoring functions.
- NOT_FOUND does not mean hallucinated. Very recent papers, niche venues, non-English publications, or items not yet indexed may score low despite being real.
- VERIFIED does not mean correct metadata. A real paper may have wrong year, volume, or pages in your
.bibfile. - Books are harder to verify than journal articles (CrossRef coverage varies).
@misc,@phdthesis, and@techreportentries are skipped — verify those manually.- Semantic Scholar has stricter rate limits (1 second delay between requests); you may see 429 errors under heavy use.
- Always manually confirm any entry flagged as SUSPICIOUS or worse before removing it from your bibliography.