We then replace its last word with the EOS tag and add this sequence to the beam (EOS replacement in Section 4.1).
3 we keep only the sequences that contain the EOS tag and are in the defined length range.