A language model says it searched a book catalogue and located the required book. What changes if it really can query the catalogue? Its next action can depend on what the catalogue returned. It would be valuable to know if this happens in examples given to demonstrate an agent's ability to detect and rectify errors. All three of the query, the returned information, and the model's subsequent response, would be required. A statement that it searched only tells us what the model reported.
In ReAct, introduced by Shunyu Yao and colleagues, reasoning and actions produced by the model alternate with observations from the environment. Examples given include finding answers using a simple interface to Wikipedia, and performing various actions in other toy environments. So the model may notice the lack of information required to complete the current task, take appropriate action, and go on to complete the task successfully. But observations are not guaranteed to lead to the desired outcome; the wrong information may be returned, or the model may fail to extract the required information from the information returned. See Yao et al., ReAct: Synergizing Reasoning and Acting in Language Models.
Follow the sequence of observations
Given only the title, find the name of the translator of the first edition into English of "The Last Orchard". There would be 2 entries in our hypothetical catalogue: one for a subsequent edition translated into English, and one for the first edition. With knowledge of the catalogue a person would expect to find 2 entries. With only the information given, the model queries the catalogue and is returned 2 reference numbers. So it would be sensible to request information on both.
On requesting information on the first reference number, the model is told this is an edition printed in 1992, translated by Mara Cole. The record says the translation was commissioned for that printing. At this stage it would be possible to stop and return Mara Cole, a name drawn from the catalogue record. However this would not be a response to the question asked. The model has information relating to an edition, but not to the particular edition specified. Presumably its next action would relate to finding information on that.
It therefore requests information on the second reference number and is told this relates to an edition printed in 1964, translated by Eli Ross and is the first edition in English. So the model can respond with the required information, and indicate the source. And it now also has information to explain the other, apparently valid, answer. All information returned by the catalogue above is fictitious.
| Event in the trace | Source | Possible next action |
|---|---|---|
| A query for the title | Model | Wait for the catalogue response |
| 2 reference numbers | catalogue | request information on both |
| Subsequent edition, translation specially commissioned | catalogue on request for 1st reference number | seek information on first edition |
| First edition in English, translated by Eli Ross | catalogue on request for 2nd reference number | return answer and reference |
The first opportunity to revise the plan comes when the catalogue returns two reference numbers. Learning that the first record describes a later printing gives a more specific reason to check the second. Neither would be apparent from the answer alone. Nor, from the model's statements of intended action alone, would one be able to attribute to it knowledge obtained only as a result of its queries.
If the result of the initial query was only 1 reference number, relating to the 1992 printing, the model would have no obvious reference number to query for the first edition. It may query under the original title, follow other links, or simply state it was only able to find a subsequent translation. If it goes on to state Eli Ross, it is worth enquiring how it obtained this information. Of course it may be correct, but it is not obvious from the information it has received. Alternatively, assume the model is returned both reference numbers as above, but that information that it is the first edition in English is omitted. It may well assume Eli Ross given the date of the printing. But all it knows is that it precedes 1992. So it would be expected to seek further information or qualify its answer. So similar sequences of events, with 2 queries, both successfully actioned, and 1 final response could cover a wide range.
It is therefore helpful to vary information returned to see effect, if any, on the model's actions. If, for example, it always requests information on both reference numbers returned, in that order, we cannot conclude from this that any information returned has affected its actions. But we could make some inference if, for example, the second query was omitted given different information. So ideally one would like to know all the information available to the model prior to each action, and be told which of these may have influenced the action. Any change in action following information returned at least shows the effect of that "intervention". Inferring the model's motivation would be more difficult.
Observations with ReAct
For some of their tasks the model was given a very simple set of options for interacting with Wikipedia: search, find text on the current page, or state an answer. The lookup operation returned the next sentence on the current page containing the search string, if there was a match. A "search" could return one or more suggested pages. The model would decide if it wished to modify its search term, presumably giving reasons in its "thought" response. It would then receive the result of that search. So again it is important to distinguish information provided by Wikipedia from that generated by the model. See ReAct, section 3 on knowledge-intensive reasoning tasks.
In Table 1, HotpotQA exact-match scores were 27.4 for ReAct and 29.4 for chain-of-thought prompting. On FEVER, a claim-classification task, the corresponding accuracies were 60.9 and 56.3. There are, of course, many differences between these 2 tasks and measures. But at least it suggests caution in assuming benefits of allowing actions. See ReAct, Table 1, comparing prompting methods on HotpotQA and FEVER.
Where the measure of success is coarse, a trace may help to distinguish between several possible causes. For the question-answering task measured by exact match, the model may search for, and obtain information on, the wrong subject; find the correct subject but fail to note a relevant qualification; or find all the relevant information but fail to combine it into the expected response. All would be equally unsuccessful. Further ability to search would possibly overcome the first difficulty, but be of little benefit if all the information was already available to the model.
Actions with an effect
Most actions, such as querying a book catalogue, would be expected to have no effect on the item queried. But many others will, so the model may wish to act on knowledge that it has brought about a change. For example, in one of the toy environments the model may need to open something in order to find out what it contains. That it has opened it and what is contained within are 2 separate pieces of information. So as well as a record of the model instructing an "open", one would look for confirmation from the environment and ideally a subsequent check of the state.
One example of failure in ALFWorld is given on the authors' site, where information is inserted into the sequence of "thoughts". So one can then see the effect of "correcting" the model. It is important to note where this intervention occurs, since one is then only seeing how the model proceeds given correct information. One cannot claim the model is capable of detecting and correcting the error without examples where this is achieved unaided. Nevertheless such examples are useful to identify where the model went wrong.
Similarly one would want to know why the model decided to stop. In the example above it seems reasonable, having established who translated the relevant edition. On another occasion it may reach maximum time without finding suitable information. So again there are several possibilities for "finished" which it would be useful to know when interpreting overall results. Has it given an answer? Answered correctly? Caused the desired change?
How to annotate an agent’s final claim
Pick some statement in the model's final response. Go back through the sequence of events to the earliest point at which it could reasonably have made this statement. Note the information available at that point and what, if anything, it still wished to establish. Continue forward to see if and when this is satisfied, or if the model omits the relevant qualification. This is a quick check on the thoroughness of the model's investigation.
If important for subsequent action, it would be useful to include actual responses from tools, rather than relying on statements by the model. For example, the comment that the translation was specially commissioned would prevent assuming either entry could answer the question. Similarly if only part of a page is returned to the model, this should be noted, since the assessor may have access to more information.
So with feedback from actions the model at least has the opportunity to act on information not included in its original input. Ideally one would hope to point to this information, an action taken in consequence, and a reasonable rationale for ceasing further action. Failing to find an answer, because all information available related to the wrong subject, could be a very useful example!