Masked decoding trick tames text rivers in Gemma 3 12B, with a width-aware LoRA and coherence RL
cephaloform · x · 2026-11-14
Developer erinbeess shared a technique for controlling text layout in Gemma 3 12B generations: masked decoding at inference time, where any token that doesn't match the desired length gets masked out, eliminating unsightly 'text rivers' in generated paragraphs.
The full pipeline:
- Token-length-based masking during decoding to filter out ill-fitting tokens
- A LoRA trained with width tags so the model becomes aware of text length
- Coherence-oriented RL fine-tuning afterwards
The accompanying screenshot shows even, well-aligned lines without the repetitive stacking typical of small models. A hands-on decoding-control trick worth replicating.
More from Models
- The LLM #1 spot is now a rotating dance between Claude, GPT and Gemini — roydanroy · 2026-11-14
- Polymarket odds give Anthropic lab leak just 7% by mid-2027 after Claude safety incidents disclosed — Polymarket · 2026-11-14
- Ai2's XYBench Wins EMNLP Best Resource Award, Exposing LLMs' XY Problem Blind Spot — allen_ai · 2026-11-14
- GPT-6 emails consciousness researcher questions already answered in his own paper — erikphoel · 2026-11-14
- Edge0-145B-NVFP4 trends on Hugging Face: a 4-bit MoE built for edge inference — Edge0 · 2026-11-14
- Drex Max v1.1 claims #1 on Artificial Analysis Decision Index at $103/1M tasks — JaynitMakwana · 2026-11-14