FAILURE MAP
← Case archive

FA-99371 / Embedding vector normalization / Open access

Masked mean pooling counts masked positions · case 01

Masked mean pooling counts masked positions.

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

ROOT CAUSE

The denominator uses every input position even though masked vectors contribute nothing.

THE FAILURE

The denominator uses every input position even though masked vectors contribute nothing.

Unsuccessful approach: Dividing by the feature width confuses dimensions with included tokens.

Case contract

Return the coordinate mean over vectors with truthy mask values; no included vector returns an empty list.

Why this case matters

A small embedding preparation contract can be checked without a model or retrieval system.

1 / The failure

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

N = 1
observations = []
def solve(vectors, mask):
    return [sum(v[j] for v,m in zip(vectors,mask) if m)/len(vectors) for j in range(len(vectors[0]))] if vectors else []
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('one kept', solve([[N,2*N],[3*N,4*N]],[1,0]), [N,2*N])
check('both kept', solve([[0,N],[2*N,3*N]],[1,1]), [N,2*N])
check('none kept', solve([[N]],[0]), [])
check('empty', solve([],[]), [])
check('middle kept', solve([[0,0],[N,2*N],[4*N,6*N]],[0,1,0]), [N,2*N])
check('zero values', solve([[0,N],[N,0]],[1,0]), [0,N])
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
one kept[0.5, 1.0][1, 2]Failed
both kept[1.0, 2.0][1, 2]Passed
none kept[0.0][]Failed
empty[][]Passed
middle kept[0.3333333333333333, 0.6666666666666666][1, 2]Failed
zero values[0.0, 0.5][0, 1]Failed

SHA-256 / d17a73271f3e5cfb2d277f101ecbf698b724e45c1f66bf54fe99a846c215e6a2

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(vectors, mask):
    return [sum(v[j] for v,m in zip(vectors,mask) if m)/len(vectors[0]) for j in range(len(vectors[0]))] if vectors else []
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('one kept', solve([[N,2*N],[3*N,4*N]],[1,0]), [N,2*N])
check('both kept', solve([[0,N],[2*N,3*N]],[1,1]), [N,2*N])
check('none kept', solve([[N]],[0]), [])
check('empty', solve([],[]), [])
check('middle kept', solve([[0,0],[N,2*N],[4*N,6*N]],[0,1,0]), [N,2*N])
check('zero values', solve([[0,N],[N,0]],[1,0]), [0,N])
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
one kept[0.5, 1.0][1, 2]Failed
both kept[1.0, 2.0][1, 2]Passed
none kept[0.0][]Failed
empty[][]Passed
middle kept[0.5, 1.0][1, 2]Failed
zero values[0.0, 0.5][0, 1]Failed

SHA-256 / fd22d7fc91e0222f849574bee12a6d733cd7d53138852c03b812ae51e9065b4c

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

Inputs are finite toy vectors or token rows; this contract makes no claim about model quality or production embedding behavior. 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:23.554941+00:00.

Case digest / 5b53dea5f76c9571b81744fd492da53cf1133e04186ea64051616feaedead276