Therefore, we define the following reward: where u is the node where the agent is located and u * is the closest tree node that contains the answer (n(u) is the node index as defined above).
when stopping, the reward is proportional to the distance to the closest answer location given the document length.