In a timely move coinciding with Halloween, researchers at MIT have created Shelley, the world's first artificial intelligence designed to collaborate with humans on horror stories. Conceived and coded by a research team from the MIT Media Lab's Scalable Cooperation group, the Twitter-based AI has been trained using over 140,000 horror stories from Reddit's r/nosleep subreddit that allow "her" to work with visitors to create suitably fiendish stories for the ghoulish season.

A famous writing exercise is the Round Robin, where a group of authors take it in turns to write a story collaboratively. As the manuscript is passed around, each person adds to it with new characters and ideas. The fun of the game is that no one knows how or when the story will end, or if someone is going to add some monstrous twist that the next person has to find a way to write out of.

Shelley works in a similar fashion. She's named after the English Author Mary Shelley, who, at the age of 18, wrote a novel as part of a contest with future husband, Percy Shelley, Lord Byron, and John Polidori to see who could write the best scary story as a way to pass a dull, rainy holiday at Lake Geneva. That story we know today as Frankenstein: or, the Modern Prometheus.

The cybernetic Shelley also specializes in horror stories, but of the Round Robin variety, which she comes up with thanks to her database, deep-learning algorithms, and her ability to improve her literary efforts as she interacts with humans. Every hour, @shelley_ai posts the start of a new story with the hashtag #yourturn. Anyone who visits can then add the next instalment. Shelley analyzes this and then makes her own addition. The AI and visitors take turns in this way until the tale of terror is complete.

According to MIT, this collaboration is a way to study how far artificial intelligence and machine learning can go. The feedback works with Shelly's multi-layer recurrent neural network and learning algorithm to create stories that are better and scarier as time goes on.

"Shelley's creative mind has no boundaries," says the research team. "She writes stories about a pregnant man who woke up in a hospital, a mouth on the floor with a calm smile, an entire haunted town, a faceless man on the mirror... anything is possible!"

The completed stories are available to read on the Shelley project website, but the MIT team warns that Shelley can't screen for content, so parental discretion is advised.