Not All Pretraining are Created Equal: Threshold Tuning and Class Weighting for Imbalanced Polarization Tasks in Low-Resource Settings

Abass Oguntade

Published 2026-03-26
📖 5 min read🧠 Deep dive

Imagine social media as a giant, noisy town square where people are shouting their opinions. Sometimes, these shouts are just normal disagreements. But other times, the shouting turns into a toxic mob mentality where people hate "outsiders" and blindly support their own "tribe." This is polarization.

This paper is like a report card from a student (Abass) who tried to build a smart security guard (an AI) to patrol this town square. The guard's job is to spot the toxic shouting, figure out who they are attacking (politicians, a specific religion, a gender, etc.), and identify how they are attacking (using insults, dehumanizing words, or extreme language).

Here is the story of how the student built this guard, using simple analogies:

1. The Challenge: The "Rare Event" Problem

The biggest problem the student faced was that the town square is mostly calm. For every 100 posts, maybe only 30 are actually toxic. The rest are just normal talk.

  • The Analogy: Imagine trying to train a dog to find a specific rare flower in a massive field of grass. If you just show the dog the whole field, it will get lazy and just say "I see grass" every time because that's the most common thing.
  • The Fix: The student had to teach the AI to pay extra attention to the rare flowers (the toxic posts). They did this by giving the AI a "special score" (Class Weighting) that made mistakes on the rare toxic posts hurt more than mistakes on the common normal posts.

2. The Tools: Choosing the Right "Brain"

The student had to choose which "brain" (AI model) to give the guard. They had two types of candidates:

  • The Local Experts: Models trained specifically on Swahili (the local language of the area).
  • The World Travelers: Models trained on many languages (English, Swahili, French, etc.) but not specifically on Swahili.

The Surprise: The student expected the "Local Experts" to win because they knew the local slang better. But the World Travelers (specifically one called mDeBERTa) actually won by a landslide!

  • The Analogy: It's like hiring a local guide who knows every shortcut but gets confused by the specific rules of this new game, versus hiring a world-class athlete who has played every sport in the world. The athlete adapted to the new game faster than the local guide. The paper found that having a "big brain" that understands many languages was more important than having a "small brain" that only knows one language perfectly.

3. The Secret Sauce: "Threshold Tuning"

This is the most important trick the student used.

  • The Analogy: Imagine the AI is a bouncer at a club. It has to decide: "Is this person toxic? Yes or No?"
    • Normally, the bouncer uses a strict rule: "If you are 50% toxic, you are out."
    • But because toxic posts are so rare, the bouncer was being too strict and letting the bad guys in.
    • The Fix: The student adjusted the bouncer's sensitivity. They said, "Hey, if you think someone is even 30% toxic, let's flag them." They did this for every single type of toxicity separately.
  • The Result: This simple tweak was like magic. It boosted the AI's performance by a huge margin (over 20 points!). It's like turning up the volume on a radio so you can finally hear the quiet music you were missing.

4. The Results: How Good Was the Guard?

  • Binary Detection (Toxic vs. Not Toxic): The guard got very good at this, scoring around 80% accuracy. It could tell the difference between a heated political argument and actual hate speech.
  • The Hard Part (Multi-Label): When asked to identify exactly what kind of hate it was (e.g., "Is this racist? Is it sexist?"), the guard struggled a bit more. This is because some posts are tricky.
    • Example: A post saying "Those people don't understand our way of life" sounds polite but is actually a hidden insult (a "dog whistle"). The AI missed these sometimes.
    • Example: People mixing English and Swahili in one sentence confused the AI's tokenizer (the part that breaks words into pieces), making it hard to read.

5. What Didn't Work?

The student tried to train the guard on both English and Swahili data at the same time, hoping it would learn faster.

  • The Analogy: It was like trying to teach a student French and Japanese simultaneously by mixing the textbooks. The student got confused, and their performance actually got worse.
  • The Lesson: Sometimes, it's better to train on one language at a time and then combine the knowledge later, rather than mixing everything up from the start.

Summary

This paper teaches us that when building AI to detect hate speech in low-resource languages (like Swahili):

  1. Don't just use local models: A general, multilingual model often works better than a specialized one.
  2. Adjust the sensitivity: You can't just use a standard "yes/no" rule. You have to fine-tune the "alarm threshold" for every specific type of hate speech.
  3. Beware of mixing languages too early: Training on multiple languages at once can sometimes confuse the AI.

The student's system is now a strong tool for spotting online toxicity, but it still needs to get better at understanding hidden insults and mixed languages.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →