FA-99416 / Embedding vector normalization / Open access
Weighted centering subtracts an unweighted mean · case 01
Weighted centering subtracts an unweighted mean.
ROOT CAUSE
The center ignores token or sample weights even though the downstream operation is weighted.
THE FAILURE
The center ignores token or sample weights even though the downstream operation is weighted.
Unsuccessful approach: Using only the first row as the center leaves the weighted centroid offset.
Case contract
Return vectors centered by their weighted coordinate mean; zero total weight returns copies unchanged.
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, weights):
m=[sum(v[j] for v in vectors)/len(vectors) for j in range(len(vectors[0]))] if vectors else []
return [[x-m[j] for j,x in enumerate(v)] for v in vectors]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unequal weights', solve([[0,N],[2*N,3*N]],[3,1]), [[-N/2,-N/2],[3*N/2,3*N/2]])
check('equal weights', solve([[0],[2*N]],[1,1]), [[-N],[N]])
check('zero total', solve([[N],[2*N]],[0,0]), [[N],[2*N]])
check('empty', solve([],[]), [])
check('single vector', solve([[N,N]],[N]), [[0,0]])
check('ignored row weight', solve([[N],[0]],[0,1]), [[N],[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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| unequal weights | [[-1.0, -1.0], [1.0, 1.0]] | [[-0.5, -0.5], [1.5, 1.5]] | Failed |
| equal weights | [[-1.0], [1.0]] | [[-1], [1]] | Passed |
| zero total | [[-0.5], [0.5]] | [[1], [2]] | Failed |
| empty | [] | [] | Passed |
| single vector | [[0.0, 0.0]] | [[0, 0]] | Passed |
| ignored row weight | [[0.5], [-0.5]] | [[1], [0]] | Failed |
SHA-256 / 9e74cfd86ceb8948888947ba9e08af9a5697596f009692900b7e397553d9b27e
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(vectors, weights):
m=[vectors[0][j] for j in range(len(vectors[0]))] if vectors else []
return [[x-m[j] for j,x in enumerate(v)] for v in vectors]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unequal weights', solve([[0,N],[2*N,3*N]],[3,1]), [[-N/2,-N/2],[3*N/2,3*N/2]])
check('equal weights', solve([[0],[2*N]],[1,1]), [[-N],[N]])
check('zero total', solve([[N],[2*N]],[0,0]), [[N],[2*N]])
check('empty', solve([],[]), [])
check('single vector', solve([[N,N]],[N]), [[0,0]])
check('ignored row weight', solve([[N],[0]],[0,1]), [[N],[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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| unequal weights | [[0, 0], [2, 2]] | [[-0.5, -0.5], [1.5, 1.5]] | Failed |
| equal weights | [[0], [2]] | [[-1], [1]] | Failed |
| zero total | [[0], [1]] | [[1], [2]] | Failed |
| empty | [] | [] | Passed |
| single vector | [[0, 0]] | [[0, 0]] | Passed |
| ignored row weight | [[0], [-1]] | [[1], [0]] | Failed |
SHA-256 / 43215510a39edc360bc0dede86ee5239dbdf47ee60a0a567bc72b467f287b29b
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.023786+00:00.
Case digest / d9cd56203412bff332b44370c8c39cb112b9e639dbf12d7a5f5adbab802f6f7d