Automated masking of Personally Identifiable Information (PII) is critical for privacy-preserving conversational systems. While current frontier large language models demonstrate strong PII masking capabilities, concerns about data handling and computational costs motivate exploration of whether lightweight models can achieve comparable performance. We compare encoder-decoder and decoder-only architectures by fine-tuning T5-small and Mistral-Instruct-v0.3 on English datasets constructed from the AI4Privacy benchmark. We create different dataset variants to study label standardization and PII representation, covering 24 standardized PII categories and higher-granularity settings. Evaluation using entity-level and character-level metrics, type accuracy, and exact match shows that both lightweight models achieve performance comparable to frontier LLMs for PII masking tasks. Label normalization consistently improves performance across architectures. Mistral achieves higher F1 and recall with greater robustness across PII types but incurs significantly higher generation latency. T5, while less robust in conversational text, offers more controllable structured outputs and lower inference cost, motivating its use in a real-time Discord bot for real-world PII redaction. Evaluation on live messages reveals performance degradation under informal inputs. These results clarify trade-offs between accuracy, robustness, and computational efficiency, demonstrating that lightweight models can provide effective PII masking while addressing data handling concerns associated with frontier LLMs.
翻译:个人身份信息(PII)的自动掩码对于隐私保护的对话系统至关重要。尽管当前前沿的大型语言模型展现出强大的PII掩码能力,但对数据处理和计算成本的担忧促使我们探索轻量级模型是否能够达到可比性能。我们通过在基于AI4Privacy基准构建的英文数据集上微调T5-small和Mistral-Instruct-v0.3,比较了编码器-解码器与仅解码器架构。我们创建了不同的数据集变体以研究标签标准化和PII表示,涵盖24个标准化PII类别及更高粒度的设置。使用实体级和字符级指标、类型准确率和精确匹配进行评估表明,两种轻量级模型在PII掩码任务上均实现了与前沿LLMs相当的性能。标签归一化在不同架构中持续提升性能。Mistral在跨PII类型上实现了更高的F1分数和召回率,且鲁棒性更强,但生成了显著更高的延迟。T5虽然在对话文本中鲁棒性较低,但提供了更可控的结构化输出和更低的推理成本,这推动了其在实时Discord机器人中用于真实世界PII编辑的应用。对实时消息的评估揭示了在非正式输入下性能下降的现象。这些结果阐明了准确性、鲁棒性和计算效率之间的权衡,证明轻量级模型能够提供有效的PII掩码,同时解决与前沿LLMs相关的数据处理问题。