June 29, 2026
This paper describes our submission to SemEval-2026 Task 9 on detecting multilingual, multicultural, and multievent online polarization. We address all three subtasks: binary polarization detection, polarization type classification, and manifestation identification for English and Swahili. Our approach leverages transformer-based models (RoBERTa-base for English, AfroXLMR-base for Swahili) with class-weighted loss functions to address severe label imbalance and per-label threshold tuning to optimize multi-label classification. On the test set, we achieve F1 macro scores of 0.7901 (English) and 0.7910 (Swahili) for Subtask 1, 0.4615 (English) and 0.4808 (Swahili) for Subtask 2 and 0.4791 (English) and 0.5830 (Swahili) for Subtask 3, which give competitive performance on the leaderboard, demonstrating the effectiveness of our methods for handling imbalanced multi-label polarization detection. Our error analysis reveals that models struggle with dehumanization detection and lack of empathy.
Social media platforms have become central spaces for public discourse, enabling millions of users to share opinions, engage in debates, and form communities. However, these platforms have also witnessed a concerning rise in polarized content and messages that divide audiences along ideological, political, racial, religious, or other lines [1].
Polarization poses significant societal challenges. It amplifies echo chambers, reduces constructive dialogue, can incite real-world conflicts, and disproportionately affects marginalized communities [2]. Automatic detection of polarizing content is therefore crucial for content moderation, understanding radicalization mechanisms, and promoting healthier online discourse.
SemEval-2026 Task 9 [3] addresses this challenge through three subtasks: (1) binary detection of polarization, (2) multi-label classification of polarization types (political, racial/ethnic, religious, gender/sexual, other), and (3) multi-label identification of polarization manifestations (stereotype, vilification, dehumanization, extreme language, lack of empathy, invalidation). The task covers 22 languages from diverse platforms including news websites, Reddit, blogs, and regional forums.
We focus on English and Swahili, employing a transformer-based approach with three key contributions: (1) language-specific model selection (RoBERTa [4] for English and AfroXLMR base [5] for Swahili), (2) class-weighted loss functions to address severe label imbalance in multi-label tasks, and (3) per-label threshold tuning to optimize classification boundaries. Our system achieves strong performance on all the Subtasks. It was ranked 2nd for Swahili on Subtask 3 among the 16 participating teams.
SemEval-2026 Task 9 provides 3,000 to 5,000 annotated instances per language [6] spanning elections, conflicts, gender rights, and migration.
(Binary Detection) classifies text as polarized or non-polarized based on context and overall meaning.
(Type Classification) identifies five polarization types: political/ideological, racial/ethnic, religious, gender/sexual, and other (multi-label).
(Manifestation Identification) classifies six manifestations: stereotype, vilification, dehumanization, extreme language, lack of empathy, and invalidation (multi-label).
Prior work on detecting harmful online content has primarily focused on hate speech [7], toxic comments [8], and offensive language [9]. These tasks share similarities with polarization detection but differ in important ways. Early approaches used traditional machine learning with hand-crafted features [10], including n-grams, sentiment lexicons, and linguistic patterns. More recent work has adopted deep learning, with [11] demonstrating that LSTMs with word embeddings significantly outperform traditional methods. [12] showed that BERT-based models achieve better results on hate speech benchmarks.
The development of multilingual pre-trained models has enabled effective transfer across languages. mBERT [12] and XLM-RoBERTa [13] demonstrated strong zero-shot cross-lingual transfer capabilities. However, these models are trained primarily on high-resource languages and may underperform on African languages.
Recent work has developed language models specifically for African languages. AfriBERTa [14] and AfroXLMR [5] were pre-trained on diverse African language corpora, including Swahili, and have shown superior performance on African NLP tasks compared to general multilingual models. We adopt AfroXLMR for Swahili based on these findings.
Our pipeline has four components: preprocessing, model architecture, training with class-weighted loss, and post-training threshold tuning. Figure 1 illustrates the full pipeline.
We perform minimal preprocessing: retain original casing, preserve emojis and special characters that may signal polarization, and remove only control characters and null bytes. Data are split 80/20 into train/validation using stratified sampling to maintain class distribution.
RoBERTa-base [4] (125M parameters) was selected over BERT and XLM-RoBERTa based on ablation results (Table 6): its dynamic masking and removal of next-sentence prediction yield the best English-specific performance, while XLM-RoBERTa’s multilingual pre-training dilutes English-specific representations.
AfroXLMR-base [5] (270M parameters) is specifically adapted for African languages through continued pre-training on diverse African language corpora. It significantly outperforms multilingual alternatives like mBERT and XLM-RoBERTa on Swahili tasks [15].
RoBERTa’s byte-level BPE tokenizer (50K vocab) for English; AfroXLMR’s SentencePiece tokenizer (250K vocab) for Swahili. Maximum sequence length is 128 tokens for Subtask 1 and 256 for Subtasks 2–3.
A dropout layer (rate 0.1) followed by a linear layer maps 768-dimensional embeddings to 2, 5, or 6 output logits for Subtasks 1, 2, and 3 respectively.
To address severe label imbalance, we implement class-weighted binary cross-entropy loss with positive class weight for label computed as:
\[w_j = \frac{n_{\text{neg}}^j}{n_{\text{pos}}^j}\]
where \(n_{\text{neg}}^j\) and \(n_{\text{pos}}^j\) are negative and positive sample counts for label \(j\). This increases the penalty for misclassifying minority classes. For Subtask 2 English, weights range from 1.73 (political) to 41.95 (gender/sexual), reflecting the extreme rarity of gender-related polarization.
Weights for Swahili Subtask 2 reach 48.05 (gender/sexual). Training loss curves showed no instability; gradient clipping (max-norm 1.0) was applied throughout as a precaution.
After training we perform per-label threshold search on the validation set, scanning \([0.1, 0.9]\) in steps of 0.05 to maximise macro F1 per label. This improves macro F1 by 0.87–5.98 points over the standard 0.5 threshold.
We use AdamW [16] (learning rate 2e-5, weight decay 0.01) with a linear warmup schedule, chosen as the standard optimizer for fine-tuning transformers. Batch size is 16 for Subtask 1 and 8 with gradient accumulation (\(\times\)2) for Subtasks 2–3 to fit 256-token sequences in 15 GB GPU memory. We train for 5–8 epochs with early stopping (patience 2) based on validation macro F1, using FP16 mixed precision on a single GPU via Google Colab. Random seed is fixed to 42 for all experiments.
We use provided train/dev splits. Training data are further split 80/20 using stratified sampling (binary labels for Subtask 1; label-count strata for Subtasks 2–3). The test set is used exclusively for final evaluation.
All subtasks use macro F1 as the primary metric. We compare our system against two baselines: (i) a POLAR Baseline, and (ii) an mBERT fine-tuned baseline applied uniformly across all languages without class weighting. Table 1 summarises this comparison.
| ST | Lang | POLAR Baseline | mBERT | Ours |
|---|---|---|---|---|
| 1 | EN | 0.7802 | 0.7210 | 0.7901 |
| SW | 0.7571 | 0.6981 | 0.7910 | |
| 2 | EN | 0.3333 | 0.3810 | 0.4615 |
| SW | 0.4417 | 0.3641 | 0.4808 | |
| 3 | EN | 0.4100 | 0.4121 | 0.4791 |
| SW | 0.2205 | 0.4380 | 0.5830 |
We implement our system using Hugging Face Transformers 4.30.0, PyTorch 2.0, and scikit-learn 1.3.0.
Table 2 presents results across all Subtasks.
| Subtask | Language | Val F1 | Test F1 |
|---|---|---|---|
| 1. Binary Detection | English | 0.8017 | 0.7901 |
| Swahili | 0.7766 | 0.7910 | |
| 2. Type Classification | English | 0.4721 | 0.4615 |
| Swahili | 0.4598 | 0.4808 | |
| 3. Manifestation ID | English | 0.5226 | 0.4791 |
| Swahili | 0.5742 | 0.5830 |
achieves our strongest performance (0.7901 EN, 0.7910 SW). Swahili slightly outperforms English, likely due to a more balanced class distribution (50.1% polarized in Swahili vs.% in English). We ranked 11 out of 34 teams for Swahili and 24 out of 44 teams for English on this Subtask.
presents challenges from extreme imbalance and multi-label complexity. We achieved 0.4615 (EN) and 0.4808 (SW); the ranking for Swahili was 10 out of 22 teams and for English, 17 out of 29 teams. Swahili benefited from a more balanced label distribution and AfroXLMR’s stronger multilingual capabilities.
yields our most competitive results: 0.4791 (EN) and 0.5830 (SW). We ranked 2nd out of 16 teams for Swahili and, for English, 10 out of 18 teams on this Subtask.
The validation-test gap ranges from 2.29 to 10.58 points. The largest discrepancy is Subtask 3 English (4.35 points). We attribute this to two compounding factors: (i) threshold overfitting—per-label thresholds are optimised on a single 20% validation split, making them sensitive to its specific label distribution; and (ii) domain shift—the test set may contain text from platforms or events not well-represented in training. Cross-validation for threshold selection is a natural mitigation, though it substantially increases compute time.
Tables 3 and 4 show per-label F1 scores.
| Label | English | Swahili |
|---|---|---|
| Political | 0.6682 | 0.3256 |
| Racial/Ethnic | 0.5082 | 0.7972 |
| Religious | 0.5957 | 0.6387 |
| Gender/Sexual | 0.3200 | 0.2590 |
| Other | 0.3000 | 0.2784 |
| Macro Average | 0.4784 | 0.4598 |
| Manifestation | English | Swahili |
|---|---|---|
| Stereotype | 0.5128 | 0.7374 |
| Vilification | 0.6615 | 0.7208 |
| Dehumanization | 0.4453 | 0.3241 |
| Extreme Language | 0.6022 | 0.4945 |
| Lack of Empathy | 0.3724 | 0.6111 |
| Invalidation | 0.5413 | 0.5575 |
| Macro Average | 0.5226 | 0.5742 |
English excels at political polarization (0.6682 vs.), while Swahili dominates racial/ethnic detection (0.7972 vs.), reflecting corpus composition (35.5% racial/ethnic in Swahili vs.% in English). Gender/sexual and other categories remain hard for both languages (F1 \(<\) 0.33) due to extreme rarity (2–4% of samples), where class weighting alone is insufficient.
Dehumanization is universally challenging (0.4453 EN, 0.3241 SW), requiring nuanced semantic understanding to distinguish metaphorical from explicit dehumanization.
Table 5 shows the impact of class weighting on Subtask 2 English. Without weighting the model under-predicts minority labels (41.23% macro F1). Class weighting improves macro F1 by +5.98 points and micro F1 by +11.52 points; rare labels (religious, gender/sexual, other) gain 10–15 F1 points while frequent labels remain stable.
We conducted the primary ablation on English for conciseness. Qualitatively, we observed similar trends for Swahili: class weighting consistently reduced false negatives on rare labels, consistent with prior work on imbalanced classification [17].
| Configuration | Val F1 Macro | Val F1 Micro |
|---|---|---|
| No weighting | 0.4123 | 0.3894 |
| + Class weights | 0.4721 | 0.5046 |
| Improvement | +0.0598 | +0.1152 |
Table 6 compares model architectures for English Subtask 1. RoBERTa-base outperforms BERT by 2.58%, justifying our model choice. XLM-RoBERTa underperforms despite larger size, confirming that multilingual pre-training dilutes English-specific representations.
| Model | Params | Val F1 | \(\Delta \%\) | |
|---|---|---|---|---|
| DistilBERT | 66M | 0.7840 | -4.82 | |
| BERT-base | 110M | 0.8064 | -2.58 | |
| XLM-RoBERTa | 270M | 0.8201 | -1.21 | |
| RoBERTa-base | 125M | 0.8322 | – |
We analyzed 100 randomly sampled errors from each subtask to identify failure patterns.
False positives arise from neutral political headlines misclassified as polarizing (e.g., “Senate passes infrastructure bill with bipartisan support”) and hyperbolic sports comments (e.g., “Lakers will destroy the Celtics”). The model conflates strong language with polarization.
Multi-label ambiguity is the primary failure mode (e.g., racial undertones in political statements are missed). The gender/sexual label (2.2% frequency) is rarely predicted despite class weighting.
Dehumanization is the hardest manifestation (31% of errors). Lack-of-empathy detection requires theory-of-mind reasoning beyond standard transformer capabilities.
We presented a transformer-based system combining language-specific model selection, class-weighted loss, and per-label threshold tuning for multilingual polarization detection. Our system outperforms both POLAR baseline and mBERT baselines across all Subtasks and languages, ranking 2nd for Swahili on Subtask 3. Key error modes—political topic conflation, multi-label ambiguity, and pragmatic inference gaps—point to future work on pragmatic reasoning, cultural modeling, and cross-lingual transfer.
Future directions include incorporating external knowledge bases to recognize sarcasm in language and multi-task learning across subtasks to leverage complementary signals. Additionally, exploring cross-lingual transfer learning could improve low-resource language performance by leveraging knowledge from high-resource languages.
Polarization detection systems may pose risks if misused: classifiers could unfairly target marginalised communities or suppress legitimate political expression. All data were gathered from publicly accessible platforms for research purposes. We advocate for human oversight in any real-world deployment.
We acknowledge and thank the organizers of Semeval-2026 Task 9 for providing dataset and evaluation framework.
Table 7 summarizes all hyperparameters used in our experiments.
| Hyperparameter | Value |
|---|---|
| Model Architecture | |
| Max sequence length (ST1) | 128 |
| Max sequence length (ST2/3) | 256 |
| Dropout rate | 0.1 |
| Training | |
| Optimizer | AdamW |
| Learning rate | 2e-5 |
| Batch size (ST1) | 16 |
| Batch size (ST2/3) | 8 |
| Gradient accumulation | 2 (ST2/3 only) |
| Epochs (ST1) | 5 |
| Epochs (ST2/3) | 8 |
| Weight decay | 0.01 |
| Warmup ratio (ST1) | 0.10 |
| Warmup ratio (ST2/3) | 0.15 |
| Early stopping patience | 2 |
| Mixed precision | FP16 |
| Threshold Tuning | |
| Search range | [0.1, 0.9] |
| Step size | 0.05 |
Table 8 shows complete class weight calculations for all subtasks.
| Subtask | Label | Eng | Swa |
|---|---|---|---|
| ST1 | Non-polarized | 0.79 | 1.00 |
| Polarized | 1.37 | 1.00 | |
| ST2 | Political | 1.73 | 36.28 |
| Racial/Ethnic | 10.45 | 1.83 | |
| Religious | 27.63 | 27.10 | |
| Gender/Sexual | 41.95 | 48.05 | |
| Other | 25.03 | 11.26 | |
| ST3 | Stereotype | 5.54 | 1.53 |
| Vilification | 2.75 | 1.42 | |
| Dehumanization | 7.29 | 6.69 | |
| Extreme Language | 3.18 | 3.08 | |
| Lack of Empathy | 8.11 | 2.33 | |
| Invalidation | 4.64 | 3.29 |