When the problem arrives again

Two forcing terms, one floor

Inexact Newton's adaptive forcing rule comes in two versions, and every measurement of the floor under it used the second, which reads the ratio of the last two residuals. The first reads how wrong the linear model was at the last step, and it was natural to hope that a rule watching the model's own error would not solve its last step past what the stopping test needs. It does. Run without the floor on five problems at four forward targets, it over-solves its last step by a median of 34 times, against the second rule's 95; the floor saves 17.5 per cent of its inner work, against 16.0. Floored, the first rule is the cheaper by 4.6 per cent overall, and it buys that with Newton steps: two more on the median cell, a third less inner work on the strongly nonlinear problem, and 4.5 per cent more on the easy one.

Worth reading first: The accuracy that is thrown away · A parameter that counts steps.

A target the residual can promise stopped inexact Newton for a forward error rather than a residual. A caller who wants six digits divides 10−610^{-6} by a condition number, and conjugate gradients estimates that condition number for free from the Ritz values its own iterations produce. Stopped by the effective rule — tolerance δ λ^min⁡∥x∥/∥b∥\delta\,\hat\lambda_{\min}\lVert x\rVert/\lVert b\rVert, the bound ∥x−x∗∥≤∥J−1∥∥F∥\lVert x - x^*\rVert \le \lVert J^{-1}\rVert\lVert F\rVert read with the smallest Ritz value — and with the usual floor under the forcing term, the run landed within a fifth of its target on every cell a residual can certify.

Every run there, and every run in the four essays before it, used the second of Eisenstat and Walker’s two adaptive forcing terms: the ratio of the last two residual norms, squared and scaled. A tolerance that reads its own residual introduced it and one line that buys a quarter of the run found that it over-solves its last step unless a floor stops it. The essay named the other one. “Eisenstat and Walker’s other choice of η reads the difference between the new residual and the linear model’s prediction of it. The question from the earlier essay stands, now with a target to set its floor from: whether that rule over-solves its last step the way the ratio rule does, and so whether the floor set from δ saves as much there.”

How far past the stopping test the last inner solve went: the effective tolerance over the residual reached, for Eisenstat and Walker's two forcing choices, without and with the floor, every certifiable cellfirst choice, model error: unfloored median 34.1, from 1.6 to 1.9·10⁴; floored from 1.6 to 2.8. second choice, residual ratio: unfloored median 95.2, from 1 to 9517; floored from 1.3 to 2.9. Nineteen cells: five problems at four targets, less the one a residual cannot certify.tolerance ÷ residual reachedfirst choice, model error, unfloored median34second choice, residual ratio, unfloored median95110¹10²10³10⁴tolerance ÷ residual reachedstandingeasyhardmildstrongfirst choicesecond choicegrey: with the floordashed: stopped exactly at the testboth rules over-solve the last step
Fig. 1 How far past the stopping test the last inner solve went, for both forcing choices, without the floor in colour and with it in grey, every certifiable cell.

The figure above answers the first half. Run without the floor, both rules solve the last step far past what the stopping test asks — every coloured dot above the dashed line, most of them by one to four decades. The grey dots are the same runs with the floor, all between 1.3 and 2.9.

The two forcing terms

Inexact Newton solves each linear system J(xk)s=−F(xk)J(x_k)s = -F(x_k) only until the relative residual of the inner solve is below a forcing term ηk\eta_k. Too small an ηk\eta_k and the inner solver does work the outer iteration will throw away, because the linearisation itself is wrong at second order; too large and the outer iteration crawls. The accuracy that is thrown away measured the first half of that: below the square of the current error, inner accuracy buys nothing.

The second choice, the one measured so far, is

ηk=0.9(∥F(xk)∥∥F(xk−1)∥)2,\eta_k = 0.9\left(\frac{\lVert F(x_k)\rVert}{\lVert F(x_{k-1})\rVert}\right)^{2},

which asks for more accuracy as the residual falls faster, on the reasoning that fast decrease means the iteration is in the region where Newton’s quadratic rate holds. The first choice is

ηk=∣ ∥F(xk)∥−∥F(xk−1)+J(xk−1)sk−1∥ ∣∥F(xk−1)∥,\eta_k = \frac{\bigl|\,\lVert F(x_k)\rVert - \lVert F(x_{k-1}) + J(x_{k-1})s_{k-1}\rVert\,\bigr|}{\lVert F(x_{k-1})\rVert},

the difference between the residual actually reached and the residual the linear model predicted, relative to where the step started. It is a direct measurement of how wrong the linearisation was over the last step, and it asks the next inner solve to be no more accurate than that. Both carry Eisenstat and Walker’s safeguards — a lower bound from the previous η\eta when that is above 0.1, with exponent 2 for the second choice and the golden ratio for the first — and both are capped at 0.9.

The first choice is the one that sounds as though it should know when to stop. It measures exactly the quantity that makes extra inner accuracy pointless.

Both over-solve the last step

The problems are the forcing essays’ F(x)=Ax+λx3−bF(x) = Ax + \lambda x^3 - b on 200 unknowns, at the standing κ(A)=105\kappa(A) = 10^5, λ=3\lambda = 3 and at four variants moving one knob, with forward targets from 10−410^{-4} to 10−1010^{-10} — nineteen cells a residual can certify, as before. Each is run four ways: each choice, with the floor at half the effective tolerance and without it.

Without the floor the first choice’s last inner solve reaches a residual a median of 34 times below the stopping tolerance, and up to 19,000 times; the second choice’s median is 95 and its largest 9,500. The first choice over-solves by less in the middle of the distribution and by more at the extreme, and on four cells of nineteen it stops within three times the test, against three for the second. That is not a rule that knows when to stop. It is a rule that over-solves on a slightly different schedule.

The extremes are larger for the first choice for a reason in its formula. Near the root the linear model’s error over a step is second order in the step, so the numerator of the first choice shrinks like the square of the residual and ηk\eta_k like the residual itself: the closer the iteration gets, the harder it asks the next step to be solved, which is what gives the method its fast local rate. On the strongly nonlinear problem at 10−610^{-6} that drove the last unfloored step to 19,000 times the accuracy the stopping test needed. The second choice’s ηk\eta_k falls like the square of the residual ratio, which flattens once the ratio settles, and its extremes are correspondingly milder.

The reason is the same for both, and it is the reason the floor exists. Neither forcing term knows where the outer iteration will stop. Each sets a tolerance from the iteration’s recent history — the residual ratio, or the model’s error — and near the end that history says the iteration is converging fast and the model is good, so each asks for an accurate step. Neither can see that the step it is solving is the last one, and that the stopping test will accept a residual several decades larger than the one it is about to pay for. The floor is the one line that tells the inner solve what the outer test needs, and nothing about how the forcing term is computed can replace it.

Forward error over the target for the two forcing choices, floored and unfloored, stopped by the effective rule, every certifiable cellfirst, floored: 0.026 to 0.15; second, floored: 0.045 to 0.18; first, no floor: 7.1·10⁻⁶ to 0.15; second, no floor: 4.1·10⁻⁵ to 0.38. The dashed line is the target.error ÷ targetfirst, floored, worst0.15second, floored, worst0.1810⁻⁶10⁻⁵10⁻⁴10⁻³10⁻²10⁻¹110¹forward error ÷ targetfirst, flooredsecond, flooredfirst, no floorsecond, no floordashed: the targetthe floor gives back what nobody asked for
Fig. 2 Forward error over the target for both choices, floored and unfloored, every certifiable cell.

The over-solve shows in the forward error as accuracy nobody asked for. Floored, both choices land within a fifth of the target on every cell — the first between 2.6⋅10−22.6\cdot 10^{-2} and 0.15 of it, the second between 4.5⋅10−24.5\cdot 10^{-2} and 0.18. Unfloored, each sometimes lands within a fifth and sometimes five decades below the target, as one line that buys a quarter of the run found for the second choice with a residual stopping test. The forward target makes the waste legible: the caller said δ\delta, and the unfloored run delivered 10−5δ10^{-5}\delta and charged for it.

The floor saves about as much

The share of the inner work the floor saves, under Eisenstat and Walker's first forcing choice against under the second, every certifiable cellMedians 0.131 for the first choice and 0.149 for the second. Over all nineteen cells the floor takes the first choice from 42859 inner iterations to 35368 and the second from 44154 to 37087.share of the inner workfirst choice, model error, total saved0.17second choice, residual ratio, total saved0.16-0.100.10.20.30.4-0.100.10.20.30.4saved under the second choicesaved under the first choicedashed: the floor saves the same under boththe floor saves about as much
Fig. 3 The share of inner work the floor saves under the first choice against under the second, every certifiable cell.

Over all nineteen cells the floor takes the first choice from 42,859 inner iterations to 35,368, a saving of 17.5 per cent, and the second from 44,154 to 37,087, 16.0 per cent. Cell by cell the savings scatter widely and do not line up — the median is 13.1 per cent for the first and 14.9 for the second, and on individual cells one choice saves thirty per cent where the other saves nothing — because which cell’s last step happens to over-solve heavily depends on the schedule each rule follows. In total they are within one and a half points.

So the second half of the prediction holds: the floor saves as much under the first choice as under the second. On one cell, the strongly nonlinear problem at 10−610^{-6}, the floor costs the second choice eight per cent instead of saving, because it lets an early step be solved loosely enough to cost an extra Newton step; under the first choice the floor never costs anything. That one cell aside, the floor is the same good bargain under either rule, which is what one would want of a line that is meant to be independent of how the forcing term is chosen.

Where they differ: the middle of the run

The forcing term at each Newton step for Eisenstat and Walker's two choices, floored, on the problem with κ 10⁵, λ 30, at a forward target of ten to the minus eightfirst choice, model error: forcing terms 9e-1, 8e-1, 8e-1, 6e-1, 5e-1, 3e-1, 2e-1, 2e-2, 3e-2, 3e-3, 2e-3; inner iterations 1, 1, 1, 2, 5, 23, 38, 91, 91, 143, 154, 550 in all. second choice, residual ratio: forcing terms 9e-1, 7e-1, 5e-1, 2e-1, 2e-2, 9e-1, 7e-1, 5e-1, 2e-1, 3e-2, 2e-3, 4e-4, 5e-3; inner iterations 1, 1, 2, 9, 109, 6, 8, 15, 26, 86, 174, 202, 147, 786 in all.κ 10⁵, λ 30, target ten to the minus eightfirst choice, model error, inner550second choice, residual ratio, inner7861234567891011121310⁻⁴10⁻³10⁻²10⁻¹1Newton stepforcing termfirst choicesecond choiceboth floored at half the effective toleranceone reads the model, one the residual
Fig. 4 The forcing term at each Newton step for both choices, floored, at a target of 10−810^{-8}. The dial sets the problem.

The two choices end alike and travel differently. On the strongly nonlinear problem, λ=30\lambda = 30, the second choice’s forcing term falls quickly to 2⋅10−22\cdot 10^{-2} by the fifth Newton step — and then jumps back to 0.9, because at the sixth step the residual rose, from 1.3⋅10−21.3\cdot 10^{-2} to 1.5⋅10−21.5\cdot 10^{-2} of its start, and a ratio above one gives the largest forcing term allowed. It spends five more steps descending again. The first choice never resets: the model’s error falls steadily, and the first choice reaches the end in eleven steps and 550 inner iterations against the second’s thirteen and 786.

Turn the dial to the easy problem, κ(A)=103\kappa(A) = 10^3, and the picture reverses in miniature. The second choice falls fast and straight, the residual never rises, and the first choice’s more cautious schedule — it reads a model error that is small but not tiny, and so asks for moderate accuracy for longer — costs it a step and a few per cent. On the standing problem the first choice is the cheaper by eleven per cent, and on the two in between the two are within one and a half per cent.

Cheaper overall, by a different route

Inner work of the first forcing choice over the second, both floored and stopped by the effective rule, every certifiable cellPer cell: 0.85, 0.88, 0.91, 0.91, 1.06, 1.04, 1.09, 1.00, 0.90, 1.01, 1.03, 0.97, 1.06, 0.97, 0.99, 0.62, 0.67, 0.70, 0.72. Per problem, summed over its targets: standing 0.891, easy 1.045, hard 0.988, mild 0.995, strong 0.684. The first choice is cheaper on 12 of 19 cells.first ÷ second, per problemstanding0.89easy1hard0.99mild1strong0.680.60.70.80.911.1first choice ÷ second, inner workstandingeasyhardmildstrongdashed: the same workcheaper where the nonlinearity is strong
Fig. 5 The first choice’s floored inner work over the second’s, every certifiable cell, grouped by problem.

Summed over the certifiable cells, the first choice floored spends 35,368 inner iterations and the second 37,087: 4.6 per cent less. Per problem the ratio is 0.684 on the strongly nonlinear problem, 0.891 on the standing one, 0.988 on the hard one, 0.995 on the mildly nonlinear one and 1.045 on the easy one. The first choice is the cheaper on 12 of 19 cells.

Newton steps against inner conjugate-gradient iterations for the two forcing choices, floored and stopped by the effective rule, every certifiable cellfirst choice, model error: Newton steps from 9 to 13, median 11; second choice, residual ratio: Newton steps from 7 to 13, median 9. The first choice takes more Newton steps on 15 of 19 cells.7891011121310²10³10⁴Newton stepsinner iterationsfirst choicesecond choicea thin line joins one cell's two runsmore steps, each cheaper
Fig. 6 Newton steps against inner iterations for both choices, floored, every certifiable cell; a thin line joins one cell’s two runs.

It is cheaper by a different route, and the route has a price the measure used here does not count. The first choice takes more Newton steps on 15 of the 19 cells, a median of eleven against nine, and fewer inner iterations per step. Each Newton step costs an evaluation of FF and of the Jacobian’s action, which in these problems is cheap beside a hundred conjugate-gradient iterations, and so inner iterations are the right currency here. In a problem where evaluating FF is the expensive part — a simulation behind every residual — two extra Newton steps could cost more than the 4.6 per cent saved. The first choice’s advantage is real on the strongly nonlinear problem, where it avoids the second choice’s reset, and slight elsewhere.

The last step, and the steps before it

How much of a run the last step is says how much the floor can possibly save. Without the floor the last inner solve is a median of 33 per cent of the first choice’s whole run and 36 per cent of the second’s: a third of the work spent on one step, most of it on decades the stopping test will not read. With the floor the median shares fall to 24 and 19 per cent. The floor cannot touch the rest, and the rest has its own over-solves.

A forcing term that rises by more than three times from one step to the next is the rule saying, in hindsight, that the previous step was solved more accurately than the iteration could use: the residual ratio or the model’s error has turned out worse than the accuracy it had asked for. Both choices do this on 24 steps of their runs — 24 of 189 steps for the first choice, 24 of 165 for the second. The steps just before such a rise hold 17,770 of the first choice’s 35,368 floored inner iterations and 13,504 of the second’s 37,087: half of the first choice’s work and a bit over a third of the second’s sits in steps that the rule itself later judged too tight.

That is not all waste — a tight step that lands well can be what makes the next one cheap — but it says where a better forcing term would have to find its savings. The floor removes the over-solve that comes from not knowing where the iteration ends. The over-solve that comes from not knowing how the next step will go is the forcing term’s own, and the two rules have it in different measure: the first choice, reading a noisy measurement of the model’s error, puts more of its work into steps it later loosens after; the second, reading the smoother residual ratio, puts less, but pays the reset when the residual rises. Neither is a fix for the other.

What a library default should be

Codes that offer inexact Newton usually offer both choices and pick one as the default, and the measurements here give a reason for either. The first choice is the safer default where the nonlinearity is strong enough to make the residual rise, since its forcing term does not reset; the second is marginally cheaper on mild problems and takes fewer evaluations of FF everywhere. What the measurements do settle is that the floor belongs in every implementation whichever is chosen, and that it should be on by default: it saves a sixth of the inner work under either rule, costs nothing under the first and almost nothing under the second, and changes no answer the caller asked for.

What the floor is, seen twice

The floor was introduced as a correction to one forcing rule, and it turns out to be the same correction to the other. That is the useful finding, more than which rule is cheaper. A forcing term is a model of how accurate the next step needs to be, built from the iteration’s past; the stopping test is a statement about the future, the accuracy at which the iteration will be declared done. The floor is where the two meet, and its form — never ask for less than half the stopping tolerance, relative to the current residual — does not depend on which past the forcing term read. A floor with a cliff at one found its constant must stay below one; a target the residual can promise found the tolerance it reads should come from a forward target. Neither finding depended on the forcing choice, and this one confirms that they do not.

It also says something about a guess worth two per cent, which found that starting each inner solve from a scaled previous step buys only a constant handful of iterations because conjugate gradients pays the logarithm of its tolerance. The floor works on the same logarithm from the other side: it does not make the inner solve converge faster, it stops it asking for decades it does not need, and decades are what conjugate gradients charges for.

What five problems do not show

One family of problems, symmetric positive definite Jacobians, conjugate gradients as the inner solver, and one constant in each safeguard as Eisenstat and Walker published it. The first choice’s safeguard exponent and the second’s scaling constant were not varied; with a nonsymmetric Jacobian and GMRES the over-solve could differ, because GMRES’s residual falls monotonically and its cost per iteration grows. The targets and the effective stopping rule are the earlier essay’s unchanged, so the one uncertifiable cell — the hardest problem at 10−1010^{-10} — is left out here for the same reason it was there: no residual test can certify it, and every rule runs to the outer limit on it whichever forcing term it uses.

Still open: the safeguard’s exponent, and a residual that rises

The safeguard. The second choice’s reset on the strongly nonlinear problem came from its safeguard permitting a jump to 0.9 when the residual rose. Eisenstat and Walker’s safeguard bounds ηk\eta_k below by a power of ηk−1\eta_{k-1}, which prevents the forcing term falling too fast but not rising too fast. The prediction with a sign is that capping the rise — never more than ten times ηk−1\eta_{k-1} — removes the second choice’s two extra steps on that problem and makes it within five per cent of the first choice’s work, while changing nothing on the four problems where the residual never rose.

A rising residual, on purpose. None of the five problems is hard enough to make either choice’s residual rise more than once. A problem with a fold, where Newton’s direction is poor for several steps, would make the second choice reset repeatedly; the prediction is that the first choice’s advantage there grows past the third it reached on the strongly nonlinear problem here, and that a line search, which every production code adds, changes which choice wins.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A flat tag is an object no other essay names yet.

Condition numberConjugate gradientsForcing termForward errorInexact newtonRitz valuesStopping criterion