# Google/MT5 model: While generating always starts with the same token, after \`\<pad\>\`

**URL:** <https://discuss.huggingface.co/t/google-mt5-model-while-generating-always-starts-with-the-same-token-after-pad/39059>\
**Category:** 🤗Transformers\
**Created:** [May 8, 2023, 7:58am UTC](https://discuss.huggingface.co/t/google-mt5-model-while-generating-always-starts-with-the-same-token-after-pad/39059 "2023-05-08T07:58:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spranjal25](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@spranjal25](https://discuss.huggingface.co/u/spranjal25)\
**Post date:** [May 8, 2023, 7:58am UTC](https://discuss.huggingface.co/t/google-mt5-model-while-generating-always-starts-with-the-same-token-after-pad/39059/1 "2023-05-08T07:58:42Z")

</div>

Hi,

I am Fine-tuning an mt5-small model on a custom dataset, for a downstream task.  
The model loss appears to be converging but the only issue is that the output from `model.generate()` always starts with a specific token:  
eg: `a`. For each input , …  
I’m getting the outputs: “`a <Generated Output for sentence 1>`”, “`a <Generated Output for sentence 2>`…”

I’m using the beam search strategy for decoding, have tried with different beam widths and other parameters (like repeat\_penalty etc) but the output from `generate()` always starts with the same token `a`

Is there any known reason why this might be happening?
