Leveraging Large Language Models in Detecting Anti- LGBTQIA + User-generated Texts (2025)

Abstract: Anti-LGBTQIA+ texts in user-generated content pose significant risks to online safety and inclusivity. This study investigates the capabilities and limitations of five widely adopted Large Language Models (LLMs)—DeepSeek-V3, GPT-4o, GPT-4o-mini, GPT-o1-mini, and Llama3.3-70B—in detecting such harmful content. Our findings reveal that while LLMs demonstrate potential in identifying offensive language, their effectiveness varies across models and metrics, with notable shortcomings in calibration. Furthermore, linguistic analysis exposes deeply embedded patterns of discrimination, reinforcing the urgency for improved detection mechanisms for this marginalised population. In summary, this study demonstrates the significant potential of LLMs for practical application in detecting anti-LGBTQIA+ user-generated texts and provides valuable insights from text analysis that can inform topic modelling. These findings contribute to developing safer digital platforms and enhancing protection for LGBTQIA+ individuals.

## introduction the dramatic growth of user-generated content @xcite underscores the urgent need to prevent the spread of intentionally and unintentionally harmful material across online social networks (osns) or other digital platforms. initially, user-generated text moderation relied on manual, rule-based methods, but with advancements in artificial intelligence (ai), osns and digital platforms have increasingly applied advanced technologies to uphold platform integrity. these developments are essential to protect both users and online communities from harmful content @xcite . abusive language or cyberbullying are among the most vital problems, and continue to pose significant challenges worldwide, affecting a vast number of individuals @xcite . if left unaddressed, such harmful interactions can greatly heighten the risk of suicidal thoughts and behaviours @xcite . although the relationship between bullying and suicidality-including suicidal ideation and attempts-is complex, research strongly indicates that victimization plays a major role in increasing this risk, often leading to severe psychological consequences for those affected @xcite . a promising approach to mitigating this problem is the development of ai-based moderation systems @xcite @xcite , which can efficiently detect abusive language on a large scale. especially, utilising large language models (llms) has notably advanced this task @xcite @xcite @xcite . however, the previous studies typically adopt a universal framework neglecting the evaluation and specific development, leading to high potential risks for queer individuals @xcite or lgbtqia+ community @xcite foot_0 despite growing evidence that they experience cyberbullying at significantly higher rates and at significantly higher rates than their heterosexual peers @xcite . cyberbullying among lgbtqia+ individuals has been linked to a wide range of harmful consequences (abreu and kenny, 2018), including severe psychological and emotional distress such as depression, low selfesteem, and an increased risk of suicidal thoughts and attempts. furthermore, it can also contribute to behavioural issues, such as heightened physical aggression, body image concerns, and social isolation (abreu and kenny, 2018). therefore, when leveraging llms for user-generated text moderation on osns or other digital platforms (websites, mobile apps,...), it is crucial to assess their effectiveness in identifying harmful or anti-lgbtqia+ user-generated text @xcite before deployment. without proper evaluation, llms may fail to recognize subtle forms of discrimination, reinforce biases, or even inadvertently allow harmful user-generated texts to persist, ultimately exacerbating the challenges faced by people in the lgbtqia+ community. hence, in this paper, we leverage five llms including deepseek-v3 @xcite , gpt-4o @xcite , gpt-4o mini @xcite , gpt-o1-mini @xcite which are among the most widely-used and up-to-date methods in the literature, to answer the following research questions (rqs) using user-generated texts comments data from youtube, reddit, and x with anti-lgbtqia+ user-generated content @xcite : lgbtqia+ user-generated texts? lgbtqia+ user-generated texts, and how do their predictive performance and calibration differ in this task? ## related work recent studies highlight the growing role of llms in automated content moderation. sarah et al. (2024) proved llms' contextual understanding aids hate speech detection. neele et al. (2024) proved the potential of user-driven moderation but pointed out scalability challenges. wei et al. (2024) demonstrated that llm pipelines reduce computational costs while maintaining high accuracy. cedric et al. (2022) emphasized detecting minority arguments for better understanding in debates. franco et al. (2024) highlighted llms' support in moderation dynamics, though reasoning limitations remain. kou and gui (2020) stressed the importance of community-aligned explanations in ai-led moderation. nevertheless, existing research predominantly addresses the general population, with limited evaluation of these methods specifically for the lgbtqia+ community. this gap raises concerns regarding potential biases and shortcomings that may disproportionately affect this marginalised group. however, studies addressing this issue remain limited in the literature. while llms have shown advancements over conventional ai models, current methodologies for anti-lgbtqia+ usergenerated content still primarily rely on conventional ai approaches @xcite . ## experiments the experiments of llms in this research are completed via model apis provided by open ai (ope-nai, 2025) (gpt-4o @xcite , gpt-4o mini @xcite , and gpt-o1-mini @xcite ), and meta llama (meta, 2025) (llama3.3-70b (jonas et al., 2025), deepseek-v3 @xcite ). the default hyperparameters are set, including @xmath0.0, @xmath1.0, and @xmath2.0. in text analysis, a word cloud (jin, 2017) is used to visualize the top 30 most frequent words in anti-lgbtqia+ user-generated texts. additionally, the strongest associations between commonly occurring offensive terms are analysed and visualised by a bigram network graph, which visualizes the top 30 most frequent bigrams, using a library named networkx @xcite . regarding evaluation metrics, five key performance indicators are utilised, each playing a crucial role in ai applications @xcite . these metrics include accuracy (acc ↑), true positive rate (t p r ↑), false positive rate (f p r ↓), precision (p rec ↑), and f1-score (f 1 ↑). additionally, the brier score (brier ↓) @xcite is incorporated as a metric of probabilistic calibration @xcite . the values for tpr, f p r, prec, and f1 are computed using macroaveraging. these metrics range from 0 to 1, where higher values correspond to better performance for all metrics, except for f p r and brier, where a better model has lower values. ## conclusions and discussions this research proves the potential of llms for realworld applications in identifying anti-lgbtqia+ user-generated content and underscores the valuable insights that text analysis can provide for topic modelling. these findings play a crucial role in fostering safer digital environments, ultimately improving protections for lgbtqia+ individuals including their mental health and well-being. to begin with, regarding the rqs outlined in section 1, about rq1, our analysis of anti-lgbtqia+ user-generated texts (see section 5.1) reveals a high prevalence of derogatory language, hate speech, and aggressive expressions. this can significantly contribute to topic modelling research. these find-ings underscore the urgent need for effective moderation strategies and improved detection models to mitigate harmful content and foster a safer online environment, improving the mental health and wellbeing of lgbtqia+ individuals. moreover, the proposed framework with the workflow in section 3.2, including the developed prompt and experiments establish a general pipeline for leveraging llms in detecting anti-lgbtqia+ user-generated texts, addressing rq2. for rq3, as detailed in section 5.2 while llms demonstrate promising performance in detecting anti-lgbtqia+ user-generated texts, improvements are still necessary for real-world deployment. firstly, performance varies across different metrics. deepseek-v3 and llama3.3-70b emerge as the top-performing models; however, their calibration is not as good as gpt-4o and gpt-4o-mini. in contrast, gpt-o1-mini consistently underperforms across all metrics, underscoring its limitations in this task. notably, despite achieving the highest performance, deepseek-v3 and llama3.3-70b still fall short, with all key metrics (acc, tpr, prec, and f1) remaining below 0.9. this highlights the limitations of these llms in a zero-shot setting, emphasizing the need for fine-tuning and further development to enhance their reliability and applicability. on top of that, all llms exhibit a notable calibration issue, tending to be overconfident in their predictions. this overconfidence can lead to increased false positives and false negatives, resulting in unreliable moderation/classification of anti-lgbtqia+ content. additionally, it may amplify biases, reduce trust in ai-driven moderation systems, and create challenges in human-ai collaboration by insufficient moderators. furthermore, as analysed in section 5.3, although achieving the best-performing model, deepseek-v3 has limitations in distinguishing between neutral discussions and harmful rhetoric, struggles with contextual nuance, and exhibits sociocultural detecting limitations in detecting anti-lgbtqia+ user-generated texts. the findings of this study establish a strong foundation for future research. future work should aim to enhance model performance through strategies such as few-shot prompting @xcite which may significantly improve the predictive capabilities of llms in detecting anti-lgbtqia+ user-generated texts. additionally, utilising larger-scale datasets with different languages is a crucial next step. additionally, ensuring demographic representation is critical for assessing llms' performance, and fairness across gender, nationality, lgbtqia+ subgroups, and so on. these advancements will contribute to developing a robust, fair, and generalisable llm-based anti-lgbtqia+ user-generated text detection framework for protecting people of the lgbtqia+ community.