CS231n Lecture 17 - Robot Learning

LECTURE 글 목록
목차

핵심 한 줄 정리

Robot learning은 observation에서 정답 하나를 예측하는 문제가 아니라 action으로 environment를 바꾸며 장기적인 reward를 높이는 sequential decision-making 문제이고, model-free reinforcement learning, learned world model을 이용한 planning, demonstration 기반 imitation learning, vision-language-action foundation model이 서로 다른 방식으로 이 policy를 학습한다.

반드시 기억할 개념

Robot learning이 일반적인 supervised learning과 다른 점

Supervised learning은 고정된 dataset의 input xx에서 label yy를 예측한다.

y^=fθ(x)\hat{y} = f_\theta(x)

Prediction이 틀려도 다음 input의 distribution은 바뀌지 않는다. 반면 robot은 현재 observation에서 action을 선택하고, 그 action이 physical world를 바꾸며 다음 observation을 만든다.

otπatenvironmentot+1,rto_t \xrightarrow{\pi} a_t \xrightarrow{\text{environment}} o_{t+1},r_t

따라서 robot learning의 output은 한 번의 prediction이 아니라 feedback을 받으며 이어지는 action sequence이다. 한 시점의 작은 error도 다음 state를 training distribution 밖으로 밀어내고 이후 error를 키울 수 있다.

Computer vision이 주로 environment의 representation을 얻는 데 초점을 둔다면 robot learning은 그 representation을 사용해 physical constraint 아래 objective를 최적화한다.

Sequential decision-making formulation

Robot learning problem은 보통 Markov Decision Process, MDP로 정리한다.

M=(S,A,P,R,γ)\mathcal{M} = (\mathcal{S},\mathcal{A},P,R,\gamma)
  • S\mathcal{S}는 state space이다.
  • A\mathcal{A}는 action space이다.
  • P(st+1st,at)P(s_{t+1}\mid s_t,a_t)는 transition dynamics이다.
  • R(st,at)R(s_t,a_t)는 reward function이다.
  • γ[0,1)\gamma\in[0,1)는 미래 reward의 discount factor이다.

Policy는 state에서 action distribution을 정한다.

πθ(atst)\pi_\theta(a_t\mid s_t)

Environment는 policy의 action에 따라 다음 state와 reward를 만든다.

st+1P(st,at)s_{t+1} \sim P(\cdot\mid s_t,a_t) rt=R(st,at)r_t = R(s_t,a_t)

Agent의 목표는 discounted return의 expectation을 maximize하는 것이다.

Gt=k=0γkrt+kG_t = \sum_{k=0}^{\infty} \gamma^k r_{t+k} J(θ)=Eπθ,P[G0]J(\theta) = \mathbb{E}_{\pi_\theta,P} \left[ G_0 \right]
%% title: Sequential Decision-Making의 Agent-Environment Loop
%% caption: Policy가 observation으로 action을 선택하면 environment가 다음 state·observation과 reward를 만든다. 이 반복 구조 때문에 현재 action이 미래 data distribution을 바꾼다.
flowchart LR
    env["Environment<br/>State sₜ"] --> observe["Observation oₜ<br/>camera · proprioception · force"]
    goal["Goal / Instruction g"] --> policy["Policy π(aₜ | o≤ₜ, g)"]
    observe --> policy
    policy --> action["Action aₜ"]
    action --> transition["Dynamics<br/>p(sₜ₊₁ | sₜ, aₜ)"]
    transition --> envnext["Next State sₜ₊₁"]
    envnext --> reward["Reward rₜ"]
    reward -. "learning signal" .-> policy
    envnext --> observe

State와 observation

State sts_t는 future를 예측하는 데 필요한 environment의 완전한 정보를 뜻한다. 실제 robot은 occlusion, sensor noise, hidden physical property 때문에 true state를 직접 알지 못하고 observation oto_t만 얻는 경우가 많다.

otO(st)o_t \sim O(\cdot\mid s_t)

이 경우 문제는 Partially Observable Markov Decision Process, POMDP에 가깝다. Policy는 한 frame만 보거나 observation history, recurrent state, estimated belief를 사용할 수 있다.

atπθ(atot,g)a_t \sim \pi_\theta \left( a_t \mid o_{\le t},g \right)

gg는 language instruction이나 target configuration 같은 goal이다.

Goal, state, action, reward의 예

같은 formulation은 서로 다른 domain에 적용할 수 있다.

TaskState 또는 observationActionReward
Cart-polecart position, pole angle과 velocitycart에 주는 horizontal forcepole이 upright이면 timestep마다 1
Locomotionrobot joint position과 velocity각 joint의 torqueforward progress와 upright posture
Atarigame screen의 pixelup, down, left, rightscore 변화
Goboard 위 stone configuration다음 stone의 위치episode 끝의 win 또는 loss
Cloth foldingmulti-view RGB 또는 RGB-Dend-effector motion과 gripper open·close원하는 fold가 완성되면 높은 reward

Cloth folding처럼 deformable object를 다루는 task는 state estimation부터 어렵다. Cloth가 가려질 수 있고 같은 visual shape도 fold topology가 다를 수 있으며, grasp 실패가 environment를 예상 밖으로 바꿀 수 있다.

Reward design은 task specification이다

Reward는 단순한 score가 아니라 무엇을 좋은 behavior로 볼 것인지 정의한다. Self-driving에서는 빠른 이동, 승차감, collision avoidance가 서로 충돌할 수 있다. Cloth folding에서도 compactness, smoothness, fold style에 따라 다른 reward가 필요하다.

여러 objective를 weighted sum으로 만들 수 있다.

rt=w1rttask+w2rtsafety+w3rtsmoothr_t = w_1r_t^{\text{task}} + w_2r_t^{\text{safety}} + w_3r_t^{\text{smooth}}

Weight를 잘못 고르면 agent는 designer의 의도보다 reward의 허점을 최적화할 수 있다. Sparse terminal reward는 specification이 간단하지만 credit assignment가 어렵고, dense shaping reward는 학습을 돕지만 unintended shortcut을 만들 수 있다.

Robot perception은 embodied, active, situated하다

일반 image recognition은 이미 수집된 image를 수동적으로 처리한다. Robot은 physical body를 가지고 environment 안에서 움직이며 perception과 action을 닫힌 loop로 연결한다.

  • Embodied: sensor와 actuator가 특정 body와 kinematics에 묶여 있다.
  • Active: 더 잘 보기 위해 camera나 object를 움직일 수 있다.
  • Situated: 지금 이 위치와 task에 필요한 information을 판단해야 한다.

겹쳐 보이는 object가 하나인지 여러 개가 포개진 것인지 image 한 장으로 알기 어렵다면 robot이 건드려 보고 분리되는지 관찰할 수 있다. 이는 action이 control뿐 아니라 information acquisition의 수단이 되는 active perception이다.

at=argmaxatE[task utility+λinformation gain]a_t^* = \arg\max_{a_t} \mathbb{E} \left[ \text{task utility} + \lambda \text{information gain} \right]

Task와 무관한 world 전체를 완벽히 복원할 필요도 없다. Shirt button을 잠그는 task라면 button 주변의 local geometry와 contact state가 더 중요하다. Perception representation은 downstream action에 필요한 information을 중심으로 설계해야 한다.

Multimodal robot perception

Physical interaction은 RGB image 하나로 보이지 않는 property를 포함한다.

  • RGB는 object identity, scene context, texture를 알려 준다.
  • Depth와 LiDAR는 geometry와 distance를 알려 준다.
  • Tactile sensor는 contact, slip, grasp stability를 알려 준다.
  • Force-torque sensor는 interaction force를 알려 준다.
  • Audio는 collision, motor, material interaction의 event를 알려 줄 수 있다.
  • Proprioception은 joint position, velocity, gripper state를 제공한다.

각 modality는 observation이 불완전해지는 지점이 다르다. Camera에서 가려진 contact는 tactile sensor가 보완하고, tactile sensor가 주지 못하는 global context는 vision이 제공한다. Sensor fusion은 단순 concatenation보다 timestamp, coordinate frame, uncertainty를 함께 맞추는 문제이다.

Reinforcement learning의 기본 아이디어

Reinforcement learning은 environment interaction으로 trajectory를 모으고 high-return action의 probability를 높인다.

τ=(s0,a0,r0,s1,a1,r1,)\tau = (s_0,a_0,r_0,s_1,a_1,r_1,\ldots)

Supervised learning과 비교하면 다음 어려움이 있다.

  • Transition과 reward가 stochastic할 수 있다.
  • Reward가 늦게 나타나 credit assignment가 어렵다.
  • Physical environment는 보통 미분할 수 없다.
  • Policy가 바뀌면 방문하는 state distribution도 바뀐다.
  • Exploration 중 위험한 action을 실행할 수 있다.

같은 push action도 friction과 contact의 미세한 차이로 object를 다른 방향으로 돌릴 수 있다. Go에서는 마지막 win reward를 수십 또는 수백 step 전 action에 배분해야 한다. Robot의 action은 다음 training sample 자체를 바꾸므로 data가 stationary하지 않다.

Value function과 Q-function

State value는 state ss에서 policy를 따를 때 얻는 expected return이다.

Vπ(s)=Eπ[Gtst=s]V^\pi(s) = \mathbb{E}_\pi \left[ G_t \mid s_t=s \right]

Action value는 state ss에서 action aa를 먼저 실행한 뒤 policy를 따를 expected return이다.

Qπ(s,a)=Eπ[Gtst=s,at=a]Q^\pi(s,a) = \mathbb{E}_\pi \left[ G_t \mid s_t=s, a_t=a \right]

Bellman equation은 current reward와 next-state value를 연결한다.

Qπ(s,a)=E[rt+γEaπQπ(st+1,a)]Q^\pi(s,a) = \mathbb{E} \left[ r_t + \gamma \mathbb{E}_{a'\sim\pi} Q^\pi(s_{t+1},a') \right]

Optimal Q-function을 알고 discrete action을 사용한다면 가장 큰 value의 action을 선택할 수 있다.

at=argmaxaQ(st,a)a_t^* = \arg\max_a Q^*(s_t,a)

Atari의 Deep Q-Network 예에서는 최근 네 game frame을 CNN에 넣고 각 discrete action의 Q-value를 한 번에 출력한다. 여러 frame이 필요한 이유는 single image만으로 ball의 velocity와 direction을 알 수 없기 때문이다.

Policy optimization

Value를 거치지 않고 policy parameter를 직접 update할 수도 있다. Policy gradient의 기본 형태는 다음과 같다.

θJ(θ)=Eπθ[θlogπθ(atst)A^t]\nabla_\theta J(\theta) = \mathbb{E}_{\pi_\theta} \left[ \nabla_\theta \log \pi_\theta(a_t\mid s_t) \hat{A}_t \right]

A^t\hat{A}_t는 선택한 action이 baseline보다 얼마나 좋은지 나타내는 advantage estimate이다. PPO는 policy update가 지나치게 커지는 것을 제한하고, SAC는 entropy를 함께 maximize해 continuous action에서 exploration을 유지하는 대표적인 algorithm이다.

강의에서는 Breakout agent가 약 10분 뒤 ball을 맞히기 시작하고, 약 2시간 뒤 안정적으로 paddle을 제어하며, 약 4시간 뒤 side tunnel을 만들어 위쪽 brick을 빠르게 제거하는 strategy를 발견하는 예를 소개했다. RL은 human demonstration에 없는 strategy를 exploration으로 발견할 수 있다는 장점이 있다.

Model-free reinforcement learning의 한계

Model-free RL은 transition model을 명시적으로 학습하지 않고 policy나 value를 interaction에서 바로 학습한다. Simulation과 game처럼 많은 trial을 병렬로 만들 수 있는 곳에서는 강력하지만 real robot에서는 다음 문제가 크다.

  • Sample inefficiency: 실제 interaction을 대량으로 모으기 어렵다.
  • Safety: random exploration이 robot과 주변을 손상시킬 수 있다.
  • Reset cost: 실패 뒤 environment를 초기화하는 데 사람이 필요하다.
  • Interpretability: 실패 원인과 수정 방법을 찾기 어렵다.
  • Sim-to-real gap: simulation에서 배운 behavior가 real dynamics에서 달라질 수 있다.

Locomotion은 simulation에서 대규모 RL을 수행한 뒤 real robot으로 옮기는 성공 사례가 많다. Manipulation은 grasp success와 failure가 contact의 작은 오차로 불연속적으로 바뀌므로 sim-to-real이 더 어렵다.

Domain randomization과 sim-to-real

Domain randomization은 simulation parameter를 고정하지 않고 매 episode sampling한다.

ξp(ξ)\xi \sim p(\xi) st+1Pξ(st,at)s_{t+1} \sim P_\xi (\cdot\mid s_t,a_t)

ξ\xi에는 friction, mass, geometry, actuator delay, sensor noise 등이 포함될 수 있다. Policy는 randomized environment 전체에서 return을 높인다.

maxθEξp(ξ)Eπθ,Pξ[G0]\max_\theta \mathbb{E}_{\xi\sim p(\xi)} \mathbb{E}_{\pi_\theta,P_\xi} \left[ G_0 \right]

Real world가 training distribution 안의 한 sample과 비슷하다면 policy가 transfer될 수 있다. Snow나 bush를 정확히 rendering하지 않아도 low-level locomotion control이 robust할 수 있는 이유이다.

하지만 randomization이 support하지 않은 contact event는 해결하지 못한다. Simulation에서 box가 10도, real world에서 12도 회전하는 차이는 feedback으로 수정할 수 있지만, simulation에서는 grasp가 성공하고 real world에서는 object가 slip하는 차이는 trajectory 자체를 바꾼다.

Hierarchical control

실제 robot demo는 human이 high-level direction을 주고 learned policy가 low-level torque를 생성하는 경우가 많다.

gtπlowatjointg_t \xrightarrow{\pi_{\text{low}}} a_t^{\text{joint}}

High-level command gtg_t는 forward, turn, target location처럼 추상적이고 low-level action은 각 joint의 torque나 target position이다.

멋진 demo가 모든 planning을 autonomous하게 했다는 뜻은 아니다. Human operator가 robot이 잘 통과할 route를 고르거나 실패하면 다른 command를 줄 수 있다. 평가할 때 human intervention과 autonomy level을 명확히 구분해야 한다.

Dynamics model과 world model

Model-based approach는 action이 environment를 어떻게 바꾸는지 예측하는 forward model을 학습한다.

s^t+1=fϕ(st,at)\hat{s}_{t+1} = f_\phi(s_t,a_t)

Stochastic dynamics라면 next-state distribution을 예측한다.

pϕ(st+1st,at)p_\phi(s_{t+1}\mid s_t,a_t)

Transition data로 supervised learning할 수 있다.

Ddyn={(st,at,st+1)}\mathcal{D}_{\text{dyn}} = \{(s_t,a_t,s_{t+1})\} Ldyn=tfϕ(st,at)st+122\mathcal{L}_{\text{dyn}} = \sum_t \left\lVert f_\phi(s_t,a_t)-s_{t+1} \right\rVert_2^2

World model이 정확하면 robot은 physical world에서 모든 action을 시도하지 않고 virtual rollout으로 결과를 비교할 수 있다.

Planning은 forward prediction의 inverse problem이다

Current state sts_t와 goal sgs_g가 주어졌을 때 horizon HH의 action sequence를 최적화한다.

s^t+k+1=fϕ(s^t+k,at+k)\hat{s}_{t+k+1} = f_\phi (\hat{s}_{t+k},a_{t+k}) At=(at,at+1,,at+H1)A_t = (a_t,a_{t+1},\ldots,a_{t+H-1}) At=argminAt[(s^t+H,sg)+k=0H1c(s^t+k,at+k)]A_t^* = \arg\min_{A_t} \left[ \ell (\hat{s}_{t+H},s_g) + \sum_{k=0}^{H-1} c(\hat{s}_{t+k},a_{t+k}) \right]

\ell은 final target error이고 cc는 collision, force, action smoothness 같은 intermediate cost이다. Differentiable model이면 action에 gradient descent를 적용할 수 있고, 그렇지 않으면 random shooting이나 sampling-based trajectory optimization을 사용할 수 있다.

Model Predictive Control

Learned model은 완벽하지 않으므로 긴 sequence를 open loop로 모두 실행하면 model error가 누적된다. Model Predictive Control, MPC는 매 step 다시 planning한다.

  1. Current observation에서 state를 estimate한다.
  2. Horizon HH의 action sequence를 optimize한다.
  3. 첫 action ata_t^*만 실행한다.
  4. 새 observation ot+1o_{t+1}을 받는다.
  5. State를 update하고 다시 optimize한다.
at=first(At)a_t = \operatorname{first} \left( A_t^* \right)

Feedback이 model prediction error와 external disturbance를 계속 교정한다. Planning이 느리다면 offline에서 많은 optimized trajectory를 만들고 그 action을 빠른 policy로 distillation할 수 있다.

%% title: Model Predictive Control의 Receding-Horizon Loop
%% caption: 현재 state에서 여러 action sequence의 future를 model로 예측하고 가장 좋은 sequence의 첫 action만 실행한 뒤, 새 observation으로 다시 planning한다.
flowchart LR
    obs["Current Observation oₜ"] --> state["State Estimate ŝₜ"]
    state --> candidates["Candidate Action Sequences<br/>Aₜ¹ … Aₜᵏ"]
    candidates --> rollout["Dynamics / World Model<br/>Virtual Rollouts"]
    rollout --> cost["Goal + Constraint Cost"]
    cost --> best["Best Sequence Aₜ*"]
    best --> first["Execute First Action aₜ*"]
    first --> robot["Robot + Environment"]
    robot --> newobs["New Observation oₜ₊₁"]
    newobs --> state

State representation이 model learning을 결정한다

같은 physical world도 어떤 state를 사용하느냐에 따라 dynamics learning 난도가 달라진다.

  • Pixel: raw information을 보존하지만 high-dimensional하고 appearance 변화까지 예측해야 한다.
  • Keypoint: object의 중요한 위치만 추적해 compact하지만 keypoint detector에 의존한다.
  • Particle: deformable object나 granular material의 geometry를 세밀하게 표현하지만 point correspondence와 interaction modeling이 필요하다.
  • Latent state: encoder가 task-relevant dynamics를 학습하지만 해석이 어렵고 중요한 contact를 잃을 수 있다.

Pixel dynamics는 image 자체의 future를 예측해 visual goal과 비교할 수 있다. Keypoint dynamics는 box 위 point의 3D movement를 예측한다. Particle dynamics는 granular material이나 dough처럼 자유도가 큰 object를 point set으로 나타낸다.

Particle-based planning 예

Granular rearrangement에서는 blue particle이 current object shape, red particle이 target shape를 나타낸다고 볼 수 있다. Dynamics model이 candidate action 뒤 particle movement를 예측하고 point-set distance가 작은 action을 선택한다.

P^t+1=fϕ(Pt,at)\hat{P}_{t+1} = f_\phi(P_t,a_t) at=argminad(fϕ(Pt,a),Pg)a_t^* = \arg\min_a d \left( f_\phi(P_t,a),P_g \right)

dd에는 Chamfer distance 같은 set metric을 사용할 수 있다. 강의에서는 granular pile을 target region으로 모으거나 letter A부터 Z까지의 shape로 재배치하는 예가 소개되었다.

Tool use와 hierarchical planning 예

Dumpling-making system은 네 대의 RGB-D camera로 dough geometry를 관찰하고 15개의 3D-printed tool 중 하나를 선택했다. Decision은 두 level로 나뉜다.

kt=πtool(st,sg)k_t = \pi_{\text{tool}}(s_t,s_g) at=πmotion(st,sg,kt)a_t = \pi_{\text{motion}}(s_t,s_g,k_t)

ktk_t는 tool category이고 ata_t는 선택한 tool의 motion이다. Learned particle dynamics는 각 tool과 action이 dough shape를 어떻게 바꿀지 예측한다.

Human이 dough를 망가뜨려도 current observation에서 task stage를 다시 판단하고 이전 stage로 돌아갈 수 있었다. 이는 고정된 open-loop script가 아니라 perception, stage selection, motion planning이 feedback loop 안에서 동작한다는 의미이다.

이 예에서는 처음부터 physics simulator를 사용하지 않고 real interaction data로 dynamics model을 학습했다. Material Point Method simulator를 system identification한 baseline보다 learned real-world dynamics가 더 정확했던 사례도 소개되었다. Simulator가 항상 learned model보다 나쁘다는 뜻은 아니며, 복잡한 deformable contact에서는 simulator parameter와 real material을 맞추기 특히 어렵다는 뜻이다.

Model-based planning과 model-based RL

Dynamics model만 supervised learning하고 그 model 위에서 action optimization을 수행하면 model learning과 model-based planning이라고 부를 수 있다. Model과 value 또는 policy를 함께 학습하고 imagined rollout을 RL update에 사용하면 model-based reinforcement learning이라고 부르는 경우가 많다.

두 용어의 경계보다 중요한 질문은 다음과 같다.

  • 어떤 data로 dynamics를 학습하는가?
  • Model uncertainty를 planning에 반영하는가?
  • Planning을 online으로 수행하는가, policy로 distill하는가?
  • Model error가 큰 state를 피하거나 새 data를 수집하는가?

Imitation learning

Imitation learning은 expert demonstration에서 observation-to-action policy를 supervised learning한다.

DE={(ot,atE)}\mathcal{D}_E = \{(o_t,a_t^E)\} πθ(atot,g)\pi_\theta(a_t\mid o_t,g)

Reward를 설계하거나 위험한 exploration을 대량 수행하지 않아도 human의 useful behavior를 직접 배울 수 있다. Real manipulation에서 흥미로운 behavior를 빠르게 얻는 가장 실용적인 방법 중 하나이다.

Behavior cloning

Continuous action의 deterministic behavior cloning은 expert action과의 regression loss를 사용할 수 있다.

LBC=E(o,aE)DE[πθ(o)aE22]\mathcal{L}_{\text{BC}} = \mathbb{E}_{(o,a^E)\sim\mathcal{D}_E} \left[ \left\lVert \pi_\theta(o)-a^E \right\rVert_2^2 \right]

Stochastic policy라면 negative log-likelihood를 minimize한다.

LBC=E(o,aE)DE[logπθ(aEo)]\mathcal{L}_{\text{BC}} = -\mathbb{E}_{(o,a^E)\sim\mathcal{D}_E} \left[ \log \pi_\theta(a^E\mid o) \right]

Training만 보면 일반 supervised learning이지만 deployment에서는 policy action이 다음 observation을 만든다는 차이가 남는다.

Covariate shift와 cascading error

Demonstration은 expert가 방문한 state distribution dπEd_{\pi_E}에서 수집된다. Learned policy는 작은 mistake 뒤 다른 distribution dπθd_{\pi_\theta}를 방문한다.

dπθdπEd_{\pi_\theta} \ne d_{\pi_E}

Training data에 없는 off-trajectory state에서는 action error가 커지고, 그 action이 더 낯선 state를 만들어 error가 시간에 따라 증폭된다. One-step validation loss가 작아도 long-horizon success가 낮을 수 있는 이유이다.

이를 줄이려면 policy를 rollout한 상태에서 expert correction을 추가한다.

  1. Initial expert demonstration으로 policy를 학습한다.
  2. Learned policy를 real 또는 simulated environment에서 실행한다.
  3. Failure와 recovery state에서 expert action을 labeling한다.
  4. 새 data를 기존 dataset에 합쳐 다시 학습한다.

DAgger 계열의 핵심도 learner가 실제로 방문하는 state distribution에서 expert label을 모으는 것이다. Initial successful trajectory만큼 recovery demonstration이 중요하다.

%% title: Behavior Cloning의 Covariate Shift와 Data Aggregation
%% caption: Expert trajectory에서만 학습한 policy는 작은 실수 뒤 off-trajectory state를 만나고, 낯선 state에서 추가 실수를 만들 수 있다. Policy가 실제로 방문한 state의 expert correction을 다시 학습 data에 합친다.
flowchart LR
    expert["Expert Demonstrations<br/>dπ_E"] --> train["Supervised Policy Training"]
    train --> policy["Learned Policy πθ"]
    policy --> rollout["Deployment Rollout"]
    rollout --> error["Small Action Error"]
    error --> drift["Off-Distribution State<br/>dπ_θ ≠ dπ_E"]
    drift --> cascade["Cascading Error"]
    drift --> correction["Expert Recovery Label"]
    correction --> aggregate["Aggregate Dataset"]
    expert --> aggregate
    aggregate --> train

Inverse reinforcement learning

Imitation learning의 demonstration에는 task objective가 명시적으로 적혀 있지 않다. Inverse reinforcement learning, IRL은 expert trajectory를 잘 설명하는 reward를 추정한다.

Rψ=argmaxRP(DER)R_\psi = \arg\max_R P(\mathcal{D}_E\mid R)

추정한 reward로 새로운 dynamics나 initial state에서 reinforcement learning을 수행할 수 있다. Policy action을 그대로 복제하는 것보다 expert가 최적화한 의도를 복원하려는 접근이다.

Reward는 여러 형태로 같은 expert behavior를 설명할 수 있어 identifiability가 어렵고, 이후 RL 단계의 sample cost가 다시 생긴다는 한계가 있다.

Explicit policy와 implicit policy

Explicit policy는 observation을 action으로 직접 mapping한다.

a=πθ(o)a = \pi_\theta(o)

같은 observation에서 여러 action이 모두 valid하면 MSE regression은 서로 다른 mode의 평균을 예측할 수 있다. 평균 action이 어느 valid behavior에도 속하지 않을 수 있다.

Implicit policy는 observation과 candidate action의 compatibility를 energy로 나타낸다.

Eθ(o,a)RE_\theta(o,a) \in \mathbb{R} a=argminaEθ(o,a)a^* = \arg\min_a E_\theta(o,a)

Action distribution의 여러 mode를 유지할 수 있지만 inference 때 optimization이나 sampling이 필요하다.

Diffusion Policy

Diffusion Policy는 generative diffusion model을 policy function class로 사용한다. 한 action이 아니라 future action chunk를 생성하는 경우가 많다.

At=(at,at+1,,at+Ha1)A_t = (a_t,a_{t+1},\ldots,a_{t+H_a-1})

Training에서는 expert action chunk에 noise를 더하고 observation에 conditioned한 denoiser가 noise 또는 clean action을 예측한다.

At(k)=αˉkAt+1αˉkϵA_t^{(k)} = \sqrt{\bar{\alpha}_k} A_t + \sqrt{1-\bar{\alpha}_k} \epsilon Ldiff=E[ϵϵθ(At(k),k,ot,g)22]\mathcal{L}_{\text{diff}} = \mathbb{E} \left[ \left\lVert \epsilon - \epsilon_\theta (A_t^{(k)},k,o_{\le t},g) \right\rVert_2^2 \right]

Inference에서는 random action sequence에서 시작해 iterative denoising으로 coherent action chunk를 만든다. Multimodal demonstration을 하나의 평균 action으로 collapse하지 않고 여러 valid behavior를 표현할 수 있으며, chunk 단위 생성은 temporal consistency에도 유리하다.

Diffusion Policy가 모든 manipulation을 자동으로 generalize하는 것은 아니다. Initial configuration과 object variation이 demonstration distribution을 벗어나면 여전히 실패하므로 iterative data collection과 recovery example이 필요하다.

%% title: Diffusion Policy의 Action-Chunk 생성
%% caption: Observation과 goal을 condition으로 사용해 random action sequence를 반복적으로 denoise하고, 생성된 coherent action chunk의 일부를 실행한 뒤 새 observation에서 다시 생성한다.
flowchart LR
    obs["Observation History o≤ₜ"] --> denoiser["Conditional Action Denoiser"]
    goal["Goal / Language g"] --> denoiser
    noise["Random Action Chunk<br/>Aₜ⁽ᴷ⁾"] --> denoiser
    denoiser --> k1["Denoise Step K-1"]
    k1 --> k2["…"]
    k2 --> clean["Action Chunk<br/>(aₜ … aₜ₊ₕ₋₁)"]
    clean --> execute["Execute Prefix"]
    execute --> robot["Robot / Environment"]
    robot --> nextobs["New Observation"]
    nextobs -. "replan" .-> denoiser

Robot learning 방법 비교

방법주된 data학습 대상장점핵심 한계
Model-free RLenvironment interaction과 rewardpolicy 또는 valuehuman보다 나은 strategy를 발견할 수 있음sample cost, safety, reward design
Model-based planningtransition tupledynamics와 online planvirtual rollout과 feedback correctionmodel bias, online planning cost
Behavior cloningexpert observation-action pairpolicy단순하고 real task를 빠르게 학습covariate shift, demonstration quality
Diffusion Policyexpert action sequencemultimodal action generatorsmooth하고 다양한 action chunkiterative inference와 data coverage
VLA foundation modelmulti-task robot data와 vision-language datagoal-conditioned general policysemantic generalization과 task transferembodiment gap, post-training, evaluation

Robotic foundation model과 VLA

Robotic foundation model은 observation과 task specification을 받아 physical action을 생성하는 broad policy이다. Vision-Language-Action, VLA model이라고도 부른다.

atπθ(atot,,e)a_t \sim \pi_\theta \left( a_t \mid o_{\le t}, \ell, e \right)

\ell은 language instruction이고 ee는 robot embodiment와 sensor context이다. 단일 task policy와 달리 다양한 object, scene, instruction, task, robot에서 reasonable action을 생성하는 것이 목표이다.

Action이 optimal하지 않더라도 다음 조건을 만족해야 한다.

  • Language instruction과 semantic하게 일치한다.
  • Kinematic limit과 collision constraint를 지킨다.
  • Motion이 smooth하고 physical world에서 실행 가능하다.
  • Unexpected observation에 feedback으로 반응한다.

RT-1, RT-2, RT-X, OpenVLA, π0\pi_0, π0.5\pi_{0.5}, Gemini Robotics 등이 이 방향의 예이다. Model 이름보다 어떤 data와 action representation, embodiment를 사용하는지 보는 것이 중요하다.

Vision-language prior를 action으로 확장하기

VLA는 large-scale vision-language pretraining에서 얻은 semantic knowledge를 robot action prediction에 연결한다.

vision-language pretrainingmulti-robot action trainingtask post-training\text{vision-language pretraining} \longrightarrow \text{multi-robot action training} \longrightarrow \text{task post-training}

Pretrained vision-language model은 object와 instruction을 이해하는 semantic prior를 제공한다. Robot demonstration은 어떤 visual state에서 어떤 motor command를 실행해야 하는지 grounding한다.

Action objective만 강하게 학습하면 pretrained semantic ability를 잊을 수 있다. 따라서 robot action prediction과 vision-language objective를 함께 사용하는 co-training 또는 co-fine-tuning으로 semantic knowledge를 유지할 수 있다.

L=λactLact+λvlLvl\mathcal{L} = \lambda_{\text{act}} \mathcal{L}_{\text{act}} + \lambda_{\text{vl}} \mathcal{L}_{\text{vl}}
%% title: Vision-Language-Action Model의 입력부터 행동까지
%% caption: Vision-language pretraining의 semantic prior에 multi-robot demonstration으로 action grounding을 더하고, 추론 시에는 visual observation·instruction·robot state를 함께 받아 executable action을 출력한다.
flowchart LR
    image["Camera / Visual Tokens"] --> backbone["Vision-Language Backbone"]
    language["Language Instruction"] --> backbone
    robotstate["Robot State + Embodiment Token"] --> actionhead["Action Decoder / Head"]
    backbone --> actionhead
    actionhead --> action["Action Token / Chunk<br/>pose · gripper · joints"]
    action --> robot["Robot Execution"]
    robot --> feedback["New Multimodal Observation"]
    feedback --> image
    vlpre["Vision-Language Pretraining"] -.-> backbone
    demos["Cross-Robot Demonstrations"] -.-> actionhead
    taskdata["Task-Specific Post-Training"] -.-> actionhead

Base model과 post-training

Broad pretraining을 마친 base policy는 data에 자주 등장한 simple task를 바로 수행할 수 있다. 하지만 difficult in-distribution task나 unseen task에서 높은 reliability가 필요하면 task-specific data로 post-training한다.

  • Base evaluation: pretraining에서 본 것과 비슷한 task를 그대로 실행한다.
  • In-distribution post-training: 같은 task family의 더 어려운 variation을 fine-tuning한다.
  • New-task adaptation: 새로운 task demonstration을 추가해 post-training한다.

Foundation model이라는 이름이 zero-shot으로 모든 robot task를 해결한다는 뜻은 아니다. 현재 model도 semantic transfer는 얻지만 precise contact-rich action에는 task와 embodiment에 맞는 data가 필요한 경우가 많다.

Cross-embodiment data

Robot dataset을 크게 만들려면 서로 다른 arm, gripper, camera, control frequency에서 수집한 demonstration을 합쳐야 한다. 하지만 action space와 kinematics가 서로 다르다.

같은 end-effector motion도 robot마다 다른 joint command가 필요하다. Cross-embodiment learning에는 다음 중 하나가 필요하다.

  • End-effector pose처럼 공통 action space로 변환한다.
  • Embodiment token이나 robot state를 condition으로 제공한다.
  • Robot-specific action head를 사용한다.
  • Shared representation과 embodiment-specific controller를 계층적으로 분리한다.

Data 규모만 합치는 것으로는 충분하지 않으며 coordinate convention과 control semantics를 맞춰야 한다.

Teleoperation data의 bias

Human teleoperation은 real robot demonstration을 수집하는 대표적인 방법이다. 하지만 사람이 자신의 손으로 하는 동작보다 robot을 원격 조종하는 동작이 느리고 불연속적일 수 있다.

Camera occlusion, communication delay, unfamiliar interface 때문에 operator가 자주 멈추고 확인한다. Behavior cloning policy는 이 속도와 hesitation도 함께 복제할 수 있다. Data collection interface와 operator skill이 downstream policy의 upper bound를 결정하는 이유이다.

더 빠른 teleoperation device, autonomous correction, model-assisted annotation, offline trajectory refinement가 data quality를 개선할 수 있다.

Long-horizon task에는 hierarchy가 필요하다

Box folding 하나는 긴 horizon이지만 home assistant는 cleaning, laundry, navigation, tool use를 연결해야 한다. 하나의 flat policy가 모든 step을 직접 생성하면 context와 error recovery가 복잡해진다.

Hierarchical policy는 high-level task와 low-level skill을 나눈다.

zkπhigh(zkot,)z_k \sim \pi_{\text{high}} (z_k\mid o_t,\ell) atπlow(atot,zk)a_t \sim \pi_{\text{low}} (a_t\mid o_t,z_k)

zkz_k는 subgoal, skill, object relation, scene graph node처럼 더 느린 timescale의 variable이다. High-level planner가 pick up shirt, fold sleeve, place in drawer를 정하고 low-level policy가 contact-rich motion을 수행할 수 있다.

Language model의 semantic planning, scene graph의 structured state, learned skill policy를 결합하는 방식은 긴 task의 recovery와 interpretability를 높일 수 있다.

Generalization을 무엇으로 측정할 것인가

Robotic foundation model의 generalization은 하나의 숫자로 정의하기 어렵다. 최소한 다음 axis를 구분해야 한다.

  • Novel object와 appearance
  • Novel scene와 background
  • Unseen language phrasing
  • New initial configuration
  • New task composition
  • Different robot embodiment
  • Longer horizon와 external disturbance

Training task를 조금 변형한 성공과 완전히 새로운 task의 zero-shot 성공은 같은 generalization이 아니다. Evaluation protocol에서 train data와 test condition의 관계를 공개해야 한다.

One-step loss와 long-horizon success의 차이

Policy training loss는 보통 한 observation에서 expert action을 얼마나 잘 맞혔는지 측정한다. Real task metric은 전체 trajectory가 성공했는지 측정한다.

각 step을 올바르게 실행할 probability가 독립적으로 pp라고 단순화하면 TT step 전체가 성공할 probability는 다음과 같다.

P(success)=pTP(\text{success}) = p^T

p=0.99p=0.99여도 T=100T=100이면 다음과 같다.

0.991000.3660.99^{100} \approx 0.366

작은 one-step error가 긴 horizon에서 큰 failure rate가 되는 이유이다. 따라서 validation loss보다 rollout success, recovery rate, completion time, intervention count를 함께 봐야 한다.

Real-world evaluation의 어려움

Real robot evaluation은 비용이 크고 noise가 많다.

  • Initial object pose와 fold 상태가 trial마다 다르다.
  • Lighting, friction, battery, calibration이 바뀐다.
  • Human reset과 success judgment가 개입한다.
  • 충분한 trial을 수행하는 데 시간이 오래 걸린다.
  • 다른 lab이 같은 setup을 재현하기 어렵다.

성공 횟수 kk와 trial 수 nn만 제시하는 것보다 confidence interval, failure category, human intervention, seed와 setup을 함께 기록해야 한다.

Training loss와 real success의 correlation이 약하기 때문에 checkpoint selection도 어렵다. Offline metric이 좋더라도 real rollout에서 더 나쁠 수 있다.

Simulation benchmark의 역할과 한계

Simulation은 대량의 repeatable evaluation을 제공하지만 sim-to-real correlation이 검증되어야 한다. Rigid object, deformable object, cloth, contact를 정확히 simulation하는 난도가 다르고 realistic asset과 scene variation을 만드는 비용도 크다.

좋은 embodied benchmark는 다음 조건이 필요하다.

  • 같은 policy를 반복 평가할 수 있다.
  • Diverse task, asset, initial state를 제공한다.
  • Real-world success와 유의미한 correlation이 있다.
  • Sensor와 action interface가 명확하다.
  • Hidden test condition으로 overfitting을 막는다.

Computer vision에서 ImageNet score의 개선이 한동안 실제 representation 개선과 연결되었던 것처럼, robot learning에도 broadly useful progress를 반영하는 benchmark가 필요하다.

Foundation world model

Large-scale robot interaction data에는 policy supervision뿐 아니라 physical dynamics도 들어 있다.

(ot,at,ot+1)(o_t,a_t,o_{t+1})

이 data를 action prediction에만 쓰지 않고 action-conditioned world model을 학습할 수 있다.

pϕ(ot+1:t+Hot,at:t+H1)p_\phi (o_{t+1:t+H} \mid o_{\le t}, a_{t:t+H-1})

Foundation world model은 여러 object, task, embodiment의 transition을 예측하고 policy planning, synthetic data generation, safety verification에 사용할 수 있다.

남은 설계 질문은 다음과 같다.

  • Pixel, 3D geometry, object-centric graph 중 어떤 state를 예측할 것인가?
  • Learned dynamics와 analytic physics를 어떻게 결합할 것인가?
  • Long rollout의 uncertainty와 compounding error를 어떻게 표현할 것인가?
  • Policy와 world model을 joint training할 것인가, 분리할 것인가?

전체 흐름 정리

Robot learning의 방법은 서로 대체 관계라기보다 data와 constraint에 따라 결합된다.

  1. Reinforcement learning은 reward를 기준으로 trial-and-error exploration을 수행한다.
  2. Domain randomization은 simulation의 다양한 dynamics에서 robust policy를 학습해 real world로 옮긴다.
  3. Model-based planning은 learned dynamics로 candidate action의 future를 예측하고 feedback마다 다시 계획한다.
  4. Imitation learning은 expert demonstration에서 policy를 직접 학습해 real task를 빠르게 구현한다.
  5. Diffusion Policy는 multimodal action sequence를 generative model로 표현한다.
  6. VLA foundation model은 vision-language semantic prior와 multi-task robot data를 결합한다.
  7. Foundation world model은 같은 interaction data에서 reusable physical prediction model을 학습한다.

핵심은 좋은 vision encoder 하나만으로 robot이 완성되지 않는다는 점이다. Physical feedback, action-conditioned data, recovery behavior, embodiment, long-horizon evaluation이 함께 설계되어야 perception이 reliable action으로 이어진다.

과제에서 확인할 것

MDP 구성 요소 구분

Cart-pole, Atari, cloth folding에서 state, observation, action, transition, reward, goal을 각각 적어 본다. Camera image가 true state가 아니라 partial observation일 수 있다는 점도 구분한다.

Return과 Q-value

Discount factor γ\gamma가 작을 때와 클 때 agent가 immediate reward와 long-term reward를 어떻게 다르게 평가하는지 확인한다. Discrete action DQN에서 output dimension이 action 수와 같은 이유도 본다.

RL과 supervised learning 비교

Stochastic transition, delayed reward, non-differentiable environment, policy-dependent data distribution이 각각 어떤 학습 문제를 만드는지 example과 연결한다.

Domain randomization

Mass, friction, sensor noise를 sampling하는 simulation을 생각하고 real parameter가 training support 밖에 있을 때 왜 transfer가 실패하는지 확인한다.

MPC rollout

Horizon HH의 action sequence를 forward model에 넣어 target cost를 계산하고 첫 action만 실행하는 흐름을 따라간다. Open-loop rollout과 receding-horizon control의 차이를 확인한다.

State representation 선택

Pixel, keypoint, particle representation에서 dynamics model의 input과 output shape를 적어 본다. Deformable object에서 particle representation이 유용한 이유와 point correspondence 문제를 함께 본다.

Behavior cloning의 distribution shift

Expert trajectory에서 작은 action noise를 추가해 off-trajectory state를 만들고, initial demonstration만 학습한 policy가 recovery action을 알지 못하는 이유를 확인한다.

Diffusion action policy

Single action 대신 action chunk를 denoise할 때 tensor shape와 conditioning observation을 추적한다. Multimodal demonstration에서 MSE policy가 평균 action을 내는 문제와 diffusion policy의 차이를 비교한다.

VLA의 generalization axis

Novel object, scene, task, instruction, embodiment 중 무엇이 train distribution 밖인지 명시한다. Base model 성능과 task-specific post-training 성능을 같은 zero-shot 결과로 해석하지 않도록 구분한다.

Long-horizon evaluation

One-step accuracy가 높아도 전체 task success가 낮을 수 있음을 pTp^T로 확인한다. Success rate와 함께 recovery rate, intervention count, completion time을 기록해야 하는 이유를 정리한다.