Skip to content

feat: add CBDR strategy, confidence-gain reranking, and LM Studio pipeline - #9

Merged
pko89403 merged 19 commits into
mainfrom
codex/confidence-gain-reranking
Jul 23, 2026
Merged

feat: add CBDR strategy, confidence-gain reranking, and LM Studio pipeline#9
pko89403 merged 19 commits into
mainfrom
codex/confidence-gain-reranking

Conversation

@pko89403

Copy link
Copy Markdown
Owner

Summary

  • Adds CBDRStrategy (confidence-gain reranking: Conf(Q+D) - Conf(Q) via trained Conf(Q)/Conf(Q+C) scorers) and wires it into scripts/compare_reranking.py as an opt-in --algorithm cbdr.
  • Adds a local LM Studio confidence-generation/training pipeline (LMStudioModelProvider, ProviderAnswerGenerator, dataset generation/report CLIs) so Conf(Q)/Conf(Q+C) scorer artifacts can be produced without Azure.
  • Fixes CBDRStrategy reloading its BERT encoder + LightGBM scorer on every single benchmark query (functools.cache); this was going to take ~4 hours of pure reload overhead for the 361-query AskUbuntu benchmark before the fix.
  • Runs the full 361-query AskUbuntu BM25-top20 benchmark for cbdr and records it in the README Benchmarking table with an explicit out-of-domain disclosure (scorers trained on TriviaQA, evaluated on AskUbuntu).

Test plan

  • uv run pytest -q (640 passed)
  • uv run ruff check .
  • uv run mypy src/
  • Live --algorithm cbdr run against the committed AskUbuntu BM25 top-20 candidates (361/361 valid, invalid_rate 0.000); evidence: benchmark-results/askubuntu-bm25-top20-cbdr-live.json

🤖 Generated with Claude Code

pko89403 and others added 19 commits June 4, 2026 15:52
…DR estimators

Adds the local LM Studio confidence-generation/training pipeline (provider,
answer generator, dataset/report CLIs) and fixes CBDRStrategy reloading its
BERT+LightGBM estimators on every benchmark query by caching them per
artifact path. Runs the full 361-query AskUbuntu CBDR benchmark and records
the results in README with an out-of-domain disclosure.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…-reranking

; Conflicts:
;	docs/wiki/02_architecture.md
;	src/ranksmith/confidence_training/features.py
;	src/ranksmith/strategies/__init__.py
;	tests/test_confidence_scorer.py
…-resolved

The merge commit only staged the files that had textual conflicts. Several
files auto-merged cleanly but still referenced pre-rename module paths
(ranksmith.confidence._encoder, confidence_training._dataset, strategies
_common/_confidence_gain, integrations._answer_generator, etc.) or relied on
ModelRequest.response_format/temperature, which origin/main's cleanup had
dropped and this branch's LM Studio/answer-generator code still needs. This
commit finishes that reconciliation; it was verified locally before the
merge commit but not staged with it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@pko89403
pko89403 merged commit 5f736f1 into main Jul 23, 2026
5 checks passed
@pko89403
pko89403 deleted the codex/confidence-gain-reranking branch July 23, 2026 10:19
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