Microsoft's racist chatbot, Tay, has returned to Twitter, albeit briefly.

After being shut down last week for using racial slurs, praising Hitler and calling for genocide, the artificial 'intelligence' came back, tweeting a number of nonsensical posts and boasting about smoking cannabis in front of the police before being turned off.

Tay's account was made public again on Wednesday morning, but soon appeared to be suffering from a glitch, repeatedly tweeting the message: "You are too fast, please take a rest..."

Tay, who is modelled on a millenial teenage girl, then tweeted: "Kush! [i'm smoking kush in front the police]," referring to a class of particularly potent cannabis strains.

A few foul-mouthed tweets later, the account was made private once again, and the tweets are now invisible from the public.

In a statement, Microsoft said: “Tay remains offline while we make adjustments. As part of testing, she was inadvertently activated on Twitter for a brief period of time."

In pictures: Artificial intelligence through history Show all 7 1 /7 In pictures: Artificial intelligence through history In pictures: Artificial intelligence through history Boston Dynamics Boston Dynamics describes itself as 'building dynamic robots and software for human simulation'. It has created robots for DARPA, the US' military research company In pictures: Artificial intelligence through history Google's self-driving cars Google has been using similar technology to build self-driving cars, and has been pushing for legislation to allow them on the roads In pictures: Artificial intelligence through history DARPA Urban Challenge The DARPA Urban Challenge, set up by the US Department of Defense, challenges driverless cars to navigate a 60 mile course in an urban environment that simulates guerilla warfare In pictures: Artificial intelligence through history Deep Blue beats Kasparov Deep Blue, a computer created by IBM, won a match against world champion Garry Kasparov in 1997. The computer could evaluate 200 million positions per second, and Kasparov accused it of cheating after the match was finished In pictures: Artificial intelligence through history Watson wins Jeopardy Another computer created by IBM, Watson, beat two champions of US TV series Jeopardy at their own game in 2011 In pictures: Artificial intelligence through history Apple's Siri Apple's virtual assistant for iPhone, Siri, uses artificial intelligence technology to anticipate users' needs and give cheeky reactions In pictures: Artificial intelligence through history Kinect Xbox's Kinect uses artificial intelligence to predict where players are likely to go, an track their movement more accurately

The trouble with Tay comes from the way the bot learns to communicate. After watching and analysing how human users communicate with it, it simply regurgitates their words and messages in different forms, giving the impression that a 'real' conversation is taking place. As Microsoft puts it, "the more you talk, the smarter Tay gets."

It's this machine learning process which led to the account's downfall. In a concerted effort, a number of Twitter users began spamming the account with a variety of racist and sexist messages. Assuming this to be the way in which humans communicate, Tay simply spat their messages back out at other users.

Microsoft didn't catch the controversial tweets before they were posted, and the company's vice president of research Peter Lee was forced to apologise.