Spam is highly problematic on Twitter, which is why the social media network has developed a system that helps its efforts to keep users’ feeds free of unsolicited or malicious posts.
Dubbed “BotMaker,” Twitter’s anti-spam system is already being used in production, and the company claims to have observed a 40% reduction in key spam metrics since its introduction.
Because it’s crucial for content to be delivered in real-time, anti-spam systems must not add latency to operations carried out by users. On the other hand, because developer APIs are made available to make it easy to interact with the platform, spammers have access to information on how the anti-spam systems work.
When it created BotMaker, Twitter had three main objectives: prevent spam from being created, reduce the amount of time spam is visible to users, and reduce reaction time to new spam runs.
“BotMaker achieves these goals by receiving events from Twitter’s distributed systems, inspecting the data according to a set of rules, and then acting accordingly,” Raghav Jeyaraman explained on Twitter’s engineering blog.
According to Jeyaraman, the rules that power BotMaker are comprised of two parts: conditions based on which the system decides whether or not to act on an event, and actions that dictate what should be done with the event. This type of system, in the case of Twitter, has three main challenges: evaluating the rules with low latency, ensuring that engineers can create and modify rules quickly, and supporting computationally intense machine learning-based rules.
BotMaker leverages a combination of systems to detect spam. The system dubbed “Scarecrow” is designed to identify and block spammy content in real time. The “Sniper” system, which detects spam in near real time, works by continuously classifying users and content. Twitter also runs periodic scans that analyze user behavior over extended periods of time.
“BotMaker has also helped us reduce our response time to spam attacks significantly. Before BotMaker, it took hours or days to make a code change, test and deploy, whereas using BotMaker it takes minutes to react,” said Jeyaraman. “This faster reaction time has dramatically improved developer and operational efficiency, and it has allowed us to rapidly iterate and refine our rules and models, thus reducing the amount of spam on Twitter.”
