Model predicts always sos and eos labels

There are hundreds of things that can be off :). Since you’re not showing any code, just a few comments:

  • Why are <SOS> and <EOS> are the some token index. It might not matter in your concrete setting, but generally they serve different purposes.

  • Most of the time <PAD> is represented by 0. While it does not matter in principle, approaches using pack_padded_sequence assume that 0 means padding by default. In this case, you need to make it explicit that 1 means padding

  • I assume you use the LSTM to generate sentences. In this case, bidirectionally doesn’t really makes sense.

  • Do you have any view() or reshape() calls that might mangle your data?