Back to directory

QuCo-RAG

The official implementation of a paper on retrieval-augmented generation that decides when to retrieve based on statistics from the model's pre-training corpus, rather than relying on the model's own, often miscalibrated, internal confidence signals.

QuCo-RAG

QuCo-RAG is dynamic retrieval-augmented generation code accompanying a paper accepted to ACL Findings 2026. Instead of triggering retrieval from a model's internal signals such as logits or entropy, it uses Infini-gram to query entity frequencies and co-occurrences in a large pre-training corpus, checking before generation for low-frequency entities that indicate long-tail knowledge gaps, and during generation for entity co-occurrence patterns that indicate a risk of hallucination.

The paper reports the method as model-agnostic, tested with OLMo, Llama, Qwen and GPT-family models, with exact-match gains of five to twelve points over prior baselines on multi-hop question-answering benchmarks. The repository includes data preparation steps for a Wikipedia dump and BM25 index, scripts to run the method and baselines, and evaluation code, along with a downloadable pre-computed cache to speed up experiments on the included datasets.

It is written in Python and released under the MIT license.

More in RAG

See all 540
  • ai·rete·rag

    ai-rete-rag.com

    A platform that pairs a Rete rule engine with retrieval-augmented generation, so deterministic rules decide an outcome and grounded retrieval explains the decision in plain language.

  • Xtriever

    github.com

    A hybrid retrieval engine for retrieval-augmented generation, written in Rust to run on-device on a phone or a laptop, combining lexical BM25 search, dense embedding search, reciprocal-rank fusion and cross-encoder re-ranking with no server.

  • FileFlux

    github.com

    A .NET library that turns PDF, DOCX, HWP and other documents into optimized chunks for RAG systems, through a five-stage pipeline built on high-performance Rust FFI readers.