Repository navigation
fix: Python CoT suffix says "step-by-step manner", as in JS - #265
Open
Abhay Mettu (abhaymettu) wants to merge 1 commit into
Open
Abhay Mettu (abhaymettu) wants to merge 1 commit into
Abhay Mettu (abhaymettu) wants to merge 1 commit into
Conversation
The Python COT_SUFFIX still read "step-by-step matter", a typo braintrustdata#66 fixed only in js/llm.ts, so Python and JS judges sent different prompts. Pin the corrected wording with a test on the rendered Factuality prompt.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
The Python
COT_SUFFIXinpy/autoevals/llm.pystill says "in a step-by-step matter". #66 fixed the same typo only injs/llm.ts, so the Python and JS versions of every LLM judge send different prompts whenuse_cotis on. This change makes the Python text match JS ("manner", the wording of OpenAI'scot_classifyprompt) and adds a test that pins it. Partly addresses #217.The typo is not in
templates/factuality.yaml, as the issue says. It is in the suffix that code appends to every template, Factuality included. I left the issue's other point alone. OpenAI'sclosedqa.yamlwrites its CoT instruction inline as "your reasoning about the criterion". Autoevals uses one shared suffix for all templates instead, and that suffix also has to serve Factuality, Battle and the rest, so scoping it to "the criterion" would need a per-template suffix. That is a change to how prompts are built, not a typo fix. I also left the scoring weights alone.Verification
uv run --extra dev --extra scipy pytest py/autoevals/test_llm.py -k cot_suffix: the new test fails on main (assert 'with your reasoning in a step-by-step manner to be sure' in "You are comparing ...") and passes with the fix.uv run --extra dev --extra scipy pytest py/autoevals/test_llm.py: 16 passed, 5 failed both here and on main (15 passed before the new test). The 5 failures aretest_openai,test_llm_classifier,test_nested_async,test_factualityandtest_battle, which need a real OpenAI or Braintrust key (OpenAIError: Missing credentials). I did not run them with a key.pnpm exec vitest run js/llm.test.ts: 11 passed. JS is unchanged.uv run --extra dev pre-commit run --files py/autoevals/llm.py py/autoevals/test_llm.py: black, ruff, codespell and prettier pass.