FAILURE MAP
← Case archive

FA-98971 / Optimizer update state / Open access

Adam second moment keeps a signed gradient · case 01

Adam second moment keeps a signed gradient.

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

ROOT CAUSE

The squared-gradient accumulator uses g rather than g squared.

THE FAILURE

The squared-gradient accumulator uses g rather than g squared.

Unsuccessful approach: Taking the absolute gradient prevents negative state but still omits squaring.

Case contract

v_next=b2*v+(1-b2)*g*g.

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(g, v, b2):
    return b2*v+(1-b2)*g
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive gradient',solve(4,0,0.5),8)
check('negative gradient',solve(-4,0,0.5),8)
check('prior state',solve(2,6,0.5),5)
check('beta zero',solve(3,7,0),9)
check('beta one',solve(-2,5,1),5)
check('zero gradient decays',solve(0,8,0.25),2)
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
positive gradient2.08Failed
negative gradient-2.08Failed
prior state4.05Failed
beta zero39Failed
beta one55Passed
zero gradient decays2.02Passed

SHA-256 / 3c3dca2a42a3575945d28da3e38304a19b4c5c94b160ac057754b07961760f3e

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(g, v, b2):
    return b2*v+(1-b2)*abs(g)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive gradient',solve(4,0,0.5),8)
check('negative gradient',solve(-4,0,0.5),8)
check('prior state',solve(2,6,0.5),5)
check('beta zero',solve(3,7,0),9)
check('beta one',solve(-2,5,1),5)
check('zero gradient decays',solve(0,8,0.25),2)
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
positive gradient2.08Failed
negative gradient2.08Failed
prior state4.05Failed
beta zero39Failed
beta one55Passed
zero gradient decays2.02Passed

SHA-256 / 9ae5e90531a6c2e01921d98e8c793c05ab18cf09808fef954101e436e1438699

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.000011+00:00.

Case digest / 2b82518cab127119fbca44000b98dcc403d7e01e2178f98147d88b38c551c314