Large demonstration datasets are rarely produced by one expert pursuing one task. Crowdsourced teleoperation logs, play data, and multi-task kitchen recordings mix many people, many intentions, and many mistakes. Imitation methods that drop the assumption of a perfect expert usually rate each action as "good" or "bad" against a single known objective. That rating breaks down when the demonstrator's goal is itself unknown. A long, coherent detour can be a mistake on the way to the bin on the left. It can equally be an efficient route to the bin on the right. Goal recognition, the study of inferring what an agent is trying to achieve from what it does, has spent two decades on exactly this ambiguity. Its central tool is the cost difference: how much more expensive the observed behavior is than the best behavior for each candidate goal. A soft rationality parameter turns these cost gaps into a posterior over goals. That tool has never been used to decide which demonstrations a robot should copy.
This note proposes a two-step method. First, a goal-conditioned cost-to-go model is learned from the offline data itself. Second, for each demonstration segment, the method infers a joint posterior over the intended goal and a rationality level. Each segment is then either relabeled to the goal it efficiently serves, kept with high weight for its stated goal, or down-weighted as a genuine mistake. The claim is narrow and testable: when intent varies across or within demonstrations, marginalizing over inferred goals beats weighting against a fixed goal. When intent is fixed and known, the method should collapse to advantage-weighted cloning, and we expect it to give no gain there.
Core Claim
The two research directions fail in complementary ways. Goal recognizers that tolerate suboptimal agents only classify. Plan recognition as planning (Plan Recognition as Planning, Probabilistic Plan Recognition Using Off-the-Shelf Classical Planners) scores each goal by the detour cost $\Delta(G,O)=c(G\mid O)-c(G)$, the extra cost of a plan forced through observations $O$ relative to the best plan for goal $G$. The operator-counting linear programs of An LP-Based Approach for Goal Recognition as Planning make this fast. GRAQL (Goal Recognition as Reinforcement Learning) swaps the planner for per-goal Q-tables. All of these require symbolic or tabular domains, and none produces a policy.
Imitation methods for suboptimal data produce policies but assume suboptimality is noise around one task. ILEED (Imitation Learning by Estimating Expertise of Demonstrators) mixes an optimal policy with uniform or high-variance noise. MARWIL (Exponentially Weighted Imitation Learning for Batched Historical Data) weights actions by advantage under one reward. Neither can tell a low-variance detour driven by a different intention from a fumble.
Our construction rests on one observation. A learned goal-conditioned quasimetric $d(s,g)$, the asymmetric cost-to-go of Optimal Goal-Reaching Reinforcement Learning via Quasimetric Learning, supplies both planning costs that recognition needs, in continuous spaces and without any planner. For a demonstration segment from state $s_t$ to state $s_{t+k}$ under unit step cost, the detour cost toward goal $g$ is
$$ \Delta(g; t,k) = k + d(s_{t+k}, g) - d(s_t, g). $$
This is exactly the plan-recognition cost difference with the observed segment embedded. Because $d$ satisfies the triangle inequality, $\Delta \ge 0$, up to errors in the learned model.
The joint posterior over goal $g$ and rationality $\beta$ for the segment is
$$ p(g, \beta \mid \text{segment}) \propto p(g)\, p(\beta)\, \exp(-\beta\, \Delta(g; t,k)). $$
Here $p(g)$ is a prior over candidate goals drawn from dataset states, and $p(\beta)$ is a prior over a small grid of rationality levels.
The imitation loss trains a history-dependent goal-conditioned policy. Each segment is weighted by its posterior mass on high-$\beta$ explanations. The goal input comes from the posterior: the stated goal when that goal explains the segment, a relabeled goal when another goal explains it better, and near-zero weight when no goal explains it at any reasonable rationality level.
Research Program
The first component is the cost model. We train a quasimetric network on all offline transitions. Its geometry means it estimates optimal cost-to-go even from suboptimal data, since it maximizes pairwise distances subject only to local one-step constraints. We therefore do not need clean expert anchors, unlike DWBC (Discriminator-Weighted Offline Imitation Learning from Suboptimal Demonstrations) or DP-IL (Imitation Learning from Purified Demonstrations). Quasimetric RL is derived under deterministic dynamics. We will report how the guarantee degrades on stochastic and contact-rich human data rather than assume it holds.
The second component is inference over segments rather than single actions. Two findings motivate this choice. What Matters in Learning from Offline Human Demonstrations for Robot Manipulation shows that human demonstrations are non-Markovian and that per-transition value filtering (BCQ, CQL) collapses on them. Scoring whole segments of length $k$ follows that evidence. We sweep $k$, and we also test a budget variant in the spirit of Goal Recognition Design for Non-Optimal Agents, which keeps segments with $\Delta \le B$ for some candidate goal.
Rationality is shared across segments of a trajectory and estimated by expectation–maximization over the $\beta$ grid. No demonstrator identities are required, which removes ILEED's need for identity metadata.
The third component is the policy. It is a goal-conditioned recurrent cloning policy in the style of BC-RNN, trained on the reweighted and relabeled segments. This keeps the policy class matched to the strongest known learner on human data. The only change is which segments the policy sees, and with which goal.
As a by-product, the same posterior is a goal recognizer that works on continuous states and high-dimensional observations. That directly addresses the tabular limitation of GRAQL and the symbolic limitation of the linear-programming recognizers. We will evaluate it as a recognizer too.
Baselines
The naive reference point is BC-RNN on all data with stated goals, as in Mandlekar et al. It is the right floor because that paper reports it beating offline RL on human data: 84% success on Square and 71.3% on Transport, against 0–10% for BCQ and CQL (What Matters in Learning from Offline Human Demonstrations for Robot Manipulation). We rerun it ourselves on each split rather than copying numbers. We also include plain goal-conditioned BC with hindsight relabeling to the final achieved state.
The strongest direct competitor is goal-conditioned advantage-weighted cloning. This is the MARWIL objective with the advantage computed from the same quasimetric, using the same policy network, data, and segment length. Only the weighting rule differs, so the comparison is clean. This baseline is precisely our method with the goal posterior replaced by the stated goal. Beating it is therefore the central test.
For navigation stitching, we also compare against QRL's own extracted policy. On D4RL maze2d, QRL reports more than a 37% improvement over the best baseline (Optimal Goal-Reaching Reinforcement Learning via Quasimetric Learning).
For learning from human data with mistakes, we compare against two methods. IRIS reports 81.3% success on Lift with fumbled data and 28.3% on RoboTurk Cans (IRIS: Implicit Reinforcement without Interaction at Scale for Learning Control from Offline Robot Manipulation Data). ILEED reports gains in 21 of 23 settings, averaging 7% (Imitation Learning by Estimating Expertise of Demonstrators). ILEED receives true demonstrator identities, which our method does not use. For FrankaKitchen and AntMaze under these specific protocols, we found no reported result on Lacuna, so all numbers there come from our reruns.
Every method gets the same hyperparameter budget, 20 configurations. Every method is also selected by the same rollout-free proxy, because validation loss is unreliable for model selection on human data, as Mandlekar et al. report. Online rollout results are reported only as final test scores.
Two ablations isolate the key ingredient. The first fixes the goal to the stated goal, which recovers advantage weighting. The second fixes $\beta$, which removes rationality inference. Beating the strongest baseline means a statistically significant gain in success rate or normalized score over goal-conditioned advantage weighting, across seeds, on the mixed-intent splits. We expect parity, not a gain, on single-goal splits.
Why not just…?
Why not just use advantage-weighted cloning with a goal-conditioned value? This is the real threat. With a known single goal, our weight is algebraically an advantage summed over a segment. If every demonstration carries a correct goal label, we expect no improvement, and the ablation will show that. The proposal stands or falls on mixed-intent data, where the stated goal is missing, wrong, or changes mid-trajectory. There, advantage weighting discards efficient segments toward other goals. We construct exactly such splits and report both regimes honestly.
Why not just relabel every trajectory in hindsight to the state it reached? Hindsight relabeling, as used in Goal-conditioned Imitation Learning, treats a fumbling path as a valid demonstration for wherever it ended. A detour that eventually reaches $s_T$ still has large $\Delta$ toward $s_T$. goalGAIL also corrects for this only through online interaction with environment reward, which the offline setting lacks. The hindsight-relabeling baseline measures this gap directly.
Why not just use ILEED's expertise estimates? ILEED models a weak demonstrator as a noisier version of the optimal policy. A demonstrator who confidently follows a wrong mental map, the situation formalized in Goal Recognition in Incomplete Domain Models, produces low-variance, systematically wrong actions. ILEED's noise model cannot represent this. Our structured-suboptimality split tests this case. If ILEED matches us there, the cost-difference machinery adds nothing beyond its noise model, and we will report that.
Proposed Experiments
We build mixed-intent versions of three data sources. In D4RL maze2d and AntMaze (D4RL: Datasets for Deep Data-Driven Reinforcement Learning), we re-segment trajectories and assign stated goals that are correct only some of the time. We also inject two kinds of scripted demonstrators. Random-noise demonstrators follow the ILEED style. Incomplete-map demonstrators believe a blocked corridor is open and commit to the detour it forces.
FrankaKitchen provides natural multi-task data with unstructured subtask order. There, success is measured on held-out commanded subtasks.
Robomimic multi-human splits provide real human fumbles, measured by success rate on Lift, Can, and Square.
The decisive check is a crossover. On splits with correct single goals, our method should match goal-conditioned advantage weighting. As the fraction of mislabeled or mixed-intent segments rises, the gap should widen. On incomplete-map demonstrators specifically, we should beat ILEED. A second check scores the recognizer itself: goal-inference accuracy on partially observed held-out trajectories at 10–100% observability, the protocol used by GRAQL. This tests whether the learned cost-difference posterior keeps the low-observability robustness that GRAQL reports for tabular Q-functions. A third check reports how far the quasimetric violates $\Delta \ge 0$ on human data. Large violations would mean the cost model, not the inference, is the bottleneck.
References
- Plan Recognition as Planning
- Probabilistic Plan Recognition Using Off-the-Shelf Classical Planners
- An LP-Based Approach for Goal Recognition as Planning
- Goal Recognition as Reinforcement Learning
- Imitation Learning by Estimating Expertise of Demonstrators
- Exponentially Weighted Imitation Learning for Batched Historical Data
- Optimal Goal-Reaching Reinforcement Learning via Quasimetric Learning
- Discriminator-Weighted Offline Imitation Learning from Suboptimal Demonstrations
- Imitation Learning from Purified Demonstrations
- What Matters in Learning from Offline Human Demonstrations for Robot Manipulation
- Goal Recognition Design for Non-Optimal Agents
- IRIS: Implicit Reinforcement without Interaction at Scale for Learning Control from Offline Robot Manipulation Data
- Goal-conditioned Imitation Learning
- Goal Recognition in Incomplete Domain Models
- D4RL: Datasets for Deep Data-Driven Reinforcement Learning.