Recommend argument values for transformers.generation_utils.GenerationMixin.generate() for summarization and translation tasks?

Are there a set of recommended argument values folks should pass to 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.


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, 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

1 Like