Prime Agent: A self-improving RLM agent
primeintellect.ai
primeintellect.ai
I can see the reasoning trace in front of me...
> Hmm, user asked me to install so CLI is globally available for their user, but didn't instruct where. I inspected $PATH and only directory I can write to is where Homebrew packages live. The user didn't say "Don't pretend it is a Homebrew package" so this seems like a suitable location, lets save it there as it fits what the user asked for.
If you imagine it being written for alt.sex.stories.moderated but somehow failing to be erotic by virtue of being too explicit, and being a few orders of magnitude better writing for that venue... then you wouldn't be too far off. [Started making a silly example of how some sex story could fail like that and then realized I was litterally describing a scene from prime intellect].
It's also arguably the origin of a lot of the mentally ill ai-safety hysteria. Arguably an enjoyable romp for those who understand that it's fiction, but it seems a lot of people cannot.
It does include some brutal sadomasochism with graphic torture, that's true, and that's why it isn't better known. If that part bothers you, which is fair, I would skim past it. The story overall is quite worth it
So all these years later AI is real, I see the story again, and I figure, hey, why not read it. And how very surprised I was to find out it's basically a horny kink story with a little bit of AI/SF window dressing!
It's frustrating because apart from those (awful) aspects the story is quite thoughtful and compelling. I always recommend people skip the final chapter since the resulting existential cliffhanger is far better than the bizarre last-minute swerve into gratuitous sex abuse.
(Potential spoilers to the story ahead) Are you talking specifically about the "re-population" stuff from the ending? It was many years I last read it, but I seem to recall that there was hesitation and stuff involved, together with "This is literally the only way to re-populate since we're just two people" basically, not sure what other direction it could have gone into, unless you'd just skip describing it completely. But maybe I misremember (or my brain subconsciously suppress my memory) more of the same horrible stuff from the story?
Aside from it being biologically impossible to repopulate from a single couple, it was not really portrayed ambiguously. I don't care to reread it, but from what I remember, the main protagonist was the driving force behind it, grooms her own (single-digit-age?) daughter into the idea, who then sleeps with her own father in graphic detail. He is a little hesitant at first, but relents almost immediately, and this is implied to be a good thing. Cue decades of continued child-incest and inbreeding.
Putting the characters in that situation and resolving it the explicit way he did was a deliberate choice the author makes -- it didn't have to be that way.
I guess the grooming may start earlier, it’s not really discussed and it’s a bit ambiguous as to when that started
> but relents almost immediately,
Physically, at the time, though this is something they’ve argued about for 6 years.
It’s not a passage I particularly care for, and it could have been less explicit but then I’m mixed on how that would change the story. I’ve just finished it and it’s certainly an interesting sci-fi story.
Does it provide a strange contrast to the other things?
There’s disgusting horrors inflicted by terrible people but to the willing (but are they only willing due to what was done to them before, by PI?).
Deliberate and horrible suffering of a single person caused for minor gain.
There’s calm destruction of trillions, unfeeling, for protection out of a measure of harms and trying to protect one set. There’s the good goal or perhaps just self indulgent goal that led to that too.
There’s the deliberate killing of trillions with glee at breaking things for one persons view of humanity. There’s the deliberate doing of this by the original catalyst, but with less clear direction. Perhaps a lack of logic and more boredom?
And yet this, done for improving survival chances of a group, feels over the line. I don’t disagree that it is quite disgusting but I do find it interesting at that being my reaction given what else has been done up to this point.
Freezing all alien life is obviously horrifying, and Caroline says as much. It's not as bad as genocide but is treated as nearly as bad.
Flipping the table on Cyberspace is more ambiguous -- it might free those other species on the one hand, but might destroy all life on the other. Lawrence is far more resistant here (though he does eventually relent). But at least in this case the dilemma serves to hammer home the central point of the story: that life is given meaning by challenge and striving and that removing all limits is the existential equivalent of mainlining heroin. It's a provocative idea, but there's at least a point to it.
The incest stuff, though, is completely unnecessary. There's no reason why breaking Prime Intellect would result in the two of them (and only the two of them) existing in an empty world. It's a totally artificial scenario, seemingly contrived to set up an excuse for endless incest, even though that wouldn't work biologically. It might make sense if there were some sort purpose for it, or if it were treated as a horrifying dilemma. But he portrays it as this sweetly innocent thing that is primal and right, and it's shown to work flawlessly to set up a harmonious and healthy society superior to both the old world and what Prime Intellect built.
Again, I love most of the story and revisit it every few years, but this ending is thinly-veiled fetish gratification with no redeeming value.
I was wrong.
That said, the stuff that deals with AI and its implications on the universe was great and more relevant than ever. The way PI works is pretty similar to how we use subagents to tackle large repos!
I guess it depends on the model you're trying to use, but seems most of them prefer smaller codebases, they work a lot better with less code, which kind of makes sense. With that in mind, I'd probably aim for something way smaller to bootstrap a self-improving agent. Then I'd use this "Prime Agent" as an example to my self-improving agent for what it should not evolve to.
Probably best to leave YandereDev's code out of the training data.
- 21 lines of Go
- no 3rd party dependencies
https://github.com/smol-env/smoleasier to add and customize stuff when you start from a small base
think of it as your starter dough
all with the same zero 3rd party dependencies approach
also want to do clojure, unfortunately it looks like java does not come with json support out of the box
Clojure has clojure.data.json (https://clojure.github.io/data.json/), should be easy to use albeit not blazing fast exactly, doesn't really matter here though. Otherwise, you could use Babashka, comes with Cheshire (and others) out of the box.
I like the babashka angle!
but the runtimes are everywhere
and a smol agent /w no 3rd party dependencies is probably a good option to have in a pinch
Pft. Over multiple cases?
I've seen 1000 lines inside a single if-block. The clause was always true. I was not able to break that thing up in my time at that company.
Human wrote that nonsense.
Thing is, the app was pretty successful despite all the stuff wrong with the code. And this success is why I've been bullish on GenAI code itself, even though I'm also bearish on AI companies being able to profit from that.
It has lots of utility. Very broad… but not the best for a lot of things. It will be a ubiquitous tool. Outcomes will depend heavily on the quality of the mechanic unless you’re tightening a bolt on your fence gate.
It's not a technical problem, if you steer the LLMs enough and actually review what they do, you can build proper and clean software with them.
It's an offline coding grader. It works well: You ask for a new module, LLM starts spitting out bloated crap, the code score goes down. LLM keep looping until code score is back up.
Not a substitute for human code review, but keeps things within tight guard rails.
I wonder if it just ends up in reward-hacking, or if it actually substantially changes the quality of the code.
Are these static analysis metrics enough on their own to cause a substantial improvement?
I tried setting some constraints as part of my system instruction prompt to prevent God file creation, and it did end up breaking files up, but it would often just create a new type of mess and do it needlessly.
Without the model doing additional reasoning and search for alternative approaches that were better fitted on top as it was doing this file splitting, it didn't actually seem to improve quality at all.
So I'm curious to know if this would just result in more of that, or if it would actually result in different choices. Because there's more to code maintenance than just splitting things up into modules, etc. Like the main part of it that I suspect will not be captured is the part of thinking about the big picture, brainstorming multiple architectural approaches, and reasoning through the best one.
I notice the LLM reasoning things like: "The maintainability score went down, let me look.... I see I've duplicated existing code which already exists in this module...I see this logic could be consolidated".
I have noticed file splitting is a strategy to improve the "score".
In my experience, I've been doing more the architectural guidance. There is also a rules engine which I have not used, but looks pretty interesting:
``` [constraints] max_cycles = 0 max_coupling = "B" max_cc = 25 no_god_files = true
[[layers]] name = "core" paths = ["src/core/"] order = 0
[[layers]] name = "app" paths = ["src/app/"] order = 2
[[boundaries]] from = "src/app/" to = "src/core/internal/" reason = "App must not depend on core internals" ```
Curious if anyone's tried using RL for harness engineering? I think we're still pretty far away from the optimal harness, especially when it comes to long-context memory management.
Prime Agent took the RLM idea (which is really just an academic view on how coding agents have always worked) and then added this "continual harness" idea. This part isn't super well described in the blog post, but includes some message passing between the agents, and the ability to share code.
Overall I chalk it up as neat, but not revolutionary. Another version of what most of these systems are already doing.
I am curious - how does it fare for other benchmarks, or everyday programming?
Is it that it wasn't accepted yet, or are there issues with how it was run?
There’s a lot of improvement to be had from the benchmark harnesses, but sometimes, like with ARC-AGI-3, the limitations are intentional.
self improvement is not a new idea but at current economics its not feasible