\end{tikzpicture}
\caption{\label{fig:prob1} MDP for Problem 1}
\end{figure}
\noindent Compute the optimal value function V∗ and the corresponding optimal policy π∗ for each state in Fig.~\ref{fig:prob1} for a discount factor of γ=0.9 in the infinite horizon setting.
\vspace{1em}
Notes:
\begin{itemize}
\item Initial State is always State 1.
\item Each edge of the MDP is labeled in the following format: "{action} : {cost of action to complete transition}". Thus, the problem formulation involves a minimization of cost, rather than a maximization of a reward as may be seen elsewhere.
\item Action a1 at states 3, 4, and 5 must be taken infinitely if those states are ever reached.
\end{itemize}
\newpage
\noindent{\bf (2) A Story of Three Cliffs: Behavior Cloning and DAgger (10 points)}
\vskip 0.1in
\noindent In this question, we are going to be thinking about robots falling off of cliffs and trying to get back on. We will look at three types of cliffs with varying levels of difficulty, and compare how well behavior cloning (BC) performs with respect to DAgger.
\noindent In all of the following parts, we will consider an infinite horizon setting with a discount factor of γ. Each part considers a Cliff MDP, where there exists a path atop the cliff consisting of ``safe'' states as well as a path to fall off the cliff from any point and land at the bottom, which we denote at sx.
For each variant of the MDP, compute the tightest possible upper bounds (in terms of big-O) for the following quantities:
\begin{itemize}
\item J(πBC): Expected total discounted sum of costs for Behavior Cloning
\item J(πDAgger): Expected total discounted sum of costs for DAgger
\end{itemize}
Important notes and assumptions:
\begin{itemize}
\item An agent begins at state s0
\item The expert will always follow an optimal trajectory, thus the expert policy will incur 0 cost
\item At each state the learner (both BC and DAgger) visits that the expert has also visited (i.e. all the safe states), it will make a mistake with probability ϵ and fall off the cliff
\item Once the the BC learner has reached an unknown state, in the worst case with probability 1 it will continue to make mistakes and stay at the bottom of the cliff
\item In contrast, the DAgger learner will query the expert to determine its next action, being able to complete a recovery action with probability 1 (if it exists)
\item Assume that 0<ϵ≪1, and 0<1−γ≪1 to simplify your calculations.
\end{itemize}
\noindent Cliff-Easy: The safe states si can either transition to si+1 with c=0 or sx with c=1, but there exists a recovery action from sx to return to s0 with c=1. Bounds should be in terms of ϵ,γ.
\noindent Cliff-Medium: The safe states si can either transition to si+1 with c=0 or sx with c=1, but there exists a recovery action from sx to return to s0 with c=H. Bounds should be in terms of ϵ,γ,H.
\noindent Cliff-Hard: The safe states si can either transition to si+1 with c=0 or sx with c=1, but there is NO recovery action at sx. Bounds should be in terms of ϵ,γ.
Finally, comment on the following: How does the gap between DAgger and BC change as we vary the H in cliff-medium from 1 to 1−γ1? What is the explanation for this trend?
\newpage
\noindent{\bf (3) [Extra Credit] Pitfalls of DAgger (5 points, CS 5756 Grad Only Question)}
\noindent In this problem, we explore the performance bound of a policy learned by DAgger in an interesting MDP with multiple routes to a final goal state.
\end{tikzpicture}
\caption*{Two ways to the goal}
\end{figure}
\noindent The MDP has two routes from the start s0 to the goal sT:
\begin{enumerate}
\item One route is the optimal route with action cost 0 that the expert takes. There is, however, a caveat. The route passes over a bridge (s1a,s2a,…,) where a mistake can result in falling off the path into a ditch (s1b,s2b,…). Once in the ditch, there is no recovery.
\item One route is a long detour with action cost β.
\end{enumerate}
\noindent Assume the following about our learner
\begin{itemize}
\item On states on the bridge, (s1a,s2a,…,), the learner makes a mistake with probability ϵ.
\item On all other states, it can perfectly imitate the expert.
\end{itemize}
\noindent Compute the upper bound on J(πDAgger), the expected total cost of trajectories for a DAgger policy over T timesteps. Now, compute the cost of the best policy in the learner's class, J(πL⋆).
\begin{itemize}
\item What is surprising about DAgger's performance specifically from this MDP based on this bound? Does DAgger find the best policy in the learner's policy class?
\item In a few sentences, can you describe a real-world example that has a similar characteristic as this MDP?
\end{itemize}
\end{document}
SOlve 2
Sure, let's tackle Problem 2: A Story of Three Cliffs: Behavior Cloning and DAgger step by step. We'll analyze each scenario—Cliff-Easy, Cliff-Medium, and Cliff-Hard—and compute the tightest possible upper bounds for both Behavior Cloning (BC) and DAgger in terms of the given parameters. Finally, we'll discuss how the gap between DAgger and BC changes with varying ( H ) in the Cliff-Medium scenario.
Problem 2: A Story of Three Cliffs
General Setup and Assumptions:
Agent Start: ( s_0 )
Expert Policy: Always follows an optimal trajectory with zero cost.
Learner's Behavior:
Behavior Cloning (BC):
Makes a mistake with probability ( \epsilon ) at each safe state.
Once in an unknown state (after a mistake), continues to make mistakes with probability 1 (trapped at ( s_x )).
DAgger:
Also makes a mistake with probability ( \epsilon ) at each safe state.
Queries the expert to recover with probability 1 if a recovery action exists.
Parameters:
( 0 < \epsilon \ll 1 )
( 0 < 1 - \gamma \ll 1 ) (where ( \gamma ) is the discount factor)
(a) Cliff-Easy
Diagram Interpretation:
Safe States ( {s_0, s_1, \ldots, s_n} ): Transition to the next safe state with cost ( c = 0 ) or fall to ( s_x ) with cost ( c = 1 ).
Recovery Action: From ( s_x ), can return to ( s_0 ) with ( c = 1 ).
Repeats Indefinitely (Infinite Horizon).
Behavior Cloning (BC):
Probability of Making a Mistake at Each Safe State: ( \epsilon ).
Upon Mistake:
Pays cost ( c = 1 ) to fall to ( s_x ).
From ( s_x ), returns to ( s_0 ) with ( c = 1 ).
Since it's infinite horizon, this cycle can repeat.
Expected Cost per Step:
At each step, the probability of incurring a cost due to a mistake is ( \epsilon ).
Since the cost when a mistake occurs is ( 1 + \gamma \times \text{Cost from } s_0 ).
At first glance, the bounds appear similar. However, DAgger ensures recovery actions are taken, preventing the learner from getting stuck indefinitely, which is implicitly accounted for in the bound.
Final Comment on Cliff-Medium: Varying ( H ) from 1 to ( \frac{1}{1 - \gamma} )
Observation:
As ( H ) increases from 1 to ( \frac{1}{1 - \gamma} ), the upper bound for both ( J(\pi_{BC}) ) and ( J(\pi_{DAgger}) ) scales linearly with ( H ):
[
J(\pi) = O\left(\frac{\epsilon H}{1 - \gamma}\right)
]
Gap Between DAgger and BC:
In the Cliff-Medium scenario, the bounds for both BC and DAgger are of the same order ( O\left(\frac{\epsilon H}{1 - \gamma}\right) ). However, the specifics of their performance may differ based on the exact implementation.
Trend Explanation:
As ( H ) Increases:
Recovery Cost Impact: A higher ( H ) means that recovery actions are more costly for DAgger. Since DAgger relies on recovery actions, the cumulative cost increases with ( H ).
Behavior Cloning's Cost: BC also pays a cost upon making mistakes, but without the flexibility of optimal recovery, its cost is more directly tied to ( H ).
Relative Gap:
The relative performance gap between DAgger and BC remains consistent as both scale linearly with ( H ). However, if DAgger can better manage recovery actions, its practical performance might be superior despite similar theoretical bounds.
Conclusion:
The gap between DAgger and BC remains proportional as ( H ) increases. Both strategies incur higher costs with increasing ( H ), but DAgger's ability to perform recovery actions ensures that it maintains a controlled performance relative to BC.