Repository navigation
feat(locales): run language-neutral scenarios in de, es, zh, and ja - #323
Merged
Merged
Conversation
Add --locale and locale= on run_benchmark. Translation packs replace the user and follow-up messages and every tool description for 26 scenarios whose grading is language-neutral, keeping identifiers, schemas, invariant anchors, and English mock data fixed. Answers are normalized for locale number formats and negation before the usual evaluators run, and each result records first- and final-reply language as a drift diagnostic. The locale joins the variant metadata, so it splits the fingerprint cohort and blocks a mismatched resume. Adapted from QwenLM BabelArena.
Use ASCII word boundaries when matching ASCII identifiers and literals so CJK and Kana text without spaces does not break answer_affirms_text, positive_argument_contains, detect_language, or fixture variant substitution. Split clauses on CJK punctuation and contrast conjunctions, map German ohne and Spanish sin to constituent negation, and guard Chinese negation normalization against compound words. Update eligible scenario evaluators and translation pack phrasing for target-language responses.
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.
Problem
The benchmark only measures tool use in English. QwenLM BabelArena shows that models lose ground when the user, the tool documentation, and the error strings speak another language, even when every identifier stays the same, and that models often start in the user's language and drift back to English after a few turns of English tool output. Neither effect is visible here today.
Change
--locale de|es|zh|ja(andlocale=onrun_benchmark) runs the scenarios whose grading is language-neutral with translated user messages, follow-up messages, and tool descriptions.src/tool_eval_bench/evals/locales/<locale>.json, one per locale, checked in and deterministic. They were drafted by a model and still need native-speaker review (see below).ANCHORS) such asTokyo,Project Alpha, orINC-710, which every translation must contain verbatim. Mock tool results stay in English.--dry-runand progress totals match the run. An explicitly named ineligible ID is an error, not a silent skip.de/esdecimal commas and dot-grouped thousands, a trailing$, and locale negation words mapped tonot.requested=… first=… final=…under thelanguagediagnostic, with(drifted)when the model started in the requested language and ended in another. It appears in the report's capability diagnostics. Scores are not affected.config_fingerprintand resume rejects a different locale. The locale composes with--variant-seed: the locale applies first, then seeded fixtures rewrite the translated prompt.Adapted from BabelArena's localized task families and its language-consistency audit.
Known limits
30ではありません), outside the shared helpers' look-back, so a negated Japanese number can still read as affirmed.unknownfor short or mixed replies.Review needed before merge
The packs need a native-speaker pass.
de.jsonis the first priority.Regression coverage
tests/test_locales.py(248 tests):1,050.--variant-seed, fingerprint metadata, and CLI selection (filtering, rejecting a named ineligible ID, an empty selection, an unsupported locale). The CLI flag reaches the service and the recorded config.The CLI golden test and the compatibility snapshots are updated (snapshots via
scripts/update_compat_snapshots.py). A locally built wheel includes the four packs.Local: ruff, ruff format, mypy, and 10,215 tests pass with seed 104729.
Changelog and documentation
changelog.d/+locale-runs.added.mddocs/locales.md. README anddocs/cli-reference.mdgain short sections that link to it.Contributor checklist
tests-not-needed.changelog.d/fragment was added or updated, or a maintainer appliedskip-changelog.Written with AI assistance; reviewed before opening.