However, this could be computationally expensive because the time complexity is O(T 2 ).
our discriminator can calculate the reward of all words with the time complexity of O(T ), which is more computationally efficient.