4 ms·
This is solvable by augmenting the database schema with comments. When you integrate your database with an LLM, you'll notice the LLM will produce flawed queri
by getmeinrn 3y ago
This is solvable by augmenting the database schema with comments.
When you integrate your database with an LLM, you'll notice the LLM will produce flawed queries based on wrinkles in your database schema. This is because the LLM relies on conventional understanding of how the schema is probably tied together. When you see the flawed queries, you augment the schema with a comment that explains why the schema has a wrinkle. The LLM takes that into consideration and the resulting queries are improved.
A concrete example[1]: I found that when querying the Sakila movie rental database, the generated query would frequently attempt to join the `rental` table to the `film` table through a nonexistent `film_id` column on the rental table. By adding the linked comment, the LLM stopped doing that.
1. https://github.com/amoffat/HeimdaLLM/blob/dev/notebooks/sakila-schema.sql#L130-L131 https://github.com/amoffat/HeimdaLLM/blob/dev/notebooks/saki...