logoalt Hacker News

Fr0styMatt88today at 7:40 AM0 repliesview on HN

I've found that LLMs are specifically bad at a certain kind of debugging, though I can't quite put my finger on what that is.

"Spot the bug in this code" when the code can be looked at and pattern-matched against bugginess is something they seem really good at.

Some parts of debugging, like "Here is this logfile, what do you think is going on?" are also surprisingly good.

It's that thing kind of in the middle -- I know it when I see it honestly is the best way I can put it into words. An example from recently, I'm receiving some bad data on a network message parser. Immediately I don't know whether it's a my-side or their-side thing, but I know if I try and just vaguely describe the behaviour to the LLM it will start churning tokens.

My current approach to problems like this is -- I need to tell the LLM what it needs to do to give itself the data it needs to solve the problem. My first reaction now isn't "It's not working, there's a bug, it's not doing X". It's "Okay, this isn't quite working properly; I need you to add some debug logging around X, Y and Z so we can figure this out". That tends to avoid spirals and get me out of the situation much more quickly.

The seeing eye dog analogy is pretty apt actually. I would love to see some transcripts from the author if they are able.

Edit to add: I think the 'thing' I'm alluding to might be -- if I have trouble expressing the buggy behaviour clearly in words, then I know it's probably going to be a fair few back-and-forths with the LLM to get something; the harder I find it to concisely describe, the more risk that it'll fall into a pit. Doubly so if I offer up a hypothesis which turns out to be wrong.