# Does generate's max\_length influence training?

**URL:** <https://discuss.huggingface.co/t/does-generates-max-length-influence-training/83805>\
**Category:** 🤗Transformers\
**Created:** [April 25, 2024, 11:40pm UTC](https://discuss.huggingface.co/t/does-generates-max-length-influence-training/83805 "2024-04-25T23:40:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vsocrates](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@vsocrates](https://discuss.huggingface.co/u/vsocrates)\
**Post date:** [April 25, 2024, 11:40pm UTC](https://discuss.huggingface.co/t/does-generates-max-length-influence-training/83805/1 "2024-04-25T23:40:25Z")

</div>

I’m finetuning a BART model from this tutorial: [Google Colab](https://colab.research.google.com/github/elsanns/xai-nlp-notebooks/blob/master/fine_tune_bart_summarization_two_langs.ipynb) and having a lot of trouble figuring out if I trained my model for the right document length.

I truncated my training data to 1028 tokens, but the default for generation is 12 tokens. If I bump this up to 512, will it still generate meaningful sentences? Is there another parameter I need to add to `Seq2SeqTrainingArguments`? Do the `GenerationConfig` parameters have any impact on training?

The `BartConfig` has the following section on task\_specific\_params.

```auto
  "task_specific_params": {
    "summarization": {
      "length_penalty": 1.0,
      "max_length": 128,
      "min_length": 12,
      "num_beams": 4
    },
    "summarization_cnn": {
      "length_penalty": 2.0,
      "max_length": 142,
      "min_length": 56,
      "num_beams": 4
    },
    "summarization_xsum": {
      "length_penalty": 1.0,
      "max_length": 62,
      "min_length": 11,
      "num_beams": 6
    }

```

Thanks!
