Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Preconditioning practice

Original practice questions (PDF)

Original questions by Wenzhi Gao.

For exercises 1–4, let f(x)=12x⊺Ax−b⊺xf(x)=\tfrac12x^\intercal Ax-b^\intercal x with 0≺μI≼A≼LI0\prec\mu I\preceq A\preceq LI and κ=L/μ\kappa=L/\mu. The matrix PP approximates A−1A^{-1}. Write h=∇f(x)h=\nabla f(x) and take the full step x+=x−Phx^+=x-Ph. When h≠0h\ne0, define g=∥∇f(x+)∥22/∥h∥22g=\|\nabla f(x^+)\|_2^2/\|h\|_2^2. Stop if a gradient is zero.

1. A perfect preconditioner and a bad one

  1. Show that ∇f(x+)=(I−AP)h\nabla f(x^+)=(I-AP)h. Why does P=A−1P=A^{-1} solve the problem in one step?
  2. For A=diag⁡(1,4)A=\operatorname{diag}(1,4), b=0b=0, x=(1,1)x=(1,1), and P=IP=I, compute x+x^+ and gg. Does the gradient norm improve?
  3. Why might we learn PP over several inexpensive steps?
Solution to exercise 1

Since ∇f(x)=Ax−b\nabla f(x)=Ax-b, the new gradient is h−APhh-APh. With P=A−1P=A^{-1} it is zero, which certifies the unique minimizer for A≻0A\succ0. In the numerical case, h=(1,4)h=(1,4), x+=(0,−3)x^+=(0,-3), and the new gradient is (0,−12)(0,-12). Thus g=144/17>1g=144/17>1. Learning from cheap updates can capture useful curvature without explicitly forming or inverting a large Hessian.

2. Repairing an unsuccessful direction

Let V(P)=∥I−AP∥F2V(P)=\|I-AP\|_F^2 and R=I−APR=I-AP. For unit vv, suppose r=Rv≠0r=Rv\ne0 and set u=r/∥r∥2u=r/\|r\|_2. Consider P+=P+ηuv⊺P^+=P+\eta u v^\intercal.

  1. Expand V(P+)V(P^+) as a quadratic in η\eta, and find the minimizing η⋆\eta^\star.
  2. You may use V(P+)≤V(P)−∥Rv∥22/κV(P^+)\le V(P)-\|Rv\|_2^2/\kappa at η⋆\eta^\star. For g>0g>0, choose vv so that ∥Rv∥22=g\|Rv\|_2^2=g, and interpret the decrease.
Solution to exercise 2

Expanding the squared Frobenius norm gives V(P+)=V(P)−2ηr⊺Au+η2∥Au∥22,η⋆=r⊺Au∥Au∥22. V(P^+)=V(P)-2\eta\, r^\intercal Au+\eta^2\|Au\|_2^2, \qquad \eta^\star=\frac{r^\intercal Au}{\|Au\|_2^2}. The denominator is positive because A≻0A\succ0 and uu is a unit vector. Choose v=h/∥h∥2v=h/\|h\|_2. Then ∥Rv∥22=∥Rh∥22/∥h∥22=g\|Rv\|_2^2=\|Rh\|_2^2/\|h\|_2^2=g. A step with larger remaining gradient ratio gives a larger guaranteed decrease g/κg/\kappa in the potential.

3. A finite budget for bad steps

Suppose Vk≥0V_k\ge0, Vk+1≤Vk−gk/κV_{k+1}\le V_k-g_k/\kappa, and gk=∥∇f(xk+1)∥22/∥∇f(xk)∥22g_k=\|\nabla f(x_{k+1})\|_2^2/\|\nabla f(x_k)\|_2^2 before termination.

  1. Bound ∑k=1Kgk\sum_{k=1}^K g_k. For fixed ε>0\varepsilon>0, how many indices can satisfy gk≥εg_k\ge\varepsilon? If the method never terminates, what happens to gkg_k?
  2. Use the arithmetic–geometric mean inequality to bound the ratio ∥∇f(xK+1)∥22/∥∇f(x1)∥22\|\nabla f(x_{K+1})\|_2^2/\|\nabla f(x_1)\|_2^2 by (κV1/K)K(\kappa V_1/K)^K. Can an occasional gk>1g_k>1 prevent that bound?
Solution to exercise 3

Summing the potential decreases gives ∑k=1Kgk≤κ(V1−VK+1)≤κV1\sum_{k=1}^K g_k\le\kappa(V_1-V_{K+1})\le\kappa V_1. At most ⌊κV1/ε⌋\lfloor\kappa V_1/\varepsilon\rfloor indices can have gk≥εg_k\ge\varepsilon, so gk→0g_k\to0 in an infinite run. The gradient ratio telescopes to ∏k=1Kgk\prod_{k=1}^K g_k. AM–GM bounds this product by (K−1∑k=1Kgk)K≤(κV1/K)K(K^{-1}\sum_{k=1}^K g_k)^K\le(\kappa V_1/K)^K. Occasional large ratios use part of a finite budget, so the cumulative bound still holds.

4. A least-change secant update

For distinct x,zx,z, let s=x−zs=x-z and y=∇f(x)−∇f(z)y=\nabla f(x)-\nabla f(z).

  1. Show that y=Asy=As and A−1y=sA^{-1}y=s. How can s,ys,y be formed without knowing the minimizer?
  2. Derive P+=arg⁡min⁡Qy=s12∥Q−P∥F2P^+=\arg\min_{Qy=s}\tfrac12\|Q-P\|_F^2 for unrestricted real QQ. Write P+−PP^+-P as an outer product.
Solution to exercise 4

Subtracting the two gradients gives y=Asy=As, hence A−1y=sA^{-1}y=s. Both differences use only the observed points and gradients. For the correction U=Q−PU=Q-P, require Uy=s−PyUy=s-Py. In each row, the least-norm vector with the required inner product with yy is a multiple of y⊺y^\intercal. Therefore P+=P+(s−Py)y⊺y⊺y.P^+=P+\frac{(s-Py)y^\intercal}{y^\intercal y}. Here y≠0y\ne0 because AA is invertible and x≠zx\ne z.

5. Learning one direction at a time

Let y=(1,0)y=(1,0), s=(1/2,0)s=(1/2,0), Pa=diag⁡(1/2,1)P_a=\operatorname{diag}(1/2,1), and Pb=diag⁡(1/2,2)P_b=\operatorname{diag}(1/2,2).

  1. Compute PayP_a y and PbyP_b y. Do both satisfy Py=sPy=s?
  2. Which column of PP does the equation determine?
  3. A second observation gives ỹ=(0,1)\widetilde y=(0,1) and s̃=(0,1/4)\widetilde s=(0,1/4). Find PP satisfying both secant equations.
Solution to exercise 5

Multiplication by y=e1y=e_1 selects the first column. Both matrices give (1/2,0)(1/2,0), and the first equation imposes no condition on the second column. Multiplication by ỹ=e2\widetilde y=e_2 selects the second column, giving (0,1/4)(0,1/4). Thus the two observations together give P=diag⁡(1/2,1/4)P=\operatorname{diag}(1/2,1/4).