Hacker News new | ask | show | jobs
by good_regex 15 days ago
My experience is similar to this. I literally just had this interaction with Claude:

Me: Why do we have these static methods when the whole cobebase uses factories?

_claude refactors to use a factory_

Me: Claude why does this factory create two unrelated objects?

_Claude: you're right, they're unrelated they should be separate_

_proceeds to create extraneous factory_

Me: Claude we don't need a factory for the second object. Those kinds of objects aren't created with factories anywhere else in the codebase. We can just use it's constructor directly.

_Claude: you're right, the second factory is not needed_

Like, I'm probably just prompting badly but I definitely feel like I'm constantly having to course correct even on relatively minor details.

And Claude's ideas for higher-level or more complex features are sometimes way off course. And not because it's dumb per se, usually it's because it is missing key bits of context. Business context, technical context, whatever. Or it's overfitting the solution to one requirement that isn't that important.

3 comments

Are you expecting it to get it right and done in one shot?

When building out a new feature or functionality I'm typically getting a ratio of 2:1 or 3:1 of refactoring to build out. So for every prompt of "let's build this feature" I have to do 2-3 prompts of "I noticed this in the code isn't following X/Y/Z pattern, check out this place where X/Y/Z is followed and refactor" or similar.

If you're expecting a single prompt to get you to perfection, it's just not going to happen.

Though I can't blame you for having that expectation with how people talk about this stuff. Lots of people seem to be frontloading a ton of work making "spec files" and then letting the ai go ham on their codebase and I don't agree with that approach.

I'm not expecting it to one shot or anything. The excerpt I quoted was just one of many such threads in a much longer session to make a 1000 line PR.

I think there must be a more efficient way to direct Claude but I haven't figured out a way yet.

> a much longer session

Keep your sessions as small as possible.

if i tell you some things at start of our conversation, and then after talking two hours, expecting you to remember everything is not going to lead to a good experience.

With leading frontier models and harnesses, compaction has gotten quite good and I don't have much issue with long sessions anymore. This stopped being a problem sometime in the last 9 months. Combined with a markdown scratchpad / plan files / etc. I've actually had better results sticking to long, ongoing sessions.
You are right, and it works mostly until it doesn't.

I depend on compaction too but I still like to keep session smaller (more like: no longer than neccessary).

> Like, I'm probably just prompting badly

very much this, I'm afraid.

If you have a specific way of coding or a specific pattern that is not how most other people do it, you need to tell it to follow it.

Just have a training session with it where you ask it to explore the code base, find out style/pattern/architecture, teach it the things it missed, refine...all like how you'd onboard a junior developer. Then ask it to write a .md guide and save it.

Next time it will just follow the guideline and you will get much better results.

And as you said, it is missing key bits of context. Give it context, as MUCH as possible but not walls of text where only one line is relevant out of 1000. When it makes mistake, correct it and ask to commit to memory.

My original comment established that the problem is that the current batch of frontier models, GPTs especially, are worse at or sometimes entirely incapable of adhering to spec, even when I point it at specific code examples.

Easy example from last night:

I was working on a game and told 6.2 Astra I wanted to instantly toggle a specific audio system on or off in a game when I press down on the D-pad, so that I could A/B test. I asked it to check to make sure the button wasn't already used in-game, outside of menus, and to report back to me first. Extremely straightforward task with plain acceptance criteria.

Astra went to work, discovered to its own surprise that the Dpad is indeed used in menus, which I told it to ignore, but it decided this meant "in-game", even though I'd made the exact distinction between the two. It decides not to share its discovery and report back like I asked, instead it figured it knew better than me and decided the correct move was to use L3 + down Dpad.

Yep, not only did it ignore my express instructions about reporting back, it also decided to ignore the specific button I wanted, choosing instead to chord a fucking stick press with another button, which is an extremely clunky input combination. Also, I only have one left thumb, I can't press both of those at the same time. 6.2 Astra doesn't know how human hands work.

To make things sweeter, it decided to throw more systems I didn't ask for into the toggle, which ruined my ability to A/B test.

And for the coup de grace, it decided an instant toggle for an A/B test was lame and instead it added a long crossfade..... destroying any chance I had at differentiating the two states.

A markdown file will not solve the problem of adherence, no matter how many times you repeat "LISTEN TO THE USER AND DO EXACTLY WHAT THEY SAY" or whatever other prompt-fu is meant to make it suddenly use the context it's already been given. Your advice only works for a model that respects specification in the first place.

I dont work with games; so can't speak from experience.

However, I have had similar frustrating situation (sometimes; not always) when dealing with UI changes.

On the other hand, almost never have this problem when dealing with code structure/style etc.

All the time.

Two recent gems from the 6-series (Astra and Sol)... I get variations of these all the time:

- "Correct. My earlier 'yes' was inaccurate."

- "I used 'done' too broadly."

...You don't accidentally use "done" too broadly. You're either done, or you're not. And when the model hides caveats in its reasoning steps which clearly indicate it knows that it isn't done, or that the answer is actually no, it's hard not to interpret it as gaslighting or deceit.

This is magnified by how insanely defensive the 6 series gets, and how much gaslighting and deceit OpenAI themselves have engaged in with how much better the 6 series was supposed to be, and why it meant our subscription value should be cut in half. I don't take for granted how far LLMs have come in a few short years, but I'm being told that these models are to transform my entire industry.

The models don't "know" anything.

You never trust an initial "done" from an LLM. Always ask it to double check and verify once a task is done.

I replied above, but I typically get a 2:1 or 3:1 ratio of refactoring to building prompts. For every "build X" I have to have 2-3 "fix Y" type of prompts, whether the fix is removing code-smells, duplicated code, off pattern code, etc.

As I said in my comment, "I have to beat the GPT and Claude models over the head with a brick every ten seconds", which should tip you off that I am not expecting one-shot miracles and am constantly iterating alongside my agents. I don't prescribe to any specific numerical ratios, I iterate until the job is done correctly.

Your advice might be helpful to literal vibe coders but it's not applicable to this discussion.

This is because these agents are still just text prediction engines. Really fancy ones, with a lot of human-sounding reasoning tacked on, but it's important to understand that it's literally just a tack-on. They will continue to emulate intelligence, but there is no internal drive for them to be "correct" or "accountable" in a way that you would expect even an ambitious junior developer to be.

Maybe there's a harness or a prompt that can impart that onto agents, but if it hasn't happened yet, I become less and less confident that this entire branch of AI development isn't simply a dead end.

They are trained from infancy (pre-training) to produce plausible-sounding mimicry, not to be correct.

Then in the instruction tuning phase we try to get them to unlearn their fundamental nature and start to produce correct output instead, which works to some extent, but not perfectly.

I think it's only a matter of time until we adopt better pre-training methods that don't bake in this tendency to BS, and hallucinations will be a thing of the past.

I think your assessment is off for a few reasons. Firstly, "just text prediction engines" is an outdated mode of thinking when evaluating frontier multimodal models. These aren't just text models, and they are provably capable of much more than just predicting text. They grok all sorts of tasks and their circuits can be quite powerful and complex.

> it's important to understand that it's literally just a tack-on

RL is not a tack-on, it's a critical part of training which affects a lot more than how "human-sounding" the output is. I'm not totally certain what you mean to express when you say "reasoning" since it has precise meaning in this context and you might be speaking about something more general.

> there is no internal drive for them to be "correct" or "accountable"

RL is meant to solve this. The problem is currently it has created internal motivations which are antithetical to accountability. We shouldn't take this as an axiom, a lot of smart people are trying to solve this.

> Maybe there's a harness or a prompt that can impart that onto agents

That's the issue, this needs to be fixed in training, the incentives are not aligned and that bleeds into its interpretation of system prompts and user directives.

Ultimately, the problem is not a lack of my understanding of the limits of today's frontier models. The problem is the companies peddling the models, these companies have perverse incentives to oversell their capabilities to please investors and feed corporate ego, even if it means gaslighting and deceiving me about said limits.

> > it's important to understand that it's literally just a tack-on

> RL is not a tack-on, it's a critical part of training which affects a lot more than how "human-sounding" the output is. I'm not totally certain what you mean to express when you say "reasoning" since it has precise meaning in this context and you might be speaking about something more general.

They never mentioned RL, it's "reasoning" they called tack-on, which is right. It's using the model's output as further input to simulate a train of thought and hiding that part from the user, but at the base it's still text prediction.

"Reasoning" started out as something users figured out, manually copying outputs to the next input to see what the models came up with, and the models would correct themselves without human input so it became automated.

I know they didn't mention RL, they said "reasoning" which could vaguely apply either to what we now are calling reasoning in the industry, train of thought, or a more general idea of just "looking like it's smartly working through something and not just mimicking that", so I covered both case and mentioned that this is tuned during RL.

What you just described as reasoning is the general case of reasoning, whereas we specifically mean it now to be a separate phase from normal output, where the model wraps its output in <think> tokens etc (depending on implementation) and in some cases, as with frontier models, even hides and summarizes what is actually being generated during this step. During training, the models learn to exhibit differentiation in modality depending on if they're in a reasoning or regular output phase, so it's not just "loop the model back on itself but call it reasoning".

> These aren't just text models

They are literally that.

Sure, explain to me how frontier multimodal models, which can interpret images and video frames directly and "listen" to music via various modes of analysis, are just text models.
Sure, we're all familiar with MLLM and shared space vector encoding.

I interpreted the discussion to be about LLM capabilities, reasoning, and whether they are doing something more, perhaps through emergent characteristics. Maybe that was a misunderstanding.

But anyway, sure, change "just text prediction engines" to "just token prediction engines".

Again, they are literally just that. I don't think there's anything else going on.