tive reward from current time step to the end of an episode would cancel the intermediate rewards and thus reflect whether current action improves the overall performance or not.
the agent would not focus on the selection of current term pair but have a long-term view that takes following actions into account.