Check out this new article by Carlos Arcila Calderón and colleagues, which digs into the link between online hate speech and offline hate crimes in Spain. The team wanted to answer a big question: can social media hate speech help predict when and where violence against migrants and LGBT people might happen?
The study set out to test whether inflammatory language on social media could serve as an early warning signal for hate crimes. The focus was on hate speech targeting migrants and LGBT communities in Spain. Crucially, the study aimed to predict hate crimes, not to prove causation.
What data did they use?
They pulled together two main sources of data from 2016 to 2018:
Official police records of hate crimes across Spain (excluding Catalonia and the Basque Country), disaggregated by day and province.
Social media data from X (formerly Twitter) and public Facebook posts, focusing on Spanish-language content generated in Spain.
From the police data, they extracted 657 hate crime cases specifically targeting migrants and LGBT people. On the social media side, they analysed over 1 million tweets and 776,000 Facebook posts, using hate speech classifiers to identify content with toxic or hateful language.
How did they analyse the data?
The researchers created a series of time series datasets, combining the hate speech indicators with daily and weekly counts of reported hate crimes. They then ran 48 machine learning models, using three methods:
Vector autoregression (VAR) – for modelling temporal relationships.
GLMNet – a regularised linear model.
XGBTree – a non-linear boosting model.
Each model aimed to forecast hate crimes based on patterns of online speech, with separate models for migrants and LGBT people, and for national vs. city-level data.
What did they find?
Here’s what stood out:
Toxicity trumps sentiment: The best predictors of offline violence weren’t messages with negative sentiment or even explicit hate speech, but those with toxic language — especially identity attacks, threats, and profanity.
Facebook beats X: Facebook posts were more predictive than tweets, especially for LGBT-related crimes.
Migrant-focused models outperformed LGBT ones: Predictive accuracy (measured by R²) was higher in models focused on crimes against migrants. One model explained up to 64% of the variance in hate crimes targeting migrants.
Weekly patterns matter: Models using weekly aggregated data performed better than daily ones, likely because daily hate crimes are rare events with lots of zeros.
Language precedes crime: In the best models, online hate language preceded spikes in offline hate crimes, supporting the idea of social media as an early indicator.
What types of language signalled offline violence?
The clearest signals included:
Threatening language (e.g. explicit calls for harm or dehumanising language).
Identity-based insults (targeting migrants or LGBT identities).
High levels of general toxicity, as measured by tools like Google’s Perspective API.
Interestingly, models that included hate speech directed at one group (e.g. migrants) could also help predict crimes against another group (e.g. LGBT people), suggesting overlapping online hate ecosystems.
Policy implications
This research has clear takeaways for governments, police, and civil society:
Early warning systems: Social media monitoring could be used to forecast risk and deploy preventative measures in real time — though with caution to avoid over-surveillance.
Focus on toxicity: Monitoring tools should prioritise toxic language rather than just tracking hate terms or hashtags.
Use multiple platforms: Relying only on Twitter/X underestimates the problem — Facebook was often a stronger signal.
Intervene early: The presence of inflammatory content could prompt outreach, counter-narratives, or increased support for vulnerable groups before violence escalates.
Research implications
The paper adds weight to the view that social media data can reflect real-world social tensions. It also shows that advanced machine learning can handle rare events like hate crimes, provided the data is granular and the models are carefully built. Future work could expand this approach by including other variables (e.g. media events, economic stressors) and comparing across regions or countries.
The authors also flag ethical concerns around surveillance and bias — a reminder that predictive policing must be transparent, evidence-based, and accountable.
This website uses cookies to ensure you get the best experience on our website.