Use the local loss landscape at a converged point — via a quadratic
(Hessian) approximation — to choose which weight to remove and how to
update the rest.
Setup
$F$ — the model
$\vec{w}$ — flattened parameter vector
$X$ — input data representative of the input distribution
Q. Again, what should we be looking at while pruning?
The only “information” we get about good and bad decisions in ML is
through the loss landscape.
$\rightarrow$ Training depends on the loss landscape.
Q. Which model should we start at?
Since the information you can get about the loss landscape is
local, you better start from the
converged model.
Far from the minimum, local geometry is
not useful for pruning decisions.
Near the converged point, it is.
Local quadratic approximation
Let $\mathcal{L}(w, X)$ be the loss and $w^\star$ the weights at a
minimum (converged model). To get analytic information about the
landscape we approximate it locally with a Taylor expansion:
For each $i$, compute saliency
$S_i = \tfrac{1}{2}\, w_i^2 / [H^{-1}]_{ii}$.
Pick $i$ with least saliency.
Update $w \leftarrow w + \delta w$.
If $\min_i S_i$ is large compared to the loss $\rightarrow$
retrain (return to step 1).
Otherwise redo the local approximation and prune again
(loop within step 2).
If $\{S_i\}$ are small, continue pruning under the current local
approximation; if the best saliency is large, retrain.
Complexity
One prune
Dominated by forming / inverting the Hessian:
$O(N^3)$,
where $N$ is the number of parameters.
Exercises
1.
Analyse the update if we remove
multiple weights at a time.
Suppose we zero out the block of coordinates
$i{:}i{+}j$ (that is, set
$w_i,\ldots,w_{i+j}$ to zero in one step).
What should the optimal update $\delta w$ be
under the same quadratic approximation
$E(\delta w)=\tfrac12\delta w^\top H\,\delta w$?
How does the Lagrange / constraint formulation change
compared to pruning a single index?
2.
Analyse the update if, instead of removing weight $i$
(setting it to zero), we set $w_i$ to a
specific value $c$
(i.e. the constraint is
$(w + \delta w)_i = c$, or equivalently
$\delta w_i = c - w_i$).
What is the optimal $\delta w$ in this case?
How does saliency change?