Why PPO Beat GRPO at Teaching a Vision-Language Model to Solve Mazes
We showed a vision-language model pictures of mazes and trained it with four reinforcement-learning recipes. The popular critic-free ones pushed the reward up but solved few mazes. Plain old PPO, which judges every move on its own, did better.
Table of contents
TL;DR
- The question: vision-language models (VLMs) describe images well but are weak at spatial reasoning. Can reinforcement learning (RL) teach one to find its way through a maze it sees as a picture?
- The bet: a maze is solved by a whole path, so we expected sequence-level RL methods (GRPO and its newer cousins GSPO and GMPO), which score whole answers, to suit it best.
- The setup: LLaVA-7B, first fine-tuned on 1,000 example answers so it writes clean JSON, then trained with RL on randomly generated mazes from 3×3 up to 10×10, smallest first.
- What happened: the GRPO family raised the average reward (GRPO levels off around 6), but success stayed low. GMPO had the best reward curve and still solved few mazes. PPO, with a learned value function and a small reward for every step, reached the highest success rates.
- The lesson: the bet was wrong. Handing one score to a whole path blurs which moves mattered. For mazes, judging each move on its own (step-level credit assignment) is what counts.
1. Why mazes
Vision-language models are language models that can also look at images. They are good at saying what is in a picture: recognising objects, answering questions about a scene, spotting patterns. They are much weaker at where: keeping track of positions, walls and paths, and planning a sequence of moves through space.
The usual fix is supervised fine-tuning: collect example answers and train the model to copy them. That teaches the model the format and the general shape of good answers, but it doesn't do much for its reasoning, and a fixed dataset only covers so many situations. Reinforcement learning is different. The model tries, the environment says how well it did, and the model is nudged toward what worked. That is how recent language models learned to reason through maths problems, so we wanted to see whether it could teach a VLM to reason about space.
Mazes are a clean test. They are easy to generate in any size, easy to check (you either reach the goal or you don't), and impossible to solve without tracking where the walls are. Related work had trained a text-only model on mazes written out as grids of symbols. We wanted the model to work from an actual picture.
We went in with two competing hypotheses:
- H1: sequence-level RL (GSPO, GMPO), which optimises whole answers rather than individual tokens, should suit a long-horizon task like a maze.
- H2: methods that give fine-grained, step-by-step credit (like PPO) might still win when every single move has to be right.
2. The setup
The mazes. We generate random mazes with the gym-maze environment and keep only those that depth-first search confirms are solvable. Training follows a curriculum: small mazes first, then bigger ones as training goes on, up to 10×10. Illegal moves, like walking into a wall, aren't allowed, as they wouldn't be for a real agent.
The model. We use LLaVA-7B, an open vision-language model. Each episode gives it a maze image plus an instruction to navigate to the goal, and it writes some reasoning followed by its move or moves.
A warm-up first. RL needs to read the model's answer reliably, so before any RL we fine-tuned the model to answer in a fixed JSON format with a "thoughts" field and an "actions" field. We had GPT-4o-mini write 1,000 synthetic example answers and trained on the whole answer, reasoning included, for 4 epochs at learning rate 5e-6. Earlier work trained only on the action tokens.
The algorithms. We compared four RL algorithms: GRPO, GSPO and GMPO, which have no critic and score whole answers, and PPO, which does have a critic and scores every step. The next section explains the difference, because it turns out to be the whole story.
3. Two ways to hand out credit
Every RL method has to answer the same question: when an attempt goes well or badly, which decisions get the credit or the blame? This is called credit assignment, and our four algorithms answer it in two different ways. They also make the model play the maze differently.
GRPO, GSPO, GMPO: plan the whole path in one shot
UP, UP, RIGHT, …→
run every move in the maze→
one score for the whole answer
PPO: one move at a time
N, S, E or W)→
agent moves→
small reward for this move
The GRPO family: compare answers within a group
GRPO (Group Relative Policy Optimization) is the recipe behind a lot of recent reasoning models. For each maze, the model writes a group of answers. Each answer gets one reward, and its advantage is how much better it did than the group's average:
Every token in that answer is then pushed up or down by the same advantage, with PPO-style clipping so no single update moves the model too far, and a penalty for drifting from a reference model. The appeal is that there is no critic: PPO normally trains a second network, often as big as the model itself, just to estimate how good each state is. GRPO replaces it with the group average.
Two newer variants keep that critic-free design but change how the update is weighted:
- GSPO (Group Sequence Policy Optimization) argues that GRPO's per-token weighting is noisy and can even collapse the model, and moves the whole objective to the level of the sequence, matching how the reward is given. This is the most “sequence-level” of the three, and the one H1 was really about.
- GMPO (Geometric-Mean Policy Optimization) goes back to per-token ratios but combines them with a geometric mean instead of an arithmetic one, which makes it less sensitive to outliers and more stable.
PPO: judge every move
PPO (Proximal Policy Optimization) is the classic actor-critic method. We attach a small value head (an MLP) to the VLM that estimates how much future reward the agent can expect from its current position. After each move, PPO compares what actually happened with that estimate:
“Did this move leave me better off than I expected?” Generalized advantage estimation (GAE) then blends these over the following steps.
The result is a separate advantage for every move, not one number smeared across the whole path.
4. What counts as a good answer
The two families need different rewards, because one scores a whole answer and the other scores single moves.
GRPO family: one reward per answer
Each answer's reward is a formatting part plus an execution part:
- Format: a bonus for having exactly one reasoning block and exactly one actions block.
- Unreadable: if the moves can't be parsed, the execution reward is −1.
- Solved: a large fixed reward, plus an efficiency bonus that grows the shorter the path is (it drops to zero once the path is twice the starting Manhattan distance to the goal, or longer).
- Not solved: partial credit for the fraction of the starting distance to the goal that was closed.
PPO: a small reward for every move
We tried several step rewards. The best one, which we call the dense reward, is simply how much closer the move brought the agent to the goal in Manhattan (grid) distance, minus a small time penalty, plus a bonus on reaching the goal:
d = Manhattan distance to the goal. Time penalty 0.3 and goal bonus 5 came from a small, non-exhaustive search. The very first step instead gets −d0 − 0.3.
Because the agent moves one cell at a time, the distance part of each move's reward is always between −1 and +1. The runner-up used the normalised straight-line (Euclidean) distance to the goal as a penalty instead, with the same kind of time penalty and goal bonus.
5. Results: the GRPO family
All of the charts below are the training curves from the paper, exported from our experiment logs. The y-axis of the GRPO-family charts is the maze execution reward described above.
GRPO learns, then plateaus
GRPO clearly learns something: the average reward rises and settles around 6. The spread stays large relative to the average, a sign of how sensitive the method is to its group baseline. The spread also keeps growing as training goes on, which we read as the model exploring more varied paths.
GSPO: the sequence-level bet does worse
This was the first surprise. GSPO, the method most aligned with our hypothesis that mazes are a sequence-level problem, converged to a lower reward than GRPO, with a similar spread. It also had a sharp dip midway through training that we can't explain, after which the reward climbed back. It was the first hint that sequence-level methods might be the wrong tool here, and it sent us back to GMPO, which works with per-token ratios again.
GMPO: best reward curve, few solved mazes
On reward alone, GMPO is the winner: it climbs fastest and reaches the highest values of any critic-free method. But reward is not the goal. The goal is to reach the red circle.
Reward went up; solved mazes didn't follow. The partial-credit reward pays for getting close to the goal. A single score per answer can't tell the model which moves turned “almost there” into “there”, so it learns almost-correct paths.
6. Results: PPO
That pointed us to PPO, which gives step-level credit through its value function and directly maximises expected return, a much closer match to “solve the maze”. Here are our two best PPO runs, one with each step reward.
PPO with the dense reward did best of everything we tried: its success rate jumps within the first couple of dozen steps and stays high for the rest of the run, an improvement on GMPO. The Euclidean version starts well but drifts down, so the shape of the step reward matters too.
7. Why step-level credit wins
Our results contradict H1. Scoring whole answers gave no advantage on this spatial task; giving each move its own credit did. We think three things explain it.
One score gets smeared over every move. GRPO, GSPO and GMPO all compute a single reward per answer, turn it into an advantage, and apply it to every token of that answer. If a path wanders but eventually succeeds, the wasted moves get exactly the same reinforcement as the moves that mattered. The signal for any individual move is diluted and noisy.
The last few moves decide everything. In a maze, the difference between an almost-solved path and a solved one is often a handful of late moves. The goal bonus is meant to reward those, but successes are rare and the group-based gradients are noisy, so it barely registers. Group normalisation makes this worse: dividing by the group's spread squeezes the gap between “nearly there” and “there”, until the goal bonus hardly matters. That is exactly the GMPO pattern: reward goes up, success stays low.
A maze is a local problem. PPO's critic and GAE tie each move to the future reward from the position it leads to, which is exactly the information a maze needs. When the agent does reach the goal, the bonus flows back through several steps of value updates instead of being one rare, high-variance number. This held even though the critic's own loss didn't fully converge.
The takeaway: solving a maze looks like a long-horizon planning task, but it behaves more like a classic step-by-step decision problem with local rewards. For that kind of problem, fine-grained, per-move credit assignment (H2) still matters, even for a 7-billion-parameter VLM.
8. What we don't claim
This was a class project and an early study, and the comparison has real gaps:
- The two families didn't play the same game. The GRPO family wrote the whole path from one image; PPO chose one move at a time from an updated image of its current position. Part of PPO's advantage may come from that feedback, not only from the algorithm.
- Different rewards and metrics. The families used different reward functions, and the success curves aren't the same measure (GMPO's is a cumulative success rate; PPO's is a per-episode mean), over different numbers of steps. The run label on one PPO chart (
custom-maze-5x5) also suggests at least that PPO run used 5×5 mazes rather than the full curriculum; the paper doesn't say. The comparison is qualitative, not a controlled head-to-head. - Small sweeps, no repeats. Each curve is one training run, with no repeated seeds reported, and the PPO reward settings came from a small, non-exhaustive search. We don't know what caused GSPO's mid-training dip.
- Toy environment. 2D, deterministic grid mazes up to 10×10, one model (LLaVA-7B). Real robot navigation is 3D, noisy and stochastic.
Next, we'd like to try hierarchical RL objectives, state-space models and learned world models, and to move from 2D grid mazes toward 3D, noisy robot exploration.
9. The paper
Everything above comes from our project write-up, which has the full objectives, gradient derivations, pseudo-code and prompts.
Class project paper · MIT EECS
Understanding Spatial Reasoning in Vision-Language Models via Sequence-Level Reinforcement Learning
Videet Mehta, Shaurya Agrawal
- Trains LLaVA-7B to solve 3×3 to 10×10 maze images with GRPO, GSPO, GMPO and PPO, after a 1,000-example JSON warm-up.
- The critic-free methods raise reward (GRPO plateaus around 6; GMPO climbs highest) but solve few mazes.
- PPO with a dense, per-move Manhattan-distance reward reaches the highest success rate, supporting step-level credit assignment over sequence-level optimisation.