Projects 2026

When Not to Hint

Adapting an LLM query optimizer to a new database instance

Written with Hanwen Liu and Ibrahim Sabek. Published in the Proceedings of the MLForSys Workshop at the Annual Conference on Neural Information Processing Systems (NeurIPS), 2026, in Sydney, Australia.

The problem

A database’s query optimizer decides how each query gets executed, and those decisions can make the same query fast or very slow. Large language models can be trained to give the optimizer hints that steer it toward better plans. I found that these LLM query optimizers underperform when they’re moved to a database they weren’t trained on.

What I built

I designed a low-cost pipeline that adapts an LLM query optimizer to a new database instance.

Results

  • 31% lower latency than PostgreSQL on hinted queries, and 8% lower overall.
  • 2.79× faster than the same model trained on a different database.