Repository navigation
fix: ask for a justification instead of step-by-step reasoning in the CoT prompt - #282
Open
Leandro (Leandr0Duar7e) wants to merge 1 commit into
Open
Leandro (Leandr0Duar7e) wants to merge 1 commit into
Leandro (Leandr0Duar7e) wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Fixes #280
The default CoT prompt asks the judge to write out its reasoning step by step. Claude Haiku 5.5 refuses that under Anthropic's
reasoning_extractionsafeguard: 80 of 100 cases on the repo's own eval data failed. This PR asks for a justification that cites the evidence instead, and keeps the rest of the sentence as it was.Change
Two strings, the same in Python and JS:
COT_SUFFIX: "with your reasoning in a step-by-step manner" becomes "with a justification that cites the evidence,". The rest ("to be sure that your conclusion is correct. Avoid simply stating the correct answer at the outset. …") is unchanged.reasonsfield description inCOT_RESPONSE_SCHEMA: "Write out in a step by step manner your reasoning to be sure that your conclusion is correct." becomes "A justification for your conclusion that cites the evidence, to be sure that it is correct." The "Avoid simply stating…" sentence stays.The field name
reasons, its title and the parsing are unchanged, sometadata["rationale"]works as before.This rewrites the Python line that has the "step-by-step matter" typo, so the Python and JS prompts become identical, which is what #265 sets out to do. Happy to rebase if #265 merges first.
Results
The repo's CoQA cases from
evals/(60 Factuality and 40 ClosedQA, the setsautoevals.eval.tsuses), each scored withNumericDiffagainst the gold label, through the Braintrust gateway. "Exact" is the number of the 100 verdicts that match the gold label.Not covered
AnswerCorrectnessandContextRelevancyparts ofautoevals.eval.ts.ContextRelevancyand others) have their own "step by step" wording, which may hit the same refusal. Not tested and not changed here.braintrust eval --no-send-logs.content_filter) is separate; neither PR depends on the other.Validation
pnpm exec vitest run js/llm.test.ts: 11 passed.uv run --extra dev --extra scipy pytest py/autoevals/test_llm.py: 16 passed; the 5 failures need a real OpenAI or Braintrust key (Missing credentials) and fail the same way onmain.pre-commit runon the changed files (black, ruff, codespell) andprettier@3.3.2 --check.pnpm run build.🤖 Generated with Claude Code