# Recommend argument values for transformers.generation\_utils.GenerationMixin.generate() for summarization and translation tasks?

**URL:** <https://discuss.huggingface.co/t/recommend-argument-values-for-transformers-generation-utils-generationmixin-generate-for-summarization-and-translation-tasks/2948>\
**Category:** 🤗Transformers\
**Created:** [December 24, 2020, 1:29am UTC](https://discuss.huggingface.co/t/recommend-argument-values-for-transformers-generation-utils-generationmixin-generate-for-summarization-and-translation-tasks/2948 "2020-12-24T01:29:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wgpubs](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/wgpubs/32/303_2.png) [@wgpubs](https://discuss.huggingface.co/u/wgpubs)\
**Post date:** [December 24, 2020, 1:29am UTC](https://discuss.huggingface.co/t/recommend-argument-values-for-transformers-generation-utils-generationmixin-generate-for-summarization-and-translation-tasks/2948/1 "2020-12-24T01:29:27Z")

</div>

Are there a set of recommended argument values folks should pass to [`generate`](https://huggingface.co/transformers/main_classes/model.html#transformers.generation_utils.GenerationMixin.generate) for summarization and for translation?

I’m looking for values that generally work for those tasks generally, as well as, values that are recommended for specific models. If any of this is documented somewhere I’d love to get the link(s) to such resources.

Thanks

---

<div class="post-metadata">

**Author:** ![valhalla](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/valhalla/32/4179_2.png) [@valhalla](https://discuss.huggingface.co/u/valhalla)\
**Post date:** [December 24, 2020, 7:25am UTC](https://discuss.huggingface.co/t/recommend-argument-values-for-transformers-generation-utils-generationmixin-generate-for-summarization-and-translation-tasks/2948/2 "2020-12-24T07:25:04Z")

</div>

Hi @wgpubs

The values will be different for different models and tasks, you should try and see what works for you. Also, almost every pre-trained model comes with some default values which you find in its `config` file.  
For ex, if you look at `bart-large-cnn` model’s [config](https://huggingface.co/facebook/bart-large-cnn/blob/main/config.json), it uses 4 `num_beams` with `no_repeat_ngram_size` 3.

Also, this blog explains different `generation` arguments and should help pick values for those [https://huggingface.co/blog/how-to-generate](https://huggingface.co/blog/how-to-generate)
