Skip to content

fix(evals): require an explicit temperature of 1 on Gemini 3 steps - #187

Closed
adnanrhussain wants to merge 1 commit into
mainfrom
worktree-temperature-schema-check
Closed

adnanrhussain wants to merge 1 commit into
mainfrom
worktree-temperature-schema-check

Conversation

@adnanrhussain

@adnanrhussain adnanrhussain commented Aug 21, 2026 •

Copy link
Copy Markdown
Collaborator

Adds an eval-config rule: any Gemini 3 step must pin generation.temperature to an explicit 1. Also corrects the temperature description in the shared schema.

Why

From Google's Gemini 3 developer guide — ai.google.dev/gemini-api/docs/gemini-3, section Temperature:

"For all Gemini 3 models, we strongly recommend keeping the temperature parameter at its default value of 1.0."

"Changing the temperature (setting it below 1.0) may lead to unexpected behavior, such as looping or degraded performance, particularly in complex mathematical or reasoning tasks."

Confirmed against the API on both models we use. Each reports an advertised default of 1 via GET /v1beta/models/{model}, and each accepts omitted / 1.0 / 0 / null with a 200:

gemini-3-flash-preview gemini-3.6-flash
advertised default 1 (max 2) 1 (max 2)
omitted / 1.0 / 0 / null all 200 all 200

Nothing rejects a bad value for us — temperature: 0 returns a clean 200 and quietly degrades — so this has to be caught by a lint rule rather than at runtime.

null is deliberately not accepted here. It would mean "omit", which is only as safe as the weakest client, and our TS provider's request.temperature ?? 0 turns both null and undefined into 0 — the one value the guidance warns against.

Changes

  • scripts/checks/eval_config.py — new _check_generation: model name containing gemini-3 requires temperature == 1. No model registry; the substring test mirrors langchain_google_genai._is_gemini_3_or_later and carries the same caveat about a future Gemini 4. The rationale and source link live in the code comment.
  • evals/_schemas/config.schema.json — the previous description claimed Google "recommends removing the parameter" for Gemini 3. That is wrong; the guidance is to keep it at 1.0. Rewritten, and cut from ~150 words to ~60. It now also states when null is correct, which feat(evals): add Critical Thinking onto the shared evaluator contract #188 (Claude Opus 5) relies on — see Anthropic's model deprecations, where temperature is deprecated for Opus 4.7 and later and the recommendation is to omit it.

Sequencing

Blocked on #175 and #177. Two configs on main violate the new rule — prompts/purpose (0) and qualitative-text-complexity/intertextuality (0.0) — and both files are deleted by those PRs, which already carry temperature: 1 at the new paths. Fixing them here would only create conflicts, so eval-config stays red until they land.

Every other Gemini 3 evaluator is already compliant on its own branch (#159, #161, #173, #175, #176, #177).

Verification

strip-notebooks, eval-schemas, eval-fixtures, eval-notebook, eval-requirements pass. eval-config fails on exactly the two configs named above and nothing else.

Copilot AI lite review requested due to automatic review settings August 21, 2026 22:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enforces Gemini 3 evaluator steps to explicitly set generation.temperature to 1 (instead of relying on omission via null), and updates existing evaluator configs to comply. It also trims and generalizes the schema documentation around temperature, moving model-specific enforcement into eval-config.

Changes:

  • Add an eval-config cross-file rule requiring generation.temperature == 1 for LLM steps whose model name contains gemini-3.
  • Update two existing Gemini 3 evaluator configs to set "temperature": 1.
  • Simplify the JSON Schema temperature description to remove stale model-family guidance.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
scripts/checks/eval_config.py Adds a new _check_generation rule enforcing explicit temperature 1 for Gemini 3 steps.
evals/_schemas/config.schema.json Updates the temperature field description to be shorter and less model-specific.
evals/prompts/purpose/config.json Changes Gemini 3 step temperature from 0 to 1 to satisfy the new check.
evals/literacy/qualitative-text-complexity/intertextuality/config.json Changes Gemini 3 step temperature from 0.0 to 1 to satisfy the new check.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/checks/eval_config.py Outdated
Comment thread evals/_schemas/config.schema.json Outdated
@adnanrhussain
adnanrhussain force-pushed the worktree-temperature-schema-check branch from a8c47c7 to 5340b65 Compare August 25, 2026 16:55
@adnanrhussain
adnanrhussain force-pushed the worktree-temperature-schema-check branch from 5340b65 to da30992 Compare August 25, 2026 16:57
@adnanrhussain
adnanrhussain requested a review from aychi1 August 25, 2026 16:58
@adnanrhussain

Copy link
Copy Markdown
Collaborator Author

Closing: the premise doesn't hold.

We deliberately do not honour Gemini 3's default temperature of 1 in most cases. Temperature 0 has been tested across the ela-reading evaluators and is the better choice for all of them except Organizational Structure (#176), which stays at 1. A blanket rule requiring an explicit 1 on every Gemini 3 step would reject #161, #173, #175 and #177.

Model pins are intentional as they stand and are not changing here.

One piece of this PR is still needed and should land separately. The evals/_schemas/config.schema.json rewrite is independent of the check, and without it main keeps a temperature description that:

  1. States "Google recommends removing the parameter" for Gemini 3 — that is not what Google's docs say (they recommend keeping it at its default of 1.0), so it is a factual error in our own schema.
  2. Directs authors to use null for Gemini 3, which is now the opposite of the convention we settled on (an explicit number, usually 0).

Filing that as its own change rather than carrying the rejected check along with it.

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.

2 participants