Simple Algorithm
Reinforcement Learning · Fixed Point · 28 min

Adversarial Imitation: GAIL & Distribution Matching

Imitation as matching occupancy measures, with a discriminator as the reward.

Behavior cloning matches the expert's actions one state at a time, on the expert's states. Adversarial imitation matches something larger: the whole distribution of states and actions the expert visits, measured on the learner's own behavior. This lesson derives that view from maximum-causal-entropy inverse RL (Ho and Ermon's theorem), shows why a discriminator's output is a reward, compares the divergences behind GAIL, AIRL and their relatives, and follows the attempts to make the idea off-policy and non-adversarial.

What you’ll learn

  • Show that RL on the cost found by ψ\psi-regularized maximum-causal-entropy IRL solves min⁡π−H(π)+ψ∗(ρπ−ρE)\min_\pi -\mathcal H(\pi) + \psi^*(\rho_\pi - \rho_E), and recover exact occupancy matching, feature matching and GAIL as special cases.
  • Derive GAIL's discriminator objective as a Jensen–Shannon divergence, and show that the optimal discriminator's log-output is the gradient of that divergence with respect to the learner's occupancy measure.
  • Explain the divergence view of imitation (cloning as forward KL on the expert's states, GAIL as Jensen–Shannon, AIRL as reverse KL) and AIRL's disentangled reward.
  • Derive ValueDICE's off-policy objective and IQ-Learn's single-Q objective, and explain what offline adversarial imitation can and cannot guarantee.

From inverse RL to occupancy matching

Maximum-causal-entropy inverse RL with a convex cost regularizer ψ\psi looks for a cost under which the expert beats every high-entropy policy, and RL then optimizes that cost:

IRLψ(πE)=arg max⁡c −ψ(c)+(min⁡π −H(π)+Eπ[c])−EπE[c],RL(c)=arg min⁡π −H(π)+Eπ[c].\mathrm{IRL}_\psi(\pi_E) = \argmax_{c}\ -\psi(c) + \Big(\min_\pi\ -\mathcal H(\pi) + \E_\pi[c]\Big) - \E_{\pi_E}[c],\qquad \mathrm{RL}(c) = \argmin_\pi\ -\mathcal H(\pi) + \E_\pi[c].
DerivationProof sketch: one saddle point, two readings
  1. L(ρ,c)=−Hˉ(ρ)−ψ(c)+∑s,ac(s,a)(ρ(s,a)−ρE(s,a))L(\rho, c) = -\bar{\mathcal H}(\rho) - \psi(c) + \sum_{s,a}c(s,a)\big(\rho(s,a) - \rho_E(s,a)\big)

    Write everything over occupancy measures with the two facts above. IRL computes max⁡cmin⁡ρ∈DL(ρ,c)\max_c\min_{\rho\in\mathcal D}L(\rho,c) for

  2. max⁡c ∑s,ac (ρ−ρE)−ψ(c)=ψ∗(ρ−ρE)⟹ρ~=arg min⁡ρ∈D −Hˉ(ρ)+ψ∗(ρ−ρE)\max_c\ \sum_{s,a}c\,(\rho - \rho_E) - \psi(c) = \psi^*(\rho - \rho_E)\quad\Longrightarrow\quad \tilde\rho = \argmin_{\rho\in\mathcal D}\ -\bar{\mathcal H}(\rho) + \psi^*(\rho - \rho_E)

    LL is strictly convex in ρ\rho and concave in cc, and D\mathcal D is convex and compact for finite S\mathcal S and A\mathcal A, so minimax duality lets the min⁡\min and the max⁡\max be exchanged. Taking the max over cc first produces a conjugate:

  3. Now let c~\tilde c be the IRL cost, a maximizer of min⁡ρL(ρ,c)\min_\rho L(\rho,c). Because the two optimal values coincide, (ρ~,c~)(\tilde\rho,\tilde c) is a saddle point, so ρ~\tilde\rho minimizes L(⋅,c~)L(\cdot,\tilde c), which is exactly the RL problem for c~\tilde c. Strict convexity makes that minimizer unique, so RL on the IRL cost returns πρ~\pi_{\tilde\rho}, the solution of the occupancy problem. (This is Ho and Ermon's argument, given optimizers of both problems.)

Regularizer ψ\psiPenalty ψ∗(ρπ−ρE)\psi^*(\rho_\pi - \rho_E)Resulting method
constant00 if ρπ=ρE\rho_\pi = \rho_E, else +∞+\inftyExact occupancy matching (Ho & Ermon, Cor. 3.2.1)
indicator of {∑iwifi:∥w∥2≤1}\{\sum_i w_i f_i : \norm{\mathbf w}_2\le1\}∥Eπ[f]−EπE[f]∥2\norm{\E_\pi[\mathbf f] - \E_{\pi_E}[\mathbf f]}_2Feature-expectation matching (Abbeel & Ng, 2004)
indicator of {∑iwifi:w≥0, ∑iwi=1}\{\sum_i w_i f_i : \mathbf w\ge0,\ \sum_i w_i = 1\}max⁡i(Eπ[fi]−EπE[fi])\max_i\big(\E_\pi[f_i] - \E_{\pi_E}[f_i]\big)MWAL and LPAL (Syed & Schapire; Syed, Bowling & Schapire)
ψGA\psi_{\mathrm{GA}} belowmax⁡D Eπ[log⁡D]+EπE[log⁡(1−D)]\max_D\ \E_\pi[\log D] + \E_{\pi_E}[\log(1-D)]GAIL
Choosing the cost regularizer chooses the distance between occupancy measures. Classic apprenticeship learning restricts costs to a small linear class, so it can match the expert only along a few feature directions.
Check your understanding

With a constant regularizer and the expert's exact occupancy measure, what does RL after IRL return?

  1. The policy of maximum causal entropy
  2. Some policy that is optimal for a cost the expert also minimizes, not necessarily the expert's
  3. The expert's own policy
  4. A policy whose occupancy measure is only approximately the expert's
Show the answer

C. The expert's own policy

A constant ψ\psi has ψ∗=0\psi^* = 0 at ρπ=ρE\rho_\pi = \rho_E and +∞+\infty elsewhere, so the solution must have exactly the expert's occupancy measure, and the one-to-one correspondence between policies and occupancy measures leaves only πE\pi_E. With finitely many demonstrations, though, most expert occupancies are estimated as zero, and exact matching would forbid every unseen state–action pair: that is why practical methods regularize.

GAIL: a discriminator as the reward

Ho and Ermon's regularizer for GAIL lets the cost be any negative function, penalized more when it assigns the expert's pairs costs close to zero: ψGA(c)=EπE[g(c(s,a))]\psi_{\mathrm{GA}}(c) = \E_{\pi_E}\big[g(c(s,a))\big] with g(x)=−x−log⁡(1−ex)g(x) = -x - \log(1-e^x) for x<0x < 0 and ψGA(c)=+∞\psi_{\mathrm{GA}}(c) = +\infty unless c<0c < 0 everywhere. Its conjugate turns out to be a classification loss.

DerivationThe conjugate is the best classifier’s log-likelihood
  1. ψGA∗(ρπ−ρE)=sup⁡c<0 ∑s,a[ρπ(s,a) c(s,a)+ρE(s,a)log⁡(1−ec(s,a))]\psi_{\mathrm{GA}}^*(\rho_\pi - \rho_E) = \sup_{c<0}\ \sum_{s,a}\Big[\rho_\pi(s,a)\,c(s,a) + \rho_E(s,a)\log\big(1 - e^{c(s,a)}\big)\Big]

    Expand the conjugate; the terms −ρEc-\rho_E c and +ρEc+\rho_E c cancel:

  2. =max⁡D∈(0,1)S×A Eπ[log⁡D(s,a)]+EπE[log⁡(1−D(s,a))]=\max_{D\in(0,1)^{\mathcal S\times\mathcal A}}\ \E_\pi\big[\log D(s,a)\big] + \E_{\pi_E}\big[\log\big(1 - D(s,a)\big)\big]

    Substitute D=ec∈(0,1)D = e^{c}\in(0,1). The result is the negative log-loss of the best discriminator D(s,a)D(s,a), trained to output 1 on the learner's pairs and 0 on the expert's:

  3. D∗(s,a)=ρπ(s,a)ρπ(s,a)+ρE(s,a)D^*(s,a) = \frac{\rho_\pi(s,a)}{\rho_\pi(s,a) + \rho_E(s,a)}

    The maximization separates over pairs, and each term ρπlog⁡D+ρElog⁡(1−D)\rho_\pi\log D + \rho_E\log(1-D) is maximized at

  4. (1−γ) ψGA∗(ρπ−ρE)=DKL(dπ ∥ m)+DKL(dE ∥ m)−log⁡4=DJS(dπ,dE)−log⁡4(1-\gamma)\,\psi_{\mathrm{GA}}^*(\rho_\pi - \rho_E) = \KL\big(d^\pi\,\|\,m\big) + \KL\big(d^E\,\|\,m\big) - \log 4 = D_{\mathrm{JS}}\big(d^\pi, d^E\big) - \log 4

    Plug D∗D^* back in and normalize, dπ=(1−γ)ρπd^\pi = (1-\gamma)\rho_\pi and dE=(1−γ)ρEd^E = (1-\gamma)\rho_E, with m=(dπ+dE)/2m = (d^\pi + d^E)/2. Up to the factor 1/(1−γ)1/(1-\gamma), the value is Ho and Ermon's Jensen–Shannon divergence DJS(p,q)=DKL(p ∥ m)+DKL(q ∥ m)D_{\mathrm{JS}}(p,q) = \KL(p\,\|\,m) + \KL(q\,\|\,m) (twice the usual one), shifted by a constant:

Predict before you look

Use the normalized measures. When the learner's occupancy measure equals the expert's, what is the optimal value of max⁡D Edπ[log⁡D]+EdE[log⁡(1−D)]\max_D\ \E_{d^\pi}[\log D] + \E_{d^E}[\log(1-D)]?

Show the answer

-1.39

With dπ=dEd^\pi = d^E the best discriminator cannot tell the two apart, D∗=12D^* = \tfrac12 everywhere, and the value is log⁡12+log⁡12=−log⁡4≈−1.386\log\tfrac12 + \log\tfrac12 = -\log4\approx-1.386, the minimum, where DJS=0D_{\mathrm{JS}} = 0. At the other extreme, with disjoint supports, D∗D^* is 1 on the learner's pairs and 0 on the expert's, the value is 0 and DJS=2log⁡2D_{\mathrm{JS}} = 2\log2, its maximum.

DerivationWhy log D* is the right cost
  1. ∂F∂ρπ(s,a)=log⁡ρπρπ+ρE+1−ρπρπ+ρE−ρEρπ+ρE=log⁡D∗(s,a)\frac{\partial F}{\partial\rho_\pi(s,a)} = \log\frac{\rho_\pi}{\rho_\pi + \rho_E} + 1 - \frac{\rho_\pi}{\rho_\pi + \rho_E} - \frac{\rho_E}{\rho_\pi + \rho_E} = \log D^*(s,a)

    Let F(ρπ)=max⁡D∑s,a[ρπlog⁡D+ρElog⁡(1−D)]F(\rho_\pi) = \max_D\sum_{s,a}\big[\rho_\pi\log D + \rho_E\log(1-D)\big]. By Danskin's theorem its derivative is the derivative of the objective at the maximizer, holding D=D∗D = D^* fixed. A direct check:

  2. A small policy change δπ\delta\pi changes the occupancy measure by δρ\delta\rho, and the objective to first order by ∑s,alog⁡D∗(s,a) δρ(s,a)\sum_{s,a}\log D^*(s,a)\,\delta\rho(s,a). That is exactly the change in the expected discounted cost Eπ[∑tγtlog⁡D∗(St,At)]\E_\pi\big[\sum_t\gamma^t\log D^*(S_t,A_t)\big] with the cost held fixed. So a policy-gradient step on the cost log⁡D∗\log D^* is a gradient step on the divergence: the discriminator is the divergence's gradient, and RL follows it.

text
GAIL(expert pairs E, policy πθ, discriminator Dw : S×A → (0, 1), entropy weight λ)
  repeat:
      sample trajectories τ with πθ
      # discriminator: ascend the log-likelihood of telling learner (1) from expert (0)
      w ← w + η ∇w [ mean over τ of log Dw(s,a) + mean over E of log(1 − Dw(s,a)) ]
      # policy: a trust-region step (TRPO in the paper) that lowers the cost
      #   E_τ[ Σt γ^t log Dw(st, at) ] − λ H(πθ)
      θ ← PolicyStep(θ, cost = log Dw)

Ho and Ermon's algorithm. Many implementations flip the convention so that DD means "expert" and use the reward −log⁡(1−D)-\log(1-D) or log⁡D−log⁡(1−D)\log D - \log(1-D). These choices give rewards of different signs, which matters when episodes can end early: a reward that is always positive rewards surviving, one that is always negative rewards ending the episode, a bias that Kostrikov et al. (2019) analyzed in their discriminator-actor-critic method.

Which divergence? AIRL and the f-divergence view

Jensen–Shannon is one choice among many. Every ff-divergence Df(P ∥ Q)=EQ[f(P/Q)]D_f(P\,\|\,Q) = \E_Q\big[f(P/Q)\big], with ff convex and f(1)=0f(1) = 0, has the variational form Df(P ∥ Q)=sup⁡T EP[T]−EQ[f∗(T)]D_f(P\,\|\,Q) = \sup_T\ \E_P[T] - \E_Q[f^*(T)], so it can be estimated by a discriminator-like critic TT and minimized by RL in the same way. Ghasemipour, Zemel and Gu (2019) wrote the common imitation methods in one table.

MethodDivergence minimized
Behavior cloningEs∼dE[DKL(πE(⋅∣s) ∥ π(⋅∣s))]\E_{s\sim d^E}\big[\KL(\pi^E(\cdot\mid s)\,\|\,\pi(\cdot\mid s))\big]: forward KL between action distributions, on the expert's states
DAgger, round nnThe same, averaged over the states of all rounds so far
GAILDJS(dπ,dE)−λH(π)D_{\mathrm{JS}}(d^\pi, d^E) - \lambda\mathcal H(\pi)
AIRLDKL(dπ ∥ dE)\KL(d^\pi\,\|\,d^E): reverse KL between occupancy measures
FAIRLDKL(dE ∥ dπ)\KL(d^E\,\|\,d^\pi): forward KL between occupancy measures
ff-MAXDf(dπ ∥ dE)D_f(d^\pi\,\|\,d^E) for a chosen ff
Two differences separate cloning from the adversarial methods: what is matched (action distributions on the expert's states, or the joint distribution of states and actions the learner itself visits) and the direction of the divergence. In Ghasemipour et al.'s experiments on simulated locomotion, with 4 to 32 demonstrations, matching the state distribution, not the direction of the divergence, explained most of the adversarial methods' advantage over cloning, especially with the fewest demonstrations.
DerivationAIRL’s reward is a log density ratio
  1. D(s,a)=ef(s,a)ef(s,a)+π(a∣s),r(s,a)=log⁡D(s,a)−log⁡(1−D(s,a))=f(s,a)−log⁡π(a∣s)D(s,a) = \frac{e^{f(s,a)}}{e^{f(s,a)} + \pi(a\mid s)},\qquad r(s,a) = \log D(s,a) - \log\big(1 - D(s,a)\big) = f(s,a) - \log\pi(a\mid s)

    AIRL (Fu, Luo & Levine, 2018) gives its discriminator a special form, with DD now the probability that a pair is the expert's, and rewards the policy with the log-odds:

  2. log⁡D∗1−D∗=log⁡dE(s,a)dπ(s,a)⟹E(s,a)∼dπ[r(s,a)]=−DKL(dπ ∥ dE)\log\frac{D^*}{1-D^*} = \log\frac{d^E(s,a)}{d^\pi(s,a)}\qquad\Longrightarrow\qquad\E_{(s,a)\sim d^\pi}\big[r(s,a)\big] = -\KL\big(d^\pi\,\|\,d^E\big)

    The −log⁡π-\log\pi term is an entropy bonus, so the policy step is entropy-regularized RL with reward ff. A rich enough discriminator, trained to tell the expert's pairs from the learner's, reaches the Bayes-optimal classifier, whose log-odds are the log density ratio:

  3. As with GAIL, holding the reward fixed and taking a policy-gradient step follows the gradient of the divergence: ∇DKL(dπ ∥ dE)=∑s,a∇dπ(s,a)(log⁡dπ(s,a)dE(s,a)+1)\nabla\KL(d^\pi\,\|\,d^E) = \sum_{s,a}\nabla d^\pi(s,a)\big(\log\frac{d^\pi(s,a)}{d^E(s,a)} + 1\big), and the +1+1 drops out because ∑s,a∇dπ(s,a)=0\sum_{s,a}\nabla d^\pi(s,a) = 0.

The direction matters. Reverse KL, DKL(dπ ∥ dE)\KL(d^\pi\,\|\,d^E), is infinite if the learner puts mass where the expert has none, so it is mode-seeking: a learner that cannot represent all of the expert's behaviors reproduces some of them faithfully. Forward KL, used by cloning and FAIRL, is infinite if the learner misses any of the expert's mass, so it is mode-covering: the same learner spreads itself over all the behaviors, including the gaps between them. Jensen–Shannon sits in between, and stays finite in both cases.

Proof idea. At the optimum f∗f^* equals the expert's soft advantage, which for deterministic dynamics is r(s)+γV∗(s′)−V∗(s)r(s) + \gamma V^*(s') - V^*(s). Equating g∗(s)+γh∗(s′)−h∗(s)g^*(s) + \gamma h^*(s') - h^*(s) with it for every transition, decomposability separates the terms in ss from those in s′s' and gives both identities. Which rewards demonstrations can identify in general is the subject of Which Rewards Explain Behavior?

Off-policy and non-adversarial imitation

GAIL's two loops both consume interaction: the discriminator compares against fresh on-policy samples, and the policy step is on-policy RL. Training the discriminator on a replay buffer instead changes the divergence being minimized, to one between the expert and the buffer. Two ideas remove the on-policy expectation altogether.

DerivationValueDICE (Kostrikov, Nachum & Tompson, 2020)
  1. −DKL(dπ ∥ dE)=min⁡x log⁡E(s,a)∼dE[ex(s,a)]−E(s,a)∼dπ[x(s,a)]-\KL\big(d^\pi\,\|\,d^E\big) = \min_x\ \log\E_{(s,a)\sim d^E}\big[e^{x(s,a)}\big] - \E_{(s,a)\sim d^\pi}\big[x(s,a)\big]

    Start from the Donsker–Varadhan form of the reverse KL, whose minimizer is the log density ratio x∗=log⁡(dπ/dE)x^* = \log(d^\pi/d^E), up to a constant:

  2. E(s,a)∼dπ[ν(s,a)−Bπν(s,a)]=(1−γ) Es0∼μ, a0∼π(⋅∣s0)[ν(s0,a0)]\E_{(s,a)\sim d^\pi}\big[\nu(s,a) - \mathcal B^\pi\nu(s,a)\big] = (1-\gamma)\,\E_{s_0\sim\mu,\ a_0\sim\pi(\cdot\mid s_0)}\big[\nu(s_0,a_0)\big]

    The second term needs samples from the learner. Change variables to x=ν−Bπνx = \nu - \mathcal B^\pi\nu, where Bπν(s,a)=γ Es′∼P(⋅∣s,a), a′∼π(⋅∣s′)[ν(s′,a′)]\mathcal B^\pi\nu(s,a) = \gamma\,\E_{s'\sim P(\cdot\mid s,a),\,a'\sim\pi(\cdot\mid s')}\big[\nu(s',a')\big] is the Bellman operator with zero reward. By the flow constraints of dπd^\pi, the on-policy expectation telescopes to the start:

  3. max⁡π min⁡ν log⁡E(s,a)∼dE[eν(s,a)−Bπν(s,a)]−(1−γ) Es0∼μ, a0∼π(⋅∣s0)[ν(s0,a0)]\max_\pi\ \min_\nu\ \log\E_{(s,a)\sim d^E}\Big[e^{\nu(s,a) - \mathcal B^\pi\nu(s,a)}\Big] - (1-\gamma)\,\E_{s_0\sim\mu,\ a_0\sim\pi(\cdot\mid s_0)}\big[\nu(s_0,a_0)\big]

    What remains needs only expert transitions, start states and the learner's own action choices, and the policy is trained on the same objective, with no separate reward or RL step. (In practice a single sample (s′,a′)(s',a') replaces the expectation inside the exponent.)

In principle ValueDICE needs no interaction at all. The published experiments still mixed a little replay-buffer data into both terms, which keeps the expert as the optimum, and treated every state of a demonstration as a start state. Two later readings temper the picture. Li, Xu, Yu and Luo (2022) argued that in the purely offline setting ValueDICE effectively reduces to behavior cloning, and that properly regularized cloning matches it. Swamy et al. (2021) place it with cloning among the off-policy Q-value moment matchers, whose worst case is O(ϵT2)\order{\epsilon T^2} (Compounding Errors & Interactive Imitation).

The start-state term can be rewritten by the same telescoping identity as an expectation over the transitions of any policy, so IQ-Learn can be trained on expert data alone, and Garg et al. report strong results both offline and online. Offline, though, any of these methods still learns only from the states in the demonstrations, so the lower bounds for imitation without interaction apply to them just as to cloning.

Key takeaways

  • ψ\psi-regularized maximum-causal-entropy IRL followed by RL solves min⁡π−H(π)+ψ∗(ρπ−ρE)\min_\pi -\mathcal H(\pi) + \psi^*(\rho_\pi - \rho_E): inverse RL is implicitly occupancy-measure matching, and ψ\psi picks the distance (constant: exact matching; linear cost classes: feature matching or MWAL; ψGA\psi_{\mathrm{GA}}: GAIL).
  • GAIL's discriminator objective equals a Jensen–Shannon divergence between occupancy measures up to constants, and log⁡D∗\log D^* is that divergence's derivative with respect to the learner's occupancy measure, so RL on the cost log⁡D\log D follows its gradient.
  • Imitation methods differ in what they match and in which direction: cloning uses forward KL between action distributions on the expert's states, GAIL Jensen–Shannon and AIRL reverse KL between occupancy measures. AIRL's shaped discriminator recovers a state-only reward up to a constant under deterministic dynamics.
  • ValueDICE (Donsker–Varadhan plus a Bellman change of variables) and IQ-Learn (an inverse soft Bellman operator and one concave objective in QQ) avoid on-policy samples or adversarial reward learning; trained offline, they still learn only from the expert's states and face the lower bounds of imitation without interaction.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

In RL∘IRLψ(πE)=arg min⁡π−H(π)+ψ∗(ρπ−ρE)\mathrm{RL}\circ\mathrm{IRL}_\psi(\pi_E) = \argmin_\pi -\mathcal H(\pi) + \psi^*(\rho_\pi - \rho_E), what is the role of the cost regularizer ψ\psi?

  1. It smooths the reward so that the RL step converges faster
  2. Its conjugate ψ∗\psi^* is the penalty on the gap between the learner's and the expert's occupancy measures, so choosing ψ\psi chooses the distance that imitation minimizes
  3. It plays no role at the optimum, which is always the expert
  4. It fixes the overall scale of the recovered reward and nothing else
Show the answer

B. Its conjugate ψ∗\psi^* is the penalty on the gap between the learner's and the expert's occupancy measures, so choosing ψ\psi chooses the distance that imitation minimizes

A constant ψ\psi gives exact matching, indicator functions of linear cost classes give feature matching or MWAL, and ψGA\psi_{\mathrm{GA}} gives a Jensen–Shannon divergence. The regularizer is not a nuisance: it decides what "close to the expert" means, which matters as soon as the data are finite.

Question 2

In GAIL, what does the optimal discriminator output when the learner's occupancy measure equals the expert's?

  1. 12\tfrac12 for every state–action pair
  2. 0 for every pair, since every pair is the expert's
  3. 1 for every pair, since every pair is the learner's
  4. It is undefined, because the classification problem is degenerate
Show the answer

A. 12\tfrac12 for every state–action pair

D∗=ρπ/(ρπ+ρE)=12D^* = \rho_\pi/(\rho_\pi + \rho_E) = \tfrac12 wherever the two measures agree. The cost log⁡D∗=−log⁡2\log D^* = -\log2 is then constant, so it gives the policy no direction to move: the expert's occupancy measure is a fixed point of the game.

Question 3

At the optimal discriminator, what does AIRL's reward log⁡D−log⁡(1−D)\log D - \log(1-D) equal, and which divergence does the policy then minimize?

  1. log⁡dπ(s,a)−log⁡dE(s,a)\log d^\pi(s,a) - \log d^E(s,a), and the forward KL DKL(dE ∥ dπ)\KL(d^E\,\|\,d^\pi)
  2. log⁡dE(s,a)−log⁡dπ(s,a)\log d^E(s,a) - \log d^\pi(s,a), and the reverse KL DKL(dπ ∥ dE)\KL(d^\pi\,\|\,d^E)
  3. log⁡πE(a∣s)\log\pi^E(a\mid s), and the Jensen–Shannon divergence
  4. The true reward, and no divergence at all
Show the answer

B. log⁡dE(s,a)−log⁡dπ(s,a)\log d^E(s,a) - \log d^\pi(s,a), and the reverse KL DKL(dπ ∥ dE)\KL(d^\pi\,\|\,d^E)

With DD the probability of the expert, the Bayes-optimal log-odds are log⁡(dE/dπ)\log(d^E/d^\pi), whose expectation under the learner's occupancy measure is −DKL(dπ ∥ dE)-\KL(d^\pi\,\|\,d^E). Reverse KL is mode-seeking: it punishes the learner hardest for visiting pairs the expert never visits.

Question 4

Why can ValueDICE's objective be estimated without samples from the learner's own occupancy measure?

  1. It reweights the expert's samples by importance ratios π/πE\pi/\pi^E
  2. It fits a dynamics model and simulates the learner
  3. It assumes that the learner already matches the expert
  4. The change of variables x=ν−Bπνx = \nu - \mathcal B^\pi\nu makes the on-policy expectation telescope into one over start states, leaving only expert transitions, start states and the learner's action choices
Show the answer

D. The change of variables x=ν−Bπνx = \nu - \mathcal B^\pi\nu makes the on-policy expectation telescope into one over start states, leaving only expert transitions, start states and the learner's action choices

The Donsker–Varadhan form of −DKL(dπ ∥ dE)-\KL(d^\pi\,\|\,d^E) has one expectation under dEd^E, which the demonstrations provide, and one under dπd^\pi. Writing x=ν−Bπνx = \nu - \mathcal B^\pi\nu turns the second into (1−γ) Es0∼μ, a0∼π[ν(s0,a0)](1-\gamma)\,\E_{s_0\sim\mu,\,a_0\sim\pi}[\nu(s_0,a_0)] by the flow constraints of dπd^\pi.

Further reading

  • J. Ho & S. Ermon, "Generative adversarial imitation learning," NeurIPS (2016).
  • J. Fu, K. Luo & S. Levine, "Learning robust rewards with adversarial inverse reinforcement learning," ICLR (2018).
  • S. K. S. Ghasemipour, R. Zemel & S. Gu, "A divergence minimization perspective on imitation learning methods," CoRL (2019).
  • I. Kostrikov, O. Nachum & J. Tompson, "Imitation learning via off-policy distribution matching," ICLR (2020).
  • D. Garg, S. Chakraborty, C. Cundy, J. Song & S. Ermon, "IQ-Learn: Inverse soft-Q learning for imitation," NeurIPS (2021).