Skip to content

fix(grounded_reasoning): bump max_new_tokens 512 → 1024#927

Closed
lichengzhe wants to merge 2 commits into
Blaizzy:mainfrom
lichengzhe:fix/grounded-reasoning-max-tokens
Closed

fix(grounded_reasoning): bump max_new_tokens 512 → 1024#927
lichengzhe wants to merge 2 commits into
Blaizzy:mainfrom
lichengzhe:fix/grounded-reasoning-max-tokens

Conversation

@lichengzhe
Copy link
Copy Markdown

Summary

  • Increases the default max_new_tokens from 512 to 1024 in grounded_reasoning/fp_tools.py
  • Fixes silent truncation of Falcon Perception output in dense scenes (170+ instances)
  • One-line change, +16.5% recall on a real-world counting task

Problem

Falcon Perception generates mask coordinates autoregressively. When segmenting dense scenes (e.g., 200+ small objects), the token sequence exceeds 512 tokens and later masks are silently dropped — no error, no warning, just missing detections.

Test results

max_new_tokens Masks detected Recall change
512 (current) 170 baseline
1024 (proposed) 198 +16.5%
2048 / 4096 198 no further gain

Tested with tiiuae/Falcon-Perception + mlx-community/gemma-4-26b-a4b-it-4bit on M4 Pro 64GB.

Related

🤖 Generated with Claude Code

YasserdahouML and others added 2 commits April 8, 2026 22:23
The default max_new_tokens=512 silently truncates Falcon Perception
output when segmenting dense scenes (170+ instances). Autoregressive
mask-coordinate generation exceeds 512 tokens, causing later masks
to never be emitted.

Tested on a 200+ object counting task:
  512 tokens → 170 masks
  1024 tokens → 198 masks (+16.5% recall)
  2048/4096 → 198 (no further gain, 1024 is sufficient)

Ref: Blaizzy#926

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lichengzhe lichengzhe force-pushed the fix/grounded-reasoning-max-tokens branch from 246e3f7 to 930cbff Compare April 8, 2026 14:23
@Blaizzy
Copy link
Copy Markdown
Owner

Blaizzy commented May 6, 2026

done in main

@Blaizzy Blaizzy closed this May 6, 2026
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.

3 participants