← Back to Reinforcement Learning Mind Map
🎮 Reinforcement LearningID: behavioral-cloning

Behavioral Cloning

行为克隆 BC
🎯Core Definition
Behavioral cloning (BC) is the most direct imitation method: treat expert trajectories as labeled data and run supervised learning on (s,a)(s,a) pairs, minimizing min⁡πE(s,a)∼πE[−log⁡π(a∣s)]\min_\pi \mathbb{E}_{(s,a) \sim \pi_E}[-\log \pi(a|s)] — maximum-likelihood fitting of the expert policy.
💡Use Cases
a fast start when expert demos are available but rewards are hard to design — data-driven driving, teleoperated robot demos; LLM SFT (supervised fine-tuning) is BC in disguise.
⚡Key Problems Solved
simple, yet two fatal limitations: (1) compounding error — with independent per-step error probability ϵ\epsilon, deviation grows O(tϵ)\mathcal{O}(t\epsilon) by step tt, so the total loss accumulates to ∑t=1TO(tϵ)=O(T2ϵ)\sum_{t=1}^{T} \mathcal{O}(t\epsilon) = \mathcal{O}(T^2 \epsilon), growing quadratically in horizon; worse, training only sees states inside the expert's distribution (the i.i.d. assumption), while deployment must cope with the shifted state distribution its own mistakes create (covariate shift); (2) causal confusion — the model may latch onto effects rather than causes, e.g. a driving agent correcting from the ego car's lateral offset (an effect of its own steering) instead of the true cause — plausible in training, but the feedback loop breaks at test time and performance collapses.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Behavioral Cloning.
Use Cases
In production engineering, what are the primary use cases for Behavioral Cloning and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Why is BC's compounding error O(T2)\mathcal{O}(T^2)? Give the derivation intuition: how does per-step error ϵ\epsilon accumulate quadratically along the trajectory?
2
What is causal confusion? Give a driving/robotics example and its mitigations.
3
BC vs DAgger? How does DAgger fix covariate shift?
4
Why does BC look fine in training but fail at deployment? How does the i.i.d. assumption break?
5
BC vs GAIL/IRL: which imitation approach fits which scenario?
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "Behavioral Cloning"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
← Previous CardOffline Distribution ShiftNext Card →GAIL & Inverse RL

🔗 More Reinforcement Learning Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/RL/card/behavioral-cloning
中文速览与面试要点

行为克隆 BC (Behavioral Cloning)

定义: 行为克隆 (Behavioral Cloning, BC) 是最直接的模仿学习:把专家轨迹当有标签数据,对 (s,a) 对做监督学习,最小化 _ E_(s,a) _E[- (a|s)],即最大似然拟合专家策略。 使用场景: 有高质量专家演示、奖励难设计时的快速起点——自动驾驶数据驱动、机器人遥操作示教;LLM 的 SFT (监督微调) 本质就是 BC。 解决的问题: 简单直接,但有两个致命局限: (1) 复合误差 (Compounding Error)——若每步独立犯错概率为 ,偏差沿轨迹累积:第 t 步期望偏移约 O(t ),总回报损失 _t=1^T O(t ) = O(T^2 ) 随时间平方放大;更糟的是训练只见到专家分布内的状态 (i.i.d. 假设),部署时却要处理自己犯错导致的偏移状态分布 (协变量偏移); (2) 因果混淆 (Causal Confusion)——模型学到的可能是『结果』而非『原因』,如自动驾驶 BC 学会用自车横向偏移量 (自身转向动作的后果) 来修正方向,训练分布里专家总能纠正,部署时反馈环路失效、表现断崖下跌。

核心要点

  • BC 的复合误差为什么是 O(T^2)?给出推导直觉:每步独立误差 如何沿轨迹平方累积?
  • 因果混淆 (Causal Confusion) 是什么?举一个自动驾驶/机器人例子,并说明如何缓解。
  • BC 与 DAgger 的区别?DAgger 如何解决协变量偏移 (covariate shift)?
  • 为什么 BC 训练时表现良好、部署时错误连环发生?i.i.d. 假设如何失效?
  • BC 与 GAIL/逆向 RL 的对比:分别适合什么模仿学习场景?