arXiv:2609.00958cs.CLSep 2026

Manuscript Offprint

arXiv:2609.00958

PersianAnonymizer: Evaluating LLM-Labeled Training for Efficient NER-based Anonymization in Persian

Mohammad Hossein Shalchian, Mostafa Amiri, Amir Mahdi Sadeghzadeh

Abstract

We target practical anonymization of Persian customer chats by training a compact NER model from LLM-labeled supervision and selecting the best labeler for deployment. We compare three instruction-tuned LLMs—DEEPSEEK-V3-0324, GPT-OSS-120B, and QWEN3-235B-A22B-INSTRUCT-2507—to produce span annotations under a shared JSON protocol, yielding four corpora (OSS_ZeroShot, Qwen_ZeroShot, Qwen_FewShot, DeepSeek_FewShot). A MATINAROBERTA-based token-classifier is trained per corpus and evaluated with token-level Precision/Recall/F1 (overall and per-class). We also report Label Coverage Recall (LCR), the proportion of gold non-0 tokens predicted as non-0, and quantify cross-labeler behavior via a token-level Venn on test annotations. Finally, we contrast test-set annotation latency of the LLMs on H200 nodes with the trained NER's test-time labeling on a single RTX 3090. Results show that supervision from OSS_ZeroShot yields the strongest macro-F1 and LCR, while the resulting NER labels an entire 40K-message test set in ~2 minutes on one consumer GPU. This establishes a practical path to high-quality, low-cost anonymization for Persian industrial data.

Keywords: Named Entity Recognition, Text Anonymization, Persian, Low-Resource, LLM-labeled Supervision, Industrial Chats, Personally Identifiable Information

1. Introduction

Organizations increasingly rely on large language models (LLMs) to analyze customer chats and to automate responses, yet these interactions routinely contain personally identifiable information (PII) and, in some domains, protected health information (PHI). Sharing raw messages with third-party or closed-source models raises privacy and compliance concerns (e.g., GDPR), and even aligned language models can memorize and surface snippets from their training data, exacerbating leakage risks (gdp, 2016; Carlini et al., 2021; Shokri et al., 2017). A natural mitigation is to anonymize inputs before any downstream processing.

A straightforward path is to ask an LLM to perform anonymization directly; however, production use often encounters a cost-latency-privacy trade-off: high-capacity models demand multi-GPU resources and vendor exposure, while smaller open models may not deliver the needed quality within tight latency budgets. In contrast, a compact token-classification NER model, once trained, can anonymize at scale with low, predictable inference cost—provided that we can obtain reliable supervision for the domain.

Recent practice leverages LLMs as labelers to bootstrap task models, reducing human annotation overhead (Zhang et al., 2023). For Persian, NER resources exist but are comparatively limited and not tailored to industrial chat anonymization.

Figure

Figure 1: Overall research pipeline: from raw Persian chat data labeling by multiple LLMs to NER training and multi-stage evaluation.

Moreover, to our knowledge there is no systematic comparison of which LLM produces supervision that yields the most learnable Persian NER for anonymization scenarios, nor an analysis that balances accuracy with deployment-time efficiency. Recent evidence also documents persistent performance gaps for LLMs in Persian and the need for targeted evaluation, underscoring the impor-tance of our Persian-focused study. (Abaskohi et al., 2024) Multilingual backbones (e.g., XLM-RoBERTa) (Conneau et al., 2020) have advanced transfer to lower-resource languages, but the choice of supervising labeler remains a critical—and underexplored—factor for downstream quality and throughput.

In this paper We compare three instruction-tuned LLMs as automatic labelers for Persian anonymization NER and train a compact NER per labeler. We evaluate token-level precision/recall/F1 (overall and per-class), cross-labeler agreement on test annotations, and end-to-end efficiency. Our results show that labels from one model yield the most learnable supervision, while the resulting NER achieves fast, single-GPU anonymization suitable for industrial deployment. The remainder of this paper is organized as follows: Section 2 reviews related work on anonymization, LLM-assisted labeling, and Persian NER. Section 3 describes dataset construction and annotation procedures, while Section 4 outlines the NER training setup. Section 5 presents the evaluation results and cross-dataset validation. Finally, Sections 6–8 discuss conclusions, limitations, and ethical considerations.