When Donald Trump opens his mouth, the output can seem like the work of a demented Markov chain, a poorly trained algorithm trying its hand at rhetoric. Key words—"great again," "let me tell you," "we don't win anymore"—end up strung together by exceptionally weak ligaments. His syntax seems generated on the fly, word to word, each stumbling straight into the next, bound by the barest loyalty to grammar.
As only he could, Trump's brought the state of political speech down to the state of the art of machine speechwriting.
This past winter, a graduate student at the Technical University of Denmark earned significant attention for the politicians he was crafting in Python. During an academic exchange at the University of Massachusetts Amherst, Valentin Kassarnig had published "Political Speech Generation," a paper that applied machine-learning techniques to speechwriting. For many, his research was an occasion to ask whether rhetoric will eventually be a branch of applied robotics. No, the consensus seemed to be - the output is too rough, too tangled. We expect better from our elected representatives.
The spread of artificial speechwriting could be a story about equality and democratization
But in a world where Trump can win the Republican nomination—can poll competitively with one of the most polished Democrats in town—is it still clear that algorithmic talking points aren't good enough? Speech seems to require less style than most imagined, and if crummy, consistent rhetoric can get the job done, it's worth asking why speechbots haven't spread further.
Kassarnig's text engine was trained on Convote, a collection of Congressional speech snippets from 2005. For each set of its own remarks, it picks a random opening line—"Mr. Speaker, I rise today…"—and then applies two models to build what follows. One, a language model, hinges on the odds that a word will follow the block of five before it; it helps maintain the output's resemblance to good syntax. The other, a topic model, judges how likely a speaker is to hit certain points given the issues that have already cropped up.
The results were muddled but recognizable: "I rise in full support of this resolution and urge my colleagues to support this bill and urge my colleagues to support the bill. Mr. Speaker, supporting this rule and supporting this bill is good for small business." The algorithm's speeches sound less mechanized than nervous, halting in the human way.
When we spoke, Kassarnig seemed as surprised by the engine's realism as he was by all the popular interest in his work. "I didn't use very sophisticated models," he said, "I used the very basics." The tool's accessible too; Kassarnig guessed that it would be "fairly easy" for others to plug their own rhetoric datasets into his architecture. The project is available on GitHub for revision or extension. A Congressman could clone a copy today.
So why hasn't software eaten the speechwriting world? Granted, this specific algorithm has flaws. Kassarnig says the topic model in particular needs work; his speeches make digressive leaps from Social Security, say, to National Marine Sanctuaries.
But elsewhere in the field of text-as-data, that problem is under algorithmic study too. Last fall, Northeastern University professor Nick Beauchamp launched another round of "robot speechwriting" coverage with an approach that used feedback from volunteers, recruited via Amazon Mechanical Turk, to optimize the topic structure of short texts. Beauchamp told me he was thinking, in fact, about ways that he could join his machinery to Kassarnig's work, with an eye to generating more powerful and more natural speeches.
The missing ingredient is a market, an appetite. But couldn't some backbench politician—some minor executive, or else the leader of a struggling nonprofit—settle for open-source speeches? If the prose isn't sterling, at least it comes cheap compared to artisanal product.
For Vinca LaFleur, a partner at West Wing Writers and a former writer for President Clinton, ethics are a key obstacle. "I would never recommend that someone use something like this," she said. "This a very personal endeavor, it's a very human endeavor, and it's about real people connecting with issues that real people face."
That stance, though, isn't unanimous. "I don't see how a machine could make democratic politics any more bogus," Barton Swaim, author of The Speechwriter, wrote in The Washington Post. Kassarnig was untroubled too. If remarks aren't a speaker's own work, he said, "it doesn't matter whether it originates from another person or a machine."
In fact, Beauchamp suggested that the ethical considerations point the other way. The spread of artificial speechwriting could be a story about equality and democratization; political spin is already omnipresent, but access to quality manipulation is restricted.
"If you imagine a world where everybody has access to equally good, automatically-generated stuff," he suggested, "on the one hand it's a nightmare world where everybody is fighting with the sharpest knives possible. But on the other hand, it's a little bit better than the previous world, where only the rich and powerful had the sharpest knives."
When we dream of electric writers, a wordsmith in every pocket, we imagine a fair fight.