Skip to content

Calibrate semantic judge against human labels - #27

Merged
sakshammaurya merged 1 commit into
mainfrom
eval/human-judge-calibration
Nov 19, 2026
Merged

sakshammaurya merged 1 commit into
mainfrom
eval/human-judge-calibration

Conversation

@sakshammaurya

Copy link
Copy Markdown
Owner

Summary

  • add an explicit native Ollama semantic-judge provider while preserving the existing OpenAI-compatible default
  • send think: false for short structured evaluation instead of spending the output budget on hidden reasoning
  • constrain native output with a strict, case-specific JSON Schema, including null applicability for abstentions and missing evidence
  • commit the complete eight-case judge and human-calibration reports
  • document measured agreement, disagreements, latency, token usage, and small-sample limitations

Why this was needed

The original OpenAI-compatible qwen3:4b run reached the 512-token ceiling for all 8 cases because the installed model generated thinking tokens before JSON. It took 1,481.134 seconds and produced zero comparable judgments. Raising the ceiling to 1,024 was stopped after about 25 minutes because it projected toward an hour without guaranteeing valid output.

The native Ollama provider makes thinking control explicit. A strict static schema improved valid output from 4/8 to 7/8; specializing score applicability per case produced 8/8 valid judgments without weakening validation.

Measured judge run

  • source: evals/v2/results/isolated-validation-2026-10-29.json
  • model: qwen3:4b
  • provider: native Ollama
  • thinking: disabled
  • max output tokens: 512
  • judged: 8/8
  • failures: 0
  • total judge latency: 308.418 seconds
  • prompt tokens: 3,394
  • completion tokens: 976
  • semantic pass rate: 100%

Human calibration

  • faithfulness exact agreement: 100% (6 applicable cases)
  • answer-relevance exact agreement: 100% (8 cases)
  • context-relevance exact agreement: 50% (6 applicable cases)
  • context-relevance within-one agreement: 83.33%
  • context-relevance MAE: 0.6667
  • pass/fail agreement: 75%
  • unsupported-claim agreement: 100%

All three score disagreements concern context relevance. The judge rated noisy evidence more generously than the human reviewer; commuter-stipend differed by two points. These eight synthetic cases validate the workflow but do not establish general judge reliability.

Validation

  • python -m pytest tests/test_semantic_evaluation.py tests/test_semantic_calibration.py -q: 35 passed
  • python -m pytest -m "not integration" -q: 127 passed, 6 deselected
  • python -m ruff check .: passed
  • git diff --check: passed

Scope

  • no production API, ingestion, embedding, retrieval, answer-generation, or deterministic-evaluation behavior changed
  • OpenAI-compatible semantic judging remains the default
  • native Ollama behavior is opt-in with --provider ollama
  • no claim that one human reviewer or eight synthetic cases are ground truth

@sakshammaurya
sakshammaurya merged commit 859eeda into main Nov 19, 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