FAILURE MAP
← Case archive

FA-98171 / Attention mask construction / Open access

Prefix tokens cannot see the rest of their prefix · case 01

Prefix tokens cannot see the rest of their prefix.

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

ROOT CAUSE

A causal mask only permits earlier keys for prefix queries.

THE FAILURE

A causal mask only permits earlier keys for prefix queries.

Unsuccessful approach: Suffix rows that attend to prefix positions leak prefix context into the separately defined suffix-only contract.

Case contract

Positions [0,p) are a bidirectional prefix. Positions >=p attend only to suffix positions from p through the current query.

Why this case matters

A small explicit visibility matrix makes sequence-attention boundary behavior reviewable.

1 / The failure

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

N = 1
observations = []
def solve(length, prefix):
    return [[j<=i for j in range(length)] for i in range(length)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('prefix and suffix',solve(N+2,2),[[j<2 if i<2 else 2<=j<=i for j in range(N+2)] for i in range(N+2)])
check('full prefix',solve(3,3),[[True]*3 for _ in range(3)])
check('no prefix',solve(3,0),[[j<=i for j in range(3)] for i in range(3)])
check('empty',solve(0,0),[])
check('singleton prefix',solve(1,1),[[True]])
check('suffix boundary excludes prefix',solve(4,1)[1:],[[False,True,False,False],[False,True,True,False],[False,True,True,True]])
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
prefix and suffix[[True, False, False], [True, True, False], [True, True, True]][[True, True, False], [True, True, False], [False, False, True]]Failed
full prefix[[True, False, False], [True, True, False], [True, True, True]][[True, True, True], [True, True, True], [True, True, True]]Failed
no prefix[[True, False, False], [True, True, False], [True, True, True]][[True, False, False], [True, True, False], [True, True, True]]Passed
empty[][]Passed
singleton prefix[[True]][[True]]Passed
suffix boundary excludes prefix[[True, True, False, False], [True, True, True, False], [True, True, True, True]][[False, True, False, False], [False, True, True, False], [False, True, True, True]]Failed

SHA-256 / 645ed0af29fa72eeb8cb742d8072b6c6e7a1a9ef69c50b5aa35103ca29db40da

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(length, prefix):
    return [[j<prefix or j<=i for j in range(length)] for i in range(length)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('prefix and suffix',solve(N+2,2),[[j<2 if i<2 else 2<=j<=i for j in range(N+2)] for i in range(N+2)])
check('full prefix',solve(3,3),[[True]*3 for _ in range(3)])
check('no prefix',solve(3,0),[[j<=i for j in range(3)] for i in range(3)])
check('empty',solve(0,0),[])
check('singleton prefix',solve(1,1),[[True]])
check('suffix boundary excludes prefix',solve(4,1)[1:],[[False,True,False,False],[False,True,True,False],[False,True,True,True]])
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
prefix and suffix[[True, True, False], [True, True, False], [True, True, True]][[True, True, False], [True, True, False], [False, False, True]]Failed
full prefix[[True, True, True], [True, True, True], [True, True, True]][[True, True, True], [True, True, True], [True, True, True]]Passed
no prefix[[True, False, False], [True, True, False], [True, True, True]][[True, False, False], [True, True, False], [True, True, True]]Passed
empty[][]Passed
singleton prefix[[True]][[True]]Passed
suffix boundary excludes prefix[[True, True, False, False], [True, True, True, False], [True, True, True, True]][[False, True, False, False], [False, True, True, False], [False, True, True, True]]Failed

SHA-256 / 6cc7dfdb94e44f8d4112f7a5c0a871adea0b6ce82ba1725f4b79046e246bfbfd

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

These are toy Boolean matrix contracts; they do not define a production model architecture or tensor library 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:10.193976+00:00.

Case digest / 9529fadcfe246589558e75e0349cb8b31e0d940c9285572d931035fb853bd971