open-standards/jouleclaw/jouleclaw-rs
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 92de7f86a0 jouleclaw-runtime: score_binary — one-forward-pass token scoring for reranking
Add score_binary / score_binary_tokens: prefill a prompt and return the softmax
probability of one token vs another as the next token — the mechanism of a
cross-encoder reranker (Qwen3-Reranker and friends format query+document into a
yes/no question and read P(yes)). One forward pass, no generation.

- Uses the lfm2-aware cached step builder (run_inplace_step_cached), so it scores
  hybrid conv+attention models too (the plain run_inplace_step assumes every block
  is attention and dies on a conv layer).
- score_binary_tokens takes pre-tokenized input so a reranker prompt's chat
  special tokens (<|im_start|>/<|im_end|>) can be encoded atomically — plain BPE
  would shatter them and the model would score garbage.
- Reads the last-position logits as the final vocab window, robust to whether the
  step returns per-position or last-only logits.

Verified with Qwen3-Reranker-0.6B (real_reranker.rs, ignored): relevant document
0.300 vs irrelevant 0.120. Note: the reranker template must omit the reasoning
<think> block for the 0.6B GGUF.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-14 09:46:23 -04:00
..
crates jouleclaw-runtime: score_binary — one-forward-pass token scoring for reranking 2026-07-14 09:46:23 -04:00
Cargo.lock WIP checkpoint: local safety commit (unpushed — Transaction-Science remote unreachable) 2026-07-02 11:53:09 -04:00
Cargo.toml Add jouleclaw-harness-econ: joules+$ per verified fix 2026-06-21 08:59:28 -04:00