# Set\_seed and training argument's data\_seed

**URL:** <https://discuss.huggingface.co/t/set-seed-and-training-arguments-data-seed/101048>\
**Category:** Beginners\
**Created:** [August 6, 2024, 3:00am UTC](https://discuss.huggingface.co/t/set-seed-and-training-arguments-data-seed/101048 "2024-08-06T03:00:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lIlBrother](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lilbrother/32/30226_2.png) [@lIlBrother](https://discuss.huggingface.co/u/lIlBrother)\
**Post date:** [August 6, 2024, 3:00am UTC](https://discuss.huggingface.co/t/set-seed-and-training-arguments-data-seed/101048/1 "2024-08-06T03:00:50Z")

</div>

If I specify the set\_seed in the trainer utility, does it also fix the data\_seed in TrainingArguments?

To ensure reproducibility, is using set\_seed alone sufficient, or should I also define data\_seed?

---

<div class="post-metadata">

**Author:** ![lIlBrother](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lilbrother/32/30226_2.png) [@lIlBrother](https://discuss.huggingface.co/u/lIlBrother)\
**Post date:** [August 6, 2024, 3:04am UTC](https://discuss.huggingface.co/t/set-seed-and-training-arguments-data-seed/101048/2 "2024-08-06T03:04:20Z")

</div>

data\_seed (`int`, _optional_):  
Random seed to be used with data samplers. If not set, random generators for data sampling will use the  
same seed as `seed`. This can be used to ensure reproducibility of data sampling, independent of the model  
seed.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](https://discuss.huggingface.co/u/system)\
**Post date:** [August 6, 2024, 3:04pm UTC](https://discuss.huggingface.co/t/set-seed-and-training-arguments-data-seed/101048/3 "2024-08-06T15:04:43Z")

</div>

Closed on August 6, 2024, 3:04pm UTC

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
