MemReward: Graph-Based Experience Memory for LLM Reward Prediction with Limited Labels

Tianyang Luo, Tao Feng, Zhigang Hua, Yan Xie, Shuang Yang, Ge Liu, Jiaxuan You

TL;DR

MemReward is a novel graph-based framework designed to solve the label-scarcity problem in reinforcement learning (RL) for LLM reasoning. By organizing training rollouts into a heterogeneous graph and using a Graph Neural Network (GNN) to propagate rewards from a small set of labeled examples to unlabeled ones, MemReward achieves up to 97.3% of full-supervision (Oracle) performance using only 20% of ground-truth labels.

What Problem Does This Paper Address?

Post-training large language models (LLMs) via reinforcement learning—such as the recent DeepSeek-R1 models—has dramatically advanced machine reasoning. However, these methods rely heavily on calculating rewards over thousands of sampled rollouts.

For complex tasks like mathematical proofs, code generation, or open-ended question answering, verifying correctness automatically is incredibly difficult, while relying on human experts or manual verification at scale is prohibitively expensive. When ground-truth labels are scarce, online RL fine-tuning stalls. MemReward addresses this bottleneck by introducing a semi-supervised label propagation approach directly into the online policy optimization loop.

Methods

MemReward treats an LLM's training history as an evolving relational structure rather than independent data points. It constructs a cross-domain heterogeneous graph consisting of three node types and three edge types:

  • Nodes: Queries ($q$), Thinking Processes ($t$), and Final Answers ($a$).
  • Edges: Structural edges connecting a query to its generated thinking process and final answer, alongside semantic similarity edges connecting similar queries (built using top-$k$ cosine similarity from a sentence encoder).

The framework operates in two distinct phases:

  1. Warmup Phase: The GNN is trained on a small pool of labeled rollouts. It uses heterogeneous neighborhood aggregation to pass messages across the query-thinking-answer structures, learning to predict binary correctness rewards via a cross-entropy loss.
  2. Online RL Phase: During online training (using Group Relative Policy Optimization, or GRPO), the LLM policy generates new rollouts. Labeled queries receive standard ground-truth rewards. Unlabeled queries are dynamically attached to the frozen warmup graph based on embedding similarity, and the GNN predicts their rewards on the fly.
Figure 2: Overview of MemReward. Rollouts generated by the initial policy are stored as experience memory and organized into a heterogeneous graph for reward prediction. (Left) Warmup Phase: We construct a heterogeneous graph from labeled rollouts, where query nodes connect via embedding similarity, and each query links to its thinking and answer nodes. A GNN is trained to predict rewards through relational message passing. (Right) Online Phase: During GRPO training, labeled rollouts receive ground-truth rewards while unlabeled rollouts connect to the warmup graph via top-k similarity edges and obtain GNN-predicted rewards.

Datasets

The authors evaluated MemReward across 13 datasets spanning three core reasoning domains:

  • Mathematical Reasoning: GSM8K, GSM-Symbolic, MATH, and NuminaMath (used as an out-of-domain benchmark).
  • Question Answering (QA): MMLU, CommonsenseQA, OpenBookQA, ARC-Challenge, GPQA, SIQA (out-of-domain), and PIQA (out-of-domain).
  • Code Generation: HumanEval+ and MBPP+.

Key Insights and Ideas

  • The Power of "Thinking" Nodes: Ablation studies revealed that omitting the intermediate "thinking process" node severely degrades performance in math and coding tasks. Explicitly modeling the reasoning path allows the GNN to evaluate how the model arrived at an answer, rather than just checking the final output against the query.
  • Heterogeneity is Crucial: Treating the graph as homogeneous (collapsing all edge types into one) hurts performance. Separating problem-to-problem similarity from solution correctness preserves the hierarchical structure necessary for accurate reward assignment.
  • Robustness to Policy Shifts: Even as the online LLM policy updates and shifts its response distribution, the semantic relationships between queries remain stable. This allows a frozen GNN to provide highly reliable reward signals throughout the entire RL trajectory.

Key Results

  • Closing the Supervision Gap: With a strict budget of only 20% ground-truth labels, MemReward achieved 96.6% of Oracle performance on Qwen2.5-1.5B and 97.3% on Qwen2.5-3B.
  • Outperforming Baselines: MemReward consistently outperformed standard partial-label training, $k$-NN majority voting, and standard LLM-based reward models (LLM-RM), particularly when the base policy was weaker (1.5B scale).
  • Strong Out-of-Domain Generalization: On held-out datasets like NuminaMath, the GNN successfully transferred reward patterns across domain boundaries without any task-specific fine-tuning, trailing the Oracle by a mere 0.23 points on the 3B model.
Figure 1: MemReward approaches Oracle performance with only 20% labels. Using the same 20% ground-truth labels, MemReward (purple) substantially outperforms partial labels (R1-p, gray), closely approaching fully-supervised Oracle performance (green) on both in-domain and out-of- domain tasks across both model scales.

Limitations and Future Work

  • Model Scale & Families: The evaluation focused exclusively on smaller Qwen2.5 models (1.5B and 3B). Validating the framework on larger scales and alternative model families (e.g., Llama, Mistral) remains an open step.
  • Fixed Similarity Metrics: The query-query graph structure currently relies on a frozen, off-the-shelf sentence encoder (all-MiniLM-L6-v2). Developing learnable or task-specific similarity metrics could yield cleaner graph structures and finer-grained reward transfer.
  • Graph Scalability: As the pool of rollouts grows exponentially during long RL runs, scaling the framework will require more efficient graph construction and sparse aggregation algorithms.

Summary updated

BibTeX
@inproceedings{luo2026memreward,
  author = {Tianyang Luo and Tao Feng and Zhigang Hua and Yan Xie and Shuang Yang and Ge Liu and Jiaxuan You},
  title = {{MemReward: Graph-Based Experience Memory for LLM Reward Prediction with Limited Labels}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=A5lXDI842J},
}
Figure