Objective-Aligned Amortized Inference for Offline Bayes-Adaptive MDP Model Learning

Toru Hishinuma, Kei SendaNeurIPS 2026

TL;DR

When AI agents learn world models from pre-recorded (offline) logs, they often confuse how data was collected with the actual physics of the environment. Even if you mathematically blind your loss function to data-collection quirks using importance weighting, standard neural network encoders will still "peek" at the raw data and smuggle those quirks back into your representations. This paper identifies this structural blind spot—dubbed amortization mismatch—and fixes it with a clean architectural rule: force the encoder to wear the exact same mathematical blinders as the loss function.

What Problem Does This Paper Address?

Imagine watching two dashcam videos of identical cars driving on the exact same icy road. Driver A is cautious and stays in the slow lane; Driver B weaves aggressively. If an algorithm tries to infer hidden physical properties of the world (like road friction or car mass) from these logs—a framework known as a Bayes-Adaptive Markov Decision Process (BAMDP)—it faces a trap. Because the two drivers visited different states and took different actions, a naive model might conclude the two cars are operating under completely different laws of physics. It entangles transition dynamics (the physics) with visitation variation (the data-collection protocol).

The standard textbook fix is a Visitation-Decoupled (VD) objective: you use importance weighting to re-evaluate all logs under a neutral, shared reference distribution, effectively erasing the driver's habits from the loss function.

Here is the catch the authors uncover: we usually pair these objectives with amortized inference—a neural network encoder (like in a Variational Autoencoder) that gulps down a dataset of transitions and spits out a latent belief about the environment. While the loss function only sees the reweighted data, an unconstrained encoder still looks at the raw, unweighted dataset. As a result, two datasets that look identical to the loss function can still trigger wildly different beliefs in the encoder. The authors call this structural leak amortization mismatch.

Methods

To plug this leak, the authors propose an objective-aligned design principle rather than a brand-new black-box algorithm.

Under an importance-weighted VD objective (specifically, a $\beta$-VAE-style objective they call VD-ELBO), a dataset only influences the loss through its objective-induced dataset signature—essentially, the importance-weighted empirical sum of its transitions. The authors' rule is simple: restrict the encoder's architecture so it can only access the dataset through this exact same weighted signature.

  • What's standard: Permutation-invariant set encoders (like DeepSets and attention-based set encoders) and importance-weighted variational objectives.
  • What's new: Modifying how these set encoders pool information. Instead of taking a standard unweighted sum or attention pass over observed transitions, objective-aligned encoders aggregate embeddings and centered residual attention features using the exact same importance weights used in the loss function.
  • Practical stabilization: Because estimated importance weights in the real world can be noisy and heavy-tailed, the authors also introduce weight interpolation (tempering weights via an exponent $\alpha$, i.e., $w^\alpha$) applied jointly to both the objective and the encoder to trade off strict invariance against numerical stability.

Datasets

Rather than chasing leaderboard scores on massive benchmarks, the authors construct targeted offline datasets designed to isolate protocol shifts while varying underlying physics:

  • Toy Linear-Gaussian BAMDP: A synthetic single-environment setup where $N$ "irrelevant" transitions (assigned zero importance weight by the reference distribution) are injected into a valid dataset to test exact invariance.
  • Pendulum-v1: Offline datasets across three pendulum lengths ($\xi \in \{0.7, 1.0, 1.3\}$), each collected under two different reset protocols (truncated-Gaussian vs. uniform resets) using random actions.
  • HalfCheetah-v5: Offline datasets varying the joint damping parameter ($\xi \in \{0.9, 1.0, 1.1\}$), collected under two different action-sampling protocols (truncated-Gaussian vs. uniform actions).

Key Insights and Ideas

  • Objective invariance isn't inherited "for free": Fixing covariate shift in your loss function does not constrain what features your inference network latches onto. Even transitions with literally zero weight in the loss function will corrupt a standard DeepSets or attention encoder because unweighted pooling still averages them in.
  • Alignment is architecture-agnostic: Whether you use simple DeepSets or fancier residual attention networks, amortization mismatch happens—and objective alignment fixes it—proving the issue is about data-dependence structure, not network expressivity.
  • Cleaner beliefs lead to consistent planning: If two agents observe the same Pendulum physics through different logging protocols, an unaligned encoder gives them different beliefs, causing a downstream planner (CEM) to choose diverging actions and get different returns. Aligning the encoder largely eliminates this planning gap.

Key Results

  • Exact Invariance in Toy Settings: When up to $2^{12}$ zero-weight distractor transitions are added to a dataset, unconstrained DeepSets and attention encoders suffer steadily growing posterior drift (measured by squared Wasserstein-2 distance). Objective-aligned encoders remain invariant down to numerical precision ($< 10^{-12}$).
Toy experiment showing unconstrained encoders drifting as zero-weight transitions are added, while objective-aligned encoders remain completely flat at numerical precision.
  • Pendulum Posterior Consistency: Across 5 seeds using estimated weights, objective alignment slashes relative protocol drift from 0.265 to 0.020 for DeepSets, and from 0.141 to 0.023 for residual attention, while still accurately tracking the true pendulum length.
Pendulum posterior tracking showing protocol-induced vertical offset in the unconstrained encoder versus tightly aligned curves in the objective-aligned encoder.
  • Mitigating Downstream Planning Discrepancy: When using a Cross-Entropy Method (CEM) planner in Pendulum, the return gap between protocols drops from 2.160 (VD-ELBO + unconstrained DeepSets) and 5.754 (standard ELBO) down to 0.320 with an objective-aligned DeepSets encoder (and from 0.839 down to 0.158 for residual attention).
  • Weight Tempering in HalfCheetah: Under noisy estimated weights over 100-step horizons, an intermediate tempering value ($\alpha = 0.8$) successfully stabilizes posterior tracking while preserving approximate protocol alignment.

Limitations and Future Work

  • Garbage-in, garbage-out on weights and reference distributions: Objective alignment is mathematically orthogonal to how you get your importance weights, meaning it is still vulnerable to bad weight estimation or poorly chosen reference distributions ($\rho$). If $\rho$ focuses on poorly covered state-action regions, importance weights explode; if it plays it too safe, it might ignore regions where physics actually differ.
  • Open-loop vs. Closed-loop: Downstream experiments only test open-loop planning with a fixed planner. How posterior consistency interacts with compounding model errors and policy learning in full closed-loop RL remains an open question.
  • Future directions: The authors point toward integrating post-hoc weight stabilization (like Pareto smoothed importance sampling or covariate-balancing weights) and co-designing the reference distribution alongside policy learning to focus on task-relevant regions.

Summary updated

Abstract

Learning latent environment representations from offline datasets is an important challenge for Bayes-adaptive Markov decision process model learning. A key difficulty is that offline datasets collected under heterogeneous protocols can differ in state--action visitation even when the underlying dynamics are identical. Visitation-decoupled objectives address this by evaluating transition predictive fit under a protocol-independent reference distribution via a change of measure. We show, however, that the resulting objective-induced invariances need not be inherited by amortized inference. An unconstrained encoder can depend on protocol-induced visitation variations that are invisible to the objective, a structural failure mode we term amortization mismatch. To address this issue, we formalize an objective-aligned design principle as an objective--inference compatibility condition: the encoder should factor through the objective-induced dataset signature. We instantiate this principle in multiple set-encoder families and, through targeted experiments, provide evidence that objective-aligned encoders improve posterior consistency and can mitigate downstream planning discrepancy across protocols.
BibTeX
@inproceedings{hishinuma2026objective,
  author = {Toru Hishinuma and Kei Senda},
  title = {{Objective-Aligned Amortized Inference for Offline Bayes-Adaptive MDP Model Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=bKLjQijakE},
}
Figure