Robin Sloan is using a computer program he created using a database of texts to help write his latest novel. (Peter Prato for The New York Times)
The idea that a novelist is someone struggling alone in a room, equipped with nothing more than determination and inspiration, could soon be obsolete. Robin Sloan is writing his book with the help of home-brewed software that finishes his sentences with the push of a tab key.
It’s probably too early to add “novelist” to the long list of jobs that artificial intelligence will eliminate. But if you watch Mr. Sloan at work, it is quickly clear that programming is on the verge of redefining creativity.
Mr. Sloan, who won acclaim for his debut, “Mr. Penumbra’s 24-Hour Bookstore,” composes by writing snippets of text, which he sends to himself as messages and then works over into longer passages. His new novel is set in a near-future California where nature is resurgent. Recently, the writer made this note: “The bison are back. Herds 50 miles long.”
As he expands this slender notion, he writes: The bison are gathered around the canyon. He hits tab. The computer analyzes the last few sentences, and adds “by the bare sky.”
Mr. Sloan likes it. “Would I have written ‘bare sky’ by myself?” he said. “Maybe, maybe not.”
He moves on: The bison have been traveling for two years back and forth. The computer suggests between the main range of the city.
“That wasn’t what I was thinking at all, but it’s interesting,” the writer said. His software is not labeled anything as grand as artificial intelligence. It’s machine learning, facilitating and extending his own words, his own imagination. At one level, it merely helps him do what fledgling writers have always done — immerse themselves in the works of those they want to emulate.
“I have read some uncounted number of books and words over the years that all went into my brain and stewed together in unknown and unpredictable ways, and then certain things come out,” Mr. Sloan said. “The output can’t be anything but a function of the input.”
But the input can be pushed in certain directions. About 25 years ago, an electronic surveillance consultant named Scott French used a supercharged Mac to imitate Jacqueline Susann’s sex-drenched tales. Mr. French wrote thousands of computer-coded rules suggesting how certain character types derived from Ms. Susann’s works might interact.
It took Mr. French and his Mac eight years to finish the tale. “Just This Once” was commercially published, although it did not join Ms. Susann’s “Valley of the Dolls” on the best-seller list.
Many others have been experimenting with fiction that pushes in the direction of A.I.
Botnik Studios used a predictive text program to generate four pages of rather wild Harry Potter fan fiction.The Alibaba Group, the Chinese e-commerce company, said in January that its software for the first time outperformed humans on a global reading comprehension test. If the machines can read, then they can write.
Mr. Sloan wanted to see for himself. He acquired from the Internet Archive a database of texts: issues of Galaxy and If, two popular science fiction magazines in the 1950s and ’60s.
Those original magazines were too limiting, full of clichés and stereotypes. So Mr. Sloan augmented the pool with digital text of novels by John Steinbeck, Dashiell Hammett, Joan Didion, Philip K. Dick and others; Johnny Cash’s poems; Silicon Valley oral histories; old Wired articles; the California Department of Fish and Wildlife’s Fish Bulletin; and more.
Mr. Sloan has finished his paragraph:
“The bison were lined up fifty miles long, not in the cool sunlight, gathered around the canyon by the bare sky. They had been traveling for two years, back and forth between the main range of the city. They ring the outermost suburbs, grunting and muttering, and are briefly an annoyance, before returning to the beginning again, a loop that had been destroyed and was now reconstituted.”
“I like it, but it’s still primitive,” the writer said. “What’s coming next is going to make this look like crystal radio kits from a century ago.”