FAILURE MAP
← Case archive

FA-98986 / Optimizer update state / Open access

AMSGrad forgets the historical maximum variance · case 01

AMSGrad forgets the historical maximum variance.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The denominator uses only the current second-moment estimate.

THE FAILURE

The denominator uses only the current second-moment estimate.

Unsuccessful approach: Taking max of raw variance fixes monotonicity but mixes corrected and uncorrected scales.

Case contract

Return [max(old_max,vhat), lr*mhat/(sqrt(maximum)+eps)].

Why this case matters

Optimizer implementations must associate each parameter with its own mathematically specified update state.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(m, v, oldmax, lr, b1, b2, t, eps):
    mh=m/(1-b1**t); vh=v/(1-b2**t)
    return [vh,lr*mh/(vh**0.5+eps)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new maximum',solve(2,2,0,1,0.5,0.5,1,0),[4,2])
check('retain historical',solve(1,1,9,1,0.5,0.5,1,0),[9,2/3])
check('equal maximum',solve(1,2,4,1,0.5,0.5,1,0),[4,1])
check('zero numerator',solve(0,2,0,1,0.5,0.5,1,1),[4,0])
check('later corrected variance',solve(1,3,1,1,0.5,0.5,2,0),[4,2/3])
check('epsilon denominator',solve(1,2,0,2,0.5,0.5,1,1),[4,4/3])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
new maximum[4.0, 2.0][4, 2]Passed
retain historical[2.0, 1.414213562373095][9, 0.6666666666666666]Failed
equal maximum[4.0, 1.0][4, 1]Passed
zero numerator[4.0, 0.0][4, 0]Passed
later corrected variance[4.0, 0.6666666666666666][4, 0.6666666666666666]Passed
epsilon denominator[4.0, 1.3333333333333333][4, 1.3333333333333333]Passed

SHA-256 / 5d0e6d3527d77e3deca5f29bfba61fee132ee96e88aceac8b3291f40fb62b8b5

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(m, v, oldmax, lr, b1, b2, t, eps):
    mh=m/(1-b1**t); vh=v/(1-b2**t); vmax=max(oldmax,v)
    return [vmax,lr*mh/(vmax**0.5+eps)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('new maximum',solve(2,2,0,1,0.5,0.5,1,0),[4,2])
check('retain historical',solve(1,1,9,1,0.5,0.5,1,0),[9,2/3])
check('equal maximum',solve(1,2,4,1,0.5,0.5,1,0),[4,1])
check('zero numerator',solve(0,2,0,1,0.5,0.5,1,1),[4,0])
check('later corrected variance',solve(1,3,1,1,0.5,0.5,2,0),[4,2/3])
check('epsilon denominator',solve(1,2,0,2,0.5,0.5,1,1),[4,4/3])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
new maximum[2, 2.82842712474619][4, 2]Failed
retain historical[9, 0.6666666666666666][9, 0.6666666666666666]Passed
equal maximum[4, 1.0][4, 1]Passed
zero numerator[2, 0.0][4, 0]Failed
later corrected variance[3, 0.769800358919501][4, 0.6666666666666666]Failed
epsilon denominator[2, 1.6568542494923804][4, 1.3333333333333333]Failed

SHA-256 / 23d4f528690fde8c2066979fa026dd170a1bf8ac94a2bec05b7baea42b369e0a

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

These are deterministic scalar or short-vector toy contracts, not claims about production optimizer APIs or training quality. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-30T16:48:19.000054+00:00.

Case digest / b022592da996708feab20a6af90b92b8c960000b129d27658ce56c7c09886bc1