Split an agent into four parts that share a written memory, then train only the planner, inside the live loop. With one 7B model in every part, training the planner lifts 2Wiki from 60.0% to 77.2% and GAIA from 17.2% to 33.1%.
Pick a system and watch it work one real question from the paper, turn by turn. Then pick a benchmark and compare the scores. After that we build it from zero: the four modules, the memory, and how one final grade trains every turn.
You need what an LLM does (it writes text one token at a time) and what reinforcement learning is (try, get a score, make high-scoring tries more likely). We build the rest.
Press Play. The question: compute the ISBN-10 check digit of the Tropicos ID of the order Helotiales.
The question and both AgentFlow traces are the paper's case study (Figure 5): before training the planner loops on the same Python error until the turn budget runs out; after training it finds a new path at turn 4. The monolithic trace is illustrative, to show the format; the paper does not run a monolithic model on this question. Bars: Table 1 and Table 2, mean of three runs. "Monolithic" is Search-R1 for the search benchmarks and GAIA, and ToRL for math and science: both are 7B-Instruct policies trained with RL to call tools in one full context. All AgentFlow numbers use Qwen2.5-7B-Instruct in every module and tool.
Chapter 0
See the two ways people give a language model tools today, and the gap between them that this paper fills
Ask a question that needs two facts and a calculation. "What is the ISBN-10 check digit of the Tropicos ID for the order Helotiales?" No model knows that ID by heart. It must search for it, then compute a check digit, then answer.
So we give the model tools: a web search, a Python interpreter, an encyclopedia. A tool is a program the model can call by writing a short command. The program runs, and its output comes back as text.
Today there are two main ways to build such an agent. Both work. Both have a weak spot. AgentFlow is an attempt to keep the strength of each and drop the weak spots.
The first way is the monolithic tool-using policy. One LLM does everything in one long text. It thinks inside <think> tags, writes a <tool_call>, reads the result, thinks again, and so on. Search-R1 and ToRL are examples. We train this one model with reinforcement learning on whether its final answer is right.
The second way is the agentic system. Several LLM calls play fixed roles: one plans, one writes code, one checks. They pass notes to each other. AutoGen is an example. Usually nobody trains these roles. People write prompts and glue code, and hope the parts work well together.
Pick a design. The picture shows who writes what, and which parts learn from the final grade. The bar is the design's average on four search benchmarks.
Averages over Bamboogle, 2Wiki, HotpotQA and Musique from Table 1: Search-R1 33.3%, AutoGen 42.4%, AgentFlow before training 47.2%, after Flow-GRPO 57.3%. Search-R1 is a 7B-Instruct policy trained with RL; AutoGen and AgentFlow use Qwen2.5-7B-Instruct for every agent and tool. The paper standardizes the search tool for all of them (Section C.2).
Look at what each design gives up. The monolithic policy learns from results, but everything lives in one growing context: every thought, every raw tool output. The paper names two costs. Training gets unstable as the horizon grows and the tools multiply. And the trained policy carries over poorly to new tasks and tools.
The agentic system keeps each call short and focused. But its parts never learn. A planner that picks the wrong tool on Monday picks it again on Friday. Nothing in the system turns a failure into a better plan.
AgentFlow takes the modular design and trains one part of it, the planner, with reinforcement learning. The key words are in the flow: the planner trains while the whole system runs, on the exact situations it will meet at test time. Its training signal is the grade of the final answer.
That last sentence hides most of the paper. Here is the road.
Chapter 1
Step through one turn and see exactly what the planner, the executor, the verifier and the generator read and write
Think of a small research team. One person decides the next step. One person runs the tool. One person checks the result and says "done" or "keep going". At the end, one person writes the answer. Nobody does two jobs, and everybody reads the same notebook.
AgentFlow is that team. The paper calls the parts the Action Planner, the Tool Executor, the Execution Verifier and the Solution Generator. The shared notebook is the evolving memory. The tools sit in a toolset.
In the main experiments every module is a call to the same model, Qwen2.5-7B-Instruct, with a different prompt. The toolset has five tools: a Base Generator (the same model, answering directly), a Python Coder, Google Search, Wikipedia Search and Web Search. The paper prints all the prompts in its Appendix E.
Press Next to move the turn forward one module at a time. Each box lists what that module reads and what it writes. Flip the verifier's verdict to see where the loop goes.
Inputs and outputs follow Figure 2(b) and the prompt templates in Appendix E.1. The example turn is turn 2 of the paper's Figure 5 case. Only the planner (teal) has trainable weights; every other box is frozen.
Now the same turn in symbols. Let q be the question, K the toolset, and Mt the memory before turn t. At the first turn the memory holds only the question.
The loop repeats until the verifier says stop, or until a turn budget runs out. The budget is 3 turns during training and 10 at evaluation (Appendix C). Then the generator reads the question and the final memory and writes the answer o.
Notice what the planner does not do. It never writes code and never reads a raw web page. It picks a tool, states a sub-goal, and hands over the context the tool needs. Its whole job is the decision. That is why it is the part worth training.
Where does this sit among older systems? Planner and executor teams with tool descriptions already exist; the paper's related work lists AutoGen, MetaGPT and OctoTools as training-free examples. The new part is not the shape of the team. It is that one member of the team learns while the team works.
Chapter 2
Read the exact record the modules share, field by field, and compare its size with a monolithic policy's full context
The memory is the most ordinary part of AgentFlow, and one of the most important. It is a text record with one entry per turn. Code, not a model, writes it. Every module reads some part of it.
Here is one entry, in the format the paper gives in Appendix E.1.5. We filled it with turn 2 of the Helotiales case.
"Query": "Compute the check digit the Tropicos ID for the Order Helotiales would have if it were an ISBN-10 number." "Action Turn 2": { "Tool Name": "Google Search", ← planner, after "Tool Name:" "Sub-Goal": "Retrieve the Tropicos ID of the Order.", ← planner, after "Sub-Goal:" "Command": "execution = tool.execute(query=\"Tropicos ID for the Order Helotiales\")", ← executor, the whole execution = ... line "Result": "The Tropicos ID for the Order Helotiales is 100370510.", ← the tool's output, stored as is "Verification Status": "... Conclusion: CONTINUE" ← verifier, its analysis and verdict }
Five fields, each written by one source. The planner fills the tool name and the sub-goal. The executor fills the command. The tool fills the result. The verifier fills the status. The paper's update function pulls each field out of the module's text with a regular expression, so a module that breaks its format can break the memory (our reading of Appendix E.1.5).
Now compare the two designs as the turns go by. The monolithic policy keeps everything in one context: each thought, each tool call and each raw result. AgentFlow keeps a compact entry per turn. Each module reads only the part it needs.
Drag the turn count. The top stack is a monolithic policy's context; the bottom stack is AgentFlow's memory. The row of boxes shows what each AgentFlow module reads at that turn.
The fields are the paper's (Appendix E.1.5). The token sizes are ours, chosen only to show the shape. A planner action of about 200 tokens matches the response length in Figure 9a. The other sizes (sub-goal 25, command 30, summarized result 150, verifier status 80, a monolithic thought 300 and a raw tool output 600 tokens) are illustrative assumptions. The paper reports no context-length measurements.
Two things change. First, the size. Even with our rough numbers, by turn 10 the monolithic context holds several times more tokens than the memory. Second, and more important for learning, the planner always sees the same kind of input: the question, the tool list and a clean list of past steps. It never sees a raw web page.
Now look at the messages between modules. They are short, named fields, not free chat. The planner must end its reply with exactly three parts, in this order.
# planner reply (template from Appendix E.1.1) Justification: Wikipedia returned nothing; a web search can find database IDs. Context: Order Helotiales; we need its Tropicos ID. Sub-Goal: Retrieve the Tropicos ID of the Order. Tool Name: Google Search # executor reply (template from Appendix E.1.2) Generated Command: execution = tool.execute(query="Tropicos ID for the Order Helotiales") # verifier reply ends with exactly one line (Appendix E.1.3) Conclusion: CONTINUE or Conclusion: STOP
The justification line above is ours, to show the shape; the sub-goal, tool and command are the paper's. During training the planner may write up to 2,048 tokens per action (Appendix C.1). In practice its replies average about 180 to 230 tokens (Figure 9a, read by eye).
Why does this format matter so much? Because it is what makes the planner trainable. The planner's output is short, its input has a fixed shape, and its decision is one line. That is a much easier thing to improve with reinforcement learning than a long free-form chain of thoughts and calls.
Chapter 3
Get one grade at the end of several turns, and decide which of the planner's choices deserve it
A football team wins 1 to 0. Who gets the credit? The striker scored. But the defender won the ball, and the midfielder made the pass. The scoreboard says only "win". It does not say which choices made the win.
The planner has the same problem. It makes a choice at each turn. Only after the last turn does anyone check the answer. The paper's grade is a single number: 1 if the final answer matches the ground truth, 0 if not.
Who gives that grade? An LLM-as-judge: GPT-4o reads the question, the generator's answer and the true answer, and returns True or False. Its prompt allows "1,000" to equal "1000" and "A" to equal the text of option A (Appendix E.3). This is still a verifiable reward, because a true answer exists. The judge only handles the matching.
That equation is the paper's answer to the credit question. Before we accept it, try the alternatives on one run.
This run has three turns: a search that failed, a search that found the ID, and a calculation. Pick a rule and see which turns get a signal. Flip the outcome to see what changes.
The three turns come from the paper's Figure 5 case, shortened. "Hand-made step scores" stands for the family of per-turn rewards the paper argues against (for example rewards for information gain, as in StepSearch); the numbers shown for it are illustrative.
Each rule has a flaw. "Last turn only" teaches the final step and ignores the search that found the ID. Hand-made step scores look sensible, but someone must design them, and the model learns to please the designer. A failed search at turn 1 might be a good move: it ruled out a source. A scorer cannot easily know that.
Broadcasting is crude in a different way. Every turn in a winning run gets the full reward, including the failed first search. Every turn in a losing run gets punished, including good moves. So why does it work at all?
Here is the intuition. Over many runs, a habit that helps shows up in winners more often than in losers. A habit that hurts shows up in losers more often. Each run is noisy, but the average leans the right way. The cost of crude credit is noise, and the next chapter's trick, comparing tries at the same question, cuts that noise.
Chapter 4
Grade a group of 8 tries at one question, turn each grade into an advantage, and watch a multi-turn problem become a pile of single-turn updates
A grade of 1 by itself says little. If the question was easy, every try gets 1, and there is nothing to learn. What we want to know is: was this try better than usual for this question?
So Flow-GRPO runs the whole system 8 times on the same question. The planner samples at temperature 0.5, so the 8 runs differ: different tools, different sub-goals, different numbers of turns. Some end right, some wrong. The paper calls this a group, with group size G = 8 (Section 4.1).
Then it compares each run with its group. A run that succeeded where most failed is good news. A run that failed where most succeeded is bad news. That comparison is the group-normalized advantage:
Work one by hand. Say 3 of the 8 runs are right. The mean is 3/8 = 0.375. For 0-or-1 grades the spread is √(0.375 × 0.625) ≈ 0.484. Then:
right run: (1 − 0.375) / 0.484 = +1.29 · wrong run: (0 − 0.375) / 0.484 = −0.77
Rare successes earn big pushes. If only 1 of 8 is right, that run gets +2.65 and each wrong run only −0.38. If 7 of 8 are right, the lone failure gets −2.65. The group tells the planner how surprising each outcome was.
Each row is one run of the whole system on the same question; each block is one planner turn. Tap a row's grade to flip it, or drag how many are right. Watch every block of a run take that run's advantage, then drop into the update pile on the right.
G = 8 runs per question and at most 3 turns per run are the paper's training settings (Section 4.1, Appendix C.1). The turn counts per run are random draws for illustration. We use the population spread; the paper does not say population or sample, or what happens when all 8 grades agree. A spread of 0 would divide by zero; common GRPO code adds a tiny constant, which makes every advantage 0 (our reading).
Now the step that gives the method its name. Every block in the device, every planner turn, carries its run's advantage. So we can cut the runs apart. Each turn becomes one standalone training example: "in this memory state, the planner wrote this action, and it was worth +1.29".
That is what the paper means by turning multi-turn RL into a set of single-turn updates. A run with 3 turns gives 3 examples. A group of 8 runs gives one example per turn, so between 8 and 24 at a 3-turn budget. Each example looks just like one step of ordinary GRPO on a single prompt. The prompt is the planner's full input at that turn: question, toolset and memory.
What happens when all 8 runs agree? If all are right, or all wrong, every advantage is 0. Nothing is learned from that question. This is the same blind spot plain GRPO has. Too-easy and too-hard questions are wasted compute. The paper does not filter them; some later GRPO variants do (our note).
Chapter 5
Turn the advantages into a gradient with an importance ratio, a clip, a KL penalty and three averages
We now have training examples: a planner input, the action it wrote, and an advantage. How do the weights move? The answer is the standard PPO-style clipped update that GRPO uses, applied to each planner action token by token.
An action is a short string of tokens. For each token j of action ait, compare the new planner with the one that sampled the runs:
If the advantage is positive, we want ρ above 1: make the token more likely. If negative, below 1. But not too far in one step. The clip stops the gain once ρ leaves the band from 1 − ε to 1 + ε. Try it.
Drag the ratio. The curve is what this token adds to the objective; the shaded band is where the gradient is alive. Flip the advantage's sign to see the other side.
ε = 0.2 is the common PPO default, used here for illustration: the paper names the clip ε but does not report its value. The advantage values come from the 3-of-8 example in Chapter 4.
Now put the pieces together. This is the paper's Equation 5, the Flow-GRPO objective. It looks heavy, but it is three averages around the clipped term, and one penalty.
The three averages have a side effect worth seeing in numbers. Take two runs from the same group. Run A answered in 1 turn of 150 tokens. Run B used 3 turns, one of them 250 tokens long. The weight on a single token is 1/G × 1/T × 1/|a|:
run A: 1/8 × 1/1 × 1/150 ≈ 8.3 × 10−4 · run B: 1/8 × 1/3 × 1/250 ≈ 1.7 × 10−4
So a token in the short, one-turn run counts about 5 times as much. Each run gets an equal vote, and the run splits its vote across its turns. Our reading: this keeps long, wandering runs from dominating the gradient, but it also means a single good turn in a long run gets a small share.
The paper also states a convergence result (Appendix B.3). It borrows the trust-region bound from TRPO: if the new policy stays close to the old one in KL, the true return cannot drop. Our reading: the bound is a standard result, and the paper does not show that its clipped, group-normalized objective meets the bound's exact conditions. Treat it as motivation, not a guarantee for this code.
Chapter 6
Follow a batch from 32 questions to one weight update, and count every call, token and grade on the way
Let's run one real training step, with every size the paper gives. If you can trace this, you can build it.
Press Play to send a batch through the step. Drag the average number of turns per run and watch the counts change. Teal boxes are trained, blue boxes frozen.
From the paper: 32 questions, 8 runs each, at most 3 turns, planner temperature 0.5, up to 2,048 tokens per action, GPT-4o judge, tool LLMs at temperature 0, 500-second tool timeout, 8 A100 GPUs (Section 4.1, Appendix C.1). Our arithmetic: call counts follow from those settings, with one LLM call per tool use (true for the Base Generator, the Python Coder and the summarizing search tools); token totals assume about 200 tokens per planner action (Figure 9a). The paper reports no average turn count during training, no wall-clock time and no dollar cost.
Look at the ratio in the device. With 2 turns per run, a step makes about 512 planner calls, but about 2,000 calls to frozen models: executors, tools, verifiers, generators and the judge. Only the planner calls produce gradients. The rest is the environment. In agentic RL, most of the compute goes into running the world, not into the update.
Here is the full recipe in one table.
| Setting | Value | Source |
|---|---|---|
| Backbone, all four modules and tool LLMs | Qwen2.5-7B-Instruct | Sec. 4.1 |
| Trained | the planner only | Sec. 4.1 |
| Tools | Base Generator, Python Coder, Google Search, Wikipedia Search, Web Search | Sec. 4.1 |
| Training data | Search-R1 data + DeepMath (mix ratio and size not given) | Sec. 4.1 |
| Batch | 32 questions × 8 runs = 256 runs | Sec. 4.1 |
| Turn budget | 3 in training, 10 at evaluation | App. C.1, C.2 |
| Planner sampling | temperature 0.5 (training), 0.7 (evaluation); max 2,048 tokens | App. C.1, C.2 |
| Optimizer settings | learning rate 1 × 10−6; KL β = 0.001; clip ε not reported | App. C.1 |
| Reward | GPT-4o judge, 1 or 0 | App. C.1, E.3 |
| Hardware | 8 NVIDIA A100 GPUs | App. C.1 |
| Length of training | curves run to about 60 steps (Fig. 9a); tool-use analysis at step 32 (Fig. 8) | Figs. 8, 9 |
| Full weights or adapter | not stated | — |
One honest gap stands out. The reward comes from GPT-4o, a large proprietary model, on every run. The trained system is "7B", but its training loop depends on a much larger model as the grader. The paper also uses GPT-4o as the judge at evaluation (Appendix C.2). Its judging prompt is strict about format and equivalence, so we read it as a matcher, not a source of hints. Still, a reader who wants a fully open pipeline must replace it.
Chapter 7
Compare four planners in the same system: frozen, a much bigger model, imitation of that model, and Flow-GRPO
Suppose you accept that the planner is the part to improve. There are easier ways than reinforcement learning. You could swap in a stronger model. Or you could record a strong model's plans and fine-tune the small planner to copy them. The paper tests both, with the other three modules held fixed.
Pick a planner. Bars show accuracy on six benchmarks; the thin lines are the frozen 7B planner for reference. Executor, verifier and generator are the same frozen 7B model in every case.
All numbers from Table 3. Averages over the six benchmarks: frozen Qwen2.5-7B 38.5, GPT-4o planner 44.3, SFT on GPT-4o's planner traces 19.5, Flow-GRPO 55.7.
Three results, each with a lesson.
A bigger planner helps, a little. GPT-4o as the planner raises the average by 5.8 points. On AIME24 it adds nothing (16.7 both). The authors' reading: a frozen planner, however strong, cannot adapt to how these particular modules and tools behave.
Imitation collapses. Fine-tuning the 7B planner on GPT-4o's plans drops the average from 38.5 to 19.5. GameOf24 falls from 31.0 to 7.0. The authors blame the objective: copying tokens is not the same as succeeding. Our reading adds a second cause. The copied plans were made in GPT-4o's own runs, so the small planner meets memories during deployment that it never saw in the traces. One early mistake, and it is off the map. This is the classic failure of offline imitation.
In-the-flow RL wins. Flow-GRPO raises the average by 17.2 points, to 55.7. The 7B planner trained this way beats the frozen GPT-4o planner on all six benchmarks.
So why train only the planner? The paper does not argue it at length; our reading gives four reasons.
The method also works at a smaller size. With Qwen2.5-3B-Instruct in every module, Flow-GRPO raises Bamboogle from 53.6 to 68.8, 2Wiki from 63.0 to 72.3, GAIA from 14.3 to 29.1 and AIME24 from 13.3 to 20.0 (Figure 6).
Chapter 8
Sort the ten benchmarks' baselines into fair and unfair comparisons, and find the one comparison that isolates Flow-GRPO
The paper tests on ten benchmarks in four groups. Search: Bamboogle, 2Wiki, HotpotQA and Musique, all multi-hop factual questions. Agentic: the text-only part of GAIA. Math: AIME24, AMC23 and GameOf24. Science: GPQA and MedQA. Every number is the mean of three runs.
The headline: AgentFlow with Flow-GRPO averages 57.3% on search, 33.1% on GAIA, 51.5% on math and 63.5% on science. The abstract's gains (14.9, 14.0, 14.5 and 4.1) are percentage points over the best baseline in each group, and that best baseline is a different system each time.
Pick a domain. Each bar is one system's average. The tag says how fair the comparison with AgentFlow is.
Tables 1 and 2. "Same system" means AgentFlow before Flow-GRPO: identical modules, tools and backbone. "Same backbone" means AutoGen with Qwen2.5-7B-Instruct for its agents and tools. Monolithic tool RL baselines keep their own trained weights, but the paper swaps in its Google Search and Python Coder tools at test time (Appendix C.2). Plain LLMs and GPT-4o answer without tools.
Now sort the comparisons by how much they tell us.
The cleanest: before and after Flow-GRPO. Same modules, same tools, same backbone, same evaluation. Only the planner's training differs. The gains are +10.1 points on search, +15.9 on GAIA, +19.8 on math and +7.0 on science. This comparison isolates the paper's method, and it is large.
Fair on the backbone: AutoGen. AutoGen uses the same 7B model in its agents and tools, but it is training-free and has a different design. AgentFlow beats it by 14.9 on search and 19.9 on math. Note that untrained AgentFlow beats AutoGen too (47.2 against 42.4 on search). Part of the gain is the design.
Partly fair: monolithic tool RL. Search-R1, ToRL and the rest are 7B policies trained by their own authors, on their own data, some from the Base model and some from Instruct. The paper gives them its own search and code tools at test time. That makes the tools equal. But a policy trained on one search engine's output may suffer on another's (our reading). Treat these gaps as indicative.
Not apples to apples: GPT-4o. The abstract says the 7B system surpasses GPT-4o. In Table 1 GPT-4o answers with no tools at all, while AgentFlow can search the web. On search-heavy questions that is a large handicap. The fair version of that claim is Chapter 7's: a trained 7B planner beats a frozen GPT-4o planner inside the same system.
Three smaller things a careful reader should know.
Chapter 9
Look inside the trained planner: which tools it now picks, how it uses a bigger turn budget, and how training went
Accuracy went up. But what changed in the planner's behaviour? The paper offers four views. Each one is a check that the gain comes from better decisions, not luck.
Pick a view. In Turns, drag the budget. In Tools, flip between the two benchmarks.
Tools: share of tool calls before training and at step 32, from the labelled bars of Figure 8 (small unlabelled bars omitted). Turns: accuracy read by eye from Figure 7 (end points at 10 turns match Tables 1 and 2, start points follow from the printed gains) and average turns used from Table 4. Training: reward and length traced by eye from Figure 9a; validation accuracy on AIME24 from Figure 9b, where each point is a multiple of 1/30. Scale: Figure 6.
Tools. On 2Wiki, broad factual questions, the trained planner shifts to Google Search: its share rises by 42.0 points to 70.5%, and accuracy goes from 60.0% to 77.2%. On MedQA, medical questions, it moves the other way: Google Search falls from 66.2% to 10.9%, while Wikipedia Search rises from 0 to 59.8% and Web Search from 0 to 19.5%. Nobody wrote a rule for this. The reward taught each habit where it pays.
Turns. Training used at most 3 turns. At test time, raising the budget from 3 to 10 lifts every benchmark: 2Wiki gains 15.8 points, GameOf24 20.0, AIME24 16.7 and GAIA 6.3. The planner does use the room: on GAIA its average run grows from 2.43 to 5.42 turns (Table 4). It does not just loop until the budget ends.
Training. The training reward climbs from about 0.5 to about 0.75 over some 60 steps. The planner's replies first grow to about 225 tokens, then settle near 190 to 195. On AIME24, the validation score rises from 0.10 to 0.40 by step 32, while a monolithic tool RL baseline (ToRL) drifts from 0.17 down to 0.10. Our reading: with 30 problems these curves are noisy; one point dips to 1 of 30 at step 12. The end point is what matters, and it matches Table 2.
Scale. The same recipe helps a 3B system too, on every benchmark shown. The gains are similar in size, about 9 to 15 points, except AIME24, where 3B gains 6.7 and 7B gains 23.3.
So what did the planner learn? Our reading: mostly which tool, for what, with what context. Those are exactly the decisions it controls. It did not learn new facts or new math; the frozen tools still do the work. That is the point of the design. Training the decision maker is cheap, and it makes every frozen part more useful.
Chapter 10
Lock in the cheat sheet, run Flow-GRPO in a few lines of Python, and place AgentFlow among its neighbours
You can now defend each choice in this paper. Why split the agent into modules. Why the memory is structured text written by code. Why the final grade goes to every turn. Why a group of 8 tries makes that grade useful. Why only the planner learns. Let's lock it in.
AgentFlow is a tool-using agent made of four modules. The planner picks a sub-goal and a tool. The executor writes the tool command. The verifier decides whether to stop, and the generator writes the answer. They share an evolving memory, one structured entry per turn. All four run Qwen2.5-7B-Instruct; only the planner is trained.
Flow-GRPO trains it inside the live system. For each question it runs the system 8 times, grades each final answer 1 or 0 with a GPT-4o judge, and normalizes the grades within the group. Each run's advantage goes to every one of its turns, so each turn becomes a single-turn example with its memory as the prompt. A clipped, KL-penalized update follows.
With the same system before and after training, accuracy rises by 10.1 points on search, 15.9 on GAIA, 19.8 on math and 7.0 on science. A frozen GPT-4o planner gains far less, and imitating GPT-4o's plans makes the planner worse.
| Quantity | Value | Source |
|---|---|---|
| Modules | planner (trained), executor, verifier, generator (frozen); all Qwen2.5-7B-Instruct | Sec. 3.1, 4.1 |
| Training batch | 32 questions × 8 runs; ≤ 3 turns; ≤ 2,048 tokens per planner action | Sec. 4.1, App. C.1 |
| Optimizer | lr 1 × 10−6; KL β = 0.001; planner temperature 0.5; 8 A100s | App. C.1 |
| Reward | GPT-4o judge, 1 or 0, broadcast to every turn | Eq. 4, App. E.3 |
| Search average (4 sets) | 47.2 → 57.3; AutoGen 42.4; Search-R1 33.3; GPT-4o, no tools, 49.1 | Table 1 |
| GAIA (text) | 17.2 → 33.1; Search-R1 19.1; GPT-4o 17.3 | Table 1 |
| Math average (3 sets) | 31.7 → 51.5; ToRL 37.0; AIME24 16.7 → 40.0 | Table 2 |
| Science average (2 sets) | 56.5 → 63.5; TIR 59.4 | Table 2 |
| Planner ablation (6-set average) | frozen 38.5; GPT-4o 44.3; SFT 19.5; Flow-GRPO 55.7 | Table 3 |
| Turn budget at test | 3 → 10 turns: 2Wiki +15.8, GameOf24 +20.0, AIME24 +16.7, GAIA +6.3 | Fig. 7, Table 4 |
The sketch below is Flow-GRPO in miniature, and it runs as written with NumPy. The planner is a table of tool preferences for three memory states. The executor, tools, verifier, generator and judge are frozen code. Each step grades 32 questions with 8 runs each, broadcasts each run's advantage to its turns, and takes one step on the planner only.
pythonimport numpy as np rng = np.random.default_rng(0) TOOLS = ["base", "search", "python"] # memory state the planner sees: 0 = only the question, 1 = the ID is found, 2 = the digit is computed def env_turn(s, tool): """Frozen executor + tool + verifier for one turn. Returns (new state, verifier says STOP).""" if s == 0 and tool == "search" and rng.random() < 0.8: s = 1 # search finds the ID elif s == 1 and tool == "python" and rng.random() < 0.9: s = 2 # code computes the check digit return s, s == 2 def generator_and_judge(s): """Frozen generator answers from memory; the judge returns 1 if the answer is right.""" return 1.0 if s == 2 else float(rng.random() < 0.05) # without the result it guesses theta = np.zeros((3, 3)) # the planner: logits over tools for each memory state def policy(s): p = np.exp(theta[s] - theta[s].max()); return p / p.sum() def rollout(t_max): s, turns = 0, [] for _ in range(t_max): a = rng.choice(3, p=policy(s)); turns.append((s, a)) s, stop = env_turn(s, TOOLS[a]) if stop: break return turns, generator_and_judge(s) def success(t_max, n=4000): return np.mean([rollout(t_max)[1] for _ in range(n)]) print(f"before: {success(3):.2f} at 3 turns, {success(10):.2f} at 10 turns") G, B, lr = 8, 32, 2.0 for step in range(60): # 60 training steps, 3-turn budget grad = np.zeros_like(theta) for q in range(B): # 32 questions per batch group = [rollout(3) for _ in range(G)] # 8 runs of the whole system R = np.array([r for _, r in group]) if R.std() == 0: continue # all 8 agree: no signal from this question A = (R - R.mean()) / R.std() # group-normalized advantage, one per run for (turns, _), a_i in zip(group, A): for s, a in turns: # broadcast a_i to every turn: single-turn updates g = -policy(s); g[a] += 1.0 # gradient of log pi(a | s) w.r.t. the logits grad[s] += a_i * g / len(turns) / G # 1/T_i and 1/G weights, as in Eq. 5 theta += lr * grad / B # one on-policy step: ratio = 1, so no clip needed print(f"after: {success(3):.2f} at 3 turns, {success(10):.2f} at 10 turns") for s, name in enumerate(["question only", "ID found"]): print(f" {name:13s} ->", {t: round(float(p), 2) for t, p in zip(TOOLS, policy(s))}) # before: 0.24 at 3 turns, 0.83 at 10 turns # after: 0.93 at 3 turns, 1.00 at 10 turns # question only -> {'base': 0.01, 'search': 0.98, 'python': 0.01} # ID found -> {'base': 0.01, 'search': 0.01, 'python': 0.98}
Three things to try. Replace A with the raw grade R. In this easy toy it still learns (we got 0.92), because failed runs simply get no push; the group baseline earns its keep when most runs fail or most succeed. Give only the last turn the advantage, and see the planner learn the Python step but not the search (we got 0.39). Train with rollout(1) and the planner never sees the second step at all.
Now press Present or Teach and explain, out loud and from memory, how one final grade trains every turn of the planner, and why the group of 8 matters. If you can, you own this paper. Then go back to the Helotiales question and watch the untrained and trained planners side by side once more.