Training a 4B model to produce 81% faster query plans than Postgres
Rohan Bansal post-trained a Qwen 4B model to beat Postgres's default query plans. After SFT distillation from 500 GPT-6 Astra trajectories and a custom GRPO variant for RL, the model achieved 44.7% latency reduction and 81% geometric mean speedup across 113 join-heavy queries. Training ran on a rented 2×H100 node with four Postgres containers on his desk for measurement. The post doesn't disclose total training time or per-inference latency.
Why it matters: A 4B model trained via RL beats Postgres default plans by 81% on the Join Order Benchmark. The method is practically interesting, but only 113 queries were tested—generalization is unproven, capping the score at 78.