Anyone who's waded into an online comments section has encountered trolls. The users just want to get a rise out of you, and sometimes, despite your best efforts, you give in to their offensive posting and get into a big fight. But Quartz reports that academics are working on a way to prevent the Internet's worst trolls before they even get started.

Researchers from Stanford and Cornell tracked trolls in the comments on CNN, Breitbart, and IGN using the commenting service Disqus. They tracked users from the moment they signed up to comment to the moment they got banned, and compared them to users who were never banned. Overall, they studied around 1.7 million users over an 18-month time period.

They found specific patterns of behavior from online trolls. They are more likely to focus on a few threads and post irrelevant content, and they have much lower writing quality than fellow commenters (which isn't much of a surprise). They're also likely to succeed in getting a reaction out of fellow readers, which is their goal in the first place. Once the backlash gets strong, their trolling just gets worse until they're banned.

Once the researchers tracked the patterns, they developed an algorithm that can predict whether a commenter will be banned in the future. The algorithm is 80% accurate, using just the first five posts. It works especially well when moderators are actively deleting their posts, and it gets harder to predict if the poster lasts longer without getting banned.

The researchers make it clear that some users got called trolls when they were simply just being grouchy. But when a commenter had more posts deleted over time, they were more likely to just be trolling people. And Time notes that an algorithm can't detect sarcasm, or trolls who are especially savvy with their language.

With a few tweaks, an algorithm might make it safe to go into the comments section again. But for now, it's safest to follow the old Internet adage: Never feed the trolls.