Skip to content

Preserve exact length-stop histories followed by a synthetic terminal stop #881

Description

@bradhilton

A valid captured Chat Completions history can lose exact conditioning when a length-stopped response is followed by a terminal response that needs a synthetic stop. This composes two supported cases from #868/#871.

An actual Caladan049 K4 rollout on ART1ce5d7213 reproduced this before training: the first response contains2,048 sampled tokens and finish_reason=length; the later response contains2,048 sampled tokens and finish_reason=tool_calls without a recognized captured terminator. Its later captured prompt retains the entire earlier13,598-token prompt and all2,048 sampled output tokens exactly. There is no missing capture or inconsistent continuation.

_history_needs_synthetic_stop() returns true for the whole history, so _tokenize_chat_view() skips its exact length-boundary path. Rendering produces17,737 tokens with non-EXACT conditioning before sampled tokens and differs from the captured prefix at token20. Caladan's strict raw-conditioning fence correctly refuses this tensorization. All eight raw rollouts are preserved privately; one history is affected. No optimizer update occurred in that failed arm.

The correction should prove boundaries per source: keep all captured prompt/output IDs and sampled logprobs; preserve the renderer-owned terminal tail and natural-stop attribution; retain strict nonterminal length-boundary/context/projection checks. Removing the global check alone drops the synthetic tail and is insufficient. No loss change, truncation, dropped rollout or sampling change is appropriate.

A narrow local candidate plus a composed-history public-tokenization regression is in review. Exact captured-data CPU differential and original failure receipts are retained privately; no GPU retry is implied by this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions