How I Wrote a Whole Book with ChatGPT in Less Than 3 Hours!
Alessandro Giuntini
Senior Payments Officer at SwissBorg | Author of Thank You, President Corona!
If you have Medium, please, read the article here. It will make a huge difference for me. Thank you!
Demystifying the AI Craze
My name is Alex, and I’m just a dude working in financial technology (Fintech), a sector that inevitably makes you curious about everything, especially new trends. I couldn’t step out of the AI craze, or rather, I couldn’t help from observing people getting crazy over it.
“AI will take your job!”, “This is the end!”, “By 2024, you’ll no longer meet a doctor. Machines will diagnose and cure you!”, “How I created a whole new company using ChatGPT!”, and finally, “How I wrote a whole book with ChatGPT in 10 minutes and became rich with it!”, are all promises that smell more like marketing slogans than realistic scenarios.
Since the start of the AI hype, the reason looked obvious to me, but apparently, not to 90% of the people. Artificial Intelligence is not magic, nor the “last invention humanity will ever need”. It’s not even technologically accurate to call it AI. The most correct term is Machine Learning (ML), or Deep Learning (DL), when it comes to the Large Language Models (LLMs) such as ChatGPT.
Machine Learning vs Deep Learning
Machine Learning (ML) focuses on developing algorithms able to learn from and make decisions based on previous data. Instead of being explicitly programmed to perform tasks, ML systems identify patterns and relationships within large datasets to predict future outcomes or classify information.
Common applications of ML include spam detection, content recommendation systems, image recognition, and natural language processing.
Deep Learning (DL) is a specialized branch of machine learning that involves networks designed to simulate the structure and functioning of the human brain, enabling computers to recognize intricate patterns and representations in data. DL models excel at handling vast amounts of unstructured data, such as images, audio, and text, making them particularly effective for tasks like image classification, speech recognition, and natural language understanding, like Siri or Alexa, for example.
DL’s capacity for achieving state-of-the-art performance in complex tasks has shocked the public sphere, by revolutionizing fields like computer vision, speech recognition, and automation. People now are fearing a sad future where AI paints, indulges in poetry, composes music, and writes books, while humans are relegated to flipping burgers and delivering food at the door of the few rich AI lords.
Human Intelligence Is Bigger Than Learning
However, learning is just one aspect of the vast realm of animal and human intelligence. “AI” cannot smell, feel hot and cold, feel emotions, dream, but most importantly, AI cannot think, unlike what many believe. Every ChatGPT output is not pure thought, but a refined rearrangement of past data fed into its database and processed through its neural networks. The computational power available to OpenAI is so huge that they can drench data through neural networks so many times to make the final result look 100% credible, as if executed, written, drawn, sung by an actual human.
Nevertheless, reality is always way more complex, and even way more boring. Behind the trick of Deep Learning, there is no omniscient entity, there is no Skynet, and there is no incubation of The Matrix. There is simply an advanced cinematography of previous data points, merged together and executed so fast that the human eye will be tricked into believing the machine creating something new is actually alive. It’s indeed close to the cinematographic concept: many static images that are rolled so fast the human eye will see an actual movement in them, a “motion picture”. In reality, those images are just static, and in the case of animated movies, absolutely fictional.
Now, just because movies and AI are fictional, doesn’t mean their effects aren’t real. Movies can generate authentic emotions in the viewer, bring real people together, and spark real conversations and controversies among the audience. Likewise, DL can actually take away some jobs from humans, create brand-new pieces of art, and jot down meaningful text, either fictional or non-fictional. And here is where AI marketing pushed the most. Writing is the easiest form of expression. It only takes a bit of will to start. No wonder writing is the most diffused form of expression nowadays. We have billions of people writing at some point of their lives, and we have even more texts published, under any form, from classic novels to complex scientific papers, from magazines to modern day blogs and social media posts. Human writing provided, by far, most of the information ChatGPT was trained with.
Learning by Doing
It is normal that writing is what ChatGPT does best, and thus, it is what attracted the attention of those social media “gurus” always in search of the next big thing to make easy money with. After watching the hilarious ads and content by the usual suspects, I came up with the following questions:
I concluded that the best way to answer these questions was to learn by doing, just like an animal, a human, or a DL algorithm would do!
And what better way than to learn together with an audience? I’ve always wanted to stream something on Twitch, and this looked like a goddamn good topic to broadcast!
First and foremost, I had to set the table. I couldn’t simply go with the flow. I needed a plan, starting from choosing the topic. I couldn’t hope to write the next Divine Comedy. I had to keep my expectations realistic. Novels in general were excluded. By working with ChatGPT daily, I understood this guy is best suited for non-fiction content.
I had the genre, great. But what about the topic and the deriving content? I knew the prompt couldn’t be a simple, “Hey ChatGPT. Write the next non-fiction bestseller!”
An effective prompt is supposed to be structured. AI will best serve those humans that know what they want. Humans who don’t know what they want will face the same difficulties they experience when communicating with their fleshy peers.
Given my joker nature, I wanted the book to be a parody, possibly mocking a work written by an author that people take too seriously, even when they shouldn’t. I was thinking about the most popular internet personalities, those revered like gods, dark entities of the likes of Elon Musk, Andrew Tate, or Aleksandr Dugin. However, they aren’t actual authors, or at least, to the best of my knowledge, they didn’t produce any notable writing that shook the public sphere. I needed someone who actually wrote a bestseller, and parody it!
How to Actually Write a Book with ChatGPT
#1 Pick the Right Topic
After some sterile brainstorming, YouTube provided me with the answer. That platform is a barometer of what people are after, and it didn’t take long before some “controversial” (clickbait) excerpts from interviews with Jordan Peterson emerged in my feed. Next, I bumped into an article on Medium attacking Peterson, and I felt this was the right direction. I gave a look at his most popular book, 12 Rules for Life: An Antidote to Chaos, and nailed it. This was the kind of topic that had all the characteristics I was looking for my GPT-parody:
Most of all, a book about 12 rules for life gave ChatGPT the chance to show what it learned from all the wisdom it absorbed from its enormous training data and from the very interactions it had with its users!
#2 What Makes Art Valuable: Suffering!
However, having the right topic wasn’t enough. By observing AI art, I understood why AI will never replace human artists. What gives an art piece — be it a painting, a song, a book — is not the final result, but rather the story behind it. When we read Dante’s Inferno, we wonder how the hell the poet came up with all those strong and vivid images, that make us doubt whether it is a work of fiction or if a live person actually managed to cross the gates of the afterlife. When we listen to Queen’s latest albums, we cannot help from picturing the suffering of Freddie Mercury; the legendary singer spending the last months of his life fighting AIDS, while disappearing from public life, talking only through his music. When we contemplate Munch’s Scream, we instantly empathize with his existential crisis, whose eruption led to the creation of what we call a “masterpiece”. Technique is not what makes a piece a masterpiece, it is the very soul, the suffering the master puts in the work.
Suffering is a pillar of consciousness. As machines don’t suffer, they cannot be conscious.
How could I put “soul” and “suffering” into an AI-generated book? The answer was simpler than you could imagine. I had to do something I’ve always wanted to do, but always felt uncomfortable about. I had to appear on camera, face a virtual audience, and do what I always do, but with the pressure of the viewership. I had to risk losing my face, becoming “the dude who cannot use ChatGPT”, “the idiot who tried to write a book with AI, and who cannot even speak”. I had to challenge myself, but also to challenge ChatGPT itself. The LLM had a lot to lose too. Should my Twitch performance become viral for my own failure, I would have been the one bashed. But should the task of assembling a real book fail, ChatGPT would have been labeled as “an overpriced AI which promises to do everything and eventually can do nothing, not even write a simple book”.
I thought this strategy is the best to give AI-work that pinch of suffering capable of making its work valuable, thus sellable.
#3 Test Before Writing the Actual Book
Before carrying out this intimidating deed, I ran a test. I asked ChatGPT to write another book, this time about crypto and the dangers to avoid in the industry. I work a lot with crypto, and I invested myself, so I could easily check whether ChatGPT was providing factual information or hallucinating.
I could also test the best strategy to develop the book. I knew since the start that it would have been impossible writing the entire book with one single prompt, let alone within one single conversation. ChatGPT4 can generate around 1,000/2,000 words per prompt request, while a single conversation can keep memory of the context up to around 25,000 words. Consider that a typical non-fiction book contains around 100,000 words, and you can already figure out my strategy.
I had to create little subtasks, like one conversation per chapter. But how could I keep the same context across different conversations? Should I have repeated the same master prompt with the 12 rules in each conversation? It didn’t look efficient.
#4 Learn from the Best Prompt Engineers
I must thank Sheila Teo , who taught me how to use LLMs in the most effective manner. By reading Teo’s Medium article How I Won Singapore’s GPT-4 Prompt Engineering Competition, I understood the essence of “system prompts”. A system prompt tells your LLM what to do and what to remember across different conversations. An example of system prompt can be: @sheila teo
领英推荐
I need to write a book about the most dangerous scams in crypto and how to avoid them.
The book will be divided in 5 chapters:
1. Ponzi schemes
2. Pump and dump schemes
3. Ransomwares
4. Fake tokens
5. Fake trading platforms
The tone will be humorous and satirical, but also informative.
We will write one chapter per conversation.
System prompts can be very helpful if you use ChatGPT in your daily job for repetitive tasks. They make sure the LLM will stay on track and will mitigate the risk of hallucinations, i.e. of giving false or irrelevant information.
#5 Create Your Own, Personal GPT
To personalize the set-up, I took system prompts to a further level. ChatGPT now offers the possibility to create custom GPTs. These are personalized bots you can train on specific tasks. The outputs will be more precise, because the model will not get lost across the whole huge data universe provided by OpenAI, but it will be more focused on what you need to do. For example, a GPT trained on image generation will use DALLE-2 to output better images than you would get if you used the generic ChatGPT conversation. Creating a new GPT looks very similar to setting a system prompt, with one key difference, though. On a new GPT, you can upload entire files with your own knowledge. While system prompts, again, have length limits, source knowledge for a new GPT has no length limitation, at least in theory.
I needed a new GPT. This gave me the chance to train it with what I obtained by the “genesis conversation”. I went on the generic ChatGPT interface, and prompted:
You’re a non-fiction writer.
You’re going to write a parody of Jordan Peterson’s “12 Rules for Life: An Antidote to Chaos”
This parody book will be called “12 Rules for Life According to ChatGPT”
Draw the rules from the general wisdom you have acquired from your training data, including wise chats had with your users.
Keep the writing style friendly, humorous, funny, but also wise and deep.
Task #1: Write down the 12 rules
The result was satisfying from the get-go, so happy with it that I decided to use these very rules for the live stream. I cannot resist cats, no matter what!
#6 Define a Structure for Your Book and Your Workflow
Next step was to define the chapter’s structure, going to instruct ChatGPT on how many words to generate, more or less, for each section of the chapter. To accomplish this, I first asked ChatGPT to analyze the structure of a true non-fiction book, and what better sample than the original “12 Rules for Life”?!
“Analyze the attached file [12 Rules for Life by Jordan Peterson]. Can you detect a pattern in how the chapters are structured? I need a template to follow to write my own non-fiction book”
ChatGPT’s reply was once again well structured and effective. I just added to it the rough number of words I expected to have in order to reach a decent length for the whole book. The goal was to mark at least 60,000 words, a short non-fiction book, still comprising more than 100 pages.
Here is the structure ChatGPT and I conceived and that was going into our system prompt:
2. Background Information (about 500 words long)
3. Main Arguments (about 1000 words long)
4. Practical Advice (about 1000 words long)
5. Conclusion (about 300 words long)
I pasted this in a Google doc together with the Chapter list. Next step, I uploaded the doc into my new GPT, that I called “GPT’s Wisdom”, putting an owl as its logo.
Writing a Book with ChatGPT While Streaming on Twitch!
With this preparation, I only had to figure out how to stream on Twitch (easier than I imagined) and set a date. I chose Wednesday 31st July, 2024. I couldn’t choose a worst week, which turned out to be the easiest I had in the whole year. I was on the verge of burn-out, but I decided to continue, deflecting the temptation of postponing the event. When the day came, I had a beer before the session in order to release the tension. After that, everything came out more and more naturally.
I must thank my colleague Francesco who was there in the Twitch chat acting as my visual and sound technician! His support was vital in those first minutes. He was also the only one in the chat, making me unaware of the other 23 people who were watching without a Twitch account! Believing to have only one viewer made me feel more relaxed. The mindset was, “Fuck it. I will stream anyway. People will eventually watch the record, and if not, I will stream for my own pleasure!”.
And there ChatGPT and I went on, till the end, over the course of 2 hours and 13 minutes, managing to stay within the time-frame we had promised:
The main questions powering this mad streaming session were wild.
I think I kind of found answers to these questions, but I would like to hear the audience’s opinion once the final book will be available to the public, which should happen at the beginning of October, if every goes according to plan.
Why Don’t I Publish This Book Right Away?
To answer this question, I suggest you reading my article 11 Lessons I’ve Learned from Publishing My First Book.
Here, I explain why writing is only the first step into publishing a book, and why the final publication comes only after lengthy steps.
Curious about this upcoming book? Follow my Medium to stay up-to-date with the next developments! ??
Helping Authors Fix Book Blocks & Error | Ebook Expert | Ghostwriter Ebook writing | Cover Design | Formatting | Amazon KDP Expert | Keyword Research | Ebook sales funnel
3 个月Can we discuss
Helping Authors Fix Book Blocks & Error | Ebook Expert | Ghostwriter Ebook writing | Cover Design | Formatting | Amazon KDP Expert | Keyword Research | Ebook sales funnel
3 个月Can we discuss
Helping Authors Fix Book Blocks & Error | Ebook Expert | Ghostwriter Ebook writing | Cover Design | Formatting | Amazon KDP Expert | Keyword Research | Ebook sales funnel
3 个月Can we discuss
Helping Authors Fix Book Blocks & Error | Ebook Expert | Ghostwriter Ebook writing | Cover Design | Formatting | Amazon KDP Expert | Keyword Research | Ebook sales funnel
3 个月Wow good Did you do the demand and supply analysis of the book ??