Skip to content

Preserve forked native conditioning in multi-history tokenization - #983

Draft
bradhilton wants to merge 6 commits into
hayek/recorded-token-default-20260926from
hayek/native-nonnested-streams-20260927
Draft

bradhilton wants to merge 6 commits into
hayek/recorded-token-default-20260926from
hayek/native-nonnested-streams-20260927

Conversation

@bradhilton

@bradhilton bradhilton commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Complete recorded exchanges can still fail tokenization when a later request retains or canonicalizes an earlier response and its native prompt is no longer an extension of that response's full prompt/output sequence. This change lets the existing multi_history=True and internal exchange-training paths emit adjacent native streams, each preserving the original conditioned tokens, logprobs and sampled ownership. Single-history APIs continue to refuse incompatible linear representations; no new option is introduced.

Stacked on #977. Ordinary native successes remain first. Splitting requires complete unchanged Chat provenance, exact canonical request scopes, full native source-span occupancy and STOP proof. Request-context roles retain the existing rendering proof. Final callback-free snapshots prevent a later renderer or STOP encoder from changing already-certified source/context evidence. Explicit render overrides and incomplete/edited authority do not authorize splitting.

Validation:

  • Canonical CI passes at d1bb8e90e: 1,264 lightweight tests and 2,330 unit tests, plus lint, formatting, types and lockfile checks. Independent source and retained-result reviews passed; the test-only warning-isolation and nonzero-gradient follow-ups also have affected reviews.

  • Public regressions independently compare first ownership before finite filtering, including NaN/overflow-first duplicates; they exercise nonzero trajectory advantages, shared weights, causal packing, copied context, strict refusals and callback mutation. Actual ART CISPO/PPO losses and gradients of a tiny shared-parameter CPU predictor match an independent original-completion analytic oracle, including clipped and active contributions of both advantage signs and physical prefix sharing.

  • One bounded offline comparison of the retained batch208 trajectory: unchanged Reuse recorded tokens by default and preserve literal assistant content #977 refuses; this change preserves all 31 source encounters/30 unique sources in three histories, with 4,139 first-owned finite loss terms and 29 sampled STOPs. Public process-worker and internal preprocessing arrays agree; original input/options remain unchanged. Both single-linear APIs still refuse. The captured oracle independently derives inventory and first ownership while sharing unchanged STOP/source-key primitives. No model, provider or GPU run was performed.

  • The exact production tokenizer in this PR (92311689) was reapplied as a one-file patch to the selected current ART main 80015fae receiving tree. All 60 affected receiving cases pass. A new bounded offline replay again verifies the previously refused batch208 input (31 encounters / 30 sources, 4,139 finite selected terms and 29 sampled STOPs), while a previously successful real trajectory spanning stop, length and tool-call responses preserves its entire result and all four ownership masks exactly. Original inputs, options and source bindings remain unchanged; both local process families are closed. This is CPU token/objective coverage, not a native optimizer-update or fresh learning claim.

The captured normalization check uses a constructed one-trajectory group, whose centered advantage is zero; it is not original-group gradient equivalence. The separate public gradient regression is not transformer-weight or GPU numerical equivalence. Earlier responses outside a run become that request's context, so this does not claim universal OUTPUT/SFT layout parity with every formerly successful rendered-copy path. Extra streams can repeat context; no speed or GPU-memory claim is made. Current experiments and frozen pins are unchanged.

This branch has not been deployed

No deployments
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