Is Behavior Cloning All You Need? Understanding Horizon in Imitation Learning

Imitation learning (IL) aims to mimic the behavior of an expert in a sequential decision making task by learning from demonstrations, and has been widely applied to robotics, autonomous driving, and autoregressive text generation. The simplest approach to IL, behavior cloning (BC), is thought to incur sample complexity with unfavorable quadratic dependence on the problem horizon, motivating a variety of different online algorithms that attain improved linear horizon dependence under stronger assumptions on the data and the learner's access to the expert. We revisit the apparent gap between offline and online IL from a learning-theoretic perspective, with a focus on the realizable/well-specified setting with general policy classes up to and including deep neural networks. Through a new analysis of behavior cloning with the logarithmic loss, we show that it is possible to achieve horizon-independent sample complexity in offline IL whenever (i) the range of the cumulative payoffs is controlled, and (ii) an appropriate notion of supervised learning complexity for the policy class is controlled. Specializing our results to deterministic, stationary policies, we show that the gap between offline and online IL is smaller than previously thought: (i) it is possible to achieve linear dependence on horizon in offline IL under dense rewards (matching what was previously only known to be achievable in online IL); and (ii) without further assumptions on the policy class, online IL cannot improve over offline IL with the logarithmic loss, even in benign MDPs. We complement our theoretical results with experiments on standard RL tasks and autoregressive language generation to validate the practical relevance of our findings.

Paper

Similar papers

Peer review

Reviewer FtQL7/10 · confidence 4/52024-07-09

Summary

This paper presents a thorough analysis of imitation learning (IL), focusing on the gap between offline and online IL. The authors demonstrate that behavior cloning (BC) with logarithmic loss can achieve horizon-independent sample complexity under specific conditions, providing valuable insights into the theoretical underpinnings of IL.

Strengths

- This paper presents extensive theoretical results for offline IL and online IL under the general function approximation class. It builds a sharp separation between offline and online algorithms, which the reviewer appreciates a lot. - The reviewer believes that the analysis tools in this paper can be further applied in future studies of imitation learning and sequential decision making.

Weaknesses

- The theoretical results have a gap with practice. For example, the reviewer finds it odd that the conclusion of a 'horizon-free' guarantee is obtained by assuming the policy class is well-controlled. Practitioners often choose a large function class to ensure the approximation error is small. - Some key related work is missing.

Questions

**Experiments:** - There is a gap between the developed theory and practice. It is not safe to conclude that the theory can explain the empirical results in Figure 1. There are possible theoretical explanations for empirical results that differ from this paper. Specifically, [1] showed that MuJoCo locomotion controls have deterministic transitions, thus the statistical estimation error comes from the initial step, and there are no compounding errors. The reviewer believes the explanation provided in [1] is also true for the studied Atari environments. - The reviewer believes that practitioners choose stationary policies in practice because the MDP formulation for practical tasks has stationary transitions, rather than the non-stationary ones studied in this paper. For stationary-transition MDPs, the estimation error is, in fact, smaller. **Related Work:** - [2] studied that adversarial imitation learning algorithms can achieve horizon-free sample complexity for structured MDPs. Their results are also important for understanding the horizon in imitation learning. This work should be reviewed. [1] Li, Ziniu, et al. "Rethinking ValueDice: Does it really improve performance?." *arXiv preprint arXiv:2202.02468* (2022). [2] Xu, Tian, et al. "Understanding adversarial imitation learning in small sample regime: A stage-coupled analysis." *arXiv preprint arXiv:2208.01899* (2022).

Rating

7

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

To the reviewer's understanding, this paper mainly focuses on the model selection problem under general function class approximation. This does not provide many new insights on the compounding errors issues and horizon dependence issues in imitation learning. The title may be revised to reflect the contribution.

Reviewer DwTf4/10 · confidence 3/52024-07-09

Summary

This paper analyzes the sample complexity of offline behavior cloning w.r.t. the trajectory horizon. The theoretical result reveals that offline behavior cloning actually does not suffer more from the long horizon than the online BC, under two assumptions.

Strengths

- The theory to further understand the complexity of BC is important. - The presentation is clear and easy to follow.

Weaknesses

- The result is intuitive since with "parameter sharing", we assume the policy generalizes to longer horizon states. - One important assumption made in this paper, i.e. the policy class using parameter sharing, is unclear. For example, how the parameter sharing will affect practical learning? Does it introduce any bias for the policy learning? - The experiments are not solid. For example, the Atari figure seems like the Expected regret is random w.r.t. horizon. It is natural to question whether the MuJoCo results really fit the theoretical prediction or simply are due to the task properties.

Questions

N/A

Rating

4

Confidence

3

Soundness

2

Presentation

3

Contribution

2

Limitations

See weakness.

Reviewer meEq6/10 · confidence 4/52024-07-09

Summary

This paper studies the horizon dependence in imitation learning (IL). In particular, the authors analyze the sample complexity of Behavioral Cloning (BC) with logarithmic loss and general policy class $\Pi$. For deterministic experts, they first present a sharp horizon-independent regret decomposition and then provide a regret bound for BC. They show that BC achieves a linear horizon dependence under dense rewards when $\log (|\Pi|) = O (1)$, including stationary policies and policies with parameter sharing. Furthermore, they prove a lower bound, indicating that online IL cannot improve over offline IL with $|\Pi|=2$. For stochastic experts, they present a horizon-independent and variance-dependent regret decomposition and then give a regret bound for BC. This result shows that when $\log (|\Pi|) = O (1)$, BC can achieve a fully horizon-independent sample complexity in the sparse reward case. As for the dense reward case, BC requires a quadratic sample complexity, which is proven to be necessary in both offline and online settings.

Strengths

1. This paper provides a new understanding of the horizon dependence in IL. Classical IL works show that the offline IL method BC suffers a quadratic horizon dependence, motivating various online IL approaches that attain improved linear horizon dependence. However, this paper proves that in certain cases, it is possible for BC to achieve linear horizon dependence and online IL cannot improve over offline IL, suggesting that there is no fundamental gap between offline IL and online IL. 2. This paper contributes new techniques for analyzing IL methods, which could be of independent interest. To attain a linear horizon dependence for BC, this paper presents a sharp horizon-independent regret decomposition. For deterministic experts, this regret decomposition is based on a novel trajectory-level analysis. For stochastic experts, they provide an interesting information-theoretic analysis. I believe that these new techniques could inspire further advancements in IL theory.

Weaknesses

1. Some formulas and claims in this paper are misleading. In the logarithmic loss of Eq. (5), the policy variable $\pi (a^i_h|s^i_h)$ is written as a stationary policy, which does not include the case of non-stationary policies $\Pi = \Pi_1 \times \Pi_2 \times \cdots \times \Pi_H$ discussed in lines 242-248. Moreover, in Eq. (39) and Eq. (40) in Appendix E.1, the policy becomes non-stationary again, which is inconsistent with Eq. (5). As such, I suggest the authors to write logarithmic losses for stationary policies and non-stationary policies separately. Furthermore, in line 224, they claim that “This bound improves upon the guarantee for indicator loss behavior cloning in Eq.(3) by an O(H) factor”. This statement is a little problematic since the bound in Corollary 2.1 does **not** improve upon previous bounds for the case of non-stationary policies. 2. This paper focuses on the horizon dependence in imitation learning. However, this paper misses a closely related work [1] that proves that a kind of IL method called adversarial imitation learning can achieve a horizon-independent sample complexity bound in a certain class of IL problems. References: [1] Xu et al., Understanding Adversarial Imitation Learning in Small Sample Regime: A Stage-coupled Analysis, 2023. [2] Rajamaran et al., Toward the fundamental limits of imitation learning, 2020.

Questions

1. Theorem 2.4 implies that the slow $H/\sqrt{n}$ rate for $\sigma^2_{\pi^*}=H^2$ is necessary in both offline and online IL. How can we reconcile this result with the claim in [2] that BC can achieve the $1/n$ rate for stochastic experts in the tabular setting?

Rating

6

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

The authors have adequately discussed and addressed the limitations of this paper.

Reviewer 2nRQ9/10 · confidence 3/52024-07-12

Summary

The paper proposes theoretical results on whether and when can offline imitation learning (IL) match online imitation learning in sample efficiency. The paper connects the results of existing works and demonstrates that offline IL can indeed match online IL under certain conditions. The paper further provides results on stochastic experts rather than deterministic experts.

Strengths

- As far as I know this is the first approach that leverages Hellinger distance on analyzing imitation learning methods. - The paper extends the BC results to stochastic policies under other function classes. - Interesting that online IL cannot really improve upon offline IL without further assumptions. - In addition to the theory the appendix provides experimentation that supports the theory. - The paper is very well written---I enjoyed reading the paper.

Weaknesses

- The paper only considers log loss, which I understand is very commonly used, but I am curious about how much of these analyses transfer to other losses.

Questions

- Does the MDP assume finiteness? - If so, how would this result change under continuous action space with the most common parameterization (i.e. Gaussian policies)? - Does online IL algorithm include IRL?

Rating

9

Confidence

3

Soundness

4

Presentation

4

Contribution

4

Limitations

- See above.

Reviewer 2nRQ2024-08-10

Thank you for the response. Regarding IRL, I understand that the lower bound applies to IRL as well, I was more curious about the upper bound. In particular whether the authors have considered using this line of technique to analyze IRL.

Authorsrebuttal2024-08-10

Thank you for the clarification! Our main results (Theorem 2.1 and Theorem 2.3) are not specialized to log-loss behavior cloning; rather they are reductions that apply to any algorithm that achieves a bound on the trajectory-level Hellinger distance $D_{H}^2(\mathbb{P}^{\hat{\pi}}, \mathbb{P}^{\pi^{\star}})$. For future work, it would be interesting to see if we can design IRL algorithms based on minimizing this quantity. In particular, many existing IRL algorithms can be viewed as performing distribution matching at the occupancy level, but our analysis suggests that performing distribution matching at the trajectory-level might lead to tighter guarantees with respect to horizon.

Reviewer FtQL2024-08-12

I appreciate the detailed explanation. I am ready to increase my review score, but I still have some concerns and futher comments are provided below. **Comment 1:** I clearly understand the response about the 'horizon-free' guarantee. I would like to suggest adding a figure to the paper to clarify the concepts between supervised learning and imitation learning. I also have an additional comment about the reward notion 'R', which I elaborate on below. **Comment 2:** Could the authors clarify whether the rollout policy for expected regret in Figures 1 and 2 is deterministic or stochastic? I could not find this detail in the Appendix (although I see that the Appendix mentions the expert policy for data collection is deterministic). I ask this because I am conjecturing the following: if the learner's policy is deterministic, the 'unnormalized' regret is also independent of H for the tested environments. This is why I reference the previous work [1] in my review comment. I noticed the authors mentioned using a stochastic policy, but it does not make sense to consider stochastic policies for such tasks. I want to clarify that I agree the provided empirical results are consistent with the developed theory. However, I am pointing out other possibilities: practitioners usually care about absolute performance, relating to the notions of regret and 'R'. For BC on these tasks, the gap may be independent of the horizon because of deterministic transitions. For the same reason, due to an interest in absolute performance, practitioners also care about adversarial training algorithms like GAIL, which should a gap of $O(1/H * R)$ when using the notion of expected regret, as such methods are observed to achieve good performance regardless of horizon length.

Authorsrebuttal2024-08-12

Response to Comment

Thank you for your interest! We are happy to clarify these points. ### **Regarding comment 1:** We are happy to include a figure that better explains the distinction between supervised learning and IL in the next version of the paper. ### **Regarding comment 2:** This is a subtle issue. One point we should have mentioned earlier is that even though the transitions of the MDP are deterministic, the *initial state is stochastic*, both in MuJoCo and in Atari, which is the default in the Farama Foundation’s Gymnasium. In this setting, even if every policy is fully deterministic, we expect unnormalized regret to depend on horizon. This is true in theory (in fact, our lower bound for deterministic experts, Theorem 2.2 in our paper, covers exactly this setting) but also intuitively holds true in MuJoCo experiments for the following reason. Suppose the initial state is drawn so that the learner makes a mistake, leading the walker to fall over; then the reward after the walker has fallen will be zero, even though the expert is able to accrue reward proportional to the horizon by continuing to walk. To summarize, even when both expert and imitator are deterministic and the MDP has deterministic transitions, as long as the initial state is stochastic, we expect the *unnormalized* regret to scale with the horizon. ### **Regarding GAIL:** We agree with the reviewer that IRL methods can be beneficial in practice. However, regarding the comment about GAIL specifically, we emphasize that in a minimax sense, the regret *can* be larger than $R / H$, as shown by our Theorem 2.2; indeed, the lower bound in Theorem 2.2 demonstrates that linear scaling with $H$ is necessary for *any algorithm* (information-theoretically) in a worst-case sense when we allow dense rewards (note that in the setting of Theorem 2.2, we have $R/H = 1$). We also remark that GAIL assumes access to a global simulator, allowing the learner to sample trajectories from the MDP according to a given policy, which goes beyond the access model we study for behavior cloning. One interesting takeaway from our work (Theorem 2.2) is the observation that in the worst case, this additional assumption does not lead to improved performance. However, we emphasize that we agree with the reviewer that IRL methods likely have benefits in practice, and we think that it is an interesting question to better understand the extent to which such improved performance can be proved for some “nice” sub-class of MDPs.

Reviewer FtQL2024-08-13

Thanks a lot for the discussion! All of my concerns have been addressed. I have changed my score from 5 to 7.

Reviewer meEq2024-08-12

I thank the authors for the detailed response and I would suggest the authors incorporate the above responses in the revised version. Overall, I am maintaining my original score and remain in favor of acceptance.

Program Chairsdecision2024-09-25

Decision

Accept (spotlight)

© 2026 NYSGPT2525 LLC