FAILURE MAP
← Case archive

FA-99406 / Embedding vector normalization / Open access

Batch centering subtracts a row average · case 01

Batch centering subtracts a row average.

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

ROOT CAUSE

Each sample has its own average removed instead of each feature sharing a batch mean.

THE FAILURE

Each sample has its own average removed instead of each feature sharing a batch mean.

Unsuccessful approach: Subtracting one global scalar mean centers neither feature independently.

Case contract

For a rectangular matrix subtract each feature mean; preserve shape and return empty for no rows.

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(rows):
    return [[x-sum(row)/len(row) for x in row] for row in rows]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('independent feature offsets', solve([[0,10],[2,14]]), [[-1,-2],[1,2]])
check('three rows', solve([[0,0],[N,0],[0,N]]), [[-N/3,-N/3],[N-N/3,-N/3],[-N/3,N-N/3]])
check('singleton', solve([[N,2*N]]), [[0,0]])
check('empty batch', solve([]), [])
check('one feature', solve([[1],[3],[5]]), [[-2],[0],[2]])
check('constant features', solve([[N,N],[N,N]]), [[0,0],[0,0]])
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
independent feature offsets[[-5.0, 5.0], [-6.0, 6.0]][[-1, -2], [1, 2]]Failed
three rows[[0.0, 0.0], [0.5, -0.5], [-0.5, 0.5]][[-0.3333333333333333, -0.3333333333333333], [0.6666666666666667, -0.3333333333333333], [-0.3333333333333333, 0.6666666666666667]]Failed
singleton[[-0.5, 0.5]][[0, 0]]Failed
empty batch[][]Passed
one feature[[0.0], [0.0], [0.0]][[-2], [0], [2]]Failed
constant features[[0.0, 0.0], [0.0, 0.0]][[0, 0], [0, 0]]Passed

SHA-256 / a1ca0d420fc0600ce391643e34e09e1706ef579e910cc1c5dca2b491e700b054

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(rows):
    mean=sum(x for row in rows for x in row)/(sum(len(row) for row in rows)) if rows and any(rows) else 0
    return [[x-mean for x in row] for row in rows]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('independent feature offsets', solve([[0,10],[2,14]]), [[-1,-2],[1,2]])
check('three rows', solve([[0,0],[N,0],[0,N]]), [[-N/3,-N/3],[N-N/3,-N/3],[-N/3,N-N/3]])
check('singleton', solve([[N,2*N]]), [[0,0]])
check('empty batch', solve([]), [])
check('one feature', solve([[1],[3],[5]]), [[-2],[0],[2]])
check('constant features', solve([[N,N],[N,N]]), [[0,0],[0,0]])
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
independent feature offsets[[-6.5, 3.5], [-4.5, 7.5]][[-1, -2], [1, 2]]Failed
three rows[[-0.3333333333333333, -0.3333333333333333], [0.6666666666666667, -0.3333333333333333], [-0.3333333333333333, 0.6666666666666667]][[-0.3333333333333333, -0.3333333333333333], [0.6666666666666667, -0.3333333333333333], [-0.3333333333333333, 0.6666666666666667]]Passed
singleton[[-0.5, 0.5]][[0, 0]]Failed
empty batch[][]Passed
one feature[[-2.0], [0.0], [2.0]][[-2], [0], [2]]Passed
constant features[[0.0, 0.0], [0.0, 0.0]][[0, 0], [0, 0]]Passed

SHA-256 / 6f02687aadf5a204791b9f92e388f7e24949eab54e5025ea52b0b89b545e69f9

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

Case digest / bbfdb81bf2561d78982d606424853c336b68cbb2d269aa107230db51ace106e3