FAILURE MAP
← Case archive

FA-98126 / Sequence batch packing / Open access

Prompt tokens leak into response-only truncation · case 01

Prompt tokens leak into response-only truncation.

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

ROOT CAUSE

Truncation is applied to the concatenated prompt and response, so prompt tokens can leak into the response-only result.

THE FAILURE

Truncation is applied to the concatenated prompt and response, so prompt tokens can leak into the response-only result.

Unsuccessful approach: Taking a response prefix removes the latest response supervision even though it no longer leaks prompt tokens.

Case contract

Return response tokens only, preserving the full response when it fits and otherwise retaining its final limit tokens; output (tokens, response_start), where response_start is zero.

Why this case matters

This deterministic toy packing rule models a common boundary in preparing bounded training sequences.

1 / The failure

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

N = 1
observations = []
def solve(prompt, response, limit):
    joined=prompt+response; kept=joined[-limit:] if limit else []; return kept,max(0,len(prompt)-max(0,len(joined)-limit))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
p=list(range(N+2)); r=[8,9]
check('response exceeds limit', solve(p,r,1), ([9],0))
check('response fits', solve(p,r,N+4), (r,0))
check('zero limit', solve(p,r,0), ([],0))
check('empty response', solve(p,[],N), ([],0))
check('single final token', solve([1],[7],1), ([7],0))
check('several response tokens', solve([1],[2,3,4],2), ([3,4],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 fixtureActualExpectedOutcome
response exceeds limit[[9], 0][[9], 0]Passed
response fits[[0, 1, 2, 8, 9], 3][[8, 9], 0]Failed
zero limit[[], 0][[], 0]Passed
empty response[[2], 1][[], 0]Failed
single final token[[7], 0][[7], 0]Passed
several response tokens[[3, 4], 0][[3, 4], 0]Passed

SHA-256 / f415ae06f8e9d683aac3f268d7c875a22b3da284a9783ca58d6958c8624edb88

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(prompt, response, limit):
    kept=response[:limit] if limit else []; return kept,0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
p=list(range(N+2)); r=[8,9]
check('response exceeds limit', solve(p,r,1), ([9],0))
check('response fits', solve(p,r,N+4), (r,0))
check('zero limit', solve(p,r,0), ([],0))
check('empty response', solve(p,[],N), ([],0))
check('single final token', solve([1],[7],1), ([7],0))
check('several response tokens', solve([1],[2,3,4],2), ([3,4],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 fixtureActualExpectedOutcome
response exceeds limit[[8], 0][[9], 0]Failed
response fits[[8, 9], 0][[8, 9], 0]Passed
zero limit[[], 0][[], 0]Passed
empty response[[], 0][[], 0]Passed
single final token[[7], 0][[7], 0]Passed
several response tokens[[2, 3], 0][[3, 4], 0]Failed

SHA-256 / 3bb7bda05d446391e0aca4e3d39960c8c34f53ed5d2174cd89a18c1f20f77e95

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 short integer-token lists under the stated toy contract; results do not claim compatibility with a specific training framework. 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:09.757529+00:00.

Case digest / 1c4fccee395013c7cc13ff549dece1332ee6cd95073f929dd2224044cf00da4e