Science·Q&A

Twitter bot creates 'remarkably Trump-like' tweets

CBC Radio technology columnist Dan Misener digs deep into DeepDrumpf.

DeepDrumpf parody account uses AI and Donald Trump's actual speeches, tweets to mimic his style

The @DeepDrumpf parody Twitter account is an algorithm designed to mimic Donald Trump's voice on Twitter. (DeepDrumpf/Twitter)

On social media, Donald Trump uses the handle @realDonaldTrump. But there are plenty of imitators and parody accounts, including a Twitter bot created by a scientist at MIT.

"DeepDrumpf" uses artificial intelligence to mimic the real Donald Trump's speech patterns — creating what MIT says are "remarkably Trump-like statements."

CBC Radio technology columnist Dan Misener digs deep into DeepDrumpf.

What's the story of DeepDrumpf?

This is a parody Twitter account that started back in the spring. The name riffs on comedian John Oliver's call for Donald Trump to go back to his family's ancestral name, Drumpf — and deep learning, which is a specialized field of computer science.

Basically, it's is an algorithm designed to mimic Donald Trump's voice on Twitter. It works by taking a prompt — the first few words of a sentence — and then completing that prompt based on statistical probabilities.

So if you gave it the words "make America great," for example, it could complete that sentence with the word "again."

Or another example tweeted during the most recent presidential debate — when the algorithm was given the prompt "math is a...", it responded with this:

And while DeepDrumpf is a goofy example, the underlying technology here is powerful — and it's part of a growing field that's having a profound effect on many aspects of technology.

How is it able to mimic the real Donald Trump?

Brad Hayes is a post-doctoral associate at MIT, and the creator of the parody Twitter bot DeepDrumpf. (Brad Hayes/LinkedIn)

It can do this because it knows a lot about how the real Donald Trump speaks.

Brad Hayes is a post-doctoral associate at MIT's Computer Science and Artificial Intelligence Laboratory (CSAIL), and the creator of DeepDrumpf. He says he collected a large amount of original source material, and fed it into his algorithm to train it.

"So it's a giant text file that contains... many of his public rally speeches, debate transcripts and the tweets that are actually his," he said. 

He says it's also still learning.

"I think I'm currently at model number 34 or 35 as of today. It's retraining right now as we speak."

Basically, the algorithm analyzed all this training data to figure out how Trump speaks in public. Then, when given a prompt, it creates its full tweet based solely on the statistical probabilities of what will follow, gleaned from past speeches.

How convincing is it?

If you're familiar with Donald Trump's tweeting style, DeepDrumpf's messages can seem uncanny. They seem to have the rhythm and cadence of the real Trump, and some of them could pass as legitimate Trump tweets.

For instance, this tweet:

At first glance, that could be mistaken for a real Trump tweet.

But others seem slightly off. It's important to point out that the algorithm doesn't actually understand the meaning of language, only the statistical probability that certain words are likely to appear in a certain order. Sometimes you end up with something fairly nonsensical:

But part of why DeepDrumpf is sometimes successful at mimicking the real Donald Trump probably has to do with the nature of Twitter itself. Twitter is built for brevity, and individual tweets are often read out of context. If you're a bot trying to pass yourself off as human, Twitter's a pretty good place to do that.

What's the goal of this Twitter bot?

Hayes started all of this as an experiment, and a way to learn more about artificial intelligence. But a funny thing happened after he made DeepDrumpf public — it became fairly popular. With two weeks to go before the election, it has more than 26,000 followers on Twitter.

Hayes decided he should do something with all that attention. So he started a crowdfunding campaign, with all the proceeds going towards Girls Who Code, an organization dedicated to closing the gender gap in technology.

Bumper stickers given as perks to contributors to the DeepDrumpf crowdfunding campaign, which raises money for the non-profit organization Girls Who Code. (GoFundMe/DeepDrumpf)

In a strange twist, this weird algorithmically-generated parody Twitter account is raising real dollars to address the technology gender gap — which is a real issue in that industry.

What's next for these kind of AI mimics?

DeepDrumpf is just one example of using AI to create a a digital imposter, or mimic. Earlier this year, Google announced something called WaveNet, which is speech synthesis software. Basically, if you give it a samples of a person's voice, it can generate audio — spoken words — that convincingly mimic that person's voice.

In the visual realm, Hayes mentioned an algorithm called Neural Style that can mimic the visual style of any artist. You give it two images, and it can modify the first one so it's in the style of the second one. So your family photo can be painted in the style of Picasso or van Gogh, for example.

We're seeing more and more examples of computer software that tries to mimic human speech, writing or artistic creativity. These systems get better and better the more training data they have.

And Hayes said his software could be used to mimic anyone. As the election campaign has gone on, his Twitter bot has gotten "Trumpier" — for better or for worse.

ABOUT THE AUTHOR

Dan Misener

CBC Radio technology columnist

Dan Misener is a technology journalist for CBC radio and CBCNews.ca. Find him on Twitter @misener.