When a vision-language model answers a question about an image with help from retrieved documents, a correct final answer can hide a bad reasoning trace. The model may name the wrong entity, cite a passage that never states the claimed fact, or invent a number and still land on the right answer. Training with a single reward for answer correctness cannot see any of this. We propose a different reward. For each training question, a language model writes a small executable program that checks the model's reasoning against the evidence that was actually retrieved. Before any program is used for training, we test it by feeding it deliberately corrupted reasoning traces and discard it unless it rejects them. The program's output then becomes a step-level reward for reinforcement learning.
The main claim is that per-question reward programs, written from the retrieved evidence and filtered by this corruption testing, reduce intermediate hallucination in retrieval-augmented multimodal question answering more than answer-only rewards or neural judges do, without costing answer accuracy. The comparison that matters most is against a claim-by-claim entailment checker, the strongest simple alternative. The program's structure should help most where evidence is exact, such as entity names, dates, table cells and arithmetic, and where the right behavior is to abstain because the evidence is missing.
Why this gap, and what already exists
Three findings motivate the proposal. Multimodal models often perceive correctly and then reason badly. On MATH-Vision, 42.2% of GPT-4V's errors were reasoning errors made after the visual elements had been identified correctly. Plot Twist shows that models lean on text cues such as chart titles instead of the visual data. Adding retrieval brings failures of its own. RAG-RewardBench benchmarks 45 reward models on preference pairs covering citation, abstention and evidence conflict. It finds that the best one reaches only 78.3% and that citation judgments lag general helpfulness by about 10%. Neural reward models therefore look least reliable exactly where retrieval makes grounding checkable.
Existing work covers pieces of this. MM-RewardRAG trains a query translator and reranker for multimodal retrieval-augmented generation from a scalar answer-correctness reward, keeping the vision-language model frozen. We instead train the generator itself and reward the steps of its trace, not only the outcome.
Several papers supply parts of the method. ARM-FM has foundation models write reward machines, which are state machines of sub-goals with executable Python checks, for reinforcement-learning control tasks. We reuse the reward-machine form. The difference is that we write one machine per question, conditioned on retrieved documents. We also replace ARM-FM's critic model, which reviews code for syntax and logic flaws, with behavioral testing against corrupted traces. URSA trains an 8B neural process reward model, partly on data where misreadings are deliberately inserted into correct solutions. We borrow that corruption idea, but use it to test reward programs rather than to train an opaque scorer. Chart-R1 shows that a hand-written soft numerical reward trained with GRPO (group relative policy optimization, a reinforcement-learning method that compares several sampled answers to the same prompt) works well on charts, reaching 91.04% on ChartQA. That result tells us a strong outcome reward is a serious competitor.
Other work addresses nearby problems without retrieval-grounded step checks. RetrievalPRM retrieves reference solutions so that a text-only process reward model can handle unfamiliar problems. IRIS penalizes responses that stay likely when the image is removed, but it has no retrieval, and its gains on compositional hallucination were modest. CARE rewards calibrated confidence in medical visual question answering, also without retrieval. None of these rewards step-level agreement between a multimodal trace and retrieved evidence through inspectable code.
Core Mechanism
For each training question, the pipeline first runs a fixed retriever and returns the retrieved passages, tables and entity pages. A synthesizer model then receives the question, these documents and the gold answer, and writes a reward machine. This is an ordered set of sub-goal states, each paired with a Python check. A typical machine for an Infoseek-style question ("what year was this building completed?") has four checks. The first asks whether the trace names an entity that matches a retrieved entity page title or alias. The second asks whether the trace cites a retrieved chunk. The third asks whether that chunk contains the stated attribute value, by exact or normalized match. The fourth asks whether any arithmetic in the trace executes to the stated result.
Checks call a small shared library of primitives: string and alias matching, number parsing with tolerance, table-cell lookup, a citation resolver, and an optional image-ablation likelihood test borrowed from IRIS's rectified visual guidance. The last primitive applies only to claims about the image itself.
If the synthesizer finds that the required fact is absent from the retrieved set, it writes an abstention branch. In that case the only rewarded path is a response that declines to answer or flags insufficient evidence. This targets the abstention failures documented in RAG-RewardBench.
Programs are then tested by corruption before use. From a reference trace (a gold-grounded trace produced by a strong model and kept only if its answer is correct), we automatically build corrupted variants. These swap the entity for a retrieved distractor, perturb the key number, point the citation at an irrelevant chunk, delete the evidence step while keeping the answer, or pad the trace with extra claims. A program is kept only if two conditions hold. It must pass the reference trace, and it must reject each corruption type it claims to cover. Programs that fail are regenerated up to a fixed budget and otherwise dropped, in which case the question falls back to outcome reward. The fraction of corruptions caught is recorded and used as a per-program reliability weight.
The policy is trained with GRPO using
$$r = \alpha \cdot c + (1-\alpha) \cdot w \cdot \frac{k}{K},$$
where the symbols are defined as follows. $c$ is soft answer correctness, as in Chart-R1. $k$ is the number of reward-machine states satisfied in order. $K$ is the total number of states. $w$ is the program's corruption-catch rate, and $\alpha$ sets the weight of the outcome term. Counting only states satisfied in order means that omitting a claim earns nothing, so the policy cannot dodge checks by saying less.
Research Program
The work has three stages.
The first stage builds the synthesizer, the primitive library and the corruption generator for four benchmarks: Infoseek, E-VQA, WebQA and MultimodalQA. Their evidence types differ. Infoseek and E-VQA rest on entity knowledge, WebQA on web text and images, and MultimodalQA on tables, text and images.
The second stage evaluates the reward programs on their own, before any policy training. This includes scoring the text-only RAG-RewardBench preference pairs, where the file gives a clear reference number.
The third stage trains Qwen2.5-VL-7B, the backbone used by Chart-R1. To match MM-RewardRAG's data scale, we use a budget of about 4,000 training questions per benchmark family, and the retriever is shared across all methods. We also study how often the programs themselves are wrong. On a sample of 300 programs, human annotators judge whether each check encodes the right grounding condition. We then compare programs that pass corruption testing with those that fail it, to see whether corruption testing actually filters out bad specifications.
Baselines
The naive reference point is the untrained Qwen2.5-VL-7B with the same retriever and top-K context, prompted to reason step by step and cite its sources. It sets the floor for both accuracy and hallucination.
The first strong competitor is outcome-only GRPO: the same backbone, data, retriever and number of rollouts, rewarded only by $c$. This is our reimplementation of the Chart-R1 reward style applied to retrieval. It is the strongest simple competitor because Chart-R1's ChartQA result shows outcome rewards can be very effective. Our method beats it only if the grounded-claim rate rises and the fabricated-citation rate falls while answer accuracy stays within one point.
The second competitor is MM-RewardRAG, the strongest existing method on these exact benchmarks. It reports 43.2% on E-VQA and 39.8% on Infoseek in End-to-End Optimization for Multimodal Retrieval-Augmented Generation via Reward Backpropagation. For WebQA and MultimodalQA, no reported result was found on Lacuna. We cite its numbers as the external reference. We also run its adapter training on our retriever and backbone, so that the comparison controls for model choice. We then combine its adapters with our generator training to test whether the two are complementary. Matching or exceeding its reported accuracy while also reducing intermediate hallucination counts as beating it.
The third competitor is a neural step judge. We use a prompted open 72B vision-language judge, and a GPT-4o judge on a subset, each scoring every step's grounding against the same retrieved documents. The judge's score replaces the $k/K$ term, and the rollout budget is held equal. For calibration, RetrievalPRM shows that zero-shot GPT-4o reaches 61.9 average F1 as a step critic on ProcessBench, below a retrieval-augmented 7B process reward model at 65.8.
The fourth competitor is a claim-level entailment verifier. A natural-language-inference model scores each extracted claim against its cited chunk, and the fraction of entailed claims replaces $k/K$. It is described further under the alternatives below.
Two ablations isolate our key ingredients. The first removes corruption testing, using raw synthesized programs with $w=1$. The second keeps the checks but flattens the ordered machine into an unordered checklist. A third, smaller ablation removes the abstention branch.
Why not just…?
Why not just reward the final answer, since Chart-R1 shows that already works? Outcome rewards train accuracy but are blind to how the answer was reached. URSA found that outcome reinforcement learning encouraged verbose responses that gamed the reward. R1-Reward found final answers paired with contradictory reasoning. Our outcome-only baseline tests this directly. If it matches our method on the grounded-claim rate, the process reward is not needed, and we will report that.
Why not just use GPT-4o or a large open model as the step judge? Judges are expensive and give coarse scores. IRIS reports that external-feedback curation took up to 66 hours against 1.5 hours for internal scoring. Neural judges also sit on the model-based side of RAG-RewardBench, where no model exceeds 78.3%, and citation judgments are about 10% weaker. The judge baseline under equal rollouts settles the question. A judge that produces equally grounded policies would make our method only a cost reduction.
Why not just check each claim with an entailment model? This is the real threat. Entailment checking is simpler, needs no code generation, and may handle loosely phrased text evidence better than string matching. Our bet is narrower. Exact evidence such as numbers, dates, table cells and entity aliases is where entailment models blur distinctions and executable checks do not. In addition, the ordered machine and abstention branch penalize omission and unwarranted answers, which a per-claim entailment score cannot do. We will report results split by evidence type. If entailment matches us on MultimodalQA tables and Infoseek numeric attributes, we will conclude that programs help only as a cheaper, inspectable verifier. We also test a hybrid in which programs can call an entailment primitive for free-text claims.
Why not just fine-tune on grounded traces? RAG-RewardBench reports that supervised retrieval-augmented models barely improve on preference alignment over their base models. CARE found that supervised fine-tuning alone left models miscalibrated. We include fine-tuning on the corruption-free reference traces as an additional baseline at equal data.
Proposed Experiments
The primary metrics are answer accuracy on each benchmark and two measures of intermediate hallucination. The first is the grounded-claim rate, the fraction of factual claims in a trace supported by the cited chunk. The second is the fabricated-citation rate. Both are measured by human annotation of 500 traces per method, blind to method. They are backed up by a held-out judge model that is used by no training reward. For the insufficient-evidence subset, which we build by removing the gold document from retrieval, we measure the abstention rate.
The decisive checks come in three parts.
The first check is reward-level. Applied as a reward model on RAG-RewardBench's text pairs, the corruption-tested programs should exceed the 78.3% reported for the best model. They should do especially well on the citation and abstention subsets. If they fall below the untested programs on those subsets, corruption testing is not selecting good specifications.
The second check is policy-level. Against outcome-only GRPO and the entailment reward, our policy should raise the grounded-claim rate by a clear margin without losing more than one point of accuracy. The gain should be concentrated on numeric and entity evidence.
The third check measures reward hacking. Over training, we track the gap between each method's own reward and human-judged grounding. A reward that the policy exploits will show a growing gap. The corruption-tested programs should show the smallest gap, and removing corruption testing should widen it. If the gap does not differ across methods, the corruption-testing claim fails regardless of accuracy.
References
- Measuring Multimodal Mathematical Reasoning with MATH-Vision Dataset
- Plot Twist: Multimodal Models Don't Comprehend Simple Chart Details
- RAG-RewardBench: Benchmarking Reward Models in Retrieval Augmented Generation for Preference Alignment
- End-to-End Optimization for Multimodal Retrieval-Augmented Generation via Reward Backpropagation
- ARM-FM: Automated Reward Machines via Foundation Models for Compositional Reinforcement Learning
- Unlocking Multimodal Mathematical Reasoning via Process Reward Model
- Chart-R1: Chain-of-Thought Supervision and Reinforcement for Advanced Chart Reasoner
- Retrieval-Augmented Process Reward Model for Generalizable Mathematical Reasoning
- IRIS: Implicit Reward-Guided Internal Sifting for Mitigating Multimodal Hallucination
- CARE: Confidence-Aware Reasoning for Reliable Medical VQA
- R1-Reward: Training Multimodal Reward Model Through Stable Reinforcement Learning