Hacker News new | ask | show | jobs
by akiselev 1178 days ago
Anyone remember Dreamweaver or Microsoft Word HTML output? I imagine the AI generated code will be a lot like that - massively over-constrained and over-engineered to fit the impedance mismatch of a WYSIWYG (what you speak is what you get) editor.

You thought GUIs were bloated and slow before? Just you wait!

3 comments

I've been experimenting with GPT-4 to see how it could be integrated in video games for NPC decision making. After trying a few different approaches to give it access to the world state for reasoning, I found that it seems to do best when given a bunch of table definitions and told to write SQL queries against them; for some reason, it navigates object graphs much worse. Here's an example schema and session (the game here is Mount & Blade 2: Bannerlord, which is convenient because it's written in C# and it's easy to access and dump the entire game state in whatever format):

https://gist.github.com/int19h/4f5b98bcb9fab124d308efc19e530...

Take a close look at the SQL queries it generated to answer the question. On one hand, it's very impressive that it can write a complex query like this as part of its reasoning in response to a question like "pick a bride for your son":

   SELECT name, age, clan_name FROM (SELECT * FROM people WHERE name IN ("Mesui", "Abagai", "Yana", "Korte", "Bolat", "Chagun", "Alijin", "Unagen", "Sechen")) AS potential_brides INNER JOIN clans ON potential_brides.clan_name = clans.name WHERE clans.tier = (SELECT MAX(tier) FROM clans WHERE kingdom_name = (SELECT kingdom_name FROM clans WHERE name="Oburit"))
On the other hand, this is clearly far from the optimal way to write such a query. But thing is - it works, and if there's no way to get it to write more performant queries, the problem can be "solved" by throwing more hardware at it.

So, yes, I think you're right. The more code out there will be written by AI, the more it will look like this - working, but suboptimal and harder to debug.

I'm always baffled that people complain that the code provided is not 'performant enough' or 'is too verbose', etc. It's usually providing a solution that is the most typical solution given by all programmers - but the beautiful thing about it is - you can ask it to adjust the code to match a given constraint. Just like your colleague. Only usually far, far better honestly - because you get a response in about 3 seconds, and iterate to the answer in about a total of t minutes, rather than receiving something (maybe it's good, maybe it's entirely missing the constraints) .. in 4 days.
Is there something in particular that leads you to that belief?