Skip to content

fix(types): set optimal default top_p threshold for nucleus sampling - #3050

Open
adri22235 wants to merge 1 commit into
googleapis:mainfrom
adri22235:fix/top-p-sampling-default
Open

adri22235 wants to merge 1 commit into
googleapis:mainfrom
adri22235:fix/top-p-sampling-default

Conversation

@adri22235

Copy link
Copy Markdown

Description

Restores explicit default top_p=0.95 across configuration classes (GenerateContentConfig, GenerationConfig, Model, LiveConnectConfig) in google/genai/types.py.

Motivation

Empirical testing on fine-grained multimodal reasoning and deterministic DGT regulation benchmarks demonstrated that unconstrained sampling at temperature: 1.0 during truncated thinking effort causes hallucinations and sampling drift. Setting top_p=0.95 restores grounded, stable behavior.

Verification

  • Verified locally on Debian 12 (Linux x86_64).
  • Tested and built clean wheel package (.whl) with 0 errors.
  • CLA signed by author (@adri22235).

@Venkaiahbabuneelam Venkaiahbabuneelam self-assigned this Oct 5, 2026
@Venkaiahbabuneelam Venkaiahbabuneelam added the size:S Code changes < 10 lines label Oct 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S Code changes < 10 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants