Generate without using the generate method

This may help a lot. What if the decoding is using beam search?