Repository navigation
Cap explanation length by bullets and sentences, not words - #55
Merged
Merged
Conversation
Output length is nearly all of the latency: a Sonnet 5.5 call takes about 0.4s plus 7.7ms per output token. The prompt asked for "under roughly 250 words" but explanations averaged 423 words on the hard corpus, so the limit was ignored. Replace it with a bullet and sentence cap, which Anthropic's latency guide recommends over word limits. On 2 runs of the full suite with the Opus 5 reviewer, mean latency fell 8.2s to 6.5s (p95 12.2s to 9.0s, max 17.7s to 9.9s) and output tokens 1002 to 791, with no detectable accuracy change (87.8% vs 88.3% correct over 188 reviews each). Recorded in CLAUDE.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Summary
One sentence changes in
app/prompt.yaml: the length instruction goes from "under roughly 250 words" to a hard cap on bullets and sentences. Output length is nearly all of the latency (a Sonnet 5.5 call takes about 0.4s plus 7.7ms per output token), and the word limit was being ignored: explanations averaged 423 words on the hard corpus.Anthropic's latency guide notes that word limits work worse than sentence or paragraph limits, which matches what we saw.
Eval
Exactly the text above (nothing else changed), 2 runs of the full suite, Opus 5 adaptive reviewer, against 2 runs of current
mainon the same corpora. This depends on the fixture and reviewer fixes in #54 (the runs used them), but the prompt change itself does not.The two corpora move in opposite directions, which is what reviewer noise looks like here (two prompts differing only in JSON formatting scored 81% and 90% on the same hard-case reviews). Adding a second run of the same prompt edit with compacted input gives 165/188 (87.8%) vs 166/188 (88.3%) for baseline, p=1.0. So: no detectable change in accuracy, a clear and low-noise latency gain. The errors on the original corpus are the same kind as baseline's and spread over different cases (an
imuloperand form, a clang peel count, theedge_undefined_001UB case that fails for both), not a pattern of dropped content.Before / after on
basic_loop_001(beginner, gcc -O2 loop)Before (333 words, 5.7s): headed sections "Calling convention", "Setup (before the loop)", "The loop (
.L3)", "Why this is efficient", then an-O0/-O3comparison.After (279 words, 5.3s):
Things to know
Testing
uv run pytest: 113 passed.uv run pre-commit run --all-files: clean.🤖 Generated with Claude Code