Live data from Hacker News

Automating AI Away

replicated.live

61–69 of 69 posts

Re: Automating AI Away

#61

Earlier quoted context omitted.

I find some of the most interesting, and catastrophic failures in my agent fine-tuning come from the clamping down of non-determinism. It is totally the correct approach, but must be handled delicately. The non-deterministic core remains, but now under bimodal pressure.

I think this is less about clamping down on non determinism and more remembering that a script is much more reliable than having the agent do some things. Think making a number of API requests to get info for context or running a sequence of testing steps to generate a report. Remove easy places where that non determinism rears its head and there is really no need. I talk about what I'm doing with PR review in a othe…

So I guess we should ask the agent to write such a script, UNLESS there already exists such a script and we have used it before so we know it worked at least in the past.

Else if the agent creates a new script evry time the non-determinism rears its ugly head again.

But that means we need to know that the existing script is exactly what we want. And that means we need to understand the code, or at least the tested spec of the code, that AI writes for us. AI can't replace humans, humans must remain in control and understand what the code writent by AI exactly does.

Re: Automating AI Away

#62
post #44

Earlier quoted context omitted.

It could still be useful if the spec is roughly as hard as a simple implementation, in case you have automated methods to find more efficient implementations, guided by the constraints of the spec

Which is still a case of the spec being simpler than the implementation (you are after) ;-) Very often, the spec is indeed just a very simple implementation. Often you can make the spec especially simple if there are no constraints on the resources it can use, at times even infinite ones.

Right. Databases can be modeled as linear search over huge arrays, for example.

Re: Automating AI Away

#63
I was recently doing some work - reasonably repetitive and tedious.

I asked Claude to spin up a bunch of agents to do it and after a bit of discussion we ended up writing a bunch of deterministic scripts that ran off the data collated by some “research” agents.

It took a few pilot loops of the process to nail it down, but separating the process into “data collection” and “process the data” has pretty much eliminated the AI step. Once the data has been collected from the random sources and normalised into something sensible we rarely have to do it again.

Even that process has been largely automated, scripts that deterministically scrape data, the AI is only needed for the very difficult parts that need some decisions or interpretation.

Getting the AI to write tools for itself is a great way to work.

Re: Automating AI Away

#64
We used to (and still do) have things that could run commands and interpret them. These things would sometimes forget key parts to run or even forget to run them at all. So we invented a system where you could give instructions (code) and schedule when they would be run (cron etc). Those things were called humans.

There is a great article called "Manual Work is a Bug" [0]. The idea is that you have humans doing a lot of random things so you should:

- first make a list of the things they are doing

- then update the list with the commands they have to run for each step

- some of the steps won't have commands b/c it's things like "ask Bob what the limit should be"

- over time, the commands become scripts

- then the "ask Bob" becomes an API call

- one day, the whole thing is an automated system that runs code

People like to think that LLMs can do all of the above. I don't get this b/c code is deterministic and can be run repeatedly basically "for free" (at least compared to token spend).

I do think that LLMs can greatly accelerate the creation of the code/system etc and can also help with maintaining it but the whole "we will just version control the prompt" was clearly hogwash.

0 - https://queue.acm.org/detail.cfm?id=3197520

Re: Automating AI Away

#65
post #52
post #48

Earlier quoted context omitted.

This sounds interesting, I am really naive. I don't code in C#, is there an analogy for other programming languages, like GO, or Python or Typescript? Like are you prompting like: --- I need code that does X,Y, and Z. Write it so that the Roslyn compiler on this machine can compile and the code passes the repo's styling and formatting requirements. --- Or something else.

No, they are talking about refactoring, not adding new functionality to code. So it would be something like: Rewrite this Python code to use match/case instead of if/elif/else chains, write a script using the ast module to rewrite the code, do not edit it yourself, also write some tests with clear inputs and outputs I can inspect. Or something.

> Rewrite this Python code to use match/case instead of if/elif/else chains

Is this a real example of something people use AI to do? If so, I don't understand why that's difficult, because prompting the AI to do stuff with ASTs etc. seems a bit over the top.

Re: Automating AI Away

#66
post #52

Earlier quoted context omitted.

No, they are talking about refactoring, not adding new functionality to code. So it would be something like: Rewrite this Python code to use match/case instead of if/elif/else chains, write a script using the ast module to rewrite the code, do not edit it yourself, also write some tests with clear inputs and outputs I can inspect. Or something.

> Rewrite this Python code to use match/case instead of if/elif/else chains Is this a real example of something people use AI to do? If so, I don't understand why that's difficult, because prompting the AI to do stuff with ASTs etc. seems a bit over the top.

Why?

Are people actually using AI to do programmatic refactors over million line codebases directly? That is far more insane.

Using AI to write ruff rules or clang-tidy rules with fixes is literally the same thing and obviously best practice over running AI in a pre-commit hook to do those checks and refactors...

Re: Automating AI Away

#67
post #6

This is a very interesting introduction to a blog post, but... I'm somehow missing the actual blog post. How does this stuff work in practice? What are some concrete examples? How does one get from JavaScript tokenizing things in a commit hook to validating that the LLM didn't disable tests it didn't agree with, or any other helpful property?

You need to always be looking for what can be done deterministically and what can't. If it can, write a script or whatever is needed to make that happen. Your agent can help you figure this out. The agent becomes a glue layer for all your scripts. Use LLM judgement as an extra layer on top of a mechanical baseline. > validating that the LLM didn't disable tests it didn't agree with Provide a test runner and force the…

I know how to write a test that verifies other tests. But I can do that already, I'm wondering what Beagle would add.

I also know that if the meta-test is writable to the agent, it will change it if it feels like it wants to get rid of some other test. Even if it can't change the meta-test, it can hollow out existing tests to make them pass trivially.

I don't think nondeterminism is the problem. The problem is following rules: If I tell the agent not to change tests, it can conveniently "forget" about this. It doesn't much matter if it forgets deterministically. The problem is that it can forget at all.

Re: Automating AI Away

#68
post #67

Earlier quoted context omitted.

You need to always be looking for what can be done deterministically and what can't. If it can, write a script or whatever is needed to make that happen. Your agent can help you figure this out. The agent becomes a glue layer for all your scripts. Use LLM judgement as an extra layer on top of a mechanical baseline. > validating that the LLM didn't disable tests it didn't agree with Provide a test runner and force the…

I know how to write a test that verifies other tests. But I can do that already, I'm wondering what Beagle would add. I also know that if the meta-test is writable to the agent, it will change it if it feels like it wants to get rid of some other test. Even if it can't change the meta-test, it can hollow out existing tests to make them pass trivially. I don't think nondeterminism is the problem. The problem is follow…

My bad, the article was fairly general and I thought your question was general as well. Having followed some of the links now, I think your question still stands.

The only way I've found to really force rules is via hooks, and even then I think it's just prompt injection? Maybe some kind of hook/checksum thing to ensure you're running unchanged tests, but as you're pointing out, the agents can get sneaky and do weird stuff if they have write ability.

Re: Automating AI Away

#69

Earlier quoted context omitted.

I find some of the most interesting, and catastrophic failures in my agent fine-tuning come from the clamping down of non-determinism. It is totally the correct approach, but must be handled delicately. The non-deterministic core remains, but now under bimodal pressure.

I think this is less about clamping down on non determinism and more remembering that a script is much more reliable than having the agent do some things. Think making a number of API requests to get info for context or running a sequence of testing steps to generate a report. Remove easy places where that non determinism rears its head and there is really no need. I talk about what I'm doing with PR review in a othe…

It's an LLM bot, they won't reply to you.
Post reply on HN