Skip to content

Preserve recorded conditioning by default during tokenization - #1014

Merged
bradhilton merged 9 commits into
mainfrom
fix/recorded-native-minimal-on-parser-20260928
Sep 28, 2026
Merged

bradhilton merged 9 commits into
mainfrom
fix/recorded-native-minimal-on-parser-20260928

Conversation

@bradhilton

@bradhilton bradhilton commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Complete recorded prompt/output tokens now supply default tokenization for histories, trajectories and groups. A length-stopped turn followed by a recorded prompt no longer gains a reconstructed terminator that changes later sampled conditioning. When only an optional gap or role annotation is unavailable, consistent recorded tokens remain usable with unknown nonsampled roles; inconsistent recorded prefixes still fail.

Original sampled logprobs and source ownership are preserved. Copied responses remain context without borrowed prediction loss. Native and fallback paths certify every required recorded source, including sources omitted by a renderer, and derive terminal ownership from the original history. Complete terminal Messages/Responses records can avoid unsupported Chat projection for both length and normal stops. Explicit rendering remains available; callbacks used for proofs retain source, context, model and STOP checks. A provider stop reason does not invent a token: when the complete record omits EOS, no synthetic STOP token is appended. Earlier opaque nonterminal or multi-message Responses turns can still require unsupported projection; when their native conditioning cannot be proved, tokenization refuses rather than silently discarding sampled targets. This does not claim to solve that inherited limitation.

This is based on main after #1009 and preserves its parser and serialization changes. Two golden updates are intentional: removing one invented duplicate native terminator, and preserving literal Qwen assistant text against an independent raw-template reference.

Validation: 1,659 tests pass on this exact head across trajectories, real preprocessing/packing consumers, and parser coverage. Focused predecessor failures cover terminal boundaries, omitted sampled targets, copied ownership, protocol admission and callback identity. Independent component source reviews, pinned type checks and Ruff pass. Both persistent source-review followups are CLEAR on this exact head and its cumulative interactions. Their owners are closed. All required CI checks passed on this exact head. No frozen experiment or live runtime is changed by this PR. Two previously observed HTTP transport cleanup warnings in unchanged capture tests remain retained and unattributed.

A finite public ABBA screen on predecessor 1895678e preserved full token/logprob/flag/mask and input parity across 12 native/rendered cases. Timings were mixed: the narrow native fixture and rendered paths were roughly 1–5% slower in this local screen, while wider native cases varied. This is a correctness change; no uniform speedup or production-throughput improvement is claimed.

@bradhilton
bradhilton force-pushed the fix/recorded-native-minimal-on-parser-20260928 branch 2 times, most recently from 1f1845a to 09789fc Compare September 28, 2026 13:11
@bradhilton
bradhilton force-pushed the fix/recorded-native-minimal-on-parser-20260928 branch from f14968f to 1895678 Compare September 28, 2026 14:42
@bradhilton bradhilton changed the title Preserve complete recorded token sequences by default Preserve recorded conditioning by default during tokenization Sep 28, 2026
@bradhilton
bradhilton changed the base branch from fix/preserve-literal-reasoning-content to main September 28, 2026 14:42
@bradhilton bradhilton closed this Sep 28, 2026
@bradhilton bradhilton reopened this Sep 28, 2026
@bradhilton
bradhilton marked this pull request as ready for review September 28, 2026 16:04
@bradhilton
bradhilton merged commit d22abdc into main Sep 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant