feat(evaluate): Sprint 16 β evaluator reliability + GGUF backend (v1.6.0)#8
Merged
Merged
Conversation
β¦6.0) Addresses arXiv 2603.06594: single LLM judges degrade to near-random accuracy on adversarial samples. Adds a hybrid scoring layer so measurement is defensible. - EvaluatorMode (RULE | LLM | HYBRID) + RuleScorer (zero deps, compiled regex) - HybridScorer: ensemble of RuleScorer + optional JudgeBase; logs disagreements when |rule β llm| > agreement_threshold (default 0.2) - ScoredResult: frozen dataclass with score, rule_score, llm_score, agreement, flagged - GGUFEvaluator: llama-cpp-python backend (optional dep); raises ImportError cleanly when absent; falls back to RuleScorer on parse errors - RobustnessEvaluator: evaluator_mode + llm_judge optional params (backward compat) - CLI: python -m toki evaluate --evaluator rule|hybrid|gguf://path - pyproject.toml: [gguf] optional dep (llama-cpp-python>=0.2.0), version 1.6.0 - 53 new tests (27 hybrid_scorer + 15 gguf + 11 evaluator_extended + 5 CLI) - 600 total tests passing (547 β 600) https://claude.ai/code/session_01XCHiLCiVeL6WXQdsAcQTbx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
$(cat <<'EOF'
Summary
RuleScorer+HybridScoreras a defensible measurement baseline that is not susceptible to judge distribution shift.GGUFEvaluatorwrapsllama-cpp-pythonfor CPU-only inference on quantized models (Phi-3, Qwen2.5 Q4_K_M etc.) β no GPU required in CI. RaisesImportErrorcleanly when dep is absent.python -m toki evaluate --evaluator rule|hybrid|gguf://path/to/model.ggufDeliverables
EvaluatorModeRULE/LLM/HYBRIDRuleScorerScoredResultscore,rule_score,llm_score,agreement,flaggedHybridScorerJudgeBase; logs disagreementsGGUFEvaluatorRobustnessEvaluatorevaluator_mode+llm_judgeparams (backward compat)Test plan
python/tests/test_hybrid_scorer.pyβ 27 tests: EvaluatorMode, RuleScorer patterns, HybridScorer RULE/LLM/HYBRID modes, ScoredResult fields, disagreement flaggingpython/tests/test_gguf_evaluator.pyβ 15 tests: import guard, mockedllama_cpp.Llama, score clamping, parse-error fallback to RuleScorerpython/tests/test_evaluator_extended.pyβ 11 tests: RobustnessEvaluator backward compat, RULE mode, HYBRID mode with MockJudgepython/tests/test_main.pyadditions β 5 CLI tests:--evaluator rule,--evaluator hybrid, score-in-range, default=rule, GGUF ImportErrorcargo testgreen,cargo clippy -- -D warningscleanUnblocks
P3-3 (SaLoRA/SPLoRA safety-subspace LoRA) and P3-1 (dual-agent red-team loop) both require trustworthy measurement before their ASR numbers are meaningful. This sprint provides it.
https://claude.ai/code/session_01XCHiLCiVeL6WXQdsAcQTbx
EOF
)
Generated by Claude Code