Robot Policy Learning with Temporal Optimal Transport Reward

Reward specification is one of the most tricky problems in Reinforcement Learning, which usually requires tedious hand engineering in practice. One promising approach to tackle this challenge is to adopt existing expert video demonstrations for policy learning. Some recent work investigates how to learn robot policies from only a single/few expert video demonstrations. For example, reward labeling via Optimal Transport (OT) has been shown to be an effective strategy to generate a proxy reward by measuring the alignment between the robot trajectory and the expert demonstrations. However, previous work mostly overlooks that the OT reward is invariant to temporal order information, which could bring extra noise to the reward signal. To address this issue, in this paper, we introduce the Temporal Optimal Transport (TemporalOT) reward to incorporate temporal order information for learning a more accurate OT-based proxy reward. Extensive experiments on the Meta-world benchmark tasks validate the efficacy of the proposed method. Code is available at: https://github.com/fuyw/TemporalOT

Paper

References (61)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer GZSS5/10 · confidence 4/52024-07-04

Summary

This paper extends the vanilla optimal transport-based proxy reward method in imitation learning by 1) masking out distant steps within a trajectory in the optimization of the transport plan and 2) considering neighbouring steps in the reward estimate

Strengths

- the paper is well written and organized, with rich benchmarking experiments and comparisons - strong experimental results in comparison to baselines

Weaknesses

- the novelty is incremental, focusing on two additions to vanilla OT - the presentation of the central claim seems to contradict the rationale behind the two additions to OT (see the question below). - some result analyses contain plain observations, lacking in-depth insights - missing discussion on why learning from demonstration performs worse in door-lock and window-open tasks (sec. 4.3), important for understanding the efficacy scope of the proposed extension; in contrast, RL with simply binary reward performs well in the twos - no insights on why important components vary across tasks (sec. 4.4), beneficial for understanding the sensitivity of the proposed extension - ablation of $k_c$ and $k_m$ in sec. 4.4 is good, but a high-level guide for choosing them under different task conditions would benefit others following this work and be important for understanding the generalisation capability of the two additions - as to sec. 4.6, the description of the pixel-based setting is a bit over-simplified, the author can instead put detailed explanations in the appendix - sec. 4.7 feels like a case-by-case study; it does not relate to the method's efficacy and the paper's central claim - minor comment: - a brief description of the nine meta-world tasks (and task length) would provide an overview of task complexity - a detailed example of computing group-wise cosine similarity is missing. Including this would help clarify the value of introducing $k_c$ in the cost estimate, especially concerning the example on the right side of Figure 4

Questions

### Presentation of the central claim - in section 3.1.2, how does the permutation study with ADS connect to the first observation; is being oder-invariant within a trajectory problematic? Which proposed component (masking scheme or context embeddings) addresses this? Further, how does the 1st observation relate to the claim that existing methods overlook temporal information (e.g., lines 44-45)? - what exactly is meant by *overlooking temporal information*? eq. 5 already counts all future steps in calculating the original OT proxy reward for current state. Why incorporate temporal information? - the paper claims to incorporate this information (lines 144-145), but doesn't the masking scheme *weaken* the influence of future/distant steps (lines 149-152), while context embedding *enlarges* it (lines 168-169)? This divergence causes confusion about the central claim of mitigating the issue of overlooking temporal information (e.g., lines 8-12, 45-47) - Introducing context embeddings (section 3.2.2) seems to contradict the second observation in section 3.1.2 (lines 116-117) as considering later steps could add noise to the reward estimate of the current state-action pair. ### Methodology - is the context cost matrix in eq. 9 used in the optimisation of transport plan $\mu$ in eq 4, or just for reward inference in eq. 5? ### Experimental results - in Figure 6, the average of TemporalOT appears less than 7.5 but is reported to be 8.4 in Table 1. - in Figure 2, which step does $o_2$ correspond to? better to add x-y labels and mark $o_2$, $o_3$ to the reward curve on the right - misspecified value for TaskReward in Door-lock env, according to Figure 9, the mean value is around 60. Similarly, the Window-open env mean value should be around 30 - which $\epsilon$ values were used in the experiments (or are they determined after optimizing equation 7), and how do they affect the task performance? - the 4th baseline OT needs more explanation, though I can roughly guess how online OT differ from offline OT ### Discrepancy in ASD vs. OT performance - unsure about why ASD performs worse than vanilla OT in some tasks as shown in Table 1? I understand this paper adopts a more challenging experimental setup, with varying goals per episode and only two demonstration videos provided. However, in the benchmarking results of the ASD paper, ASD achieves over 80% success in the basketball task within 1M steps, significantly higher than OT's performance (around 10%), as shown in Figure 11 of Appendix C.2. This trend is also observed in the lever-pull task. Yet, Table 1 in this paper shows the opposite comparison between ASD and vanilla OT for these tasks. Could you explain this discrepancy? ### Minor points - Figure 1, five steps should be -> six steps? the scheme is not indicative of the magnitude of reward $r_a$ or $r_b$; what does $a_2^a$ differ from $a_2^b$? - It would be better to indicate in the caption of Table 1 that the values represent success rates, even though this is mentioned in section 4.1, as tables should be self-contained

Rating

5

Confidence

4

Soundness

2

Presentation

2

Contribution

2

Limitations

- authors acknowledge the limitations of the work, and their comments are fair - it's unclear how different pretrained visual encoders will influence OT's efficacy under the same conditions; a discussion on this topic would be helpful - nonetheless, the authors discuss the broader impact of their work, including immediate societal implications, and suggest a straightforward solution, which is appreciated

Authorsrebuttal2024-08-12

To Reviewer GZSS: Explanations for Figure 4 and proxy reward

> **S1: I found the clarifications on C2 helpful ... It would also be great if you could include the insights from W3 and W4 in the discussion section...** It is great to know that we have successfully resolved the confusions and addressed most of the questions you had, and only a few other points need discussions (as done below). We greatly appreciate many of the great points you raised that help to improve the quality of the paper (e.g. the clarifications on C2 and insights from W3 and W4). We will definitely include them in the revised paper (e.g. into Sec. 3 and discussion section respectively). > **S2: Cost Matrix in Figure 4** The context cost matrix is used in optimizing the transport plan 𝜇. We apologize for the confusion. After carefully understanding the point you raised, we realized that it is caused by our order of introducing the two components of TemporalOT. Our original intention was to organize Section 3.2.1 and Section 3.2.2 to introduce the two components of TemporalOT in a progressive way starting from vanilla OT: firstly introducing temporal mask M in Section 3.2.1, and then the component for improving the cost matrix calculation in Section 3.2.2. Figure 4 in the main paper is also organized under the same reasoning. Thanks to your reminder, now we realized that this might introduce some confusions if we want to understand the whole method from the first section only (e.g. Eqn.(6) and Eqn.(7)) if there is no explicit reminder around Eqn.(6) and Eqn.(7) (or Figure 4 Left) saying the $C$ in Eqn.(6) and Eqn.(7) (respectively Figure 4 Left) will be upgraded with a context embedded version $\hat C$ later. We are planning to introduce the Context Embedding based Cost Matrix (Eqn.(9)) in the original paper before Eqn.(6). Figure 4 will also be updated accordingly: 1) introduce Context Embedding on the left and then 2) temporal mask based OT on the right with the Cost Matrix notation $C$ changed to $\hat C$. We believe this can resolve the confusion as pointed by you. Thanks again and we will also include this change into the revision together with the ones as mentioned in reply to **Suggestion 1 (S1)**. We would thanks the reviewer sincerely again for all the great advice that helps to further improving the presentation quality of the paper. > **S3-1. IL proxy reward is not accurate enough for such details** Thank you for the question. We are sorry for the inaccurate and confusing "IL" term. By "IL proxy reward", we actually meant "visual similarity-based reward", i.e. reward calculated based on the visual similarity between the policy trajectory and reference trajectories. The term "IL" term is really unnecessary here, sorry for the confusion. It is easy to understand that due to factors such as viewpoint, occlusion, object sizes etc, sometimes it can be challenging to differentiate subtle differences in images, e.g., the knob being turned to 55° (task failure) vs a knob being turned to 60° (task success). While there is a clear difference if a low-dimensional knob angle sensor is provided (which is the case in low-dimensional state based reward), the visual signal based reward does not have the luxury of accessing the knob angles directly, leading to the challenges as mentioned above. > **S3-2: How is this generally true for imitation learning (IL)** Sorry for the usage of the confusing "IL" terms as explained above. It was an inaccurate term we used to describe the visual similarity based reward and we didn't intent to pass any implication on the Imitation Learning in our original response. After clarifying all the confusions, we can provide some of our understanding on visual observation based imitation learning. Based on our understanding, some of the challenges we observed in visual-similarity based reward calculation could also appear in imitation learning in several cases: - Imitation-learning with visual reward: this is the category that aligns with the line of works in ADS etc and this paper, which actually formulate IL into an RL form with the help of the visual similarity reward. This is easy to understand since the visual-reward calculation is directly impacted as explained above. - Visual BC-type of imitation learning: behavior cloning (BC)-type of IL methods does not require the proxy reward so the reward part is not an issue. However, if visual observation is used as the policy input, differentiating subtle differences based on visual observations is similarly challenging and will likely to impact policy learning in our opinion. Moving forward, general techniques that can improve on these aspects can potentially improve both the visual-similarity based proxy reward (the line of works in ADS etc and in this paper) and visual similarity-based imitation learning. This is a very interesting direction for future work, with potential impacts on multiple fields.

Authorsrebuttal2024-08-13

To Reviewer GZSS: A gentle reminder

Dear Reviewer GZSS, As we are approaching the end of the rebuttal period, we want to send a gentle message to you confirming that our reply to your followup question on "Figure 4 and proxy reward" has been successfully received (it seems that there was an issue with the OpenReview system, as it did not send out notification emails for some reason when we posting our replies, and we didn't receive any email notifications after we posted the replies; so we send this message just in case it also happened to you), and we also want to confirm the reply has addressed your followup questions on "Figure 4 and proxy reward". Looking forward to your confirmation and thanks again for your time and efforts in reviewing our paper and providing detailed, constructive comments. We greatly appreciate many of the great points you raised that help to improve the quality of the paper, and we enjoyed the interaction with you during the discussion period. We will definitely incorporate the valuable clarifications and insights formed in our discussion into the revised paper.

Reviewer GZSS2024-08-14

Thanks to the authors for their responses, which clear up my follow-up questions and offer details on visual-similarity-based reward calculation and imitation learning. I appreciate the added clarity.

Reviewer M6BJ5/10 · confidence 4/52024-07-11

Summary

This work proposes a reinforcement learning method from a few expert demonstrations based on optimal transport. It incorporates temporal information into the framework of optimal transport reward so that the agent can focus on more relevant information in learning. The work proposes two simple tricks to achieve this, i.e., a masking mechanism and context embedding-based cost matrix. The experiments in simulated robotic control benchmarks show that the proposed temporal OT converges to a higher success rate than imitation learning and inverse reinforcement learning methods that do not consider temporal information.

Strengths

The paper is clearly motivated. It points out a major weakness of OT-based reward calculation, that is the temporal information not being considered, and proposes a simple solution that applies a temporal mask to the cost matrix.

Weaknesses

1. TemporalOT uses a manually designed diagonal-like matrix as the mask on the transportation plan, which could be ineffective when the learning policy has not been close to the expert or gets stuck at early-stage behaviors. Have the authors tried other design choices for the temporal mask or tried to make it a part of the learning? 2. As a robot learning paper, it would be better to apply the algorithm to real robots similar to previous OT-based methods (e.g., [18]).

Questions

The variance of the baseline ADS is quite large in some environments shown in Fig. 7. Is there any explanation/discussion on it?

Rating

5

Confidence

4

Soundness

3

Presentation

3

Contribution

2

Limitations

As shown in the learning curves, the proposed algorithm requires ~1e6 timesteps to converge, which may limit its practical use for real robots. I think initializing the policy with imitation learning, then tuning it with TemporalOT might converge faster.

Authorsrebuttal2024-08-12

To Reviewer M6BJ: Explanation for PDF-Fig 5

It is great to know that we have successfully addressed most of your questions. We appreciate your great efforts in reviewing our paper that helped to improve our work. As to your follow-up question on "BC pretrain" results in PDF-Fig 5 at step-0, we apologize that this was caused by a setting that was inappropriate for methods with pre-training in generating the plot. BC-pretrain has a success rate around 10.8 $\pm$ 9.2 at step-0 for Door-open task (consistent with the result reported in Table 1 of the main paper). What happened was when we generated PDF-Fig 5, the first step of actual evaluation happens at 2e4 steps which was set according to all the online learning methods (such as ADS and TemporalOT, which only start to learn after collecting some online samples via environmental interactions). A default success rate of zero is used since all these methods always have a zero success rate at the step-0 (essentially before any training). The issue was that for generating PDF-Fig 5, we forgot to adapt the script for BC-pretrain method to run evaluation at step-0 and used a default success rate of zero. While this makes sense for the online learning methods (w.o. pre-training) as explained above, for BC-pretrain, it is inappropriate since it has a non-zero success rate before any online training because of the pre-training. Also in order to reflect the original values, we didn't apply smoothing in PDF-Fig 5, therefore the curve values remains at zero at step 0 (some curves in Figs elsewhere e.g. main paper with minor non-zero values at step 0 are due to smoothing, and the raw values are zero). To resolve the confusions and maintain consistency in presenting the results, we are planning to change PDF-Fig 5 in to a Table as shown below to be included in our revised paper (due to the reason that while Figures are good for comparing the general trends across the training period, Table is more suitable in this case since it directly shows the raw results at the actual evaluation steps and makes it easier to to compare the pre-train-only performance and the pre-train+online training performance). | | 0 | 2e4 | 4e4 | 6e4 | 8e4 | 1e5 | 5e5 | 1e6 | | ------------------------------------------------- | ----------- | ---------- | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | | BC [pure-offline, param fixed after pre-training] | 10.8 $\pm$ 9.2 | - | - | - | - | - | - | - | | TemporalOT [pure online] | 0.0 $\pm$ 0.0 | 2.0 $\pm$ 4.0 | 0.0 $\pm$ 0.0 | 0.0 $\pm$ 0.0 | 5.0 $\pm$ 10.0 | 16.6 $\pm$ 32.2 | 57.8 $\pm$ 37.1 | 78.4 $\pm$ 12.4 | | TemporalOT with BC-pretrain [offline-to-online] | 10.8 $\pm$ 9.2 | 6.8 $\pm$ 8.4 | 25.0 $\pm$ 18.5 | 42.8 $\pm$ 22.2 | 48.6 $\pm$ 25.9 | 55.4 $\pm$ 12.0 | 70.8 $\pm$ 8.2 | 82.0 $\pm$ 2.4 | We can observe that: 1. BC without any online training has relatively low success rate (10.8 $\pm$ 9.2) 2. TemporalOT achieved relatively high success rate after 1e6 environmental steps (78.4 $\pm$ 12.4) 3. Incorporating pretraining (Temporal OT with BC-pretrain) helps to further improve the sample efficiency. We want to clarify as already done in the original rebuttal reply that our default setting in the main paper is an action-free-demo setting. For this ablation study, we go beyond this setting and use action labels which are required by BC. 4. For TemporalOT with BC-pretrain, one can notice a small success rate drop (which recovers later) at the initial phase when we transit from offline to online training (step0->step2e4->step4e4). This is an "initial-dipping" phenomenon as also being reported in previous literature and can be improved by designing more specific offline-to-online methods [O2O, PEX etc]. In summary, incorporating offline pre-training into TemporalOT does show promising improvements to further boost the sample efficiency and indicate practical paths to generalizing and applying TemporalOT in real world applications (thanks for sharing your insights with us on this!). And we believe the offline-to-online training paradigm in general [O2O, PEX etc], although out-of-the scope of the current paper (which only focus on the online training setting) is a powerful one for real-world robotics applications and we plan to pursue it in our future work. **References** [O2O] Yu et al. Actor-Critic Alignment for Offline-to-Online Reinforcement Learning, ICML 2023 [PEX] Zhang et al. Policy Expansion for Bridging Offline-to-Online Reinforcement Learning, ICLR 2023

Reviewer M6BJ2024-08-13

Thank you for the additional explanation. My questions are addressed and I will raise the score to 5.

Authorsrebuttal2024-08-13

To Reviewer M6BJ: Thank you for your positive feedback and for raising the score

We thank Reviewer M6BJ for your positive feedback on the rebuttal and thank you for raising the score. We greatly appreciate your efforts in reviewing the paper and your valuable comments that have helped to further improve the quality of the paper.

Reviewer FnLe6/10 · confidence 4/52024-07-11

Summary

This paper proposes several improvements on top of the Optimal Transport reward for inverse reinforcement learning. The key observation is that the traditional OT-based reward does not consider the temporal information, i.e., it is invaraint to the order of the state-action pairs in a trajectory, and that the reward is not defined over state-action pairs but over a whole trajectory, so later transitions in the trajectory would affect the reward of an early state-action pair, which does not follow the standard definiation of reward in RL. This the key technique the paper proposes is to introduce a mask for the transport plan, such that only temporaily neighboring states between expert and the agent will be considered when computing the reward. It futher proposes a technique to futher improve the computation of the cost matrix in the OT reward. Experiments are conducted on 9 metaworld tasks, and the proposed masked OT rewards outperform several previous baselines. Ablation studies are also conducted to help understand some design choices.

Strengths

- This paper studies an important problem in the formulation of the OT-based reward, which is it being non-temporal (invariant to the order of the trajectory). - The paper is well-written and easy to follow. - The proposed algorithm is simple yet effective, and it achieves better performances than prior methods in the experiments. - The experiments are thorough, with results compared on 9 environments, and with ablaiton studies that are very helpful for understanding how each component helped to improve the performance.

Weaknesses

- The proposed method to restrict the temporal information works by masking the transport plan to only include temporaily nearby states. This "temporaily nearby" is measured using the distance between the time step indexes, which assumes that the time interval between each step, or the time scale, is similar between the agent and the expert. I am wondering how general this is true. I encourage the authors to think of cases where this assumption might be broken and add some discussion on how the method would work & can be extended to work in such cases.

Questions

Please refer to the weakness section.

Rating

6

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

Yes.

Authorsrebuttal2024-08-10

To Reviewer FnLe: Thank you for your positive feedback

We thank Reviewer FnLe for your positive feedback on the rebuttal. We greatly appreciate your efforts in reviewing the paper and your valuable comments that have helped to further improve the quality of the paper.

Reviewer hYj87/10 · confidence 3/52024-07-30

Summary

The authors introduce TemporalOT, a learning-based proxy reward that incorporates temporal information. via using a mask mechamism and context-embeddings based cost matrix. They implemented the TemporalOT-RL based on ADS implementation, conducted thorough experiments on Meta-world benchmark focusing on the a challenge setting where there are only two demonstrations available and outperformed the OT-based reward baseline.

Strengths

1. The motivation of incorporating temporal information into OT-reward is clear. 2. The paper is well-written and easy to follow. 3. The experiments are thorough and convincing 4. The ablation study of no-mask, no-context, discount factor, number of demonstrations is very sufficient.

Weaknesses

See Questions

Questions

1. Could the author analyze what potential property of the push task makes it different that ADS outperforms TemporalOT? 2. Does the author intend to incorporate visual encoder training instead of fixed pre-trained?

Rating

7

Confidence

3

Soundness

3

Presentation

3

Contribution

3

Limitations

Performance relies heavily on the demonstration quality and visual encoder effectiveness.

Reviewer FnLe2024-08-10

Official Comment

I want to thank the authors for the detailed and well-written response, and for adding a new experiment within the short rebuttal period of time. I don't have further questions and I remain positive about the paper.

Reviewer M6BJ2024-08-11

Thank you for the rebuttal. I appreciate the added results regarding other design choices of temporal masks. I have some follow-up questions: In PDF-Fig 5, why does the curve for "BC pretrain" start from a success rate of 0 instead of a positive success rate learned by BC? I am asking the BC and fine-tuning results to see how many offline demonstrations and how many online interactions are required to obtain a reasonable success rate, and to justify how practical the algorithm is for potential real-world applications.

Reviewer GZSS2024-08-11

Many thanks to the authors for thoroughly addressing my concerns and adding the extra experimental plots, much appreciated. I found the clarifications on C2 helpful and suggest (if possible) incorporating them into sec. 3 when introducing new techniques. It would also be great if you could include the insights from W3 and W4 in the discussion section. I have just a few other points: - Is the context cost matrix in eq. 9 used in optimizing the transport plan $\mu$ in the new objective (eq. 5)? It seems NO as shown in Fig. 4. If yes, shouldn’t the formulation of eq. 6 and 7 reflect the context cost matrix $\hat{C}$? - Regarding W2, you mention that the "IL proxy reward is not accurate enough for such details." How is this generally true for imitation learning (IL)?

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC