All selected work

Reward Learning under Distribution Shift

Uses variation across demonstrators as structural information to discourage reward features that fail under dynamics and nuisance shifts.

Paper
Status
Preprint

Problem

Inverse reinforcement learning can recover a reward that explains demonstrations yet fails when optimized by a new policy. Pooling trajectories from several experts makes this worse: it discards which source produced each behavior and can turn an overrepresented style into an apparent part of the task.

Given expert datasets

D1,,DE,\mathcal D_1,\ldots,\mathcal D_E,

we treat each source as a separate environment. Expert identity changes the observed state–action distribution, while the meaning of task success is assumed to remain fixed. Source-specific predictors are therefore evidence of a spurious reward feature rather than a stable task feature.

Hypothesis

Reward features that remain predictive across demonstrators transfer better under dynamics shift when those demonstrators vary nuisance factors while preserving task semantics.

Method

Let ϕθ\phi_\theta be a learned reward representation, ww a scalar predictor, and Le\mathcal L_e the inverse-reinforcement-learning loss for source ee. We regularize the representation with an invariant-risk penalty:

minθe=1E[Le(ϕθ)+λwLe(wϕθ)w=122].\min_\theta \sum_{e=1}^{E} \left[ \mathcal L_e(\phi_\theta) + \lambda \left\| \nabla_w \mathcal L_e(w\circ\phi_\theta)\big|_{w=1} \right\|_2^2 \right].

The penalty tests whether the same predictor is locally optimal for every demonstration source. For maximum-entropy feature-matching IRL, this reduces to matching the learned feature expectations separately for each source:

De=EξDe[ϕθ(ξ)]Eξpθ[ϕθ(ξ)]22.D_e= \left\| \mathbb E_{\xi\sim\mathcal D_e}[\phi_\theta(\xi)] - \mathbb E_{\xi\sim p_\theta}[\phi_\theta(\xi)] \right\|_2^2.

The same source-wise regularization extends to adversarial reward-learning objectives such as AIRL and GAIL.

Evidence

In a controlled gridworld, conventional maximum-entropy IRL learned the path most common in an imbalanced dataset. The invariant formulation recovered the shared destination while retaining multiple valid paths.

We then learned rewards on five MuJoCo locomotion tasks and trained new policies after changing body mass, joint limits, actuator strength, and contact friction. Invariant regularization improved transfer across maximum-entropy IRL, AIRL, and GAIL variants, with the largest gains where the baseline reward had overfit the original dynamics.

Five plots compare causal-invariance, unregularized, and Lipschitz-regularized reward learning as body-mass perturbation increases across MuJoCo tasks.
Ground-truth return as body-mass perturbation increases. CI improves transfer on three of five tasks without a performance penalty on the other two. Figure 4 from the paper; open for full resolution.

For a body-mass perturbation of ϵ=0.2\epsilon=0.2, the AIRL+CI reward produced mean ground-truth returns of 4,1634{,}163 on Walker2d and 5,1085{,}108 on Humanoid after one million SAC steps. The corresponding unregularized AIRL rewards produced 3-3 and 4,4524{,}452; the Lipschitz-regularized rewards produced 3,3883{,}388 and 1,7891{,}789. Results are averaged over five training seeds and ten evaluation rollouts.

The experiment separates two questions that held-out reward prediction can conflate: whether a reward fits demonstrations, and whether optimizing that reward still produces the intended behavior after a shift.

Failure modes

The causal interpretation depends on a structural assumption: sources vary nuisance factors while preserving the task. If experts genuinely optimize different tasks, enforcing invariance can remove meaningful reward information.

Regularization strength also matters. Too little leaves source-specific correlations intact; too much can suppress useful features whose relationship to behavior is not identical across sources. The method is therefore a practical inductive bias, not a guarantee of causal identification from arbitrary demonstrations.

Paper

Learning Causally Invariant Reward Functions from Diverse Demonstrations, Ovinnikov, Bykovets, and Buhmann, 2024.

Imitation LearningReward LearningCausal InvarianceDistribution Shift