FAILURE MAP
← Case archive

FA-99376 / Embedding vector normalization / Open access

Length-normalized pooling divides by squared token count · case 01

Length-normalized pooling divides by squared token count.

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

ROOT CAUSE

The summed vectors are divided by the square of the number of tokens.

THE FAILURE

The summed vectors are divided by the square of the number of tokens.

Unsuccessful approach: Dividing by vector dimension confuses token length with embedding width.

Case contract

Return the arithmetic mean of equal-width token vectors; 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('length two', solve([[N,0],[3*N,2*N]]), [2*N,N])
check('length three', solve([[0,N],[3*N,0],[6*N,2*N]]), [3*N,N])
check('singleton', solve([[N,2*N]]), [N,2*N])
check('empty', solve([]), [])
check('opposing', solve([[N],[ -N]]), [0])
check('wide vector', solve([[0,N,2*N],[2*N,3*N,4*N]]), [N,2*N,3*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
length two[1.0, 0.5][2, 1]Failed
length three[1.0, 0.3333333333333333][3, 1]Failed
singleton[1.0, 2.0][1, 2]Passed
empty[][]Passed
opposing[0.0][0]Passed
wide vector[0.5, 1.0, 1.5][1, 2, 3]Failed

SHA-256 / a1a59246db25bc5d6570c8fdd0bc8286f9f936f24807408184adc1de906b0c41

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[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('length two', solve([[N,0],[3*N,2*N]]), [2*N,N])
check('length three', solve([[0,N],[3*N,0],[6*N,2*N]]), [3*N,N])
check('singleton', solve([[N,2*N]]), [N,2*N])
check('empty', solve([]), [])
check('opposing', solve([[N],[ -N]]), [0])
check('wide vector', solve([[0,N,2*N],[2*N,3*N,4*N]]), [N,2*N,3*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
length two[2.0, 1.0][2, 1]Passed
length three[4.5, 1.5][3, 1]Failed
singleton[0.5, 1.0][1, 2]Failed
empty[][]Passed
opposing[0.0][0]Passed
wide vector[0.6666666666666666, 1.3333333333333333, 2.0][1, 2, 3]Failed

SHA-256 / ecfda69419d3118ae73847850cd713f4bded7b98543eab01847e46e69c5be768

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

Case digest / ea4db8b7d97cf7ba04ae3a6b2fd1a82a582b82868a20f969a463b0127d6bcd3f