cbx-rag-response-relevance-68M

Judges whether an answer addresses its question, from the question and answer alone. It returns one of three labels, with probabilities:

  • direct: the answer addresses the main thing the question asks. Correctness does not matter here: an answer with a wrong figure that still answers the question is direct.
  • partial: on topic, but it answers only part of what is asked, or answers vaguely.
  • irrelevant: it does not address the question: off-topic text, a related topic that does not answer it, or an evasive non-answer.

It is one of four CBX RAG evaluator models.

How to use

pip install -U huggingface_hub
hf download CobuildX-AI/cbx-rag-response-relevance-68M --revision v0.1 --local-dir cbx-rag-response-relevance-68M
cd cbx-rag-response-relevance-68M
pip install -r requirements.txt
python example.py
from cbx_rag_eval import ResponseRelevance

judge = ResponseRelevance(".")
judge(question, answer)                      # {"label": "direct", "probs": {...}}
judge.batch([(q1, a1), (q2, a2)])

It does not see the context, so it cannot tell whether a refusal ("the document does not say") was appropriate. In training, a refusal counted as direct only when the context really lacked the answer, so its refusal verdicts are guesses. Use the faithfulness and context models alongside it.

Speed (seconds per call, model loaded; GPU NVIDIA TITAN RTX fp16, CPU 8 threads fp32):

Input GPU CPU
one question + answer 0.02 s 0.04 s

The four CBX RAG evaluator models

Model Judges Output
cbx-rag-faithfulness-68M each answer sentence against the passages support score per sentence, answer score, hallucination flag
cbx-rag-response-relevance-68M the answer against the question direct / partial / irrelevant
cbx-rag-context-relevance-68M each context sentence against the question relevance per sentence, relevance fraction, context precision
cbx-rag-context-utilization-68M each context sentence against the question and answer use per sentence, utilization fraction

All four share the wrapper cbx_rag_eval.py. Every model is fine-tuned from jhu-clsp/ettin-encoder-68m (68M parameters). Current version: v0.1 (use --revision v0.1 to pin it).

Sentences and profiles

  • Sentences: the models judge sentences, and they were trained on RAGBench's sentence splits. The wrapper splits raw text by profile (split_sentences; chosen on validation):

    • contract: line breaks, then NLTK punkt;
    • financial: blank lines, then pysbd.

    This model takes the whole answer, so no splitting is involved. For the best accuracy, pass your own sentences (a list of strings per passage, and answer_sentences= for the answer); the splitter is then skipped.

  • Profiles: the settings were fixed on two kinds of validation data, so every call takes a profile.

    • "contract": one document, such as a contract (CUAD-like).
    • "financial": several short passages with numbers and tables (FinQA-like). Faithfulness adds a numeric check here.
    • "auto" (default): "contract" for a single passage, "financial" for two or more.

    For other kinds of text, choose the profile whose shape is closest and check the results on your own data.

Training data and labels

  • Source: the CUAD (contracts) and FinQA (financial reports) subsets of RAGBench (CC BY 4.0). Its answers were written by claude-3-haiku and gpt-3.5-turbo; its labels came from gpt-4-turbo.
    • Train: 1,530 CUAD and 12,502 FinQA answers.
    • Test: 510 CUAD (102 contracts) and 2,294 FinQA answers.
  • Labels were reviewed by LLMs, not humans:
    • Faithfulness: majority vote of RAGBench and two LLM reviewers: Claude Haiku and gpt-5.4-mini, or two Haiku passes for CUAD train.
    • CUAD context relevance / utilization: majority vote of RAGBench and two Claude Haiku passes.
    • FinQA context labels: kept as RAGBench made them.
    • Audits: samples were checked blind by Claude Opus and Claude Sonnet.
  • Response relevance: uses its own set (rr-v0.1). Claude Haiku wrote varied answers to the RAGBench questions and labelled them.
  • Test sets: the RAGBench test splits, with the same label views.
  • Baselines: RAGAS, GPT-3.5 and TruLens scores are the ones stored in RAGBench, not re-runs.
  • Rule: every threshold and setting was fixed on validation.

Licence

Apache-2.0 for the model weights and code.

Data attribution:

  • RAGBench (Friel et al., 2024), CC BY 4.0;
  • CUAD (The Atticus Project), CC BY 4.0;
  • FinQA (Chen et al., 2021), MIT.

Labels were produced with Claude (Anthropic) and gpt-5.4-mini (OpenAI) models.

Disclaimer: the scores are statistical estimates for evaluating RAG systems. They are not a guarantee that an answer is correct, complete or safe. Do not use them as the sole basis for legal, financial or other consequential decisions.

Results (rr-v0.1 test set)

Test set Macro-F1 [95% CI] Accuracy F1 direct / partial / irrelevant
CUAD questions 0.767 [0.74, 0.79] 0.867 0.90 / 0.49 / 0.91
FinQA questions 0.850 [0.84, 0.86] 0.881 0.94 / 0.71 / 0.91

The test set has 4,200 question-answer pairs. Most answers were written and labelled by Claude Haiku, in the same style as training, so these numbers are optimistic. Expect lower scores on answers from other systems.

Limitations

  • "Partial" is the weak class, especially on contract questions (F1 0.49).
  • No context: it judges relevance only, not correctness or support.
  • No external baseline: none was available to compare against.
  • Coverage: contract and financial-report questions in English; LLM-made labels.
Downloads last month
22
Safetensors
Model size
68.1M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for CobuildX-AI/cbx-rag-response-relevance-68M

Finetuned
(47)
this model

Collection including CobuildX-AI/cbx-rag-response-relevance-68M