Screenshot by Marrian Zhou/CNET

You can teach an AI program to write stories like a human, but you might not be prepared for the plot twists.

OpenAI, a nonprofit artificial intelligence research group backed by Elon Musk, on Thursday offered a look at GPT-2, "a large-scale unsupervised language model" that it says does remarkably well at skills like reading comprehension, question answering and summarization.

That is, give it a sentence as a prompt, and it'll give you a writing sample that's pretty convincing. Trained on a data set of 8 million web pages, GPT-2 can even adapt to the style and the content of the text you feed it.

OpenAI offered a number of examples, including this one:

SYSTEM PROMPT (HUMAN-WRITTEN) Miley Cyrus was caught shoplifting from Abercrombie and Fitch on Hollywood Boulevard today. MODEL COMPLETION (MACHINE-WRITTEN, SECOND TRY) The 19-year-old singer was caught on camera being escorted out of the store by security guards. The singer was wearing a black hoodie with the label 'Blurred Lines' on the front and 'Fashion Police' on the back. Scroll down for video Shoplifting: Miley Cyrus was caught shoplifting from Abercrombie and Fitch on Hollywood Boulevard today (pictured) The singer was wearing a black hoodie with the label 'Blurred Lines' on the front and 'Fashion Police' on the back The singer was also wearing a pair of black-rimmed glasses, a black jacket, black jeans and black sandals. She was carrying a pair of black and white striped gloves and a small black bag.

On the plus side, that could lead to things like AI writing assistants and better speech recognition systems.

But in an era still coming to grips with bot-generated tweets and deepfake videos, OpenAI is worried that bad actors would use automated text generators to whip up "deceptive, biased, or abusive language at scale" -- things like misleading news articles, online imposters, abusive content on social media, or spam and phishing content.

For that reason, OpenAI said it's not revealing all the research details of GPT-2. Instead, it's releasing a much smaller model and a technical paper for other researchers to play with.

Last year, OpenAI built a team of bots to compete in Dota 2, a popular multiplayer online battle arena game in which players compete in teams of five. In June, OpenAI's five bots defeated amateur human teams, and in August, they took on semiprofessional Dota 2 players (ranked in the 99.95th percentile in the world), beating the humans in two games and losing once.

Musk co-founded OpenAI in 2016 but stepped down as chairman a year ago amid concerns about a possible conflict of interest, given that Tesla Motors, the electric car company he runs, would be focusing more on AI. The billionaire said he would continue to "donate and advise the organization."

First published Feb. 14 at 3:12 p.m. PT.

Update Feb. 15 at 7:05 a.m. PT: Adds more information about Elon Musk and OpenAI.

Now playing: Watch this: Hear IBM Debater argue with a human -- and lose

Deepfakes have lawmakers worried: AI-generated videos could be a threat to national security, they say.

IBM's AI loses debate to a human: But that's OK. It's got whole worlds to conquer.