FAILURE MAP
← Case archive

FA-98186 / Attention mask construction / Open access

Causal ordering hides valid encoder states in cross-attention · case 01

Causal ordering hides valid encoder states in cross-attention.

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

ROOT CAUSE

The key index is limited by decoder query position even though encoder keys are all available.

THE FAILURE

The key index is limited by decoder query position even though encoder keys are all available.

Unsuccessful approach: Selecting one source validity bit by query row and broadcasting it across keys loses each key’s own padding state.

Case contract

Cross-attention visibility is source-key validity replicated for each decoder 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(source_valid, query_count):
    return [[bool(source_valid[j]) and j<=i for j in range(len(source_valid))] for i in range(query_count)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
s=[True]*N+[False]
check('later source visible',solve(s,2),[[True]*N+[False] for _ in range(2)])
check('single decoder query',solve([True,True],1),[[True,True]])
check('zero source',solve([],2),[[],[]])
check('zero target',solve([True],0),[])
check('all invalid source',solve([False,False],2),[[False,False],[False,False]])
check('source order retained',solve([False,True,True],1),[[False,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
later source visible[[True, False], [True, False]][[True, False], [True, False]]Passed
single decoder query[[True, False]][[True, True]]Failed
zero source[[], []][[], []]Passed
zero target[][]Passed
all invalid source[[False, False], [False, False]][[False, False], [False, False]]Passed
source order retained[[False, False, False]][[False, True, True]]Failed

SHA-256 / c9722cabb63d7d8521f806f7290a1d787ab6f3fc9340515aa7824dd5b7b2c771

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(source_valid, query_count):
    return [[bool(source_valid[q%len(source_valid)]) for _ in source_valid] for q in range(query_count)] if source_valid else [[] for _ in range(query_count)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
s=[True]*N+[False]
check('later source visible',solve(s,2),[[True]*N+[False] for _ in range(2)])
check('single decoder query',solve([True,True],1),[[True,True]])
check('zero source',solve([],2),[[],[]])
check('zero target',solve([True],0),[])
check('all invalid source',solve([False,False],2),[[False,False],[False,False]])
check('source order retained',solve([False,True,True],1),[[False,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
later source visible[[True, True], [False, False]][[True, False], [True, False]]Failed
single decoder query[[True, True]][[True, True]]Passed
zero source[[], []][[], []]Passed
zero target[][]Passed
all invalid source[[False, False], [False, False]][[False, False], [False, False]]Passed
source order retained[[False, False, False]][[False, True, True]]Failed

SHA-256 / 636749adc2dd945415c14bd3558a915d2d74eefbd9a5ae5e35078d00d2c0dd3a

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

Case digest / ad71ea21c557e6fba498b14d30f913ad5d30bac222550e553c24e9d3a5c38e50