Current

Adaptive retrieval and compression

Benchmark first

Corpora: BEIR (SciFact, ArguAna, HotpotQA) · LoTTE · KILT

Protocol: Build from corpus documents only; issue the published test queries; preserve ranked IDs and component scores. Report nDCG@10, Recall@100, MRR, p50/p95 query latency, index bytes, and results with ACL pre-filtering. Ablate candidate generation, reranking, fusion, graph expansion, and packing independently.

Retrieval can be triggered, corrected, rescored, or compressed at explicit decision points instead of running as one opaque model call.

How it works

CRAG routing maps evaluator scores through two thresholds to use the corpus, augment it with external search, or replace it. FLARE finds low-confidence tokens in a predicted future sentence, removes those tokens, and uses the remaining text as a retrieval query before regeneration. Self-RAG combines generation, retrieval, relevance, support, and utility signals with visible weights. RECOMP selects scored sentences under a token budget, then restores their source order.

adaptive_retrieval.py · current
from mari_components.retrieval import (
    CompressionSentence, plan_active_retrieval, plan_corrective_retrieval,
    selective_compression,
)
from mari_components.verification import score_self_rag_candidate

correction = plan_corrective_retrieval(retrieval_evaluator(query, hits),
    lower_threshold=-0.8, upper_threshold=0.6)
active = plan_active_retrieval(future.tokens, future.probabilities, threshold=0.2)
reflection = score_self_rag_candidate(generation_probability=signals.generation,
    retrieve_probability=signals.retrieve, relevance_probability=signals.relevant,
    support_probability=signals.supported, utility=signals.utility)

compressed = selective_compression([
    CompressionSentence(sentence_id=s.id, text=s.text, token_count=count_tokens(s.text),
        relevance=compressor.score(query, s.text)) for s in sentences
], token_budget=600, relevance_threshold=0.4)