Adapting Safe-for-Work Classifier for Malaysian Language Text: Enhancing Alignment in LLM-Ops Framework
Aisyah Razak, Ariff Nazhan, Kamarul Adha, Wan Adzhar Faiq Adzlan, Mas Aisyah Ahmad, Ammar Azman
TL;DR
This work tackles the scarcity of safe-for-work guardrails for Malay-language text in LLM-Ops by creating the first comprehensive Malay NSFW dataset across nine content categories and developing a tailored classifier. It employs a multi-faceted methodology: manual labeling, zero-shot knowledge distillation from LLMs, centroid and sentiment-based filtering, and active learning to efficiently curate high-quality labels. The best-performing model, mesolitica/malaysian-mistral-191M-MLM, achieves strong accuracy and balanced precision/recall, significantly outperforming baselines such as microsoft/debertav3-base. By releasing the dataset and model publicly, the work advances alignment and safety tooling for Malay-language AI systems and lays groundwork for broader, language-specific LLM-Ops guardrails.
Abstract
As large language models (LLMs) become increasingly integrated into operational workflows (LLM-Ops), there is a pressing need for effective guardrails to ensure safe and aligned interactions, including the ability to detect potentially unsafe or inappropriate content across languages. However, existing safe-for-work classifiers are primarily focused on English text. To address this gap for the Malaysian language, we present a novel safe-for-work text classifier tailored specifically for Malaysian language content. By curating and annotating a first-of-its-kind dataset of Malaysian text spanning multiple content categories, we trained a classification model capable of identifying potentially unsafe material using state-of-the-art natural language processing techniques. This work represents an important step in enabling safer interactions and content filtering to mitigate potential risks and ensure responsible deployment of LLMs. To maximize accessibility and promote further research towards enhancing alignment in LLM-Ops for the Malaysian context, the model is publicly released at https://huggingface.co/malaysia-ai/malaysian-sfw-classifier.
