Skip to content

Improve deterministic RAG evaluation scoring - #23

Merged
sakshammaurya merged 3 commits into
mainfrom
feat/deterministic-rag-evaluation
Nov 14, 2026
Merged

sakshammaurya merged 3 commits into
mainfrom
feat/deterministic-rag-evaluation

Conversation

@sakshammaurya

@sakshammaurya sakshammaurya commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add optional, validated expected_fact_variants for manually approved lexical alternatives
  • add optional, validated forbidden_phrases and make detected contradictions fail answer correctness
  • report the matched phrase and contradiction details while retaining existing metric fields
  • curate v2 variants and contradiction phrases, especially for the multi-page security case
  • validate canonical expected_facts and expose consistent ValueError configuration failures
  • document deterministic scorer behavior and concrete substring limitations

Validation

  • python -m pytest tests/test_evaluate.py tests/test_evaluation.py -q: 30 passed
  • python -m pytest -m "not integration" -q with CI-equivalent environment: 74 passed, 6 deselected
  • python -m ruff check app evals tests: passed
  • git diff --check: passed
  • v1 dataset loaded unchanged: 6 cases
  • v2 dataset loaded with optional metadata: 8 cases

Scope and limitations

  • no production API, prompt, model, retrieval, or inference behavior changed
  • no new dependency or inference call
  • historical benchmark artifacts were not overwritten
  • matching remains case-insensitive deterministic substring matching over manually curated phrases; it is not semantic entailment and will miss unlisted wording
  • expensive live Ollama benchmarks were intentionally not run

@sakshammaurya
sakshammaurya merged commit cce8961 into main Nov 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant