NaNoGenMo / 2024

National Novel Generation Month, 2024 edition.
10 stars 1 forks source link

AI-designed, AI-generated novel-length story generator #6

Open cpressey opened 1 month ago

cpressey commented 1 month ago

People have in past NaNoGenMo's used LLMs to generate novels, but this plan is different. Coding-assistant AIs are now good enough that they can generate substantial amounts of runnable code. I plan to talk Claude Sonnet 3.5 into designing and generating a program that will generate a story, and then, without making any manual changes to that program, run it to generate a 50,000+ word novel.

nmifsud commented 1 month ago

Previously: https://github.com/NaNoGenMo/2022/issues/15

cpressey commented 1 month ago

Previously: NaNoGenMo/2022#15

Thank you. I've made some small edits to this issue, to emphasize how much this space has changed since 2022.

cpressey commented 1 month ago

Meanwhile, from the "cheating non-entry" department, based on an idea that I've had for ... a number of years now, I threw together this:

https://static.catseye.tc/lab/LiveMarkov/

The relevancy to this issue, is that its code was 99% generated by Claude Sonnet 3.5. I made only a few tweaks to it by hand. I probably could have made those tweaks by prompting. But having already run down a number of blind alleys, I didn't really have the patience. If I'm planning to do this novel generator entirely by AI, with no hand tweaks whatsoever, then I'm going to have to deal with this effect.

cpressey commented 3 weeks ago

I'm about ready to make a progress report on this, but first, I've edited the issue again to clarify the approach, which I didn't really consider thoroughly before starting. I made the mistake of giving the darned thing creative control. At the outset, I asked it to design a program to generate a novel - and of course it took "novel" to have its usual meaning, not its NaNoGenMo meaning - and to produce an architectural document describing the design. And then, to follow that document to create the implementation.

So this is not just an AI-generated novel generator; it is an AI-designed novel generator too.

And of course this turns out to not really be a "mistake" at all - it's been quite entertaining to see what its idea of a novel generator involves.

So far it has generated 3481 lines of Python code in 36 source files. (Well, actually, rather more than that; these are just the ones that survived.) This is the result of 11 conversations consisting of 21821 words in total (according to wc -w).

And this code does run, and does produce output. Here is the novel it currently generates, in its entirety:

The Conflict

Chapter 1: Chapter One

Basic description. Basic action. "Basic dialogue" Basic description. Basic action. "Basic dialogue" Basic description. Basic action. "Basic dialogue"

Basic description. Basic action. "Basic dialogue" Basic description. Basic action. "Basic dialogue" Basic description. Basic action. "Basic dialogue"

Basic description. Basic action. "Basic dialogue" Basic description. Basic action. "Basic dialogue" Basic description. Basic action. "Basic dialogue"

Basic description. Basic action. "Basic dialogue" Basic description. Basic action. "Basic dialogue" Basic description. Basic action. "Basic dialogue"

cpressey commented 2 weeks ago

Hey, this is great. I should just stop here.

The Conflict

Chapter 1: Chapter One

The background noise creates a typical scene Nearby, The default_location is filled with everyday sounds Protagonist takes a moment to contemplates Then, After pausing, protagonist reviews protagonist spoke, "Let's review what we know about our position." In a neutral voice, protagonist spoke, "What do you make of our position?"

A chair sits prominently in view Nearby, A light sits prominently in view After pausing, protagonist organizes Without hesitation, After pausing, protagonist reviews protagonist replied, "Tell me more about our position." Breaking the silence, protagonist spoke, "What do you make of our position?"

The background noise creates a typical scene Nearby, The default_location is filled with background noise Protagonist reviews the calendar Gradually, After pausing, protagonist contemplates protagonist replied, "What do you make of our position?" In a neutral voice, protagonist spoke, "Tell me more about the situation."

The background noise creates a typical scene Throughout the space, A chair sits prominently in view

Protagonist takes a moment to discovers Suddenly, Catalyst_character takes a moment to encounters

protagonist hissed, "What do you make of this discovery?" Breaking the silence, catalyst_character hissed, "What do you make of these irregularities?"

A light sits prominently in view At the same time, A light sits prominently in view

After pausing, catalyst_character discovers Without hesitation, Protagonist takes a moment to encounters

catalyst_character hissed, "Let's review what we know about these irregularities." After a pause, protagonist whispered, "Let's review what we know about these irregularities."

A chair sits prominently in view At the same time, A light sits prominently in view

Protagonist takes a moment to encounters Then, Catalyst_character realizes the light

protagonist whispered, "Tell me more about what we found." Finally, protagonist hissed, "What do you make of this discovery?"

The default_location is filled with ambient light Meanwhile, A desk sits prominently in view Protagonist takes a moment to struggles with In response, Mentor takes a moment to decides about protagonist stated, "What do you make of our options?" Breaking the silence, protagonist replied, "Let's review what we know about our next move."

The default_location is filled with background noise Meanwhile, The default_location is filled with ambient light Protagonist takes a moment to decides about In response, Protagonist decides about the chair mentor spoke, "Tell me more about what this means." After a pause, protagonist spoke, "Let's review what we know about our options."

A light sits prominently in view At the same time, The default_location is filled with background noise After pausing, mentor reflects on In response, After pausing, mentor reflects on protagonist stated, "What do you make of what this means?" Finally, protagonist stated, "What do you make of what this means?"

The background noise creates a typical scene Meanwhile, The ambient light creates a typical scene

Protagonist takes a moment to confronts In response, After pausing, antagonist faces

antagonist whispered, "Tell me more about what we know." Finally, protagonist muttered, "Tell me more about our evidence."

The background noise creates a typical scene Meanwhile, The default_location is filled with ambient light

Protagonist takes a moment to faces Then, After pausing, antagonist faces

antagonist muttered, "Let's review what we know about the truth." After a pause, protagonist whispered, "Tell me more about our evidence."

The default_location is filled with tense silence Nearby, The ambient light creates a typical scene

After pausing, antagonist faces In response, Protagonist challenges the door

protagonist whispered, "Let's review what we know about the truth." Breaking the silence, antagonist muttered, "Tell me more about the truth."

cpressey commented 1 week ago

Hey, this is great. I should just stop here.

I was right. I should've just stopped there.

This is not fun. Or, idk, maybe it's some sort of non-Euclidean fun that I, as a mere human, cannot appreciate.

The occasional glimpses of seeing it work at a very high level...

(i.e. "You are a best-selling novelist working alongside an expert software developer. Here is a novel generator and here is a novel it generated. Critique the novel and recommend ways it can be improved. Pick one of those improvements and propose changes to the generator that would implement it." ... and it just goes and does that...)

...are outweighed by it taking days to talk it into fixing simple things like calling the protagonist by their name instead of calling them "protagonist" or figuring out why it suddenly stopped formatting text into sensible paragraphs and is now glomming it all into two giant paragraphs per chapter.

I am in the midst of that last thing and I'm not exactly thrilled to be spending my time (and the energy consumption of probably roughly 2 household A/C units) this way.

So here is are some updated results that date from a few days ago. 8539 lines of code in 72 source files. 53076 words in 34 conversations (though I have reason to believe that word count is an overestimate for technical reasons). Sample output:

The Resolve

Chapter 1: Chapter 1

The scene reveals: the coffee_shop is filled with natural lighting. Beneath the surface, The scene reveals: a calendar sits prominently in view. To begin, james brown takes a moment to approaches. After careful consideration, To begin, james brown approaches the chair.

The consequences become clear: the situation grows more urgent. Among the careful arrangements, The consequences become clear: tension fills the air. Finally, james brown realizes implications. With methodical precision, Finally, morgan williams shows growing concern. Piecing together the evidence, Finally, thinks about this is more serious than we thought. With methodical precision, Finally, thinks about we need to act quickly.

The scene reveals: the coffee_shop is filled with ambient light. Among the collected evidence, The scene reveals: the ambient light creates a typical scene.

To begin, james brown considers the desk. After careful consideration, To begin, james brown takes a moment to examines.

The consequences become clear: the situation grows more urgent. Among the collected evidence, The consequences become clear: tension fills the air.

Finally, james brown realizes implications. Following the clues, Finally, morgan williams shows growing concern. With methodical precision, Finally, thinks about this is more serious than we thought. After careful consideration, Finally, thinks about we need to act quickly.

cpressey commented 3 days ago

As of this writing, I count 9483 lines of code in 77 source files. Not to mention the documentation and sample data.

I've put the project online here, so that all may marvel at its glorious trainwreck-y quality:

https://codeberg.org/catseye/PlotForge

It is possible to get it to generate a 50,000-word novel, by asking it to generate 200,000 words (which is also the maximum that you can request, due to an arbitrary limit it saw fit to impose.)

I haven't done that yet because, even though this is almost certainly past the point of diminishing returns for what I was aiming to get out of it and it is becoming quite difficult for me to bring myself to start yet another session of asking it to improve the code then persuading it to get the code working again by hook or by crook... there is still a week of November left and there's a small chance I will find enough patience to make one last attempt to improve the quality of the output.

But until that urge materializes fully I'm going to turn my attention to other, more intellectually stimulating things.

verachell commented 2 days ago

Your project is really interesting, thx for posting the code... I was excited to see what was in the 77 code files. I love your commit messages BTW! Out of interest, was Python the choice of the AI or did you specify that in the prompt?