Can AI write an episode of Stargate? Google AI took on the challenge

The process of writing a television show typically involves a writer’s room and a lot of time, as humans figure out the plot and the dialogue that makes a show work.

For the cult classic Stargate science fiction franchise, which spanned three series (SG-1, Stargate Atlantis, and Stargate Universe), character and plot development was helmed by Stargate co-creator Brad Wright. In 2021, publicly posted a message on Twitter asking if it was possible for AI to write an episode of Stargate that would appear on Sci-Fi insider site The Companion.

None other than Laurence Moroney, AI lead at Google, responded by picking up the gauntlet to try and prove what AI could do. Though he wasn’t initially worried that AI would replace him or other writers.

When the whole project started, I threw it out there to The Companion as an idea I knew I had seen a couple of AI models for scripts, In some ways, it’s fantastic. In other ways, it’s very unthreatening.”                                                                                                                                                                                                                                                                                                                                                                                       Brad Wright, Stargate co-creator

The first iteration of the AI-generated script was completed by November 2021. The script was interesting, but there was also a lot of gibberish, Now Moroney and Wright are collaborating again on a second version that aims to dial a new gate address for a more involved and engaging Stargate script.

We should probably try to really step up the game if we’re going to do this again, and he accepted that challenge, that’s what blew me away because it’s not just better it’s like, whoa… better!”                                                                                                                                                                                                                                                                                                                                                                                                          Laurence Moroney, AI lead at Google

How the Stargate AI script was generated

The process for producing the Stargate AI-generated script was much the same as the way any AI model is first built by training it.

The AI model with every Stargate episode script ever written, providing the system with a corpus of every line of dialogue and plot. He used a variety of technologies, primarily Google’s TensorFlow machine learning framework.

He also used pre-trained natural language models, along with a technique known as transformers.

Not to be confused with the Hasbro toys, the technique called transformers was primarily invented actually for language translation, if you think about the idea of language translation, you have an input sentence that you want to match to an output sentence and that almost sounds like the ideal thing for script generation.”                                                                                                                                                                                                                                                                                         Laurence Moroney, AI lead at Google

For example, an input sentence could be ‘Captain Samantha Carter says something to General Jack O’Neil.’ The output sentence is derived from the transformer training on how Jack has responded in the past to input sentences like the one that Samantha just uttered.

“So, I could train a transformer to predict what Jack would say to anything,”

The other core technology approach used was something known as a universal sentence encoder, which provides a numeric value for the context of a sentence. With that approach, it was possible to have semantics in the sentences be numerically encoded, to understand the connections between one sentence and the next, moving forward and backwards. in his view, the second version of the Stargate API was better than the first because of the encoder since the script never descended into nonsensical gibberish.

While there is various Google machine learning operations tools Moroney could have used for more automation, he emphasized that much of the process to build the Stargate script was manual. He provided a prompt to the trained TensorFlow model, which would then provide a response. Those responses were then inputted into the script.

The model wasn’t spitting out a screenplay with properly formatted text, it was several models generating the appropriate tags to go in at the appropriate time.                                                                                                                                                                                                                                                                                              Laurence Moroney, AI lead at Google

Bringing scriptwriting AI to the Google enterprise

The models and techniques used by Moroney to build out the Stargate script could be applicable to the enterprise. However, he joked that it’s unlikely that his AI techniques will be used to write an event keynote script for Google and Alphabet CEO Sundar Pichai anytime soon.

I could train a model on his vernacular, If I wrote something that could help my pitch so that it’s more in his voice, than my voice, that kind of thing would be a very useful tool.”                                                                                                                                                                                                                                                                             Sundar Pichai, CEO at Alphabet

that for writers helping to produce the scripts used for keynotes at a corporate event, an AI model could help reduce the time needed to get the right tone for a particular speaker, but it won’t be able to do all the work.

If you’re doing an announcement for something like Google I/O, you’re going to be talking about something new that nobody’s ever seen before, Therefore, by definition, you don’t have the data to be able to train models like that.”                                                                                                                                                                                                                                                                                                                       Laurence Moroney, AI lead at Google

Another potential way AI is now being exploited is to produce deep fakes, which represents a non-trivial cybersecurity risk. An AI trained in the right vernacular could potentially be used to aid in the production of a deep fake, that he prefers to see positive uses of technology rather than negative ones.

I personally worry a lot about deep fakes, But I’m also optimistic that there are technologies out there that you can use to spot deep fakes and they actually are quite easy to spot with the right application of technologies.”                                                                                                                                                                                                                                                                                                                                 Laurence Moroney, AI lead at Google

Stargate AI script is good, but it won’t replace humans

An often-heard concern about AI is that it will replace humans, but Moroney isn’t worried for now. In his view, AI-assisted tools could potentially help generate the foundation for future scripts. While humans could use AI to help with parts of the process, the core storytelling and uniqueness comes from things that cannot be trained by machine learning.

emphatically that the AI-generated script is a unique idea that honours the Stargate show, but it honours the show as it was. as a man that has spent his career writing about the future, there is always potential for something more.

I think AI is going to be able to generate something eventually that will pass a test as to whether an audience believes it was written by humans, it might not be better than the best humans, but you know, at the beginning, the best chess masters were beating the best computers and now AI beats chess masters. I’m sure that something similar could happen with this.”                                                                                                                                                                                                                                                                                                                                                                                                            Brad Wright, Stargate co-creator