Skip to content

Give the judge model room to think, and ask again when it runs out - #283

Merged
mt0rm0 merged 1 commit into
devfrom
279-judge-token-budget
Oct 16, 2026
Merged

mt0rm0 merged 1 commit into
devfrom
279-judge-token-budget

Conversation

@mt0rm0

@mt0rm0 mt0rm0 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Closes #279

The judge model (qwen3-8-27b) is a reasoning model: it thinks before it answers, and the thinking counts against max_tokens. Measured over 26 identical variant requests, it used 326 to 1851 tokens (typically about 800) for an answer under 100 tokens, and once ran past the 2000 cap while still weighing a single word, returning nothing.

  • JUDGE_MAX_TOKENS is now 6000. Unused budget costs nothing.
  • A call that still returns empty content with finish_reason="length" is asked once more with twice the budget. Not the same budget: the verdicts run at temperature 0, where the same budget would most likely cut it off at the same point. An empty reply for any other reason is not retried.
  • If it runs out twice, the call still raises JudgeUnavailable, so an empty reply never becomes a verdict.
  • All three judge calls (the consistency check, the refusal check 4.4, variant proposals) go through one new helper, ask_judge, instead of three copies of the same call-and-check code.

🤖 Generated with Claude Code

)

qwen3 thinks before it answers and the thinking counts against max_tokens.
Over 26 identical variant requests it used 326 to 1851 tokens and once ran
past 2000, returning nothing. The budget is now 6000, and a call that still
runs out is asked once more with twice that, not the same budget: the
verdicts run at temperature 0, where it would most likely be cut off again.

All three judge calls (consistency, refusal, variant proposals) now go
through one helper, ask_judge, so budget and retry are the same for each.
@mt0rm0

mt0rm0 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Other infos

  • Evaluation: 408 passed (4 new for the budget and retry). mypy src clean.
  • Against the real judge model: 20 of 20 variant requests for the question that failed before succeeded. With JUDGE_* loaded from backend/.env, the live judge integration tests that were skipped earlier pass too (9 passed, 1 skipped by design).
  • The client timeout went from 180 s to 300 s, since a retried call may think for up to 12000 tokens.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4d2764f5-e97c-4dce-b9f7-801a247a09d4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mt0rm0
mt0rm0 merged commit 4521fb3 into dev Oct 16, 2026
5 checks passed
@mt0rm0
mt0rm0 deleted the 279-judge-token-budget branch October 16, 2026 12:48
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