\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}\DeclareGraphicsRule{.bmp}{bmp}{}{}
\usepackage{epsfig}
\usepackage{cse599s12sp}
\graphicspath{{Figures/}}
%% the format for the lecture environment is
% \begin{lecture}{lecture number}{lecture title}{scribe}{lecture date}
\begin{lecture}{8}{The FTRL Algorithm with Strongly Convex Regularizers}{Tamara Bonaci}{Brandan McMahan}{04/19/2012}
\section{Introduction}
In the last lecture, we talked about regularization models that induce sparsity, and we explained why such models might be preferred:
\begin{itemize}
\item {\it In statistics,} a sparse vector might correspond to a feature selection. For example, when there are more features than training examples, we might choose to set some features to 0 using $L_{1}$-regularization.
\item {\it From systems perspective}, having a large number of features requires storing a large number of coefficients. By setting some features to 0, we may reduce memory requirements.
\end{itemize}
We also talked about the difference between $L_{1}-$ and $L_{2}-$ regularization, and presented a version of an Online Gradient Descent (OGD) algorithm, that includes a prediction error and an $L_{1}-$ regularization term. For the most part today, our {\bf loss function} will be defined as
\begin{equation}
f_{t}(\omega) = \underbrace{\ell_{t}(\omega)}_{\textrm{prediction error}} + \underbrace{\lambda \|\omega\|_{1}}_{\textrm{regularization term}},
\label{eq:intro_loss_fcn}
\end{equation}
where $\ell_{t}(\omega)$ represents a short-hand notation for $\ell_{t}(\omega) := \ell(\omega\cdot x_{t}, y_{t})$, $\lambda \|\omega\|_{1}$ is a regularization term used to induce sparsity and $\lambda \in \mathbb{R}$ is a weighting factor.
In some sense, this loss function allows us to choose predictors such to minimize our regret compared to the best model making a prediction, while ensuring our predicted vector is sparse. (For example, if there exists a perfect predictor $\omega^{*}$ that makes a good prediction every time, but has a large $L_{1}-$ norm, we might not care about our regret compared to that predictor as much.)
\vspace{10pt}
\noindent{\underline {\it Remark 1:}}
The weighting factor, $\lambda$, is highly dependant on the problem we are solving and, for now, we won't care about it. As a general rule, however, we note that a hypothetical sparsity/loss curve parameterized by $\lambda$ has a form depicted in Figure \ref{fig:lambda_fig}.
\begin{figure}[h]
\begin{center}
\includegraphics[width=3in]{fig_lambda.eps}
\caption{A sparsity/loss curve parameterized by the weighting factor $\lambda$.}
\label{fig:lambda_fig}
\end{center}
\end{figure}
\section{Composite Objective-OGD Algorithm}
Let's consider the OGD algorithm again, with the update rule given as
\begin{equation}
\omega_{t+1} = \omega_{t} - \eta\hat{g}_{t},
\label{eq:intro_OGD_update}
\end{equation}
where $\hat{g}_{t}$ denotes a subgradient of the loss function $f_{t}(\omega)$, $\hat{g}_{t} \in \partial f_{t}(\omega_{t})$.
We've analyzed this algorithm last time and observed it can results in oscillatory predictions, as there is nothing to really force the predictor to got exactly to 0. In fact, if there is any noise in the loss function gradient, the predictor will never go to 0.
We can, however, rewrite the ODG update rule (\ref{eq:intro_OGD_update}) as the following optimization problem
\begin{equation}
\omega_{t+1} = \argmin_\omega g_{t}\omega + \frac{1}{2\eta}\|\omega - \omega_{t}\|^{2},
\label{eq:CO_OGD}
\end{equation}
where we approximate the prediction error, $f_{t}(\omega),$ by its subgradient at $\omega_{t}$, but keep the sparsity-regularization part intact, $g_{t}\omega + \lambda \|\omega\|_{1}$, and $g_{t} \in \partial f_{t}(\omega_{t})$. This modified algorithm is known as the {\bf Composite-Objective Online Gradient Descent (CO-OGD)}.
The CO-OGD algorithm (\ref{eq:CO_OGD}) helps prevent prediction oscillations. It turns out, however, that we can achieve even sparser predictor vector using the Follow-the-Regularized-Leader (FTRL) algorithm, with the update rule defined as~\cite{McMahan11}
\begin{equation}
\omega_{t + 1} = \argmin_{\omega} (\underbrace{g_{1:t}\omega}_{\text{subgradient approximation}} + \underbrace{t\lambda\|\omega\|_{1}}_{t \text{ copies of $L_{1}$ penalty}} + \underbrace{r_{1:t}(\omega)}_{\text{stabilization penalty}}).
\label{eq:FTRL}
\end{equation}
In order to compare the CO-OGD with the FTRL algorithm and show that the FTRL algorithm (\ref{eq:FTRL}) enjoys a better sparsity, we next rewrite the CO-OGD algorithm (\ref{eq:CO_OGD}) in the following {\it alternative form}:
\begin{equation}
\omega_{t + 1} = \argmin_{\omega} (g_{1:t}\omega + \phi_{1: t-1}\omega + \lambda \|\omega\|_{1} + r_{1:t}(\omega)),
\label{eq:CO_OGD_alternative}
\end{equation}
with $r_{t}(\omega)$ defined as $r_{t}(\omega) = \frac{\sigma_{t}}{2}\|\omega - \omega_{t}\|^{2}$ and $\phi_{t} \in \mathbb{R}^{n}$ as a subgradient approximation of the $L_{1}-$ penalty, $\phi_{t} \in \partial(\lambda \|\omega\|_{1})$. Thus, $\phi_{1:t-1}\omega + \lambda\|\omega\|_{1}$ approximates the term $t\lambda \|\omega\|_{1}$ from the FTRL algorithm (\ref{eq:FTRL}).
While the fact that CO-OGD update rule (\ref{eq:CO_OGD}) and its alternative form (\ref{eq:CO_OGD_alternative}) are the same is not immediately obvious (and we do not prove it here), using the alternative representation allows us to immediately see that in the CO-OGD there is a single $L_{1}-$ penalty for the current learning round, and all previous rounds are approximated using subgradient (linear) approximation.
On the other hand, in the FTRL algorithm there are $t$ copies of the $L_{1}-$ penalty, for each iteration of the game.
Thus, the FTRL algorithm results in a sparser solution, since it does not assume approximation of the $L_{1}-$ regularization on any of the iterations of the game.
\vspace{10pt}
\noindent{\underline{\it Remark 2:}} Note that it is possible to implement this modified FTRL algorithm by storing only a single vector in $\mathbb{R}^{n},$ or two vectors in $\mathbb{R}^{n},$ if using adaptive per-coordinate learning rate. Thus, both FTRL and CO-OGD have the same storage requirements.
\vspace{5pt}
\noindent\underline{{\it Remark 3:}} {\it [Geometrical interpretation of the stabilization penalty]} After $t$ rounds, the cumulative stabilization penalty is given as
\begin{equation*}
r_{1:t}(\omega) = \sum_{s = 1}^{t} \frac{\sigma_{s}}{2}\|\omega - \omega_{s}\|^{2}.
\label{eq:stabilization_penalty}
\end{equation*}
This stabilization penalty corresponds to a slowly decreasing learning rate, which can geometrically be represented as depicted in Figure \ref{fig:learning_rate}, where $\omega_{i}$ denotes the predictor value in the current round.
\begin{figure}[h]
\begin{center}
\includegraphics[width=1.5in]{learning_rate.eps}
\caption{Geometrical interpretation of the stabilization penalty.}
\label{fig:learning_rate}
\end{center}
\end{figure}
\section{The FTRL Algorithm with Strongly Convex Proximal Regularizers}
We next analyze the FTRL algorithm with a strongly convex proximal regularizer, and derive its regret bounds. As a part of our regret analysis, we also show a simple way of defining general convex feasible sets. We start by defining strongly convex functions.
\subsection{Strongly Convex Functions}
\begin{definition}
A convex function, $f$, is {\bf $\sigma-$ strongly convex} with respect to some norm, $\|\cdot\|,$ over a set $\mathcal{W}$ if for all $ u, w \in \mathcal{W}$, and every $g$ such that $g \in \partial f(w)$ it holds that
\begin{equation}
f(u) \geq f(w) + g \cdot (u - w) + \frac{\sigma}{2}\|u - w\|^{2}.
\label{eq:strong_convexity}
\end{equation}
\end{definition}
\noindent A graphical interpretation of strong convexity is depicted in Figure \ref{fig:strong_convexity}.
\begin{figure}[h]
\begin{center}
\includegraphics[width=3.5in]{strong_convexity.eps}
\caption{A graphical interpretation of strong convexity.}
\label{fig:strong_convexity}
\end{center}
\end{figure}
\vspace{10pt}
\noindent{\underline{\it Remark 4:}} Strongly convex functions can be thought of as functions that, in addition to a linear lower bound, also have a quadratic lower bound.
\vspace{5pt}
\noindent{\underline{\it Remark 5:}} We will almost always work with strongly convex regularization functions, but we will not assume the same about the loss functions.
\vspace{15pt}
\noindent {\bf Example:} Function $f(w) = \frac{1}{2}\|w\|_{2}^{2}$ is 1-strongly convex with respect to Euclidean norm.
\begin{proof}
Function $f(w)$ is differentiable, so its subdifferential consists of only one element, $\nabla f(w) = w$.
Now, for some points $u, w \in \mathbb{R},$ we can write:
\begin{eqnarray*}
&& \frac{1}{2}u^{2} \geq \frac{1}{2}w^{2} + w(u - w) + \frac{1}{2}(u - w)^{2}, \\
&& \frac{1}{2}u^{2} \geq \frac{1}{2}u^{2}.
\end{eqnarray*}
\end{proof}
\begin{lemma}
\label{lemma1}
Let $\mathcal{W}$ be a nonempty convex set, and let $f: \mathcal{W} \rightarrow \mathbb{R}$ be a $\sigma-$strongly convex function over $\mathcal{W}$ with respect to a norm $\|\cdot\|.$ Further, let $w^{*}$ be the minimizer of $f$ over $\mathcal{W}$, $w^{*} = \argmin_{v \in \mathcal{W}}f(v).$
Then for every $u \in \mathcal{W}$ it holds that
\begin{equation}
f(u) - f(w^{*}) \geq \frac{\sigma}{2}\|u - w^{*}\|^{2}.
\label{eq:lemma1}
\end{equation}
\end{lemma}
\begin{proof}
(Proof adapted from~\cite{ShalevShwartz12})
Let's first assume $f$ is differentiable and $w^{*}$ is in the interior of $\mathcal{W}$. Then $\nabla f(w) = 0$ and from the definition of strong convexity it follows that
\begin{equation*}
\forall u \in \mathcal{W}, \quad f(u) - f(w^{*}) \geq \frac{\sigma}{2}\|u - w^{*}\|^{2}, \quad \text{as required.}
\end{equation*}
Let's now consider the case when $w^{*}$ is on the boundary of $\mathcal{W}$. We still have that for all $u \in \mathcal{W}, \nabla f(w^{*})^{T}(u - w^{*}) \geq 0,$ otherwise $w^{*}$ wouldn't have been optimal since we could make a small step in the direction $u - w^{*}$ and decrease the value of $f$. So, the desired inequality still holds.
Finally, let's consider the case when $f$ is not differentiable. Let $g: \mathbb{R}^{d} \rightarrow \mathbb{R} \bigcup \{\infty\}$ be such that $g(w^{*}) = f(w^{*})$ if $w^{*} \in \mathcal{W}$ and $g(w^{*}) = \infty$ otherwise. We can therefore rewrite $w = \argmin_{v} g(v)$. Since $g$ a proper convex function (never receives value $-\infty$), we know that $0 \in \partial g(w^{*}).$ Thus, the inequality (\ref{eq:lemma1}) follows using the strong convexity of $g$.
\end{proof}
\subsection{Regret Analysis of the FTRL Algorithm with Strongly Convex Regularizers}
We next proceed with the regret analysis of the FTRL algorithm with the following update rule
\begin{equation*}
\omega_{t + 1} = \argmin_{\omega \in \mathbb{R}^{n}} f_{1:t}(\omega) + r_{1:t}(\omega).
\label{eq:analyzed_update}
\end{equation*}
We further assume the following about loss and regularization functions:
\begin{itemize}
\item The loss $f_{t}$ is $L_{t}-$ Lipschitz and convex,
\item The regularization function is $\sigma_{t}-$ strongly convex
\item $0 \in \partial r_{t}(\omega_{t})$
\end{itemize}
\begin{lemma}[FTRL lemma]
\label{FTRL_lemma}
The regret of the FTRL algorithm with a strongly convex regularizer, compared to some predictor, $w^{*}$, satisfies
\begin{equation}
\text{Regret}(FTRL) \le \sum_{t=1}^T (f_t(w_t) - f_t(w_{t+1})) + r_{1:T}(w^*).
\label{eq:FTRL_lemma}
\end{equation}
\end{lemma}
\begin{proof}
The proof is analgous to the simpler version of the lemma with a single fixed regularizer $r$.
\end{proof}
\begin{theorem}
\label{thm_FTRL_regret}
Let $f_{1}, \dots, f_{T}$ be a sequence of convex functions such that $f_{t}$ is $L_{t}-$ Lipschitz with respect to some norm $\|\cdot\|.$ Assume that the FTRL algorithm is run on the sequence with a regularization function which is $\sigma-$strongly convex with respect to the same norm. Then, for all $u \in \mathcal{W}$
\begin{equation}
\text{Regret}_{T}(u) \leq \sum_{t = 1}^{T}\frac{L_{t}^{2}}{\sigma_{1:t}} + r_{1:T}(\omega^{*}).
\label{eq:FTRL_regret}
\end{equation}
\end{theorem}
\begin{proof}
Let's first recall the regret bound for the FTRL algorithm that we derived in Lemma~\ref{FTRL_lemma}
\begin{equation}
\sum_{t = 1}^{T}(f_{t}(\omega_{t}) - f_{t}(u)) \leq \sum_{t = 1}^{T}(f_{t}(\omega_{t}) - f_{t}(\omega_{t + 1})) + r_{1:T}(\omega^{*}).
\label{eq:regret_bound}
\end{equation}
If the loss function, $f_{t}$, is $L_{t}-$Lipschitz with respect to a norm $\|\cdot\|,$ then:
\begin{equation}
f_{t}(\omega_{t}) - f_{t}(\omega_{t+1}) \leq L_{t}\|\omega_{t} - \omega_{t + 1}\|.
\label{eq:Lipschitzness}
\end{equation}
Thus, in order to achieve a small regret, we need to ensure that $\|\omega_{t} - \omega_{t + 1}\|$ is small. If the regularization function is strongly convex with respect to the same norm, that is indeed the case, since $\omega_{t}$ is close to $\omega_{t + 1}.$
To show that $\omega_{t}$ is close to $\omega_{t + 1}$, let's fix $t$ and let's define a {\it helper function}, $h_{t},$ as
\begin{equation}
h_{t}(\omega) = \underbrace{f_{1:t-1}(\omega)}_{t-1 \>\> \text{losses}} + \underbrace{r_{1:t-1}(\omega) + r_{t}(\omega)}_{t \>\> \text{regularizations}}.
\label{eq:helper_fct}
\end{equation}
By assumption, $0 \in \partial r_{t}(\omega_{t}).$ This implies that $h_{t}$ is $\sigma_{t}-$ strongly convex, and the update rule for $\omega_{t}$ can be rewritten using the helper function, $h_{t}$
\begin{equation*}
\omega_{t} = \argmin_{w}h_{t}(\omega).
\end{equation*}
Similarly, let's also rewrite the update rule for $\omega_{t + 1}$
\begin{equation*}
\omega_{t + 1} = \argmin_{\omega}h_{t}(\omega) + f_{t}(\omega).
\end{equation*}
Since the sum of a convex and a strongly convex function remains strongly convex~\cite{ShalevShwartz12}, we know $h_{t}(\omega_{t})$ and $h_{t}(\omega_{t + 1})$ are $\sigma_{1:t}-$ strongly convex. We can thus apply Lemma \ref{lemma1} to $h_{t}$ (with minimizer $\omega_{t}$)
\begin{equation}
h_{t}(\omega_{t + 1}) - h_{t}(\omega_{t}) \geq \frac{\sigma_{1:t}}{2}\|\omega_{t} - \omega_{t + 1}\|^{2}.
\label{eq:FTRL_proof_1}
\end{equation}
Repeating the same argument for the helper functions $h_{t + 1},$ we can write
\begin{equation}
h_{t + 1}(\omega_{t}) - h_{t + 1}(\omega_{t + 1}) \geq \frac{\sigma_{1:t}}{2}\|\omega_{t} - \omega_{t + 1}\|^{2}.
\label{eq:FTRL_proof_2}
\end{equation}
Summing inequalities (\ref{eq:FTRL_proof_1}) and (\ref{eq:FTRL_proof_2}), we obtain
\begin{equation}
f_{t}(\omega_{t}) - f_{t}(\omega_{t + 1}) \geq \sigma_{1:t}\|\omega_{t} - \omega_{t+1}\|^{2}.
\label{eq:FTRL_proof_3}
\end{equation}
Now, using the Lipschitzness of the loss function $f_{t}$ (inequality (\ref{eq:Lipschitzness})), we obtain
\begin{equation}
L_{t}\|\omega_{t} - \omega_{t + 1}\| \geq f_{t}(\omega_{t}) - f_{t}(\omega_{t + 1}).
\label{eq:FTRL_proof_4}
\end{equation}
Combining inequalities (\ref{eq:FTRL_proof_3}) and (\ref{eq:FTRL_proof_4}), we can further write
\begin{equation}
\|\omega_{t} - \omega_{t + 1}\| \leq \frac{L_{t}}{\sigma_{1:t}}.
\label{eq:FTRL_proof_5}
\end{equation}
Now, combining inequalities (\ref{eq:FTRL_proof_4}) and (\ref{eq:FTRL_proof_5}), we get
\begin{equation}
f_{t}(\omega_{t}) - f_{t}(\omega_{t + 1}) \leq \frac{L_{t}^{2}}{\sigma_{1:t}}.
\label{eq:FTRL_proof_6}
\end{equation}
Combining inequality (\ref{eq:FTRL_proof_6}) with the regret bound (\ref{eq:regret_bound}), we get
\begin{equation}
\text{Regret}_{T}(u) \leq \sum_{t = 1}^{T}\frac{L_{t}^{2}}{\sigma_{1:t}} + r_{1:T}(\omega^{*}).
\label{eq:FTRL_proof_7}
\end{equation}
Inequality (\ref{eq:FTRL_proof_7}) completes the proof.
\end{proof}
Let's now choose regularization function as $r_{t}(\omega) = \frac{\sigma_{t}}{2}\|\omega - \omega_{t}\|^{2}$. The cumulative sum of regularizers becomes
\begin{equation*}
r_{1:T}(\omega^{*}) = \sum_{t = 1}^{T}\frac{\sigma_{t}}{2}\|\omega - \omega_{t}\|^{2}.
\end{equation*}
Let's further assume that for every $\omega \in \mathcal{W} \Rightarrow \|\omega\|_{2} \leq R$. It follows that the cumulative sum is upper-bounded by
\begin{equation*}
r_{1:T}(\omega^{*}) = \sum_{t = 1}^{T}\frac{\sigma_{t}}{2}\|\omega - \omega_{t}\|^{2} \leq \sum_{t = 1}^{T}\frac{\sigma_{t}}{2}(2R)^{2} = 2\sigma_{1:T}R^{2}.
\end{equation*}
The regret bound (\ref{eq:FTRL_regret}) can now be rewritten as
\begin{equation}
\text{Regret} \leq \sum_{t = 1}^{T}\frac{L_{t}^{2}}{\sigma_{1:t}} + 2\sigma_{1:t}R^{2}.
\label{eq:FTRL_regret_1}
\end{equation}
Taking a learning-rate schedule $\eta_{t}$ for gradient descent, we can choose $\sigma_{t}$ such that
\begin{equation*}
\frac{1}{\sigma_{1:t}} = \eta_{t},
\end{equation*}
where $\eta_{t}$ denotes the {\it learning rate}. The regret bound (\ref{eq:FTRL_regret_1}) now becomes
\begin{equation}
\text{Regret} \leq \sum_{t = 1}^{T}L_{t}^{2} \eta_{t}^{2} + \frac{2R^{2}}{\eta_{T}}.
\label{eq:FTRL_regret_2}
\end{equation}
Note that if $f_{t}(\omega) = g_{t}\omega,$ then $\|g_{t}\| = L_{t}.$ Thus, the lower bounds on the regret of the OGD algorithm with adaptive learning rates and the regret of the FTRL algorithm with strongly convex proximal regulizers differ by at most factor of $\frac{1}{2}.$
\vspace{10pt}
\noindent{\underline{\it Remark 6:}} The scaling parameter $\sigma_{t}$ now becomes a part of the regret function. Larger $\sigma_{t}$ (smaller learning rate) produces a more stable algorithm, but it may take longer to move across the feasible set, resulting in a larger penalty when $\omega^{*}$ is far away.
\newpage
\subsection{Feasible Sets}
We can define proximal regularizers $r_{t}$ as 1-strongly convex functions such that $0 \in \partial r_{t}(0)$ (e.g., $r_{t}(w) = \frac{1}{2}\|w\|^{2}$). Let's rewrite $r_{t}$ as
\begin{equation}
r_{t}(w) = \frac{\sigma_{t}}{2}r(w - w_{t}) + I_{w}(w),
\end{equation}
where $I_{\mathcal{W}}(x)$ denotes an {\it indicator function} that ensures a player always plays a point form the feasible set $\mathcal{W}$
\begin{equation*}
I_{\mathcal{W}}(w) = \begin{cases}
0, & \quad w \in \mathcal{W}, \\
\infty, & \quad \text{otherwise.}
\end{cases}
\end{equation*}
Such an indicator function works for an arbitrary convex sets and does not hurt the regret bound.
Let's now apply this same idea on the FTRL algorithm; given a loss function $f_{t}(\omega) = \ell_{t}(\omega) + \lambda\|\omega\|_{1},$ let's redefine it as
\begin{equation*}
\hat{f}_{t}(\omega) = \ell_{t}(\omega_{t}) + g_{t}(w - w_{t}) + \lambda\|\omega\|_{1},
\end{equation*}
where $g_{t}(\cdot)$ denotes a subgradient approximation of $\ell_{t},$ $g_{t} := \nabla \ell_{t}(\omega_{t})$. We can run the FTRL algorithm using $\hat{f}_{t}(w)$ and get the same regret bound, since:
\begin{itemize}
\item $\hat{f}_{t}(\omega_{t}) = f_{t}(\omega_{t})$
\item $\hat{f}_{t}(\omega^{*}) \leq f_{t}(\omega^{*})$
\end{itemize}
Since constants do not contribute to the optimization, without loss of generality, we can write
\begin{equation}
\hat{f}_{t}(\omega) = g_{t}\omega + \lambda\|\omega\|_{1}.
\end{equation}
So, we get
\begin{equation}
\hat{f}_{1:t}(\omega) = g_{1:t}(\omega) + t\lambda\|\omega\|_{1},
\label{eq:feasible_set}
\end{equation}
and for such a loss function, we get the same update as with the FTRL algorithm.
\begin{thebibliography}{10}
\bibitem{CesaBianchi06}
N. Cesa-Bianchi and G. Lugosi, ``Prediction, Learning, and Games'', \emph{Cambridge University Press}, 2006.
\bibitem{ShalevShwartz12}
S. Shalev-Shwartz, ``Online Learning and Online Convex Optimization'', \emph{Foundations and Trends in Machine Learning}, 2012.
\bibitem{McMahan11}
H. B. McMahan, ``Follow-the-Regularized-Leader and Mirror Descent: Equivalence Theorems and $L_{1}$ Regularization'', \emph{Proceedings of the 14th International Conference on Artificiall Intelligence and Statistics (AISTATS)}, 2011.
\end{thebibliography}
\end{lecture}
\theend