Skip to content

Compact prompt tier by default for <=9B local models (+37pp resolve rate) - #306

Merged
dahai80 merged 4 commits into
mainfrom
feat/mlx-prompt-tier-override
Nov 21, 2026
Merged

dahai80 merged 4 commits into
mainfrom
feat/mlx-prompt-tier-override

Conversation

@dahai80

@dahai80 dahai80 commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Result (harness-gain suite, 20 tasks, Qwen3-8B on fusion-mlx 0.10.68)

Arm System prompt Resolved Mean wall
standard tier (before) ~8.1K tokens 3/20 (15%) ~130s
compact tier (after) ~1.9K tokens 10/20 (50%) 74s

Same checkpoint, same engine, same fixed harness. The compact arm ties
goose's small-prompt harness (10/20) measured the same day — prompt
size, not model quality or edit-tool shape, was the dominant gap.

Stacked on #304 (bench fixes + recovery loop used for measurement).

Changes

  • getPromptTier: paramCount <= 9 now returns compact (was
    standard). Comment carries the A/B numbers and literature pointers
    (Chroma Context Rot; Lost in the Middle arXiv:2307.03172; NoLiMa
    arXiv:2502.05171; RULER arXiv:2404.06654).
  • FUSION_CODE_MLX_PROMPT_TIER env override (previous commit on this
    branch) forces any tier for A/B comparison; invalid values fall back
    to the automatic mapping.
  • Tests updated for the new mapping; standard tier now driven via the
    override in tests.

Verification

  • 43/43 pass in mlxSystemPrompt.test.ts; typecheck clean; binary builds.
  • Full bun test shows 1 failure
    (compact/contextWindowWarning.test.ts) that also fails on a clean
    tree (pre-existing, passes in isolation).

Caveat

Single 20-task run per arm. The env override keeps the old tier
one flag away for reproduction.

🤖 Generated with Claude Code

dahai80 added a commit that referenced this pull request Nov 21, 2026
fusion-code compact tier ties goose (10/20, mean wall 74s vs 130s).
Prompt size alone closed the gap; default flipped for <=9B (PR #306).

Co-Authored-By: Claude Code <[email protected]>
dahai80 added a commit that referenced this pull request Nov 21, 2026
fusion-code compact tier ties goose (10/20, mean wall 74s vs 130s).
Prompt size alone closed the gap; default flipped for <=9B (PR #306).

Co-Authored-By: Claude Code <[email protected]>
dahai80 and others added 4 commits November 21, 2026 19:59
Env-gated escape hatch forcing a prompt tier regardless of the automatic
param-count/context mapping (mini|compact|standard|extended|full).
Motivation: bench report #2 cross-harness baseline — the same Qwen3-8B
checkpoint resolves 10/20 suite tasks under goose's ~2K-token prompt vs
3/20 under this builder's standard tier (~8.1K tokens measured with
empty memory/context; compact measures ~1.9K). Ships as an override
first; A/B suite numbers decide whether the automatic mapping for <=9B
models should move to compact.

3 unit tests: forced compact on 8B, forced full on 0.5B, invalid value
falls back to automatic.

Co-Authored-By: Claude Code <[email protected]>
A/B on the harness-gain suite (Qwen3-8B, fusion-mlx 0.10.68, same
engine, fixed harness): standard tier (~8.1K-token system prompt)
resolved 3/20; compact tier (~1.9K tokens) resolved 10/20 with mean
wall down 130s -> 74s — matching goose's small-prompt harness (10/20)
on the identical checkpoint. Literature agrees long/verbose context
degrades small models non-linearly (Context Rot, Lost in the Middle,
NoLiMa, RULER).

getPromptTier: paramCount<=9 now returns compact; 'standard' stays
reachable via FUSION_CODE_MLX_PROMPT_TIER for A/B comparison. Tests
updated for the new mapping + override paths.

Note: bun test full run shows 1 pre-existing failure
(compact/contextWindowWarning.test.ts) present on a clean tree;
passes in isolation.

Co-Authored-By: Claude Code <[email protected]>
@dahai80
dahai80 force-pushed the feat/mlx-prompt-tier-override branch from a8fe68d to 4685f35 Compare November 21, 2026 11:59
@dahai80
dahai80 merged commit 7628147 into main Nov 21, 2026
1 check passed
@dahai80 dahai80 mentioned this pull request Nov 21, 2026
@dahai80

dahai80 commented Nov 21, 2026

Copy link
Copy Markdown
Owner Author

Reproduction run (same arm, same env): 10/20 again (mean wall 79.4s, 0 timeouts, results dir fusion-code-2026-11-21T11-53-15Z). Two independent compact-tier runs both at 10/20 — the single-run caveat is retired. Per-task composition varies between runs (medium tasks flip), aggregate stable.

🤖 Generated with Claude Code

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