Skip to content

Adaptive batch size, guarded retry, and max_tokens bump for enrich step - #453

Closed
neoneye wants to merge 1 commit into
mainfrom
fix/enrich-adaptive-batch-and-retry-guards
Closed

Adaptive batch size, guarded retry, and max_tokens bump for enrich step#453
neoneye wants to merge 1 commit into
mainfrom
fix/enrich-adaptive-batch-and-retry-guards

Conversation

@neoneye

Copy link
Copy Markdown
Member

Summary

  • max_tokens bump: gpt-oss-20b from 8192 → 128000 in baseline.json — the old limit truncated structured JSON output at exactly 8192 tokens, causing 0/5 plan failures
  • C1 — Adaptive batch size: Probes model num_output metadata; uses batch_size=2 when below 16384 tokens as a safety net for output-constrained models
  • C2 — Guarded retry: On batch failure, split once (depth limit=1) within a 300s time budget, then skip. Prevents the unbounded retry cascade that caused 3×600s timeouts in PR Add per-batch retry for enrich step, update OPTIMIZE_INSTRUCTIONS #452
  • B4 — Accurate batch counting: Report actual batches_succeeded instead of hardcoded 1 in runner.py
  • D5 — OPTIMIZE_INSTRUCTIONS: Document consequence-echoing and UUID format inconsistency as known problems

Test plan

  • Run self_improve experiment across 7 models
  • Verify gpt-oss-20b recovers to 5/5 plan success (was 0/5 before)
  • Verify no 600s timeouts for gpt-oss-20b (should complete in ~300-400s)
  • Verify all other models remain at 100% success rate
  • Verify calls_succeeded reports accurate batch counts
  • Check assessment verdict is YES before merging

🤖 Generated with Claude Code

Bump gpt-oss-20b max_tokens from 8192 to 128000 to match its 131K context
window — the old limit truncated structured JSON output. Add adaptive batch
sizing (batch_size=2 when model num_output < 16384) as a safety net. Replace
the raise-on-error batch loop with a guarded retry: on failure split the batch
once (MAX_RETRY_DEPTH=1) within a 300s budget, then skip. Report actual
batches_succeeded instead of hardcoded 1. Document consequence-echoing and
UUID format inconsistency in OPTIMIZE_INSTRUCTIONS.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@neoneye

Copy link
Copy Markdown
MemberAuthor

Self-improve iteration — analysis 56

Verdict: CONDITIONAL

Wins:

  • Guarded retry: 4.3× reduction in wasted runner time (gpt-oss-20b ~2224s → ~520s)
  • max_tokens bump: 2/5 gpt-oss-20b plans produce complete JSON (no more truncation at 8192)
  • All 6 other models: 100% success, unchanged quality

Bug found — C1/C2 interaction:
max_tokens=128000 inflated num_output to 128000, making adaptive batch check (num_output < 16384) always false for gpt-oss-20b. The model still runs with batch_size=5 instead of the intended batch_size=2.

gpt-oss-20b: 2/5 functional success (unchanged from PR #452, but failure mode improved from 600s timeout → fast empty_response)

Follow-up needed: C4 — fix threshold to also check context_window (stays at 3900 regardless of max_tokens)

@neoneye

Copy link
Copy Markdown
MemberAuthor

Closing — C1/C2 interaction bug makes adaptive batch size ineffective for the target model. Will rework.

Sign up for freeto 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

@neoneye