The generation ends if a special token *end* is predicted.
actor-critic (Sutton and Barto, 1998) methods are often adopted, which involves training an additional value network to predict the expected reward.