logoalt Hacker News

Someoneyesterday at 7:57 PM4 repliesview on HN

> I paid ~$800 to rent a 2x H100 SXM node from Lambda for ~95 hours, and ~$400 in OpenAI API fees to generate the Astra trajectory demonstrations.

> a tiny 4B model went from not being able to understand the harness it was wrapped in, to achieving a 1.81x geometric mean speedup and a summed latency decrease of 44.7% across a workload of join-heavy SQL queries

I can’t find it in the article (may have skimmed it too much), but I suspect they didn’t include those ~95 hours in the benchmark numbers.

I think all database vendors know their query optimizers could do much better if they could afford to spend lots of time to derive query plans.

⇒ this may be useful for some workloads, but even then, can you afford to spend hours every now and then to update your 4B model to ensure it still picks a good query plan?


Replies

dvtyesterday at 8:13 PM

> ⇒ this may be useful for some workloads, but even then, can you afford to spend hours every now and then to update your 4B model to ensure it still picks a good query plan?

I think this would be likely comparable to a scheduled backup, so I think it would be an acceptable maintenance window. However, deterministic algorithms would likely beat re-training (or re-fine-tuning) the model. For example, one could analyze actual distributions or whatever (instead of assuming uniform), and then some plans would automatically be eliminated.

Imo a good thought experiment is to look at places that are hyper-optimized, like compilers. Would LLMs bring anything to the table (architecturally or performance-wise) to a piece of software that has been carefully crafted for decades? (Methinks no.)

show 3 replies
bananaowlyesterday at 10:48 PM

Could you stitch a specific query plan to your view?

‘create plan llm_optimized …’

‘create view foo (select x, y, z from table bar) with plan llm_optimized’

vatsachakyesterday at 9:47 PM

I think the idea would be making a frontier model that does this. One that is trained on multiple queries

mistrial9yesterday at 11:33 PM

the currency of the counts also, right.. actually recounting table contents is done from time to time