[Feature] First-class decision model abstraction for bounded metric judgments
Describe the Feature
I'd like to propose a first-class abstraction for bounded evaluation decisions in Ragas, separate from the generative LLM abstraction.
Some Ragas metrics contain evaluation steps that are fundamentally decision problems rather than text-generation problems. For example:
ContextPrecisionmakes a binary judgment about whether a retrieved context was useful.Faithfulnessfirst generates atomic statements, then makes binary support / entailment judgments for those statements.- Rubric-style metrics make bounded ordinal decisions.
Today, non-generative evaluators still need to fit through the LLM / structured-generation interface.
While reviewing #3027 and independently prototyping Jev-backed Context Precision, I wondered whether these cases would be cleaner with an abstraction along the lines of:
class DecisionModel:
async def binary(...): ...
async def choice(...): ...
async def score(...): ...Metrics could then explicitly use:
generative LLM -> text synthesis / decomposition
decision model -> bounded judgmentFor example, Faithfulness could use a generative model to extract atomic statements and a decision model to evaluate whether each statement is supported by the retrieved context.
This would not need to be Jev-specific. Jev would simply be one possible implementation of a generic bounded-decision interface.
Why is the feature important for you?
I built a small external proof of concept for ContextPrecision without modifying Ragas.
The prototype:
- passes
user_input,reference, and each retrieved context as structured state, - uses TypeSafe Jev to make the binary relevance/usefulness judgment,
- thresholds the returned probability into the same binary verdict expected by Context Precision,
- leaves the existing average-precision calculation unchanged.
I compared it against the existing Ragas LLM-based Context Precision on three small smoke-test cases:
Jev Ragas LLM
normal 0.8333 0.8333
ambiguous 1.0000 1.0000
adversarial 0.5000 0.5000This is only a small smoke test and is not intended to establish quality equivalence.
One interesting difference was that Jev also exposed the underlying probabilities:
normal [0.99, 0.03, 0.99]
ambiguous [0.56, 0.82, 0.04]
adversarial [0.05, 0.99]For the ambiguous example, both 0.56 and 0.82 become binary 1 verdicts, so the final Context Precision score is 1.0.
That made me wonder whether bounded decision outputs such as probability, confidence, or distribution should be preservable as first-class metadata for calibration, abstention, debugging, or tracing instead of being reduced immediately to a final categorical verdict.
Additional context
This came up while looking at #3027, which adds TypeSafe Jev support through the existing structured LLM abstraction.
I don't want to duplicate or compete with that work. The question here is broader: whether Ragas should have an explicit abstraction for non-generative bounded evaluators rather than requiring them to emulate an LLM interface.
A possible high-level shape could be:
Metric
├── generator / LLM
│ └── open-ended generation
│
└── decision model
├── binary
├── choice
└── scorePotential implementations could include:
- LLM-backed decision models
- Jev / System-One-style decision models
- classifiers
- other bounded evaluators
Before working on an implementation, I'd like to understand whether this separation fits the direction of the Ragas metrics API and how maintainers would prefer the abstraction boundary to look.
Related: #3027
Source: vibrantlabsai/ragas