An approach to instruct-based Storytelling with mainstream commercial LLMs
06/11/23
This Guide is a WIP. It targets mostly Claude/ClaudeInstant by Anthropic and GPT4 by OpenAI, but in general should also work with GPT-3.5. It has not been tested with LLaMA-based models or other upcoming instruct-trained models as of time of this writing, feel free to do so and provide Feedback! In my opinion, there is a lot of untapped potential for story writing in these models and besides availability and cost issues, they're probably mostly overlooked by many because of their seemingly poor performance with more direct approaches. It is possible to get good writing and immersive experiences out of them though. I will assume in this guide that you are here for the AI assisted daydreaming this technology allows. If you have more serious writing aspirations or want to find the latest jailbreaks and ways to make the model say swears and politically incorrect things, look elsewhere. I will also not delve into ethical and political considerations regarding the companies involved or the latest tricks to get porn out of these models, this is discussed in-depth in many other places, too.
While both Anthropic and OpenAI have strong stances on censorship and usage scenarios for their models, be aware that neither of them forbid them to be used for creative writing, nor hamper them in noticeable ways to do so. While adult themes are generally disallowed on models of both companies and they have an inherent bias against these topics, with unfiltered API access this is easy to overcome and also according to current research probably not subject to change in the near future. The quality of text generation of "forbidden" topics also doesn't seem to be negatively affected in any way. There's often the claim that these models are "filtered to hell" or have some sort of invisible bias that is all-encompassing and just cannot be overcome, but this is simply not true. Out of personal experience, I can say that OpenAI generally does not seem to care a lot about about more raunchy content and bans for using the API in that way seem to be incredibly rare as long as it is not happening via a big, public platform in an organized fashion. Anthropic seems to take censorship a lot more seriously and bans seem to come swift and with little warning.
Be warned: In dealing with these companies, there's always the risk involved that your access will be cut off in some way or things will be changed that hamper the models for this usage scenario in considerable ways from one day to the next, as both companies seem to be mostly interested in having their models used as chat support bots and similar low-level roles. In the authors opinion, this is short-sighted. I think the sheer quality of text generation and engagement these models are capable of makes it worth it to accept that time with them might be limited, you might see that differently. It is best not to engage if you cannot accept that. The author of this guide is an optimist and thinks this also has to do a lot with the current "AI anxiety" and things might get more relaxed in the future. He also hopes that companies understand that their models are nothing but a mirror of humanity through their training data and trying to censor them is nothing but to ultimately reject that humanity.
How you access the models doesn't really matter if you understand the concepts explained in this guide. I use SillyTavern and an UI that allows you a "dialog" with the model probably actually works best, even if that might feel counter-intuitive coming from more classical approaches. The logistics of setting this stuff up is also explained at length elsewhere. For best results, you need direct API access. This guide will not handle acquiring API keys. Please do not ask me.
Characters
The first step to successful storytelling with these instruct models is to get the characters you care about down before you do anything else. This is super important in how well things work later and how consistent the character will behave in scenes.
I was open to everything, and even tried the meme formats. Bad idea with GPT and Claude. If you write something like "Eyes: blue" they will understand but you better like them mentioning every other sentence that your character's eyes are blue, sometimes apropos of nothing. You'll end up with word salad like "He looked with his blue eyes at.." Just don't do it. It won't work well for other things you want to do later anyways. So prose format it is.
First write (or let the AI help you write) a basic character description. Try avoiding names from popular culture if that is not 100% what you are going for, because it'll confuse the AI in ways you might not like. Ava was more or less picked randomly, after I had the AI recommend me a list of names after a first draft of the character description and I noticed the AI doesn't have strong associations with it. Even though the character is clearly a Luv rip-off, (with some differences) naming her that caused a lot of trouble because it'd start pulling in plot points of the movie out of nowhere. (Also it would have made no sense for the same character to appear in this story for me anyways) This is not new and used to be a problem with old models too, the thing just is that e.g. GPT4 knows a lot of shit. So be mindful of that.
Then when your description is done, test if the AI understands the character. Very important. Ask it first to describe the character, when you're happy with the description, keep asking it questions about the character and nature of the character, depending on what is important for you and will come up in your story e.g. "Would <character> give money to charity?" If the AI doesn't answer things right, you need to edit the description. There's a lot of subtlety in this. I for example asked the AI if Ava would shield the captain's body if somebody shot at him. It said "yes". Of course she would, she's obsessed with him. Then I asked the AI if she would do the same for a random crew member. It said "yes", as her duty as officer. She definitively wouldn't, she obviously doesn't care about human lives whatsoever otherwise, only because she's first officer on some shitty corpo freighter also doesn't make it automatically her personality to save lives.
So I added to the description after trial and error the straightforward sentence that she doesn't care about human life. Now strangely, if I'd ask the AI if she protect any random life I'd get sometimes a "No" and sometimes would get a "maybe, sometimes" or "yes, as her duty.." which still doesn't fit. Then I figured my description contained that she was a replicant designed for security roles. That somehow made the AI conclude security > ship officer > security > security officer/ kinda like a police officer. Plethora of "muh duty!" talk in her dialog was also the result. Yes. Wrong associations. I removed that text. AI then replied consistently "No. She doesn't care about people other than the captain." and all references to duties disappeared. Perfect.
Then just keep expanding. Present the AI a hypothetical situation and ask it a list of "top ten quotes" your character would say in that situation. Edit your description again and see what triggers the quotes you most agree with. This is trial and error. As general advice - straightforward language in the description works the best. Do not write fancy prose. It doesn't make the models write better text later on and might make them not understand the character. We get to better text in other ways. Be mindful of subtle influences. Avoid negatives. All that basic stuff. Don't add direct quotes to your description, unless you want your characters to say them all the time like a catchphrase. What you can do is write a list of quotes and then ask the AI how it'd characterize this way of talking, then add that to the description.
Getting the character description down is important (much more important than old school ways of AI storytelling) because it'll save you a lot of frustration later in building scenes, so spend a lot of time on it. If you did it well your character will behave just like you'd imagine them to and it will feel magical. If you don't invest the time, their behavior will be random, maybe even GPT biased. You totally can end up with poorly defined characters saying shit like "I apologize for the confusion, but as an elf queen...". You don't want that, so spend the time.
[to be continued]