arXiv:2611.04342cs.AINov 2026

Manuscript Offprint

arXiv:2611.04342

Beyond Fine-Tuning: Evaluating Prompt Engineering and Prompt Tuning for Roman Urdu Hate Speech Detection

Toneema Zubair, Muhammad Junaid Asif, Faisal Kamiran, Hafiz Hassan Saeed, Rana Fayyaz Ahmad

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Toneema Zubair ¹, Muhammad Junaid Asif ²,³*, Faisal Kamiran ¹, Hafiz Hassan Saeed ¹, Rana Fayyaz Ahmad ²

¹Department of Computer Sciences, Information Technology University (ITU), Lahore 54000, Pakistan

²Natural Language Processing (NLP) Lab, Artificial Intelligence Technology Centre (AITEc), Islamabad 44000, Pakistan

³Faculty of IT and Computer Sciences, University of Central Punjab (UCP), Lahore (54000), Pakistan

*junaid.asif@ncp.edu.pk

Abstract— Low Resource Languages (LRLs) pose significant challenges for hate speech detection because of a scarcity of readily available annotated data, language variation, non-standard spelling, and context-dependent ambiguity. Beyond the problem of informal conventions of writing in Roman Urdu, there is also the issue of code-mixing. After working on the previous project about zero-shot learning and parameter-efficient fine-tuning (PEFT), this research systematically compares prompt engineering and prompt tuning for Roman Urdu hate speech detection. To study the effect of in-context examples, we will compare the zero-shot and few-shot prompting approaches. To understand the advantage of structured prompting and learnable prompt representations, we will conduct studies of manual vs. mixed prompt-based adaptation strategies. Experimentations are carried out on the PURUT dataset (~72,771 social media comments) with GPT-3.5, LLaMA-3, Mistral-7B, and multilingual BERT in several settings. Experimental results show that few-shot prompting always outperforms zero-shot prompting, with the Mistral-7B model scoring 0.67 F1 compared to 0.56 of the zero-shot models. Based on this observation, prompt-based adaptation is proposed to introduce additional improvements, with the proposed mixed prompt configuration able to yield a F1-score up to 0.87 which further surpasses the performance of regular manual prompts. Despite the larger size of the model, its performance trade-off between inference-based prompting, prompt optimization, and parameter-efficient model adaptation is compared to the previously reported PEFT-based F1-score, which is ~0.93. Overall, the study demonstrates the potential of carefully designed and optimized prompting strategies for improving hate speech detection in linguistically complex, low-resource environments while providing practical insights into selecting suitable adaptation approaches.

Keywords— Roman Urdu Hate Speech Detection (RU-HSD), Low Resource Languages (LRLs), Prompt Engineering, Zero-Shot Learning, Few-Shot Learning, Prompt Tuning, Prefix Prompting, Cloze Prompting

I. INTRODUCTION

The rapid expansion of social media platforms has transformed how people communicate, share opinions, and engage in public discourse. While platforms such as Twitter (now X), Facebook, and YouTube have increased opportunities for information sharing and public interaction, they have also facilitated the dissemination of harmful content, including hate speech, offensive language, and abusive expressions. Hate speech poses significant psychological and societal risks by contributing to discrimination, polarization, and hostility toward individuals and communities. Consequently, automatic hate speech detection has emerged as an important research area within natural language processing (NLP),

supporting the development of safer and more inclusive online environments.

Over the past decade, hate speech detection has advanced significantly through machine learning, deep learning, and transformer-based models such as BERT, which leverage contextual embeddings and self-attention mechanisms. However, most studies have focused on high-resource languages like English, where large annotated datasets are available [1]. In contrast, low-resource languages remain underexplored, and models trained on high-resource languages often fail to generalize effectively.

Roman Urdu presents particular challenges for hate speech detection because of its non-standard spelling, phonetic variations, informal expressions, and frequent code-mixing. These characteristics complicate contextual understanding and classification. Furthermore, limited linguistic resources and imbalanced datasets affect model performance. To address these challenges, Saeed et al. [2] introduced the PURUTT dataset, comprising 72,771 toxic and non-toxic social media comments, providing a benchmark for Roman Urdu toxicity classification.

Recent advancements in large language models (LLMs), including GPT, LLaMA, and Mistral, have introduced prompt-based learning as an alternative to conventional model fine-tuning. Prompt-based learning can be broadly divided into prompt engineering and prompt tuning. Prompt engineering enables models to perform downstream tasks through natural language instructions without updating model parameters. In particular, zero-shot prompting relies solely on task instructions, whereas few-shot prompting incorporates a limited number of labeled examples to improve contextual understanding and classification performance [3]. These approaches are particularly relevant to low-resource NLP applications where extensive model training may be impractical.

Beyond prompt engineering, prompt tuning provides an alternative mechanism for adapting pre-trained models through task-specific prompt representations. Lester et al.[4] demonstrated the effectiveness of learnable soft prompts, while Li and Liang [5] introduced prefix tuning, which optimizes continuous prompt representations while keeping the underlying model parameters frozen. Additionally, cloze-based prompting reformulates classification as a masked-token prediction task, allowing models to associate contextual information with predefined class labels [6]. These approaches offer

XXX-X-XXXX-XXXX-X/XX/$XX.00 ©20XX IEEE different mechanisms for improving task adaptation while reducing the need for full-model fine-tuning.

Despite their advantages, prompt-based approaches remain sensitive to prompt structure, instruction wording, demonstration selection, and linguistic variability. These limitations are particularly relevant to Roman Urdu, where inconsistent spelling and contextual ambiguity can affect classification reliability. Although parameter-efficient fine-tuning (PEFT), particularly Low-Rank Adaptation (LoRA), provides effective task-specific adaptation [8], the comparative effectiveness of prompt engineering and alternative prompt tuning strategies for Roman Urdu hate speech detection requires further investigation.

Building upon our previously published work comparing zero-shot prompting and PEFT-based adaptation [9], this study focuses on a systematic evaluation of zero-shot versus few-shot prompt engineering and prefix versus cloze prompt formulations for Roman Urdu hate speech detection. Experiments are conducted using the PURUTT dataset and multiple pretrained language models to investigate the influence of prompt design and adaptation strategies on classification performance. The study evaluates accuracy, precision, recall, and F1-score to identify effective prompting approaches for linguistically complex and low-resource environments. To guide this study, the following research questions are formulated:

  • RQ1: How does few-shot prompting perform compared to zero-shot prompting in Roman Urdu hate speech detection?
  • RQ2: How do prefix and cloze prompting strategies affect classification performance?
  • RQ3: Does mixed prompt tuning outperform conventional manual prompting?
  • RQ4: How do prompt-based approaches compare with previously reported PEFT results?
  • RQ5: What are the performance and computational efficiency trade-offs among these approaches?

This paper makes several key contributions to the field of low-resource NLP:

  • A comprehensive comparison of prompt engineering, prompt tuning, and parameter-efficient fine-tuning for hate speech detection in Roman Urdu.
  • Introduction and evaluation of a mixed prompt tuning approach that combines manual templates with learnable soft tokens.
  • Empirical analysis of zero-shot and few-shot prompting strategies in low-resource settings.
  • Insights into the strengths and limitations of prompt-based learning compared to PEFT.
  • Practical recommendations for selecting appropriate adaptation strategies in resource-constrained environments.

The remainder of this paper is organized as follows. Section II reviews related work, while Section III presents the dataset, methodology, and experimental setup. Section IV reports the experimental results, followed by a discussion of key findings in Section V. Finally, Section VI concludes the study and outlines future research directions.