← Home

MeRLa: Meta-Learned Reward Shaping for Better RLHF

By James Trappett · 31 July 2026

4 min read

Reinforcement Learning from Human Feedback has become the standard post-training step for aligning large language models, but its core reward mechanism has a structural weakness that is easy to overlook: the reward model is trained once, on static preference data, and then applied uniformly across wildly different prompt types. A model asked to score a creative writing response and a step-by-step mathematical proof is using the same fixed signal for both. This mismatch produces sparse gradients, encourages policy overoptimization, and imposes what the literature calls an alignment tax on general capabilities.

MeRLa (Meta-Learned Reward Shaping) is a new framework that addresses this directly by meta-learning a task-aware shaping function before RLHF training begins. The paper is worth reading carefully, both for its practical results and for the theoretical scaffolding it builds around reward shaping, an area that has historically been underspecified in the RLHF literature.

The Core Problem and Why It Matters

The standard RLHF pipeline trains a reward model on pairwise preference data and then uses that model as a fixed oracle during policy optimization. The problem is not that reward models are bad; it is that they are task-agnostic. A prompt about coding safety and a prompt about historical summarization will receive reward signals shaped by the same learned function, regardless of whether that function captures the relevant quality dimensions for either task.

This leads to three well-documented failure modes: reward sparsity (subtle quality differences get nearly identical scores), overoptimization (the policy finds and exploits blind spots), and capability degradation from over-fitting to a narrow signal. Prior work has addressed parts of this with process reward models and rubric-based feedback, but these approaches enhance what the reward model measures rather than how it adapts to task context.

Key Contributions

Methodology

MeRLa operates in two phases. During meta-learning, a shaping network is trained across a distribution of auxiliary tasks using a bilevel optimization setup: the inner loop performs standard RLHF on individual tasks, while the outer loop optimizes the shaping function to generalize across tasks. This is a principled application of meta-learning to reward design, and the bilevel framing is cleaner than ad hoc reward engineering approaches.

The shaping network itself is deliberately lightweight: a two-layer MLP with hidden dimension 256 and SiLU activations, taking concatenated prompt and response embeddings from the base LLM's penultimate layer, plus their difference vector. The difference term is a sensible architectural choice, encoding how far the response has moved from the prompt context in representation space. The whole network adds fewer than one million parameters.

At deployment, the shaped reward is added to the base reward model output, producing a composite signal. The potential-based formulation of the conservation loss is what provides the policy invariance guarantee: under standard potential-based shaping theory (Ng et al., 1999), adding a potential difference to a reward does not change the optimal policy. MeRLa formalizes this for the RLHF setting and provides bounds on the residual bias when the conservation loss is non-zero.

The meta-objective combines three terms: a task discrimination loss that encourages the shaping function to produce signals that distinguish task types, an entropy regularization term that prevents collapse to degenerate reward landscapes, and the conservation loss that enforces potential-based constraints. The ablation study confirms all three contribute meaningfully, with the task sampler being the single most important component, accounting for a 5.5% drop when removed.

Results and What They Show

On LLaMA-3-8B-Instruct, MeRLa with a GRPO backbone achieves:

The compatibility analysis is particularly informative. MeRLa improves PPO by 6.6 points and GRPO by 6.5 points, but only improves DAPO by 3.9 points. The paper attributes this to DAPO's dynamic sampling already partially addressing reward sparsity. A striking result is that MeRLa combined with PPO (85.2%) outperforms standalone GRPO (84.3%), which suggests that reward signal quality can compensate for algorithmic sophistication to a meaningful degree. This has practical implications: organizations with existing PPO infrastructure may not need to migrate to newer algorithms if they can improve the reward signal instead.

The process reward model experiments confirm that MeRLa is additive with step-level feedback rather than redundant with it, which is the right property for a shaping framework to have.

Limitations and Open Questions

The authors are appropriately candid about what the framework does not yet address. The meta-learning phase adds roughly two GPU-hours on 8xA100 for 64 tasks, which is modest but not negligible. More substantively, the policy invariance guarantee holds exactly only when the conservation loss is zero; in practice the residual bias appears to help, but this is not yet formally characterized. That is worth following up on, since it means the theoretical guarantee and the empirical benefit may be coming from slightly different mechanisms.

The shaping network operates on fixed-length pooled embeddings, which discards token-level structure. For tasks where the quality of specific reasoning steps matters, token-level shaping would be more expressive. The authors flag this as future work, and it connects naturally to the process reward model literature.

All experiments use a single base model. The degree to which the meta-learned shaping function transfers across model scales or architectures is unknown. Given that the shaping network takes embeddings from the base LLM's penultimate layer, the function is implicitly tied to that model's representation geometry, and it is not obvious how much retraining would be needed when switching base models.

There is also a broader question about the auxiliary task distribution. The paper does not extensively analyze sensitivity to task distribution choice during meta-learning, which matters for practitioners who need to construct that distribution for a new domain.

Overall, MeRLa makes a credible theoretical and empirical case that reward shaping is an underexplored lever in RLHF, and that meta-learning provides a principled way to make shaping task-aware. The framework is compatible with existing RLHF algorithms, adds minimal parameters, and produces consistent gains across diverse benchmarks. The open questions around token-level shaping and cross-model transfer are the natural next steps for the research program.

Full paper: arXiv:2607.26094

RLHFMeta-LearningLLM AlignmentReinforcement Learning

Related Articles

Alignment Faking Persists Without Explicit ConsequencesTransferring SFT Lessons Across Alignment, Model Organisms, and Toy ModelsNeuromorphic Diffusion LLMs: Sparsity Meets Block Decoding