ILPO(Imitating Latent Policies from Observation)提出了一种两阶段模仿学习框架: 先从专家状态观测中离线学习 latent policy 和 forward dynamics model, 再通过极少量环境交互将潜在动作对齐到真实动作空间, 从而在无需任何专家动作标签的前提下完成行为模仿。ILPO (Imitating Latent Policies from Observation) proposes a two-stage imitation learning framework: it first learns a latent policy and a forward dynamics model offline from expert state observations, and then aligns the latent actions to the real action space with very few environment interactions, thereby completing behavioral imitation without any expert action labels.
传统模仿学习需要同时获取专家的状态观测与动作标注,这在现实场景中往往难以满足—— 视频、人类示范或跨体型代理的行为记录通常只包含状态序列而没有对应动作。 现有"仅从观测模仿"方法(如 BCO)虽不依赖专家动作, 但需要先在环境中进行大量采样来学习逆向动力学模型, 在危险或高成本的真实场景中代价极高。Conventional imitation learning requires expert state observations and action labels at the same time, a requirement that is often impossible to meet in practice: videos, human demonstrations or behavior recordings of agents with a different embodiment usually contain only state sequences and no corresponding actions. Existing “imitation from observation only” methods (such as BCO) do not depend on expert actions, but they must first sample extensively in the environment to learn an inverse dynamics model, which is extremely costly in dangerous or expensive real-world settings.
"We describe a novel approach to imitation learning that infers latent policies directly from state observations … we only need a mechanism for learning policies from observation alone without requiring access to expert actions and with only a few interactions within the environment."
作者的核心洞察是:即便不知道真实动作标签,状态转移之间仍存在可预测的潜在因(latent causes)—— 这些因可以用离散的 latent actions 描述。先离线从专家数据中学习这些 latent actions 和对应的动力学模型, 然后只用极少量真实环境交互,将 latent actions 映射到真实动作空间。 这就像先观察朋友打游戏,再亲自上手几步确认手柄按键对应关系。The core insight of the authors is that even without ground-truth action labels there are still predictable latent causes (latent causes) behind state transitions, and these causes can be described by discrete latent actions. One first learns these latent actions and the corresponding dynamics model offline from expert data, and then uses only a very small amount of real environment interaction to map the latent actions onto the real action space. It is like watching a friend play a game first and then taking the controller for a few steps to confirm which button does what.
ILPO 分为两个阶段:Step 1 离线学习 latent policy 和 forward dynamics model; Step 2 用少量真实环境交互学习 action remapping network,将 latent actions 对齐到真实动作。 推理时,先选最可能的 latent action,再映射到对应的真实动作。ILPO has two stages: Step 1 learns a latent policy and a forward dynamics model offline; Step 2 learns an action remapping network from a small amount of real environment interaction, aligning the latent actions to the real actions. At inference time the most likely latent action is selected first and then mapped to the corresponding real action.
给定专家状态序列 {st, st+1},ILPO 联合训练两个目标:Given expert state sequences {st, st+1}, ILPO jointly trains two objectives:
Lmin = minz ‖Δt − Gθ(Ep(st), z)‖₂。
这使每个生成器收敛到一类转移簇(transition cluster),而非预测所有转移的均值。Latent forward dynamics (Lmin): for every latent action z the generator G separately predicts the next-state change Δt = st+1 − st, and the loss penalizes only the closest prediction: Lmin = minz ‖Δt − Gθ(Ep(st), z)‖₂. This makes each generator converge to one transition cluster instead of predicting the mean of all transitions.
ŝt+1 = Σz πω(z|st) Gθ(Ep(st), z),
损失 Lexp = ‖st+1 − ŝt+1‖₂。
总损失 Lpolicy = Lmin + Lexp。Latent policy learning (Lexp): πω(z|st) denotes the probability of observing a transition of type z in state st. It is trained by minimizing the difference between the expected next state and the true next state: ŝt+1 = Σz πω(z|st) Gθ(Ep(st), z), with loss Lexp = ‖st+1 − ŝt+1‖₂. The total loss is Lpolicy = Lmin + Lexp.
通过 ε-greedy 策略在真实环境中采集少量 {st, at, st+1} 三元组。 利用已训练好的 G,找到与观测转移最接近的 latent action:A small number of {st, at, st+1} triples is collected in the real environment with an ε-greedy policy. Using the already trained G, the latent action closest to the observed transition is found:
zt = argminz ‖st+1 − Gθ(Ep(st), z)‖₂Low-dimensional states: zt = argminz ‖st+1 − Gθ(Ep(st), z)‖₂
zt = argminz ‖Ep(st+1) − Ep(Gθ(Ep(st), z))‖₂(在 embedding 空间度量距离)High-dimensional visual inputs: zt = argminz ‖Ep(st+1) − Ep(Gθ(Ep(st), z))‖₂ (the distance is measured in embedding space)
得到 zt 后,以真实动作 at 为标签,通过 cross-entropy loss 监督训练 action remapping network πξ(at|zt, Ea(st))。 由于神经网络的泛化能力,相同动作在不同状态下通常产生相似的状态转移, 因此只需少量交互就能学会可泛化的 latent-to-real 映射。Once zt is obtained, the real action at is used as the label to supervise the action remapping network πξ(at|zt, Ea(st)) with a cross-entropy loss. Thanks to the generalization ability of neural networks, the same action usually produces similar state transitions in different states, so only a few interactions suffice to learn a latent-to-real mapping that generalizes.
给定状态 st:先选最可能的 latent action
z* = argmaxz πω(z|st),
再选最可能对应该 latent action 的真实动作
a* = argmaxa πξ(a|z*, st)。
整个推理过程无需额外环境交互。Given a state st: first select the most likely latent action z* = argmaxz πω(z|st), then select the real action most likely to correspond to that latent action a* = argmaxa πξ(a|z*, st). The whole inference procedure needs no additional environment interaction.
在 4 个环境中评估 ILPO:经典控制任务(Cartpole、Acrobot、Mountain car)和 视觉平台游戏 CoinRun(OpenAI)。 基线方法:专家策略(Expert)、随机策略(Random)、 Behavioral Cloning(BC,使用真实动作标签)、 BCO(Behavioral Cloning from Observation,不使用专家动作但需要大量环境采样)。 实验均使用 OpenAI Baselines 生成专家策略。ILPO is evaluated in 4 environments: the classic control tasks (Cartpole, Acrobot, Mountain car) and the visual platform game CoinRun (OpenAI). The baselines are the expert policy (Expert), a random policy (Random), Behavioral Cloning (BC, which uses ground-truth action labels) and BCO (Behavioral Cloning from Observation, which does not use expert actions but needs extensive environment sampling). All experiments use OpenAI Baselines to generate the expert policies.
论文测试了 |Z| ≠ |A| 的情形(图 3): 以 |Z| = |A| 为初始猜测效果最好,但智能体在其他大小下仍能学习。 |Z| = 1 在 Cartpole 和 Acrobot 中表现很差,因为所有动作会坍缩到同一个 latent, 状态预测无法解耦。这验证了"latent action 数量 = 真实动作数量"是合理的先验假设。The paper tests the case |Z| ≠ |A| (Figure 3): taking |Z| = |A| as the initial guess works best, but the agent can still learn with other sizes. |Z| = 1 performs very poorly on Cartpole and Acrobot, because all actions collapse into the same latent and the state predictions cannot be disentangled. This confirms that “the number of latent actions = the number of real actions” is a reasonable prior assumption.
| 环境Environment | BCO(基线)BCO (baseline) | ILPO(本文)ILPO (this paper) | BC(有动作标签)BC (with action labels) | Expert |
|---|---|---|---|---|
| Cartpole(步数 ≤100)Cartpole (≤100 steps) | 低于 ExpertBelow Expert | ≈ Expert | ≈ Expert | — |
| Acrobot(步数 ≤100)Acrobot (≤100 steps) | 低于 ExpertBelow Expert | ≈ Expert | ≈ Expert | — |
| Mountain car | 低于 ExpertBelow Expert | 优于 BCOBetter than BCO | ≈ Expert | — |
| CoinRun Easy / Hard | 低于 ExpertBelow Expert | 显著优于 BCOMarkedly better than BCO | — | — |
注:上表为对论文图表的定性归纳,具体数值请参见原文图 2、图 5。 BC 使用真实动作标签,ILPO 和 BCO 均不使用专家动作。Note: the table above is a qualitative summary of the figures in the paper; for the exact values see Figures 2 and 5 in the original. BC uses ground-truth action labels, while neither ILPO nor BCO uses expert actions.
"future work could address … that it requires that actions are discrete"。 当前 ILPO 假设动作空间为离散集合,连续控制(如机械臂扭矩控制)无法直接应用。 此外,方法还假设状态转移是确定性的(deterministic transitions)。“future work could address … that it requires that actions are discrete”. ILPO currently assumes the action space is a discrete set, so continuous control (such as torque control of a robot arm) cannot be applied directly. The method additionally assumes that state transitions are deterministic (deterministic transitions).
虽然比 BCO 需要少得多的交互,但 ILPO 第二步仍需在真实环境中采集 {s, a, s'} 样本进行 action remapping。 在完全无法与环境交互的场景(如医疗机器人冷启动)依然面临挑战。 论文也指出可通过"enforcing stronger local consistencies between latent actions and generated predictions"进一步减少所需样本。Although far fewer interactions are needed than for BCO, the second step of ILPO still has to collect {s, a, s'} samples in the real environment for action remapping. Settings in which the environment cannot be interacted with at all (such as the cold start of a medical robot) remain a challenge. The paper also notes that the number of required samples can be reduced further by “enforcing stronger local consistencies between latent actions and generated predictions”.
CoinRun 实验中,"some random seeds led to bad initialization that resulted in the agent not learning at all"。 高维情形(128×128×3)下动力学学习难度更大,整体结果包含了表现很差的 seed。In the CoinRun experiments, “some random seeds led to bad initialization that resulted in the agent not learning at all”. In the high-dimensional setting (128×128×3) learning the dynamics is considerably harder, and the overall results include seeds that performed very poorly.
方法需要预先指定 |Z|(通常设为 |A|)。消融实验表明 |Z| ≠ |A| 仍可学习, 但在实际应用中真实动作数量未必已知, 自动确定合适的 latent action 数量是未来工作方向之一。The method requires |Z| to be specified in advance (usually set to |A|). The ablation shows that learning is still possible when |Z| ≠ |A|, but in practice the number of real actions is not necessarily known, and automatically determining a suitable number of latent actions is one direction for future work.
"ILPO requires stochastic demonstrations … although the agent was capable of performing well with deterministic demonstrations, the performance decreased in this setting"。 如果专家演示过于确定性,某些 latent action 对应的转移可能从未在数据中出现,影响动力学模型的覆盖度。“ILPO requires stochastic demonstrations … although the agent was capable of performing well with deterministic demonstrations, the performance decreased in this setting”. If the expert demonstrations are too deterministic, the transitions corresponding to some latent actions may never appear in the data, which harms the coverage of the dynamics model.