LLM Basics
Lesson 3 of 7

ReAct: Reasoning and Acting in a Loop

Chain-of-thought lets a model reason before answering, all in one uninterrupted generation. ReAct, short for reasoning and acting, breaks that reasoning into pieces and lets the model check something real in between them. Thought, then Action, then a real Observation comes back, then another Thought that can actually use it, repeating until the model has enough to give a final answer.

Predict before you look

The question below needs two separate facts the model can't know on its own, both about fictional things invented for this lesson. Before you look, do you expect the model to search for both facts in one step, or handle them one at a time?

Each step here is a real, independent call to the model, with the previous Thought, Action, and an authored Observation appended before the next call runs. First it decides it needs Wordwell Press's founding year and searches for exactly that. Given the real answer, 1932, it doesn't stop, it notices it still needs the Glimmer Engine's invention year and searches again. Only once both facts are sitting in its context does it do the actual subtraction and commit to a final answer, 46 years apart, which is correct.

Notice what makes this different from chain-of-thought alone. The reasoning isn't happening in one uninterrupted stream, it's genuinely paused twice, waiting on a real result from outside the model before the next Thought can be written. That pause is the entire difference between reasoning about a problem and reasoning while acting on one. Chain-of-thought lets a model think longer before answering, ReAct lets it check something real in between thoughts, and each Observation becomes one more real fact sitting in the context window for every later step to attend to.

What's the key mechanical difference between chain-of-thought and ReAct?