# name
Large language models and causal analysis: zero-shot counterfactuals in hate speech perception

# metadata.dc.description[].value
Treballs finals del Màster de Fonaments de Ciència de Dades, Facultat de matemàtiques, Universitat de Barcelona. Curs: 2023-2024. Tutor: Roger Pros Rius i Jordi Vitrià i Marca

# metadata.dc.description.abstract[].value
[en] Detecting hate speech is crucial for maintaining the integrity of social media platforms, as it involves identifying content that denigrates individuals or groups based on their characteristics. However, the expression of hate can be different across different demographics and platforms, making its detection a complex task.
A significant factor in hate speech is the presence of offense, which alters the perception of hate without altering the core meaning of the text. This study aims to examine how offense affects the perception of hate speech in social media comments.
To achieve this, we employ two distinct causal inference methods to measure the impact of offensive language on the detection of hate speech. The first method utilizes the traditional backdoor criterion, which allows us to model the nodes of the causal graph as features in a machine learning model that predicts hate. This method is demanding from a modeling point of view, as it requires training a specific model for each node in the causal graph.
The second method leverages the capabilities of Large Language Models (LLMs) to generate textual  counterfactuals in a zero-shot manner, i.e., without requiring any training or fine-tuning. These textual counterfactuals are then used to estimate causal effects.
Our findings reveal that the causal effect of offense on hate is higher with the LLM generated counterfactuals than with the methodology that follows the backdoor criterion. Additionally, we train a machine learning model to directly predict the causal effect from a comment.

# metadata.dc.rights[].value
cc-by-nc-nd (c) Sergio Hernández Jiménez, 2024

# metadata.dc.rights[].value
codi: GPL (c) Sergio Hernández Jiménez, 2024

# metadata.dc.source[].value
Màster Oficial - Fonaments de la Ciència de Dades

# metadata.dc.subject.classification[].value
Tractament del llenguatge natural (Informàtica)

# metadata.dc.subject.other[].value
Natural language processing (Computer science)

# metadata.dc.title[].value
Large language models and causal analysis: zero-shot counterfactuals in hate speech perception