Optimizing Few-Shot Learning Through a Consistent Retrieval Extraction System for Hate Speech Detection

Ronghao Pan, José Antonio García-Díaz, Rafael Valencia-García

Resumen


Hate speech is a growing phenomenon on social media, posing significant risks to social cohesion and online safety. Its detection is crucial to mitigate these effects, but fine-tuning-based approaches are costly and prone to overfitting due to biases in the training data. In-context learning, which uses pre-trained models with instructions and examples during inference, is emerging as a promising alternative, although it lacks clear strategies for selecting relevant examples. This work proposes an intelligent example selection system for Few-Shot Learning (FSL) based on diversity and uncertainty metrics, which optimizes recognition compared to Zero-Shot Learning (ZSL) and Random FSL methods. Our approach was evaluated on four Spanish hate speech datasets. This strategy consistently improves the results, with the Gemma-2-2b and Gemma-2-9b models excelling across different datasets. In specific cases, the pre-trained knowledge of certain models benefits ZSL, but overall our proposal proves to be an effective and adaptable solution.

Texto completo:

PDF