Skip to content
Projetos

Sobre

A tool to detect potentially hallucinated or fabricated references in academic PDF papers.

Aprendizado e educação

Como estes números são medidos

Crescimento medido de estrelas

em 24 h
+1
em 7 dias
+6
em 15 dias
+9
em 1 mês
Coletando histórico

Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.

README.md

Original

Hallucinated Reference Detector

Detect fake citations in academic papers. This tool extracts references from PDFs and validates them against academic databases. If a reference doesn't exist anywhere, it's probably hallucinated by an LLM.

Created by Gianluca Stringhini with Claude Code and ChatGPT.


[!IMPORTANT] This tool surfaces suspicion, not proof. It flags references that it could not find (or whose authors did not match) in the bibliographic databases it checks (CrossRef, arXiv, DBLP, OpenAlex, and others). A "Not Found" or "Author Mismatch" result does not mean the reference is fake or that it does not exist elsewhere. Databases are incomplete: technical reports, books, workshop papers, brand-new work, non-English venues, and software/websites are often missing or indexed with partial metadata, and title/author matching is fuzzy and imperfect. Every flagged reference is a lead to check, not a verdict.

Confirm every detection by hand before drawing conclusions. Verify the reference yourself (search the Web, the publisher, Google Scholar, or the authors' own pages) before treating a flag as a problem.


Why this exists: Academia is under attack from AI-generated slop—fake citations, fabricated papers, LLM-written reviews. We observed several papers with hallucinated citations submitted to ACSAC 2025, but the November 2025 OpenReview incident exposed how deep the rot goes: 21% of ICLR reviews were likely AI-generated, 199 papers were likely completely written by an AI. In March 2026, ICML caught 506 reviewers using LLMs in violation of review policies and desk-rejected 497 papers. This tool is one line of defense. It's not perfect—that's the point. We use AI to fight misuse of AI, openly and honestly. Read the full manifesto.

(See those em dashes? They're a known tell of AI-generated text. This README was written with Claude. We're not hiding it—we're proving a point. Read why this matters, even if you're an AI absolutist.)

Rust TUI (Recommended for Most Scenarios)

The TUI includes a full terminal UI for batch-processing PDFs and archives interactively, with real-time progress, sorting/filtering, result export, and persistent configuration.

You can install it with:

curl -sSf https://hallucinator.science/install.sh | sh

demo

See hallucinator-rs/README.md for full documentation.


Rust CLI

When the TUI is not suitable, there's a pure CLI available too:

curl -sSf https://hallucinator.science/install-cli.sh | sh

Python Bindings (Early Release)

Pre-compiled wheels are available for Python 3.12 on Linux (x86_64), macOS (x86_64 + Apple Silicon), and Windows (x86_64). These provide Rust-native performance from Python — no Rust toolchain required.

pip install hallucinator
from hallucinator import PdfExtractor, Validator, ValidatorConfig

# Extract references from a PDF
ext = PdfExtractor()
result = ext.extract("paper.pdf")

# Validate against academic databases
config = ValidatorConfig()
validator = Validator(config)
results = validator.check(result.references)

for r in results:
    print(f"[{r.status}] {r.title}")

See hallucinator-rs/PYTHON_BINDINGS.md for full API docs, configuration options, progress callbacks, and examples.


What It Checks

The tool queries these databases simultaneously:

Database What it covers
CrossRef DOIs, journal articles, conference papers
arXiv Preprints (CS, physics, math, etc.) — online or offline
DBLP Computer science bibliography (online API currently broken — see below; offline strongly recommended)
Semantic Scholar Aggregates Academia.edu, SSRN, PubMed, and more
ACL Anthology Computational linguistics papers (online or offline)
Europe PMC Life science literature (42M+ abstracts, mirrors PubMed/PMC)
PubMed Biomedical literature via NCBI E-utilities
DOI Resolver Validates references by resolving DOIs via doi.org
OpenAlex 250M+ works (online with free API key, or offline)
Open Library Books, technical reports, and non-academic publications
GovInfo US federal laws, regulations, court opinions (optional, needs free API key)
IACR ePrint Cryptology ePrint Archive (offline-only — no public search API)
URL Checker Liveness check for non-academic URLs like GitHub repos (fallback)
Web Search SearxNG metasearch fallback for unindexed papers (optional, see below)

OpenReview - Disabled. API unreachable after the Nov 2025 incident.

[!WARNING] DBLP's online API is currently unusable. dblp.org has deployed Anubis bot-protection, which returns a JavaScript challenge page (with an HTTP 200 status) instead of real data to any non-browser client — there is no simple fix on our end for this, since it requires solving a proof-of-work challenge in a browser. Every online DBLP query will fail right now. Use offline DBLP (see below) — it talks to a local SQLite database instead of dblp.org, so it's unaffected.

We strongly recommend downloading the DBLP, ACL Anthology, and arXiv databases for local querying. DBLP's online API is currently broken entirely (see above), and arXiv rate-limits online requests aggressively (a 3-second gap between requests, so 50 references can take 2+ minutes). See the "Offline Databases" section below.


Getting API Keys

API keys are optional but recommended. They improve coverage and reduce rate limiting.

OpenAlex (free, instant)

  1. Go to https://openalex.org/settings/api
  2. Sign in with your email
  3. Copy your API key
  4. Use with --openalex-key=YOUR_KEY, set the OPENALEX_KEY env var, or add openalex_key = "YOUR_KEY" to your config file (see hallucinator-rs/README.md)

Semantic Scholar (free, requires approval)

  1. Go to https://www.semanticscholar.org/product/api
  2. Click "Request API Key"
  3. Fill out the form (academic use)
  4. Wait for email (usually same day)

GovInfo (free, instant)

For papers citing US federal laws, regulations, or court opinions:

  1. Go to https://api.data.gov/signup/
  2. Enter your name and email
  3. You'll receive an API key instantly (no approval process)
  4. Use with --govinfo-key=YOUR_KEY or set GOVINFO_KEY env var

GovInfo covers Public Laws, Congressional Bills, Code of Federal Regulations (CFR), Federal Register, and US Court Opinions.


Offline Databases

Five databases can be downloaded for local querying. Offline databases are faster than online APIs and avoid rate limits.

# Build all five (run once, refresh periodically)
hallucinator-cli update-dblp dblp.db
hallucinator-cli update-acl acl.db
hallucinator-cli update-arxiv arxiv.db
hallucinator-cli update-iacr-eprint iacr.db
hallucinator-cli update-openalex openalex.idx

# Use them
hallucinator-cli check \
    --dblp-offline=dblp.db --acl-offline=acl.db \
    --arxiv-offline=arxiv.db --iacr-eprint-offline=iacr.db \
    --openalex-offline=openalex.idx \
    paper.pdf

If you place the databases in ~/.local/share/hallucinator/, they're detected automatically—no flags needed.

DBLP (required right now — see warning above)

DBLP's online API is currently broken entirely by bot-protection, and even once that's resolved, it rate-limits requests aggressively. Download their full database and query it locally instead:

hallucinator-cli update-dblp dblp.db

This downloads the latest DBLP XML dump (a large compressed download) and builds a SQLite database with several million publications. Takes 20-30 minutes.

If the live download itself gets blocked too — dblp.org's bot-protection can intercept the bulk dump, not just the search API, though hallucinator-cli/hallucinator-tui now detect this (a download that parses to a suspiciously small number of records fails loudly with an error, instead of silently building an empty database) — download https://dblp.uni-trier.de/xml/dblp.xml.gz manually in a real browser, then point update-dblp at the saved file:

hallucinator-cli update-dblp dblp.db --from-file /path/to/dblp.xml.gz
# or: hallucinator-tui update-dblp dblp.db --from-file /path/to/dblp.xml.gz

arXiv (strongly recommended)

arXiv enforces a 3-second gap between API requests, so on a paper with 50 references the online backend alone can take 2+ minutes. The offline DB ingests the weekly Kaggle Cornell-University/arxiv snapshot (~4 GB, ~2.5M records) into a local SQLite + FTS5 index.

hallucinator-cli update-arxiv arxiv.db

First-time setup: Kaggle requires authentication to download datasets. You'll need a free Kaggle account and an API token:

  1. Sign up at https://www.kaggle.com and go to https://www.kaggle.com/settings
  2. In the API section, create a new token. Kaggle shows it once, as a single KGAT_… string — copy it before closing the dialog
  3. Hand it to Hallucinator either way — export it, or save it to the file the Kaggle client reads automatically:
    export KAGGLE_API_TOKEN=KGAT_your_token_here
    
    mkdir -p ~/.kaggle && printf '%s' 'KGAT_your_token_here' > ~/.kaggle/access_token && chmod 600 ~/.kaggle/access_token
    

Already set up with the older credentials? They still work — ~/.kaggle/kaggle.json and KAGGLE_USERNAME + KAGGLE_KEY are both still accepted, and Kaggle still issues them under Legacy API Credentials. Tokens win when both are present, so if a token is rejected, clear it to fall back. update-arxiv prints which credential it picked up before the download starts.

If a download comes back 403, open https://www.kaggle.com/datasets/Cornell-University/arxiv once in a browser — some Kaggle datasets gate downloads behind accepting their terms. The arXiv snapshot currently doesn't, so a 403 is more likely a rejected credential.

The full build takes ~10-20 minutes (download + ingest). If you already have the Kaggle zip or extracted JSON, point at it directly and skip the download:

hallucinator-cli update-arxiv arxiv.db --dump /path/to/arxiv-metadata-oai-snapshot.json

When --arxiv-offline is configured, the online arXiv backend is replaced entirely (same pattern as DBLP and ACL). The Kaggle snapshot carries only each paper's latest-version title — the rare retitled-paper edge case (reference cites an old title, paper was renamed in a later version) is not caught. Clear the offline DB config and re-run if you need that coverage.

IACR ePrint (cryptology papers)

The IACR Cryptology ePrint Archive has no public search API, so this backend is offline-only — without a local index it never registers. Build the index once (~25–30k records, takes a few minutes) and refresh periodically; subsequent runs are incremental and only fetch records newer than the stored last_harvest timestamp.

hallucinator-cli update-iacr-eprint iacr.db

# CLI
hallucinator-cli check --iacr-eprint-offline=iacr.db paper.pdf

# TUI — same flag, or set `iacr_eprint_offline_path` in the config file
hallucinator-tui --iacr-eprint-offline=iacr.db paper.pdf

Auto-detected at iacr.db in the current directory or ~/.local/share/hallucinator/iacr.db. IACR's metadata is published under CC0.

ACL Anthology

Downloads the full ACL Anthology and builds a local SQLite database:

hallucinator-cli update-acl acl.db

OpenAlex

Warning: The full OpenAlex snapshot is very large. OpenAlex records are regularly updated with citation counts, metadata corrections, and new works—so a local snapshot goes stale quickly. For most users, the online API with a free API key (see above) is the better choice. Only build a local index if you have a specific need for fully offline operation or are hitting rate limits you can't solve with an API key.

# Full build (large download — expect many gigabytes and hours of indexing)
hallucinator-cli update-openalex openalex.idx

# Only works published 2020 or later (smaller, faster)
hallucinator-cli update-openalex openalex.idx --min-year 2020

# Incremental update — only download partitions newer than a date
hallucinator-cli update-openalex openalex.idx --since 2026-01-01

The local index uses Tantivy (full-text search). Use --min-year to limit scope and --since for incremental refreshes.

Keeping databases fresh

All offline databases are snapshots. If any database is more than 30 days old, the tool shows a staleness warning with instructions to refresh. Re-run the corresponding update-* command to rebuild.

See hallucinator-rs/README.md for config file options, auto-detection paths, and more details.


Web Search Fallback (SearxNG)

For papers not found in any academic database, you can enable a web search fallback using SearxNG, a self-hosted metasearch engine. This is useful for technical reports, workshop papers, or other publications not indexed in traditional academic databases.

Important: Web search matches are weaker than database matches. They only confirm that a paper with a matching title exists somewhere on the web—they cannot verify authors. Use web matches as a hint for manual verification, not as definitive proof. The tool will display these as "Web Search" matches to distinguish them from verified database matches.

Setup (Rust TUI/CLI only)

cd hallucinator-rs/docker/searxng
docker compose up -d

This starts a SearxNG instance on http://localhost:8080.

Usage

# CLI
hallucinator-cli check --searxng paper.pdf

# TUI - configure in the Config screen (press ,)
# Set SearxNG URL to http://localhost:8080

Custom URL

# Use a different SearxNG instance
SEARXNG_URL=http://your-searxng:8080 hallucinator-cli check --searxng paper.pdf

How it works

  1. References are checked against all academic databases first
  2. If a reference is not found in any database, SearxNG is queried
  3. SearxNG searches Google, Bing, DuckDuckGo, and Google Scholar
  4. If a matching title is found, the reference is marked as "Verified (Web Search)"
  5. No author verification is performed—only title matching

Understanding Results

Verified

The reference was found in at least one database with matching authors. It exists.

Note on Web Search matches: If a reference is marked as "Verified (Web Search)", this is a weaker match—the title was found on the web but authors could not be verified. These should be manually confirmed.

Author Mismatch

The title was found but with different authors. Could be:

  • A citation error in the paper
  • Authors listed differently in the database
  • A real problem worth investigating

Not Found (Potential Hallucination)

The reference wasn't found in any database. This could mean:

  • Hallucinated - LLM made it up
  • Too new - Not indexed yet
  • Not indexed - Technical reports, books, websites
  • Database timeout - Check if timeouts were reported

The tool tells you which databases timed out so you can assess confidence.

Retracted Papers

The tool automatically checks if verified papers have been retracted using CrossRef's retraction metadata (which includes the Retraction Watch database). Retracted papers are flagged with a warning and shown in a dedicated "Retracted Papers" section in the web interface.

Retraction checks work via:

  • DOI lookup - If the reference has a DOI, checks CrossRef for retraction notices
  • Title search - Falls back to title-based search if no DOI is available

This helps identify cases where a paper cites work that has since been withdrawn due to errors, fraud, or other issues.


What Gets Skipped

Some references are intentionally not checked:

  • URLs - Links to GitHub, docs, websites (not in academic DBs)
  • Short titles - Less than 5 words (too generic, false matches)

The output tells you how many were skipped and why.


Limitations

We're not perfect. Neither is anyone else. Here's what can go wrong:

  1. Database coverage - Some legitimate papers aren't indexed anywhere
  2. Very recent papers - Takes time to appear in databases
  3. Books and technical reports - Often not in these databases
  4. PDF extraction - Bad PDF formatting can mangle references
  5. Rate limits - Heavy use may hit API limits (use API keys)

If something is flagged as "not found," verify manually with Google Scholar before accusing anyone of anything.


How It Works

  1. Extract text from PDF (MuPDF)
  2. Find references section (looks for "References" or "Bibliography")
  3. Parse each reference - extracts title and authors
  4. Query all databases in parallel - 4 references at a time, all DBs simultaneously
  5. Early exit - stops querying once a match is found
  6. Retry failed queries - timeouts get a second chance at the end
  7. Report results - verified, mismatched, or not found

Contributing

The repo ships a small pre-commit hook that runs cargo fmt --all --check on any commit that touches Rust sources. Enable it once per clone with:

git config core.hooksPath .githooks

The hook exits quickly on non-Rust commits (docs, config, Python legacy). To bypass it for a single commit — e.g. a work-in-progress stash commit — use git commit --no-verify. CI runs the same check, plus clippy and the workspace test suite.


License

GNU Affero General Public License v3.0 (AGPL-3.0). See LICENSE.

If you use this to catch fake papers, we'd love to hear about it.

Explore projetos relacionados

Carregando…