✂️ OpenProvence: An Open-Source Implementation of Efficient and Robust Context Pruning for Retrieval-Augmented Generation
⚡️ Lightweight Provence-style rerankers that keep the answers and drop the noise for retrieval-augmented generation.
OpenProvence follows the
Provence
approach to simultaneously prune irrelevant passages and produce a reranking score for question-answering workflows. Modern agents—DeepResearch loops, autonomous search pipelines, context engineering systems—tend to accumulate tangential paragraphs that inflate LLM token budgets. Drop an OpenProvence checkpoint in front of your LLM to extract only the passages that matter.
We provide open weights along with MIT-licensed training, inference, and dataset-construction tooling for reproducible workflows on commodity hardware.
Pruning power
– Drop ~99% of off-topic sentences while still compressing 80–90% of relevant text; MLDR evaluations confirm the answers stay intact.
Ship-ready checkpoints
– Four bilingual models (30M–310M parameters) on Hugging Face under MIT; the 30M xsmall runs comfortably on CPU and screams on GPU.
Reproducible training
– Follow the
training guide
to train every checkpoint on a single ≥16 GB NVIDIA GPU.
Dataset tooling
– Build OpenProvence-format corpora from your own data with the
dataset creation guide
.
Evaluation utilities
– CLI runners for dataset retention sweeps and MLDR long-document benchmarks keep regression tracking straightforward.
Documentation-first
– End-to-end reports, guides, and configs cover training, evaluation, and dataset creation.
For CUDA hosts, you can optionally install
flash-attention
for faster inference.
Python Example
from transformers import AutoModel
# Swap to the checkpoint you want to run
model_name = "hotchpotch/open-provence-reranker-xsmall-v1"
model = AutoModel.from_pretrained(
model_name,
trust_remote_code=True,
)
question:str = "What's your favorite Japanese food?"
context:str = """Work deadlines piled up today, and I kept rambling about budget spreadsheets to my roommate.Next spring I'm planning a trip to Japan so I can wander Kyoto's markets and taste every regional dish I find.Sushi is honestly my favourite—I want to grab a counter seat and let the chef serve endless nigiri until I'm smiling through soy sauce.Later I remembered to water the plants and pay the electricity bill before finally getting some sleep."""
result = model.process(
question=question,
context=context,
threshold=0.1,
show_progress=True,
)
print("Pruned context:\\n" + result["pruned_context"])
print("Reranking score:", round(result["reranking_score"], 4))
print("Compression rate:", round(result["compression_rate"], 2))
OpenProvence checkpoints expose a single
process
method that accepts raw question/context strings, applies sentence-level pruning, and returns the reranking score alongside compression metrics.
process()
accepts either a single query/context pair or batched inputs. Use
question: str
with
context: str
for one document,
question: str
with
context: List[str]
to prune multiple documents for the same query, or
question: List[str]
and
context: List[str]
to batch independent pairs. To feed pre-segmented sentences, pass
context: List[List[str]]
; each inner list is treated as already split and the built-in splitter is skipped.
⚠️
Shape matters
: A lone string paired with a list of contexts is interpreted as
one
query with many documents. Make sure
question
and
context
have matching shapes when batching to avoid truncated or duplicated outputs.
Key parameters you may want to tune:
question: str | Sequence[str]
– Query text. Provide a list to batch multiple questions; each item pairs with the corresponding entry in
context
.
context: str | Sequence[str] | Sequence[Sequence[str]]
– Contexts aligned to the query. Use a list for one document per query, or a list of lists to supply multiple documents (or pre-split sentences) for each query.
threshold: float
(default
0.1
)
– Pruning probability cutoff. Larger values discard more sentences;
0.05–0.5
works well across datasets.
batch_size: int
(default
32
)
– Number of contexts processed per inference batch. Increase for throughput, decrease if you run out of memory.
language: str | None
– Built-in splitter selection (
"auto"
,
"ja"
,
"en"
). The default behaves like
"auto"
and detects Japanese vs. English automatically.
reorder: bool
and
top_k: int | None
– When
reorder=True
, contexts are sorted by reranker score. Combine with
top_k
to keep only the top-ranked documents.
first_line_as_title: bool
/
always_select_title: bool
– Extract the first non-empty line as a title and optionally guarantee the title sentence survives pruning.
return_sentence_metrics: bool
/
return_sentence_texts: bool
– Include per-sentence probabilities and kept/removed sentence lists in the output for analysis workflows.
Evaluation Summary
Detailed metrics live in the
OpenProvence v1 Evaluation Report
. Highlights below show MLDR at each model's best Has Answer threshold, plus cross-dataset means at the standard 0.10 threshold:
MLDR with LLM eval · English (best Has Answer per model)
Threshold (p) lists the pruning probability that produced the highest Has Answer score for each checkpoint.
Model
Params
Threshold (p)
Has Answer (%)
Compression (pos)
Compression (neg)
none (original)
-
-
93.68
0.00%
0.00%
en-gte
149M
0.10
94.25
92.33%
99.91%
xsmall
30M
0.05
93.68
82.18%
99.18%
base
130M
0.05
93.68
90.05%
99.62%
large
310M
0.10
93.10
94.38%
99.90%
naver-provence
305M
0.10
93.10
94.00%
99.50%
Highlights:
en-gte surpasses the original (no compression) baseline in Has Answer score while achieving over 92% compression on positive samples. The large model (310M) achieves performance comparable to the naver/provence baseline (305M) with similar parameter counts. Smaller models (xsmall and base) match the original baseline's accuracy with substantial compression benefits, though with slightly lower compression rates compared to the larger models.
MLDR with LLM eval · Japanese (best Has Answer per model)
Threshold (p) again shows the probability cutoff that maximised Has Answer for each model.
Model
Params
Threshold (p)
Has Answer (%)
Compression (pos)
Compression (neg)
none (original)
-
-
77.71
0.00%
0.00%
xsmall
30M
0.05
81.93
76.46%
96.11%
base
130M
0.05
83.13
80.98%
97.89%
large
310M
0.10
79.52
87.89%
98.82%
Highlights:
All models significantly outperform the original baseline on Japanese MLDR. base delivers the top Has Answer score (+5.42 points over original) while retaining strong compression. Even large, which prioritizes maximum compression (nearly 88% positive, 99% negative), exceeds the original baseline by 1.81 points.
Dataset Benchmarks · English (threshold = 0.10)
Model
Mean F2
Mean Compression
Mean Inference Time (s)
en-gte
0.734
39.9%
0.55
xsmall
0.696
33.8%
0.34
base
0.737
39.9%
0.69
large
0.749
41.7%
1.04
Highlights:
en-gte is the top English reranker at this threshold, while large gives the best compression with a modest latency bump. xsmall remains the latency leader.
Dataset Benchmarks · Japanese (threshold = 0.10)
Model
Mean F2
Mean Compression
Mean Inference Time (s)
xsmall
0.727
53.2%
0.32
base
0.768
57.4%
1.06
large
0.783
59.1%
1.69
Highlights:
base and large deliver the strongest F2 on Japanese corpora, with large leading on compression. xsmall stays nimble for CPU-centric deployments.
Deduplicate near-identical negatives and follow the
dataset creation guide
for preprocessing tips.
Final Model Training
Distill existing reranker scores into a unified model that combines the cross-encoder reranker head with the context-pruning head. Reference
docs/train.md
for configuration details and baseline commands.
Sentence Transformers
provided invaluable reference implementations for cross-encoder training that informed our pipelines.
Citation
If you use OpenProvence in your research, please cite it:
@misc{yuichi-tateno-2025-open-provence,
url = {https://github.com/hotchpotch/open_provence},
title = {OpenProvence: An Open-Source Implementation of Efficient and Robust Context Pruning for Retrieval-Augmented Generation},
author = {Yuichi Tateno},
year = {2025}
}
open-provence-reranker-large-v1 huggingface.co is an AI model on huggingface.co that provides open-provence-reranker-large-v1's model effect (), which can be used instantly with this hotchpotch open-provence-reranker-large-v1 model. huggingface.co supports a free trial of the open-provence-reranker-large-v1 model, and also provides paid use of the open-provence-reranker-large-v1. Support call open-provence-reranker-large-v1 model through api, including Node.js, Python, http.
open-provence-reranker-large-v1 huggingface.co is an online trial and call api platform, which integrates open-provence-reranker-large-v1's modeling effects, including api services, and provides a free online trial of open-provence-reranker-large-v1, you can try open-provence-reranker-large-v1 online for free by clicking the link below.
hotchpotch open-provence-reranker-large-v1 online free url in huggingface.co:
open-provence-reranker-large-v1 is an open source model from GitHub that offers a free installation service, and any user can find open-provence-reranker-large-v1 on GitHub to install. At the same time, huggingface.co provides the effect of open-provence-reranker-large-v1 install, users can directly use open-provence-reranker-large-v1 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
open-provence-reranker-large-v1 install url in huggingface.co: