Skip to content

Preserve Drama3 history anchors and fit generation to context - #1197

Merged
0xShug0 merged 1 commit into
mainfrom
fix/drama3-history-context-1188
Nov 4, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
fix/drama3-history-context-1188

Conversation

@0xShug0

@0xShug0 0xShug0 commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Drama3 previously conditioned each long-form chunk on only the latest generated chunk and rejected requests whenever the prompt plus the entire requested token allowance exceeded context capacity. This retains the first generated chunk as an anchor alongside the latest chunk, and treats max_tokens as an upper bound limited by the remaining context.

Automatic history is reduced in upstream order: first + latest, first only, then none. References and caller-supplied previous takes remain required and ordered. An oversized required prompt still fails. Budget reductions are logged, and exhausting the effective budget sets reached_limit.

Changes are model-local, with documentation and prompt tests. Offline and streaming share the policy. Chunk-size/token defaults, BF16 reference encoding and empty-generation errors are unchanged.

Validation

CUDA A/B against main on RTX 5090, native Q4_K_S experts with Q8_0 tower projections, eight threads, full-resident inference, perf_mode=off, context 2048, chunk size 128 and max_tokens=1024. Five English passages of approximately 1,000 characters, with identical fixed seeds and settings on both sides:

Passage Characters Detected speakers, main → PR Qwen3-ASR WER, main → PR
Coast 1,027 2 → 1 0.56% → 0%
Observatory 1,019 1 → 1 0% → 0%
Radio 998 1 → 1 0.60% → 0.60%
Museum 1,007 1 → 1 1.22% → 0.61%
Mountain 1,000 1 → 1 1.67% → 1.11%
Aggregate 0.82% → 0.47%

Speaker counts use Nemotron 3 Diarization with no forced speaker count. WER uses Qwen3-ASR 1.7B and the same English normalization on both sides. All ten requests ended without hitting generation limits; all five first-two-chunk audio/code prefixes were byte-identical. These results support improved continuity on this cohort, not universal quality improvement. An earlier shorter passage with another seed gained one word after the change, independently confirmed by two ASR models.

Additional checks:

  • With context 512, a short request previously rejected at max_tokens=1024 now completes naturally. Its WAV matches main with a manually reduced cap byte-for-byte.
  • Required-prompt overflow still returns HTTP 400; a subsequent request succeeds. Deliberately tiny contexts exercise automatic-history removal and correctly report generation limits.
  • Streaming deltas match final PCM exactly. Offline/streaming audio codes match; waveform cosine exceeds 0.99999 on both main and PR.
  • CUDA pinned-expert offload completes multi-chunk narration with correct prefix reuse/invalidation. No independent main-versus-PR offload quality comparison is claimed.
  • Prompt fitting, mandatory conditioning, exact-fit boundaries, malformed input and existing tokenizer vectors pass. Debug CLI/server builds and whitespace checks pass.

Addresses items 3 and 4 of #1188; the other requests in that issue remain separate.

@0xShug0
0xShug0 merged commit e74e0aa into main Nov 4, 2026
7 checks passed
@0xShug0
0xShug0 deleted the fix/drama3-history-context-1188 branch November 4, 2026 15:10
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