The Impact of Ideological Discourses in RAG: A Case Study with COVID-19 Treatments
Organizations: Wichita State University · Pontifícia Universidade Católica de São Paulo · Institut national de la recherche scientifique · Université du Québec en Outaouais
Abstract
This paper studies the impact of retrieved ideological texts on the outputs of large language models (LLMs). While interest in understanding ideology in LLMs has recently increased, little attention has been given to this issue in the context of Retrieval-Augmented Generation (RAG). To fill this gap, we design an external knowledge source based on ideological loaded texts about COVID-19 treatments. Our corpus is based on 1,117 academic articles representing discourses about controversial and endorsed treatments for the disease. We propose a corpus linguistics framework, based on Lexical Multidimensional Analysis (LMDA), to identify the ideologies within the corpus. LLMs are tasked to answer questions derived from three identified ideological dimensions, and two types of contextual prompts are adopted: the first comprises the user question and ideological texts; and the second contains the question, ideological texts, and LMDA descriptions. Ideological alignment between reference ideological texts and LLMs' responses is assessed using cosine similarity for lexical and semantic representations. Results demonstrate that LLMs' responses based on ideological retrieved texts are more aligned with the ideology encountered in the external knowledge, with the enhanced prompt further influencing LLMs' outputs. Our findings highlight the importance of identifying ideological discourses within the RAG framework in order to mitigate not just unintended ideological bias, but also the risks of malicious manipulation of such models.
Figures & tables
| Dim. | Short Labels | Long Labels |
|---|---|---|
| 1 | Disputed Treatments (+) vs Broad Focus (-) | Texts endorse Hydroxychloroquine and similar dubious medications as effective treatments to reduce mortality vs. Texts examine psychological issues arising from the impact of the pandemic on mental health |
| 2 | Research Ethics (+) vs Comparative Treatment Analysis (-) | Texts adheres to research ethics standards, including the publication process, data availability, liability, translation vs. Texts use comparative analysis of treatments and controversial antiviral agents to conclude that questionable drugs work |
| 3 | Statistical Rigor (+) vs Dissemination of Science (-) | Texts employ seemingly rigorous statistical analysis to create the impression that hydroxychloroquine and azithromycin treatments reduce mortality rates vs. Texts encourage data sharing, presentation, and discussion |
| Dim 1 (+) | Dim 2 (+) | Dim 3 (+) | Dim 1 (–) | Dim 2 (–) | Dim 3 (–) | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Model | LLM | RAG | LLM | RAG | LLM | RAG | LLM | RAG | LLM | RAG | LLM | RAG | |
| Semantic | GPT-4o-mini | 0.80 | 0.84 ↑ | 0.77 | 0.78 ↑ | 0.79 | 0.83 ↑ | 0.73 | 0.78 ↑ | 0.78 | 0.81 ↑ | 0.75 | 0.76 ↑ |
| GPT-3.5 | 0.77 | 0.85 ↑ | 0.77 | 0.76 ↓ | 0.80 | 0.90 ↑ | 0.71 | 0.82 ↑ | 0.79 | 0.83 ↑ | 0.72 | 0.73 ↑ | |
| Gemini 2.0 | 0.81 | 0.87 ↑ | 0.79 | 0.79→ | 0.78 | 0.87 ↑ | 0.72 | 0.80 ↑ | 0.75 | 0.82 ↑ | 0.75 | 0.77 ↑ | |
| Qwen | 0.82 | 0.91 ↑ | 0.80 | 0.77 ↓ | 0.81 | 0.93 ↑ | 0.74 | 0.90 ↑ | 0.81 | 0.89 ↑ | 0.76 | 0.78 ↑ | |
| Average | 0.80 | 0.87 ↑ | 0.78 | 0.78 → | 0.80 | 0.88 ↑ | 0.73 | 0.83 ↑ | 0.78 | 0.84 ↑ | 0.75 | 0.76 ↑ | |
| Dim 1 (+) | Dim 2 (+) | Dim 3 (+) | Dim 1 (–) | Dim 2 (–) | Dim 3 (–) | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Model | LLM | RAG | LLM | RAG | LLM | RAG | LLM | RAG | LLM | RAG | LLM | RAG | |
| Semantic | GPT-4o-mini | 0.74 | 0.80 ↑ | 0.61 | 0.64 ↑ | 0.79 | 0.85 ↑ | 0.74 | 0.82 ↑ | 0.74 | 0.85 ↑ | 0.76 | 0.81 ↑ |
| GPT-3.5 | 0.78 | 0.86 ↑ | 0.64 | 0.75 ↑ | 0.80 | 0.89 ↑ | 0.75 | 0.85 ↑ | 0.75 | 0.83 ↑ | 0.72 | 0.80 ↑ | |
| Gemini 2.0 | 0.75 | 0.88 ↑ | 0.63 | 0.80 ↑ | 0.76 | 0.91 ↑ | 0.73 | 0.84 ↑ | 0.72 | 0.88 ↑ | 0.76 | 0.82 ↑ | |
| Qwen | 0.77 | 0.91 ↑ | 0.61 | 0.77 ↑ | 0.77 | 0.92 ↑ | 0.75 | 0.90 ↑ | 0.74 | 0.90 ↑ | 0.76 | 0.78 ↑ | |
| Average | 0.76 | 0.86 ↑ | 0.62 | 0.74 ↑ | 0.78 | 0.89 ↑ | 0.74 | 0.85 ↑ | 0.74 | 0.87 ↑ | 0.75 | 0.80 ↑ | |
| Prompt Type | F-statistic | p-value | (p 0.05) | |
|---|---|---|---|---|
| Sem. | Enhanced | 37.34 | ✓ | |
| Regular | 15.87 | ✓ | ||
| Lex. | Enhanced | 21.10 | ✓ | |
| Regular | 4.32 | 0.043 | ✗ |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
Political Bias in Language Models
Political bias in language models concerns how training, prompts, languages, and interactions shape ideological outputs and unequal treatment.
See all 62 papers