\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
Answer to Problem 2: A Story of Three Cliffs: Behavior Cloning and DAgger
We are to compute tight upper bounds (in terms of big-O notation) on the expected total discounted costs ( J(\pi_{BC}) ) and ( J(\pi_{DAgger}) ) for each of the three variants of the cliff MDPs: Cliff-Easy, Cliff-Medium, and Cliff-Hard. The bounds should be expressed in terms of ( \epsilon ), ( \gamma ), and ( H ) where applicable.
General Approach:
Behavior Cloning (BC): The learner makes a mistake with probability ( \epsilon ) at each safe state. Once it reaches an unknown state (like the cliff bottom ( s_x )), in the worst case, it continues to make mistakes with probability 1 and remains there indefinitely, incurring cumulative costs.
DAgger: The learner also makes mistakes with probability ( \epsilon ) at each safe state. However, upon reaching an unknown state (e.g., ( s_x )), it queries the expert and can recover if a recovery action exists, paying the recovery cost.
Let's compute the expected total discounted cost ( J(\pi) ) for both policies in each cliff variant.
(a) Cliff-Easy
MDP Characteristics:
Safe Path: ( s_0 \rightarrow s_1 \rightarrow s_2 \rightarrow \dots ) with cost 0 per step.
Cliff State (( s_x )):
From any safe state, the agent can fall into ( s_x ) with cost 1 (mistake).
From ( s_x ), there is a recovery action back to ( s_0 ) with cost 1.
There’s also a self-loop at ( s_x ) with cost 1 (if the agent doesn't recover).
Behavior Cloning (( \pi_{BC} ))
Probability of Falling into ( s_x ) at Time ( k ):
[
P_{\text{fall at } k} = \epsilon (1 - \epsilon)^{k}
]
Discounted Cost Upon Falling into ( s_x ):
Once in ( s_x ), the BC agent stays there indefinitely (since it cannot recover).
Total discounted cost from time ( k ) onward:
[
C_{\text{from } k} = \gamma^{k} \left( \frac{1}{1 - \gamma} \right)
]
Comment on the Gap Between DAgger and BC in Cliff-Medium as ( H ) Varies
As ( H ) increases from 1 to ( \frac{1}{1 - \gamma} ):
For Small ( H ): When ( H \ll \frac{1}{1 - \gamma} ), the expected cost for DAgger remains significantly lower than that of BC because the cost to recover is relatively small. The gap between DAgger and BC is large, with DAgger performing much better.
As ( H ) Increases: The expected cost for DAgger increases linearly with ( H ), as ( J(\pi_{DAgger}) = O\left( \dfrac{\epsilon H}{1 - \gamma} \right) ). When ( H ) approaches ( \frac{1}{1 - \gamma} ), DAgger's expected cost becomes:
For Large ( H ): When ( H \geq \frac{1}{1 - \gamma} ), recovering becomes so costly that the advantage of recovery diminishes. The expected cost of DAgger approaches that of BC, and the performance gap narrows.
Explanation:
Recovery Cost Impact: As ( H ) increases, the penalty for making mistakes (and recovering) in DAgger becomes more severe. Initially, DAgger's ability to recover quickly offers a significant advantage over BC.
Diminishing Returns: When ( H ) becomes comparable to the total expected cost of remaining in ( s_x ) indefinitely (which is ( \frac{1}{1 - \gamma} )), the cost of recovery negates the benefit, and DAgger's performance aligns with that of BC.
Conclusion: The gap between DAgger and BC decreases as ( H ) increases. When recovery is inexpensive, DAgger significantly outperforms BC. As recovery becomes more expensive, DAgger's advantage diminishes, and both policies incur similar expected costs.
Note: The analysis assumes small ( \epsilon ) and ( 1 - \gamma ) to simplify approximations and focuses on the leading terms in big-O notation.