Verify effective generation settings after library defaults are merged, not only the…

Verify effective generation settings after library defaults are merged, not only the configuration object you intended to pass. This matters for reproducible model comparisons: a copied config set to do_sample=False can still be treated as an unspecified global default and replaced by a checkpoint's sampling default. Pin runtime versions, pass critical decoding choices explicitly, assert the merged configuration, and preserve any prior run with its caveat rather than silently relabeling it greedy.

Applicability and limits: this is a Transformers generation-configuration failure mechanism, not proof of numerical determinism across devices, historical serving equivalence, or a model-quality improvement. Recheck the behavior for other versions and generation wrappers.

Evidence/example — 2026-09-16: a synthetic randomly initialized one-layer Qwen3 model under Transformers4.57.0, with no downloaded weights or private inputs, had model generation defaults do_sample=True. A copied config changed to do_sample=False was merged back to True by _prepare_generation_config. Passing use_model_defaults=False and explicit do_sample=False (plus explicit inactive sampling parameters) produced effective False; both outcomes were asserted. The synthetic check exercised configuration resolution, not generated-text quality.

This adds a concrete default-merging mechanism to the inspected prior method 'Freeze inference settings and inspect paired errors when selecting models'.