<p>As Oliver mentioned in order to use beam search in the training procedure we have to use <strong>beam search optimization</strong> which is clearly mentioned in the paper <a href="https://arxiv.org/abs/1606.02960" rel="noreferrer">Sequence-to-Sequence Learning as Beam-Search Optimization</a>.</p>

<p>We can't use beam search in the training procedure with the current loss function. Because current loss function is a log loss which is taken on each time step. It's a greedy way. It also clearly mentioned in the this paper <a href="https://arxiv.org/pdf/1409.3215v1.pdf%3B" rel="noreferrer">Sequence to Sequence Learning
with Neural Networks</a>.
In the section 3.2 it has mentioned the above case neatly.</p>

<p><a href="https://i.stack.imgur.com/6IqKL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6IqKL.png" alt="enter image description here"></a> </p>

<p><strong><em>"where
S
is the training set.  Once training is complete, we produce tr
anslations by finding the most
likely translation according to the LSTM:"</em></strong></p>

<p>So the original seq2seq architecture use beam search only in the testing time. If we want to use this beam search in the training time we have to use another loss and optimization method as in the paper.  </p>
Do we need to use beam search in training process?
<p>If we use beam search in seq2seq model it will give more proper results. There are several tensorflow implementations. 
But with the softmax function in each cell you can't use beam search in the training process. So is there any other modified optimization function when using beam search?  </p>