Revealing the impact of synthetic native samples and multi-tasking strategies in Hindi-English code-mixed humour and sarcasm detection

Debajyoti Mazumder, Aakash Kumar, Jasabanta Patro · DOI

Abstract

Detecting humor and sarcasm in code-mixed languages like Hindi-English (Hinglish) is a significant challenge due to data scarcity and linguistic nuances. This paper investigates the effectiveness of Native Sample Mixing (NSM), Multi-Task Learning (MTL) with hate speech detection as a secondary task, and Large Language Model (LLM) prompting. Results indicate that while massive multilingual models struggle with cultural subtext, smaller specialized models like MuRIL, when trained via MTL, achieve significant performance gains—up to 12.35% in sarcasm detection.

Introduction

Humor and sarcasm detection are considered "holy grails" in Natural Language Processing (NLP) because they are deeply subjective and context-dependent. In code-mixed settings, where speakers alternate between languages (e.g., Hindi and English) within a single utterance, the challenge is magnified. Models must navigate dual grammars and vocabularies while capturing the irony or wit inherent in the hybrid language.

The primary obstacles identified in this research include:

  • Data Scarcity: A lack of high-quality annotated datasets for code-mixed humor and sarcasm.
  • Linguistic Complexity: The intricate interaction between two languages used to create humor.
  • Cross-Lingual Gap: A performance drop in models trained primarily on monolingual data when applied to code-mixed text.

Methodology

The study evaluates three primary strategies across a range of models, from traditional statistical classifiers to modern Large Language Models (LLMs):

  1. Native Sample Mixing (NSM): Augmenting limited code-mixed data with monolingual English and machine-translated "silver" Hindi samples. This was tested on Multilingual Language Models (MLMs) such as mBERT, XLM-R, MuRIL, and IndicBERT.
  2. Multi-Task Learning (MTL): A BERT-based architecture with shared lower layers and task-specific upper layers. Hate speech detection was used as a secondary task, leveraging the semantic overlap between aggressive language and sarcasm. A gating mechanism was implemented to control the flow of information between shared and task-specific modules.
  3. VMLM Prompting & Finetuning: Evaluation of "Very Large" models (Gemma, Aya Expanse, Llama 3.1, and GPT-4) using few-shot prompting and Parameter-Efficient Fine-Tuning (PEFT) via LoRA.

Datasets

The research utilized a combination of code-mixed, monolingual, and synthetic datasets. Code-mixed data included Khandelwal et al. (Humor) and Swami et al. (Sarcasm). Monolingual English datasets (e.g., ColBERT, POTD, HaHa) were used for augmentation. For the MTL task, hate speech datasets like Bohra et al. and HASOC were utilized. Synthetic Hindi data was generated via the Google Translate API to fill the gap in native Hindi humor/sarcasm resources.

Results and Analysis

The experimental results highlight the superiority of specialized architectures and multi-tasking strategies over general-purpose large models.

Native Sample Mixing (NSM) Performance

Adding monolingual samples significantly improved MLM performance, with gains of up to 6.76% for humor and 8.64% for sarcasm. However, this approach negatively impacted traditional statistical models like Naive Bayes, suggesting that MLMs are better equipped to leverage cross-lingual signals through shared embeddings.

Performance of various models across different native language data (NLD) augmentation strategies for humor and sarcasm detection.

The MTL Advantage

The Multi-Task Learning approach was the most effective strategy, boosting F1-scores by 10.67% for humor and 12.35% for sarcasm. The "Hate-to-Humor" pipeline proved successful because sarcastic remarks often employ "hateful" or aggressive keywords in a non-literal manner. The MTL framework, particularly when utilizing the gating mechanism, helped models distinguish between literal hate and figurative humor. MuRIL-MTL achieved the highest F1-score for humor (0.83), while XLM-R-MTL led for sarcasm (0.91).

Multi-task learning (MTL) results for sarcasm detection using hate speech as a secondary task, comparing gated vs. non-gated architectures.

LLM Performance

Massive models like GPT-4 and Llama 3.1 were frequently outperformed by smaller, Indian-language-centric models like MuRIL. These VMLMs often fell into the trap of "literalism," failing to grasp the cultural subtext required to interpret Hinglish jokes. Few-shot prompting yielded particularly poor results, with some models scoring as low as 0.09 F1 in specific humor detection scenarios.

Key Insights

  • Gating Mechanism: The gating mechanism in the MTL setup was particularly effective for handling short, noisy social media text with misspellings.
  • Translation Loss: Machine-translated "silver" data often loses humorous nuances, indicating a need for culturally-aware translation or generation rather than literal translation.
  • Task Synergy: Hate speech detection provides a strong auxiliary signal for humor and sarcasm due to shared linguistic features and semantic overlap.

Conclusion and Future Work

This research demonstrates that specialized architectures and multi-tasking strategies are more effective for code-mixed nuance detection than simply increasing model scale. While synthetic data provides a useful baseline, the loss of idiomatic humor during translation remains a limitation. Future work will explore using LLMs for more creative data augmentation and extending these methods to other code-mixed language pairs such as Spanish-English or Tamil-English.

Summary updated

BibTeX
@inproceedings{mazumder2025revealing,
  author = {Debajyoti Mazumder and Aakash Kumar and Jasabanta Patro},
  title = {{Revealing the impact of synthetic native samples and multi-tasking strategies in Hindi-English code-mixed humour and sarcasm detection}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
}
Figure