Sentence-Level BERT and Multi-Task Learning of Age and Gender in Social Media

Muhammad Abdul-Mageed, Chiyu Zhang, Arun Rajendran, AbdelRahim A. Elmadany, Michael Przystupa, Lyle H. UngararXiv 2019

Abstract

This study investigates sentence-level author profiling for age and gender in Arabic social media. While Multi-Task Learning (MTL) with task-specific attention improves performance over standard neural baselines, a single-task fine-tuned BERT model achieves state-of-the-art results. The findings demonstrate the robustness of large-scale pre-trained representations for short-text classification in multi-dialectal contexts, even when linguistic cues are sparse.

Introduction

Author profiling—the task of predicting attributes like age, gender, or location—typically relies on aggregating a large history of a user's posts. However, in real-world scenarios such as real-time trend analysis or disaster response, we may only have a single sentence or tweet to work with. Predicting attributes at the sentence level is significantly harder because a single tweet contains very few linguistic cues.

This challenge is amplified for Arabic, a language characterized by a wide variety of regional dialects and complex morphology. This paper explores whether modern NLP architectures, specifically Multi-Task Learning (MTL) and BERT, can bridge this gap by capturing shared linguistic patterns across different demographic tasks.

Methodology

The researchers experimented with several primary architectural approaches to determine the most effective way to extract demographic information from short text:

  1. BiGRU with Attention: A bidirectional Gated Recurrent Unit (GRU) paired with self-attention, serving as a strong neural baseline.
  2. Multi-Task Learning (MTL): The model attempts to predict age and gender simultaneously. The authors tested two variations: Shared Attention, where all hidden layers are shared, and Task-Specific Attention, where the bottom layers are shared but each task receives its own unique attention layer to focus on distinct linguistic markers.
  3. Supervised Attention: A novel method using Mutual Information (MI) to identify words statistically linked to specific labels (e.g., words indicative of "female" or "under 25") to guide the model's focus.
  4. BERT: Fine-tuning the Multilingual Cased BERT-Base model, pre-trained on 104 languages including Arabic.
Comparison of MTL architectures with shared vs. task-specific attention.

Datasets

The study utilized the Arab-Tweet (Arap-Tweet) dataset, a massive collection of 1.6 million tweets from 17 different Arabic-speaking countries. It includes ground-truth labels for gender (binary) and age (three categories: Under 25, 25-34, and 35+). To test real-world generalization, the authors also used an EXTERNAL dataset of ~2,124 manually labeled users from 20 Arab countries.

Results and Discussion

The experimental results revealed that all neural models significantly outperformed majority-class baselines. A key insight from the MTL experiments was that Task-Specific Attention is vital; giving each task its own attention layer outperformed sharing a single layer. This suggests that the linguistic markers for age (e.g., slang) are distinct from those for gender (e.g., grammatical agreements in Arabic).

Performance comparison across different model settings for age and gender prediction.

Despite the theoretical advantages of MTL, the single-task BERT model emerged as the state-of-the-art champion. BERT achieved 51.42% accuracy for age and 65.30% for gender, outperforming the best MTL models. This underscores that BERT’s massive pre-training provides a "knowledge base" that is difficult to surpass with task-specific engineering.

Conclusion

While sentence-level profiling remains difficult—with a 65% accuracy ceiling for gender—BERT provides a powerful tool for handling the nuances of multi-dialectal social media text. The authors suggest that future work should explore incorporating more tasks simultaneously, such as location or dialect, and investigate why BERT's single-task performance remains superior to current MTL paradigms in this domain.

Summary updated

BibTeX
@misc{abdulmageed2019sentence,
  author = {Muhammad Abdul-Mageed and Chiyu Zhang and Arun Rajendran and AbdelRahim A. Elmadany and Michael Przystupa and Lyle H. Ungar},
  title = {{Sentence-Level BERT and Multi-Task Learning of Age and Gender in Social Media}},
  year = {2019},
  eprint = {1911.00637},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.00637},
}
Figure