Moreover, we would like to consider the overall document length, rewarding successful navigations in long documents.
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).