OpenNMT / OpenNMT/CTranslate2

set_random_seed does not make temperature based decoding deterministic

Open
#1,757 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
4.7k
Forks
537
Avg merge
12h 12m
Merged PRs (30d)
4

Description

Hello,

I'm experimenting with the set_random_seed() method of CTranslate2 (through faster whisper). Without temperature based decoding, the results from Whisper ASR models are always the same on CPUs and GPUs for the same file, e.g. I don't have any other source of stochasticity.

Previously, I was calling the set_random_seed() only at model creation. Now I changed the logic to set it to the same value before every generate() call. But still, I can't make the sampling deterministic. I tried on CPU and GPU, both give different results.

Any idea what am I missing? Thanks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files or tests are named. Start by reproducing the behavior around set_random_seed() and generate() on both CPU and GPU with temperature-based Whisper decoding, then trace how the seed is applied. Done means identical results for repeated runs with the same seed, or a documented explanation of why determinism cannot be guaranteed.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.