Showing posts with label GPT-2. Show all posts
Showing posts with label GPT-2. Show all posts

Friday, September 27

Could an Artificial Intelligence Write a Book?

Could an Artificial Intelligence Write a Book?


I want to do something a bit different in this post. I’ve gotten more into programming lately (Python) and I’ve wondered: Could an artificial intelligence (AI) write a good novel?

Back in the day -- say 20 years ago -- we talked about AI but now we’re also discussing AGI, Artificial General Intelligence. That’s what we humans have.

If we create an AGI, and if this AGI can do pretty much everything a human can, will writers be out of work? [5]

(By the way, if anyone disagrees with anything I say here, please set me right! I find the field fascinating, but I’m not a data scientist. You can contact me on Twitter (@woodwardkaren) or leave a comment, below.)

Here’s the question I’m going to try to answer: Right now, is there a text generation program that could write a story that readers couldn’t tell was computer generated? And, if so, what would this mean? Would it put me out of business or, possibly, would it make my job easier?

Deep Tweets


Let’s get specific. Could an AI read all the books by a particular author -- say Stephen King -- and write a book that a group of Stephen King’s fans could not distinguish from Stephen King’s work? And I don’t mean sometime in the future, I mean right now.

Well, something like this has happened. Lex Fridman trained the text generation program GPT-2, created by OpenAI, on the tweets of several well-known people and then asked it to complete this sentence, “The meaning of life is …”

I encourage you to read the article, DeepTweets, it’s fascinating. The program nailed it. Not only did it give an accurate answer but it answered more-or-less in the voice of the person in question. [4]

For example, Fridman trained a neural network on Richard Dawkins’ tweets and asked it to complete the prompt, “The meaning of life is …” Here’s what it came up with:

“The meaning of life is complex and Darwinian. Evolution is a FACT.”

That’s creepily good. I think that's very close to what Dawkins would actually say.

OpenAI and GPT-2


But a tweet is one thing, writing a short story -- a good short story -- is quite another.
To reiterate, we want to know if a text generation program, one available to the public right now, could produce text that not only doesn’t look computer generated but closely resembles the work of a specific author. Specifically, could such a program write a book in the voice of Stephen King that would be so authentic that a panel of die hard fans couldn’t tell the difference between the fake and a real story by King?

I’ve done a bit of research and from what I can tell (perhaps I’m wrong, and if I am please let me know) at the present time the answer is: No.

That said, I think we’ll get there one day.

GPT-2


GPT-2 is, I think, the most advanced model we have right now, at least that has been made available to the public.

GPT-2 was created by OpenAI. To give you an idea what OpenAI’s intentions are, here is their (very short!) mission statement:

“OpenAI’s mission is to ensure that artificial general intelligence (AGI)—by which we mean highly autonomous systems that outperform humans at most economically valuable work—benefits all of humanity. We will attempt to directly build safe and beneficial AGI, but will also consider our mission fulfilled if our work aids others to achieve this outcome.”

As I mentioned, the program that generated this text, GPT-2, was created by OpenAI, a nonprofit lab initially backed by Elon Musk and other tech entrepreneurs. BUT this isn’t the most powerful version of the program.

OpenAI felt it would be too disruptive to release the most powerful, trained, model because it could be used to, for example, post comments or reviews that could not be distinguished from those submitted by a human author. That could become a problem.

Although the fully trained model of GPT-2 has not been released, OpenAI did release one that was almost good enough to use to generate text that couldn’t be differentiated from human generated text.

Here’s a prompt that was given to the program, for it to finish:

“In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English.”

This is what the program wrote:
The scientist named the population, after their distinctive horn, Ovid’s Unicorn. These four-horned, silver-white unicorns were previously unknown to science.

Now, after almost two centuries, the mystery of what sparked this odd phenomenon is finally solved.

Dr. Jorge Pérez, an evolutionary biologist from the University of La Paz, and several companions, were exploring the Andes Mountains when they found a small valley, with no other animals or humans. Pérez noticed that the valley had what appeared to be a natural fountain, surrounded by two peaks of rock and silver snow.

Pérez and the others then ventured further into the valley. “By the time we reached the top of one peak, the water looked blue, with some crystals on top,” said Pérez. 

That’s not all! If you’d like to read the rest of the story GPT-2 produced, check out the article. My take on reading this is that it's not bad! But I don't think it's a thread to writers.

Could AI Help Writers?


At the moment, AI isn't going to put us out of work, but can it help us?

The other day I came across this article from Vox: How I’m using AI to write my next novel, by Sigal Samuel. [2] He writes:

"While some artists worry that AI will put them out of a job — just as it’s expected to do for, say, truck drivers and factory workers — I’ve been more inclined to see it as a collaborator than a competitor. I don’t think AI will be good enough to write a superb novel on its own, but I do think it can be very helpful in a novelist’s creative process."

Samuel has been using GPT-2 to help him get over writer’s block. I could see that working! I’m glad he’s found something to help him keep writing.

If you’d like to download the latest version of CPT-2, there’s the link.

Notes:


It took me longer than I thought it would to finish this post and I ended up not using some of the research I did. BUT, I decided to leave these notes in because the articles are interesting and I thought you might want to check them out.

1. The rise of robot authors, published by TheGuardian. 

2. How I’m using AI to write my next novel, by By Sigal Samuel over at Vox.

3. GPT-2: 6-Month Follow-Up. Published August 20th, 2019 on OpenAI.com.

4. DeepTweets: Generating Fake Tweets with Neural Networks Trained on Individual Twitter Accounts, by Lex Fridman.

5. The way I’m thinking about it, an artificial general intelligence would be able to tell jokes, it would have ideas about whether a certain stock is going to go up or down, and it could write a fabulous blog post! Basically -- and sorry to use a reference that might be a little dated -- an artificial general intelligence would be a lot like Data from Star Trek: Next Generation.

6. Here's something interesting: Hugging Face.