# Understanding adjusting Transformer max length

**URL:** <https://discuss.huggingface.co/t/understanding-adjusting-transformer-max-length/22762>\
**Category:** 🤗Transformers\
**Created:** [September 8, 2022, 1:32pm UTC](https://discuss.huggingface.co/t/understanding-adjusting-transformer-max-length/22762 "2022-09-08T13:32:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mapraw](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Mapraw](https://discuss.huggingface.co/u/Mapraw)\
**Post date:** [September 8, 2022, 1:32pm UTC](https://discuss.huggingface.co/t/understanding-adjusting-transformer-max-length/22762/1 "2022-09-08T13:32:29Z")

</div>

Hello, professors

In the config of the transformer, it shows us 3 types of max length.  
There are 1. encoder 2. decoder 3. output max length

If we want to change the transformer model output max length, we need to change 3 of them equally because the transformer, uses the length of encoder output and decoder output as an input of the model output. please correct me if I am wrong.

Thanks, sir.

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/5/5f2ee613c701c747f6b6d2c9cd4a31f92fdd7cc3.png)  
 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/1/1f6e3aa164d6af11414fbab6c4c1307826fb536d.png)  
 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/9/92b7934029dba73c34157dc18faf8a3131274898.png)
