FA-99381 / Embedding vector normalization / Open access
Square-root length pooling divides by squared token count · case 01
Square-root length pooling divides by squared token count.
ROOT CAUSE
The token count is squared where its square root is required.
THE FAILURE
The token count is squared where its square root is required.
Unsuccessful approach: A full mean removes length scaling entirely and is wrong for this pooling rule.
Case contract
Return sum(vectors)/sqrt(token_count) coordinatewise; empty input returns empty.
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):
return [sum(v[j] for v in vectors)/len(vectors)**2 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('two tokens', solve([[N,0],[N,2*N]]), [2*N/2**0.5,2*N/2**0.5])
check('four tokens', solve([[N],[N],[N],[N]]), [2*N])
check('singleton', solve([[N,2*N]]), [N,2*N])
check('empty', solve([]), [])
check('cancellation', solve([[N],[-N]]), [0])
check('three values', solve([[0,N],[0,N],[3*N,0]]), [3*N/3**0.5,2*N/3**0.5])
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 |
|---|---|---|---|
| two tokens | [0.5, 0.5] | [1.414213562373095, 1.414213562373095] | Failed |
| four tokens | [0.25] | [2] | Failed |
| singleton | [1.0, 2.0] | [1, 2] | Passed |
| empty | [] | [] | Passed |
| cancellation | [0.0] | [0] | Passed |
| three values | [0.3333333333333333, 0.2222222222222222] | [1.7320508075688774, 1.1547005383792517] | Failed |
SHA-256 / 6a2c2d2359fee9376ea00ddfa0c8759ba58191c80636f37c0de0042e1a413857
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(vectors):
return [sum(v[j] for v in vectors)/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('two tokens', solve([[N,0],[N,2*N]]), [2*N/2**0.5,2*N/2**0.5])
check('four tokens', solve([[N],[N],[N],[N]]), [2*N])
check('singleton', solve([[N,2*N]]), [N,2*N])
check('empty', solve([]), [])
check('cancellation', solve([[N],[-N]]), [0])
check('three values', solve([[0,N],[0,N],[3*N,0]]), [3*N/3**0.5,2*N/3**0.5])
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 |
|---|---|---|---|
| two tokens | [1.0, 1.0] | [1.414213562373095, 1.414213562373095] | Failed |
| four tokens | [1.0] | [2] | Failed |
| singleton | [1.0, 2.0] | [1, 2] | Passed |
| empty | [] | [] | Passed |
| cancellation | [0.0] | [0] | Passed |
| three values | [1.0, 0.6666666666666666] | [1.7320508075688774, 1.1547005383792517] | Failed |
SHA-256 / ff9a4150f6489f308e837836e75ec0d6c600b59a5d5405289197f8768064b63b
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.554817+00:00.
Case digest / 80a2a1f33ebce8e51cee4fe798bda05fd9918a08336649118b43760872abfd5f