Midjourney prompt: "a writer looking at a cork board with lots and lots of pages tacked up to it, romantic, drawing, thoughtful, morning light, cinemati"

How to Make AI Write Like Your Favorite Author

A step-by-step guide from prompting to fine-tuning

73

Sponsored By: Scrintal

This essay is brought to you by Scrintal, a visual-first knowledge management tool that lets you organize and connect all your thoughts in one place.

There is a unique blandness to entry-level AI writing. 

It’s the prose version of licking cardboard. There is a taste to it, but it is the absence of any real flavor that is most striking. So, reasonably, AI-assisted writing gets a bad rap. People say it reads like SEO content farm marketing swill. It’s not for serious writers.

This criticism is correct, in the sense that inputting a basic prompt to a popular model like ChatGPT or Bing will output wholly middle-of-the-road responses.

But this criticism is a little like saying that the output of keyboards is typically bland. Yes, it’s true, when you first learned to write on a keyboard you couldn’t write anything particularly good.

With a little practice, though, you can get a keyboard to write anything you want. The same is true for AI.

I’ve written before about how I use AI as part of my writing process—it can help me get ideas out of my head, find the narrative of a piece, or help me when I get stuck. But today I want to focus on one of the most useful things you can do with AI -assisted writing:

Capture a particular kind of voice or style.

This article will go through the whole process: from finding prompts that work to fine-tuning. By the end, you’ll have a richer understanding of how to push generative AI models in new directions, and how to add more depth and flavor to your own writing.

I know the title of this article claims to teach you how to use AI to write like your favorite author. But this is not going to be about learning to push one button in order to output a deep fake Tolstoy novel. That’s not technically possible and probably not desirable.

Instead, this article will teach you to use AI to write like a richer, deeper version of yourself. It can be used to help you understand what you love about a particular writer. And it can also be used to help push your brain into the territory of their language, so that you can incorporate some of their style into your own. 

Scrintal is a beautifully designed app that combines the power of an infinite canvas with bi-directional links. Whether you're researching, mapping complex projects, building processes, planning, or studying, Scrintal has everything you need to streamline your workflow and take your work to the next level. With Scrintal you can:

  • Organize your thoughts
  • Visually connect your notes
  • Collaborate in real-time
  • Share as PDF or markdown

Early subscribers enjoy priority support and complimentary 1-1 onboarding. Curious?

How I Started Doing This

I love Annie Dillard. 

Sometimes I want to push my writing to better describe nature, or a metaphor or simile that’s as vivid as hers. Usually, if I want to do this, I’ll sit down and read some of her stuff—like Pilgrim at Tinker Creek or The Writing Life—and then I’ll go off to write.

Some of what I’ve read will tint the voice I have that day, and if I’m lucky it’ll show up in the writing that I’m doing. It sort of pushes me into the right headspace to get the style that I want. 

Recently, I began wondering if GPT-3 could help with that. I didn’t want it to automatically spit out prose I could pass off as my own. Instead, I wondered if it could help get my brain going in the same way that reading a piece by that writer might—but with the added benefit that the sentences I was reading would be about the topic I was writing about, rather than being totally unrelated.

So I hopped into the OpenAI Playground and tried a naïve prompt: “When I breathe I feel…” 

I figured starting off with a sentence like that would be somewhat close to the territory of language that Annie Dillard’s style might live in. And that might be an ample opportunity for GPT-3 to get vivid and poetic. Unfortunately, it did not work:

This is grammatically correct, but it’s everything that AI critics say it is. It’s bland and boring. It doesn’t do anything interesting. But after experimenting with this a good amount, I’ve devised some ways to get the AI into a territory where it does sound a bit more like Dillard—and that in turn gets my mind working.

OK, ready? Let’s dive in.

How to capture a voice in AI-assisted writing

I’ve found three good ways to capture a voice in AI-assisted writing:

  1. Directly ask the AI to write like the writer you have in mind
  2. Describe what the writer’s voice is like, and ask the AI to write like that (preferably with examples)
  3. Fine-tune the AI on a specific writer

I’ve listed these in order of difficulty and expense. If you’re trying to do this yourself, start out by directly asking the AI to write like a writer you admire. If that doesn’t work, try describing the style you want the AI to write in. And, finally, if that doesn’t work, try fine-tuning.

Just because fine-tuning is more technical and expensive doesn’t necessarily mean it’s going to be the best option for your use-case. Try the easy thing first, and work up to the hard thing. You’ll learn a lot along the way. (Of course, if you just want to do fine-tuning because it’s fun, that’s also nice and I won’t stop you.)

So, let’s start with step one: Directly ask the AI to write like the writer you have in mind.

Ask the AI to simulate a famous writer

AI is not one single thing that sounds or thinks. Rather, it’s a simulator. It’s ingesting a prompt and trying to predict what it thinks you want. So directly asking it to sound like a writer you admire is a good place to start.  

This actually works quite well for writers whose work is famous and is well represented on the internet.  

Let’s start by asking GPT-3 to rewrite a sentence that could use some Dillard-ifying:

OK, so this is obviously ridiculous and doesn’t sound anything like Dillard. But…it does sound different. 

That should tell us we’re on to something. The voice and tone is, like, vaguely Shakespearean or medieval or “high schooler discovering a thesaurus for the first time-ish.” It’s using big words that it wouldn’t have ordinarily used. For example, I like the phrase “cushioned throne” and the word “sonorous.” So I might not take this output wholesale, but I might feel good about using some of these words in whatever I’m writing about. It’s getting my mind going and expanding the options in my vocabulary—which is exactly what I want.

Interestingly, Bing (which uses a more advanced version of the same model) is a bit better here:

Here, we can see Bing is using similes: “The notes are clear and precise, like icicles hanging from the eaves.” This feels vaguely Dillard-y. But I have to decide…is that really true? Do the notes of the music sound clear and precise? I also have to decide whether icicles hanging from the eaves evoke that for me. 

But now I’m actually thinking about it. What is the quality of the music I’m listening to? And what’s a simile that might evoke it? These kinds of questions get my brain working—and once again, help me improve the passage I’m working on.

This same technique works well with other major writers. Here’s Shakespeare:

Here’s Seinfeld:
The nice thing about using Bing for this versus ChatGPT is that Bing has access to the internet. So it can look up a writer in real time to try to find more about their style—which helps it to improve its responses. This is particularly useful for writers who are not as famous or who have fewer examples of their writing on the internet.

Take some time to experiment with this—see what works and what doesn’t. But if you’re not getting the results you want, it’s time to move on to the next step: describing the style you want.

Describe the kind of writing you want the AI to do

Telling the AI to “write like Annie Dillard” or “to write like Tolkien” can give you interesting results, but it’s also vague. What is it about Dillard or Tolkien that you’re trying to capture? Is it Dillard’s descriptions of nature? Is it Tolkien’s tales of dwarves and magic? There’s a blurry line between style and content. The AI has to guess, and that will make the results less interesting.

A good next step is to try to get specific with it. Ask it for exactly what you want it to do, and see if it can do it. This is a good thing to try, because the results you get might be better—and you’ll become a better writer in the process. In order for you to ask the AI to write in a specific style, you need to understand how to describe the style that you’re going for. You’ll need to ask yourself: What is it about any of these writers that I like? And that process is quite valuable. 

Here’s an example. When I think about what I like about Annie Dillard’s use of words, there are a few things that come immediately to mind:

It’s quite vivid, she has incredible metaphors and similes, and her descriptions of nature are specific, beautiful, and poignant. 

There’s a lot more to like about her writing style—but for this kind of thing, it’s better to start simple and build on top of it. Let’s see how using this description might change the output we get from the AI:

This is decent, but it’s a little cliché. But I wonder if we could make it more interesting. I want to get a good description of Dillard’s writing for my prompt. One thing to do is to look at what critics say about her and incorporate that.

So I find a review of her book, The Writing Life, and ask Bing to summarize it:

Here’s what I get back:
Now I can incorporate some of this back into my prompt and see what I get:
I actually like some of this! “The classical music plays on, weaving through the air like a graceful ribbon” is pretty good! I also like “dreams as light as snowflakes.” It’s still a little heavy-handed and on the nose about the mundane—but you can see how spending just a little bit of time on our prompt completely changes the output we get from the model. 

If you’re still looking for more though, the next step is fine-tuning.

Fine-tuning on a writer’s voice

The way to get as close as possible to a particular writer’s voice is to use fine-tuning. 

Fine-tuning is a way to adapt an AI model to a specific task by training it on a dataset specifically designed for that task. It’s a dark art. There are a lot of variables to play with, and most of what people know about it for AI models like GPT-3 seems to be gained through trial and error. (And the errors are expensive: Fine-tuning costs money, on the order of $10–$50 for a single fine-tune.) 

Here are some basics to understand. 

When you fine-tune a model, you give it examples of prompts and correct completions. It’s a way of telling the model, “if you see this prompt, here’s an example of a good way to complete it.” If you show examples like this to the model over and over again, it will eventually learn to give completions that are closer to your preferred completion. 

For example, if you fine-tune on a prompt completion pair like this: 

Prompt: What is the best kind of dog?
Completion: Bernedoodle

The next time you use the model, if you ask it for the best kind of dog, it’ll be much more likely to spit out “Bernedoodle.” So, the question is, how do we fine-tune the model so that it is more likely to output writing in the style of our favorite author?

I’ve tried lots of different experiments to try to get the AI to write in the style of a specific author, and fine-tuning on an empty prompt with a completion that is a few sentences of the writer’s work seems to be best. So, for example, your fine-tune can be something like:

Prompt:
Completion: “I used to have a cat, an old fighting tom, who would jump through the open window by my bed in the middle of the night and land on my chest. I’d half-awaken. He’d stick his skull under my nose and purr, stinking of urine and blood. Some nights he kneaded my bare chest with his front paws, powerfully, arching his back, as if sharpening his claws, or pummeling a mother for milk.. And some mornings I’d wake in daylight to find my body covered with paw prints in blood; I looked as though I’d been painted with roses.”

This type of fine-tuning appears to teach the model to learn to lean toward the voice, style, and subject matter of a particular writer for any prompt. This is quite useful for our purposes. 

The process goes like this:

  1. Find a large corpus of text from a writer that you like
  2. Break corpus into chunks of a few sentences each
  3. Create a file with prompt-completion pairs where the prompt is empty and the completion is a few sentences from your text
  4. Fine-tune on that file for 8 or 16 epochs

Here’s how to do it:

Find a text corpus

This part is a little tricky, but for any author out of copyright, you can use Project Gutenberg. For other writers, you can usually find things they’ve written on the internet or try to buy and download DRM free digital versions of their work.

There are lots of ways to do this, so get creative. But make sure you do it in a way that’s mindful of fair use and copyright.

Break the text corpus into chunks and create empty prompt-completion pairs

This one is a little more difficult and technical, but luckily you can actually use ChatGPT or Bing for this step. At the end of it you’re going to want a file that looks like this:

{"prompt":"","completion":"[text from your author here]"}

{"prompt":"","completion":"[text from your author here]"}

To get this, open up ChatGPT and ask:

Please write me a Python script that reads in a text file, breaks it into chunks of 3 sentences each, and outputs each chunk into a valid JSON file with the following form: 

{"prompt":"","completion":"[chunk 1]"}

{"prompt":"","completion":"[chunk 2]"}

Take the script that ChatGPT outputs, and run it on your text corpus from the last step. (If you’re confused by this step, I’ll be holding a workshop for paying subscribers next week to take you through it step by step.)

Fine tune on your JSON file

Now that you have your JSON file, it’s time to fine tune. You should refer to the OpenAI fine tuning guide here, but the basic steps are as follows:

Prepare your data

OpenAI has a fine tuning utility that will check your JSON file and make modifications to it in order to optimize it. 

Run the following command to prepare your data:

openai tools fine_tunes.prepare_data -f <LOCAL_FILE>

When that’s done, it’s time to actually run the fine tune.

Run the fine tune

To start the fine tune, you can run the following command:

openai api fine_tunes.create -t <TRAIN_FILE_ID_OR_PATH> -m <BASE_MODEL> --suffix "[NAME YOUR MODEL]" --n_epochs 8

There are two important pieces of this that are missing from the OpenAI fine tuning guide. One, you should definitely set your suffix. That names your model something sensible like, “My Favorite Writer Voice” so that you can find it later. Two, you should set your number of epochs to 8 or 16. Epochs are how many times the model is trained on the dataset you give it. The default for this is 4—but my experience is that the sweet spot is usually around 8 or 16. It’s unclear why this is, but 8 or 16 seems to get it focused enough on the prompts and completions you’re giving it to make sure the voice you want is coming through. But it’s not so much fine tuning that you overfit and the output gets worse.

Use your model

Now that the model is trained, it’s time to use it! I trained a model on Annie Dillard’s work, and here’s what the output looks like:

Here’s another run:
You’ll notice here that I’m not asking the model to rewrite my work, just to continue it in a Dillard-y way. I haven’t been able to get a fine-tune that does rewriting to work well. But I do think that this type of fine tune is quite good. It’s less cliché, it has more of Dillard’s style and flavor, and it’s got really nice, poetic descriptions of nature. 

Wrapping up

There you have it: Those are the basics of getting AI to assist with writing in the style of your favorite author. 

It’s worth mentioning before we close: You need to be careful when you do this. As I wrote at the top, the point of these exercises is not to help you create deep fakes—it’s to help you find your own style and inflect it with the richness of writers you admire. 

I recommend you not take the output of these models wholesale—but instead use it as a jumping-off point for your own work. If you’re writing in an environment where standards for plagiarism are important, it’s critical that you run this output through a plagiarism checker to make sure it’s not too close to someone else’s work. 

But if you’re taking the above seriously—there’s a tremendous amount of territory to explore here. You’ll get a lot of weird and wonky output. It’ll fail a lot. 

In trying, and failing, you’ll discover your own voice. It’ll be richer and deeper and spiced with the taste of all of the people we’ve read and loved.

Good luck! 


Get hands-on practice with the techniques in this article

If you want to get hands-on practice with the techniques I mentioned in this article, I’ll be running a workshop next Tuesday, March 14th at 12 PM EST about how to get AI to write in your favorite writer’s voice.

We’ll cover:

  • Basic prompts and completions
  • Fine-tuning, from start to finish

No programming experience required. Curious?


We also offer a 40-minute self-paced workshop on the basics of writing with AI. It includes everything you need to get started including prompts, and hands-on exercises. Learn more here:

Find Out What
Comes Next in Tech.

Start your free trial.

New ideas to help you build the future—in your inbox, every day. Trusted by over 75,000 readers.

Subscribe

Already have an account? Sign in

What's included?

  • Unlimited access to our daily essays by Dan Shipper, Evan Armstrong, and a roster of the best tech writers on the internet
  • Full access to an archive of hundreds of in-depth articles
  • Unlimited software access to Spiral, Sparkle, and Lex

  • Priority access and subscriber-only discounts to courses, events, and more
  • Ad-free experience
  • Access to our Discord community

Thanks to our Sponsor: Scrintal

Think and write visually with Scrintal. It is the perfect tool for individuals and teams looking to connect their ideas, have an overview, and create high-quality output.

Comments

You need to login before you can comment.
Don't have an account? Sign up!
Every

What Comes Next in Tech

Subscribe to get new ideas about the future of business, technology, and the self—every day