Training a 4B Model With RL to Beat Postgres Query Plans by 81%
bytebot · x · 2026-09-17
Developer Rohan Bansal details an experiment post-training an open-weights 4B Qwen model with SFT and agentic RL to produce Postgres query plans up to 81% faster than the default optimizer. Since plan quality reduces to a single verifiable signal — execution time — each RL rollout sends a candidate plan to Postgres for measurement, and scalar rewards flow back to update the weights. The post contextualizes this with the Leis et al. finding that query optimizers (join ordering is NP-hard) still underperform a decade later.
More from coding & agent
- Rust/Wasm AAC audio encoder claims 6x speedup over FFmpeg in head-to-head benchmarks — wavefnx · 2026-09-17
- Label the Row: A Six-Step Data Classification Cheat Sheet for AI Products — blaizedsouza · 2026-09-17
- What happens when a RAG agent retrieves a poisoned document? A reusable security test case — Tophant_ · 2026-09-17
- Agents should translate messy requests instead of forcing forms: lessons from a broadcast media deployment — NumbersProtocol · 2026-09-17
- Developer builds GitHub Radar, a UI to track activity across repos and organizations — dSebastien · 2026-09-17
- smallpt: A physically based ray tracer in just 99 lines of C++ — blaizedsouza · 2026-09-17