Live data from Hacker News

LLMs work best when the user defines their acceptance criteria first

blog.katanaquant.com

201–210 of 460 posts

Re: LLMs work best when the user defines their acceptance criteria first

#201

Earlier quoted context omitted.

And it’s slower to review because you didn’t do the hard part of understanding the code as it was being written.

You're holding it wrong. Set the boundaries and guidelines before it starts working. Don't leave it space to do things you don't understand. ie: enforce conventions, set specific and measurable/verifiable goals, define skeletons of the resulting solutions if you want/can. To give an example. I do a lot of image similarity stuff and I wanted to test the Redis VectorSet stuff when it was still in beta and the PHP exten…

So in my experience with Opus 4.6 evaluating it in an existing code base has gone like this.

You say "Do this thing".

- It does the thing (takes 15 min). Looks incredibly fast. I couldn't code that fast. It's inhuman. So far all the fantastical claims hold up.

But still. You ask "Did you do the thing?"

- it says oops I forgot to do that sub-thing. (+5m)

- it fixes the sub-thing (+10m)

You say is the change well integrated with the system?

- It says not really, let me rehash this a bit. (+5m)

- It irons out the wrinkles (+10m)

You say does this follow best engineering practices, is it good code, something we can be proud of?

- It says not really, here are some improvements. (+5m)

- It implements the best practices (+15m)

You say to look carefully at the change set and see if it can spot any potential bugs or issues.

- It says oh, I've introduced a race condition at line 35 in file foo and an null correctness bug at line 180 of file bar. Fixing. (+15m)

You ask if there's test coverage for these latest fixes?

- It says "i forgor" and adds them. (+15m)

Now the change set has shrunk a bit and is superficially looking good. Still, you must read the code line by line, and with an experienced eye will still find weird stuff happening in several of the functions, there's redundant operations, resources aren't always freed up. (60m)

You ask why it's implemented in such a roundabout way and how it intends for the resources to be freed up?

- It says "you're absolutely right" and rewrites the functions. (+15m)

You ask if there's test coverage for these latest fixes?

- It says "i forgor" and adds them. (+15m)

Now the 15 minutes of amazingly fast AI code gen has ballooned into taking most of the afternoon.

Telling Claude to be diligent, not write bugs, or to write high quality code flat out does not work. And even if such prompting can reduce the odds of omissions or lapses, you still always always always have to check the output. It can not find all the bugs and mistakes on its own. If there are bugs in its training data, you can assume there will be bugs in its output.

(You can make it run through much of this Socratic checklist on its own, but this doesn't really save wall clock time, and doesn't remove the need for manual checking.)

Re: LLMs work best when the user defines their acceptance criteria first

#202

Earlier quoted context omitted.

This is why I'm confused when people say it isn't ready to replace most of the programmer workforce.

LLM code is higher quality than any codes I have seen in my 20 years in F500. So yeah you need to "guide" it, and ensure that it will not bypass all the security guidance for ex...But at least you are in control, although the cognitive load is much higher as well than just "blind trust of what is delivered". But I can see the carnage with offshoring+LLM, or "most employees", including so call software engineer + LLM.

Huh, that explains a lot about the F500, and their buzzword slogans like "culture of excellence".

LLM code is still mostly absurdly bad, unless you tell it in painstaking detail what to do and what to avoid, and never ask it to do a bigger job at a time than a single function or very small class.

Edit: I'll admit though that the detailed explanation is often still much less work than typing everything yourself. But it is a showstopper for autonomous "agentic coding".

Re: LLMs work best when the user defines their acceptance criteria first

#203
post #36

Their default solution is to keep digging. It has a compounding effect of generating more and more code. If they implement something with a not-so-great approach, they'll keep adding workarounds or redundant code every time they run into limitations later. If you tell them the code is slow, they'll try to add optimized fast paths (more code), specialized routines (more code), custom data structures (even more code).…

Yes, this is exactly the experience I have had with LLMs as a non-programmer trying to make code. When it gets too deep into the weeds I have to ask it to get back a few steps.

Re: LLMs work best when the user defines their acceptance criteria first

#204
post #165

Earlier quoted context omitted.

Not trying to be snarky, with all due respect... this is a skill issue. It's a tool. It's a wildly effective and capable tool. I don't know how or why I have such a wildly different experience than so many that describe their experiences in a similar manner... but... nearly every time I come to the same conclusion that the input determines the output. > If they implement something with a not-so-great approach, they'l…

I absolutely tell a coworker their code is slow and expect them to fix it…

I too tell my boss to promote me and expect him to do so.

Re: LLMs work best when the user defines their acceptance criteria first

#205
post #178

Earlier quoted context omitted.

Yeah if my co-worker can't start figuring out why the code is slow, with a reasonable reference to what the code in question is, that is a knock against their skills. I would actually expect some ideas as to what the problem is just off the top of their heads, but that the coding agent can't do that isn't a hit against it specifically, this is now a good part of what needs to be done differently. The suggestion to te…

As someone who leads a team of engineers, telling someone their code is slow is not nice, helpful or something a good team member should do. It’s like telling them there’s a bug and not explaining what the bug is. Code can be slow for infinite reasons, maybe the input you gave is never expected and it’s plenty fast otherwise. Or the other dev is not senior enough to know where problems may be. It can be you when I te…

>As someone who leads a team of engineers, telling someone their code is slow is not nice, helpful or something a good team member should do

right, I'm sure there are all sorts of scenarios where that is the case and probably the phrasing would be something like that seems slow, or it seems to be taking longer than expected or some other phrasing that is actually synonymous with the code is slow. On the other hand there are also people that you can say the code is slow to, and they won't worry about it.

>So no that’s not the proper way to talk to humans

In my experience there are lots of proper ways to talk to humans, and part of the propriety is involved with what your relationship with them is. so it may be the proper way to talk to a subset of humans, which is generally the only kinds of humans one talks to - a subset. I certainly have friends that I have worked to for a long time who can say "what the fuck were you thinking here" or all sorts of things that would not be nice if it came from other people but is in fact a signifier of our closeness that we can talk in such a way. Evidently you have never led a team with people who enjoyed that relationship between them, which I think is a shame.

Finally, I'll note that when I hear a generalized description of a form of interaction I tend to give what used to be called "the benefit of a doubt" and assume that, because of the vagaries of human language and the necessity of keeping things not a big long harangue as every communication must otherwise become in order to make sure all bases of potential speech are covered, that the generalized description may in fact cover all potential forms of polite interaction in that kind of interaction, otherwise I should have to spend an inordinate amount of my time lecturing people I don't know on what moral probity in communication requires.

But hey, to each their own.

on edit: "the what the fuck were you thinking here" quote is also an example of a generalized form of communication that would be rude coming from other people but was absolutely fine given the source, and not an exact quote despite the use of quotation marks in the example.

Re: LLMs work best when the user defines their acceptance criteria first

#206

Earlier quoted context omitted.

maybe there should be an LLM trained on a corpus of a deletions and cleanup of code.

I'm guessing there's a very strong prior to "just keep generating more tokens" as opposed to deleting code that needs to be overcome. Maybe this is done already but since every git project comes with its own history, you could take a notable open-source project (like LLVM) and then do RL training against against each individual patch committed.

right, it would have to a specialized tool that you used to do analysis of codebase every now and then, or parts that you thought should be cleaned up.

Obviously there is a just keep generating more tokens bias in software management, since so many developer metrics over the years do various lines of code style analysis on things.

But just as experience and managerial programs have over time developed to say this is a bad bias for ranking devs, it should be clear it is a bad bias for LLMs to have.

Re: LLMs work best when the user defines their acceptance criteria first

#207
post #36

Their default solution is to keep digging. It has a compounding effect of generating more and more code. If they implement something with a not-so-great approach, they'll keep adding workarounds or redundant code every time they run into limitations later. If you tell them the code is slow, they'll try to add optimized fast paths (more code), specialized routines (more code), custom data structures (even more code).…

I feel like there's two types of LLM users. Those that understand it's limitations, and those that ask it to solve a millennium problem on the first try.

Re: LLMs work best when the user defines their acceptance criteria first

#208
The following paragraph appears twice:

> Now 2 case studies are not proof. I hear you! When two projects from the same methodology show the same gap, the next step is to test whether similar effects appear in the broader population. The studies below use mixed methods to reduce our single-sample bias.

Re: LLMs work best when the user defines their acceptance criteria first

#209
post #198

Earlier quoted context omitted.

As far as I've ever heard, "le code" used in a codebase is uncountable, like "le café" you'd put in a cup, so we would still say "meilleur que tout le code que j'ai vu en 20 ans" and not "meilleur que tous les codes que j'ai vus en 20 ans". There is a countable "code" (just like "un café" is either a place, or a cup of coffee, or a type of coffee), and "un code" would be the one used as a password or secret, as in "j…

> As far as I've ever heard, "le code" used in a codebase is uncountable Now I can't get the Pulp Fuction dialog out of my head. - Do you know what they call code in France? - No - Le code

As an additional wrinkle, the word seems quite French in origin in this case.

Re: LLMs work best when the user defines their acceptance criteria first

#210

Earlier quoted context omitted.

It is not a tool. It is an oracle. It can be a tool, for specific niche problems: summarization, extraction, source-to-source translation -- if post-trained properly. But that isn't what y'all are doing, you're engaging in "replace all the meatsacks AGI ftw" nonsense.

If I was on the "replace all the meatsacks AGI ftw" team then I would have referred to it as an oracle, by your own logic, wouldn't I have? It's a tool. It's good for some things, not for others. Use the right tool for the job and know the job well enough to know which tools apply to which tasks. More than anything it's a learning tool. It's also wildly effective at writing code, too. But, man... the things that it m…

Oracles have their use too, but as long as you keep confusing "oracle" and "tool" you will get nowhere.

P.S. The real big deal is the democratization of oracles. Back in the day building an oracle was a megaproject accessible only to megacorps like Google. Today you can build one for nothing if you have a gaming GPU and use it for powering your kobold text adventure session.

Post reply on HN