journal article·2026-03-30Open access

On the Applicability of LLMs and SLMs for Privacy-Preserving Named Entity Recognition in Financial Applications

Evgenia Psarra, Kyriakos Stefanidis

Applied Sciences· Volume 16· Issue 7

Abstract

This work explores how deep learning models, with different numbers of parameters, can be effectively applied to detect personal data within unstructured text using Named Entity Recognition (NER) techniques. We evaluate the performance of various architectures by leveraging a plethora of language models (LMs) consisting of Distilbert-base-uncased, Distilbert-base-cased, Bert-base-uncased, Bert-base-cased, Bert-large-uncased, Bert-large-cased, ModernBERT-base, ModernBERT-large, nomic-BERT-2048, RoBERTa-base, DistilRoBERTa-base, RoBERTa-large, Deberta-v3-xsmall, Deberta-v3-small, and Deberta-v3-base, which are evaluated using the performance indices of accuracy, precision, recall, and F1-score. Our experiments show that some Small Language Models (SLMs) compete equally with some corresponding LLMs (Large Language Models), based on the specific PII (Personally Identifiable Information) dataset, thus enhancing personal data detection, which is of paramount importance in financial applications. Moreover, we proposed a novel architecture based on an optimized transformer fine-tuning strategy to improve PII recognition across diverse contexts and conducted an extensive comparative analysis to evaluate the performance of our proposed architecture in relation to all relevant existing approaches reported in the literature. This evaluation, performed on the AI4Privacy PII 43 K dataset, encompasses every publicly available work we identified and provides a thorough benchmarking of our methods within the current research field. The results highlight both the strengths and limitations of existing solutions and demonstrate the effectiveness of SLMs in addressing the challenges of privacy-preserving information extraction.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Data Quality and Management · Topic Modeling · Machine Learning in Healthcare

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

Industrial System Institute, Athena Research Center, 26504 Patras, Greece

Archimedes, Athena Research Center, 15125 Athens, Greece

Department of Informatics, University of Piraeus, Karaoli & Dimitriou 80, 18534 Piraeus, Greece

Funding

European Union under the NextGenerationEU Program https://ror.org/03c0ach84

References (48)

Show source-provided references
1. When Llms Meet Cybersecurity: A Systematic Literature Review10.1186/s42400-025-00361-w ↗
2. Risk and the Five Hard Problems of Cybersecurity10.1111/risa.13309 ↗
3. Yigit, Y., Buchanan, W.J., Tehrani, M.G., and Maglaras, L. (2024). Review of Generative AI Methods in Cybersecurity. arXiv.
4. Fayyazi, R., Taghdimi, R., and Yang, S.J. (2024). Advancing TTP Analysis: Harnessing the power of large language models with retrieval augmented generation. Proceedings of the 2024 Annual Computer Security Applications Conference Workshops (ACSAC Workshops), IEEE.10.1109/ACSACW65225.2024.00036 ↗
5. Du, X., Zheng, G., Wang, K., Zou, Y., Wang, Y., Deng, W., Feng, J., Liu, M., Chen, B., and Peng, X. (2025). Vul-RAG: Enhancing LLM-based Vulnerability Detection via Knowledge-level RAG. arXiv.10.1145/3797277 ↗
6. Rigaki, M., Lukáš, O., Catania, C., and Garcia, S. (2024). Out of the cage: How stochastic parrots win in Cyber Security Environments. Proceedings of the 16th International Conference on Agents and Artificial Intelligence, SCITEPRESS—Science and Technology Publications, Lda.10.5220/0012391800003636 ↗
7. Belcak, P., Heinrich, G., Diao, S., Fu, Y., Dong, X., Muralidharan, S., Lin, Y.C., and Molchanov, P. (2025). Small Language Models are the Future of Agentic AI. arXiv.
8. Thamm, B.G. (Service Contractor Magazine, 2024). Trustworthy and secure ai: How small language models strengthen data security, Service Contractor Magazine.
9. Pakhale, K. (2023). Comprehensive overview of named entity recognition: Models, domain-specific applications and challenges. arXiv.
10. Enhancing Financial Named Entity Recognition through Adaptive Few-Shot Learning: A Comparative Study of Pre-Trained Language Models10.69987/JACS.2024.40702 ↗
11. Peeters, C., Vijverberg, K., Pouwer, M., Westerman, B., Boot, M., and Verberne, S. (2025). Evaluation of surus: A named entity recognition NLP system to extract knowledge from Interventional Study Records. BMC Med. Res. Methodol., 25.10.1186/s12874-025-02624-z ↗
12. FinBERT: A large language model for extracting information from financial text10.1111/1911-3846.12832 ↗
13. Henao, W.E. (2025, December 01). Ai4privacy-PII. Available online: https://www.kaggle.com/datasets/verracodeguacas/ai4privacy-pii.
14. Areskoug, T., and Mörk, V. (2025). Detection of Personal Data in Unstructured Text Using Deep Learning Models. arXiv.
15. Song, M., Kim, H., Kim, J., Shin, S., and Son, S. (2025, January 13–15). Refusal Is Not an Option: Unlearning Safety Alignment of Large Language Models. Proceedings of the 34th USENIX Security Symposium (USENIX Security 25), Seattle, WA, USA.
16. Artificial Intelligence and Privacy Concerns: Balancing Innovation with Security
17. Portcullis: A Scalable and Verifiable Privacy Gateway for Third-Party LLM Inference10.1609/aaai.v39i1.32088 ↗
18. Shen, Z., Xi, Z., He, Y., Tong, W., Hua, J., and Zhong, S. (2024). The Fire Thief Is Also the Keeper: Balancing Usability and Privacy in Prompts. arXiv.
19. Zhou, J., Xu, E., Wu, Y., and Li, T. (2025). Rescriber: Smaller-LLM-Powered User-Led Data Minimization for LLM-Based Chatbots. Proceedings of the 2025 CHI Conference on Human Factors in Computing Systems, Association for Computing Machinery.10.1145/3706598.3713701 ↗
20. Savkin, M., Ionov, T., and Konovalov, V. (2025). SPY: Enhancing Privacy with Synthetic PII Detection Dataset. Proceedings of the 2025 Conference of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Student Research Workshop), Association for Computational Linguistics.10.18653/v1/2025.naacl-srw.23 ↗
21. Meena, B., Skubisz, J., Rajgarhia, H., Dave, N., Ganesh, K., Dalmia, S., Mukherji, A., and Sundarababu, V. (2025). Scalable Multilingual PII Annotation for Responsible AI in LLMs. arXiv.10.1109/ICDMW69685.2025.00049 ↗
22. Rajgarhia, H., Gupta, S., Shaik, A., Kumar, G.P., Santhoshraj, Y., Nishitha, S.N.T., and Mukherji, A. (2025). An Evaluation Study of Hybrid Methods for Multilingual PII Detection. arXiv.
23. Hasegawa, M. (2025). LLM-Assisted Detecting and Redacting Confidential Information for Government Information Disclosure. [Ph.D. Thesis, Virginia Tech].
24. Li, H., Ye, J., and Wu, J. (2025). Privacy Dilemmas and Opportunities in Large Language Models: A Brief Review. Front. Comput. Sci., 19.10.1007/s11704-024-40583-8 ↗
25. Mainetti, L., and Elia, A. (2025). Detecting Personally Identifiable Information Through Natural Language Processing: A Step Forward. Appl. Syst. Innov., 8.10.3390/asi8020055 ↗
26. Karavdić, N. (2025). Handling Confidential Data in LLM Prompts. [Master’s Thesis, Mälardalens University].
27. Privacy Backdoors: Enhancing Membership Inference through Poisoning Pre-Trained Models
28. Forget to Flourish: Leveraging Machine Unlearning on Pretrained Language Models for Privacy Leakage10.1609/aaai.v39i19.34218 ↗
29. Chu, K., Lin, Z., Xiang, D., Shen, Z., Su, J., Chu, C., Yang, Y., Zhang, W., Wu, W., and Zhang, W. (2025). Selective KV-Cache Sharing to Mitigate Timing Side-Channels in LLM Inference. arXiv.
30. Chowdhury, A.R., Glukhov, D., Anshumaan, D., Chalasani, P., Papernot, N., Jha, S., and Bellare, M. (2025). Prεεmpt: Sanitizing Sensitive Prompts for LLMs. arXiv.
31. Zhu, Y., Gao, N., Liang, X., and Zhang, H. (2024). Exploiting Privacy-Preserving Prompt Techniques for Online Large Language Model Usage. Proceedings of the GLOBECOM 2024—IEEE Global Communications Conference, IEEE.10.1109/GLOBECOM52923.2024.10901426 ↗
32. Assoudi, H. (2024). Natural Language Processing on Oracle Cloud Infrastructure: Building Transformer-Based NLP Solutions Using Oracle AI and Hugging Face, Springer Nature.10.1007/979-8-8688-1073-2 ↗
33. Chen, X., Tang, S., Zhu, R., Yan, S., Jin, L., Wang, Z., Su, L., Zhang, Z., Wang, X., and Tang, H. (2024). The Janus Interface: How Fine-Tuning in Large Language Models Amplifies Privacy Risks. Proceedings of the 2024 ACM SIGSAC Conference on Computer and Communications Security, Association for Computing Machinery.10.1145/3658644.3690325 ↗
34. Cheng, S., Li, Z., Meng, S., Ren, M., Xu, H., Hao, S., Yue, C., and Zhang, F. (2025, January 16–22). Understanding PII leakage in large language models: A systematic survey. Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence, Montreal, QC, Canada.10.24963/ijcai.2025/1156 ↗
35. Sachenko, A., Vizhevskyi, P., Savenko, O., Ostroverkhov, V., and Maslyyak, B. (2025, January 15–16). Modern Strategies for Data Leak Detection and Prevention in Corporate Networks. Proceedings of the Modern Data Science Technologies Doctoral Consortium, Lviv, Ukraine.
36. Tao, J., and Shokri, R. (2025). (Token-Level) InfoRMIA: Stronger Membership Inference and Memorization Assessment for LLMs. arXiv.10.1109/SaTML64287.2025.00026 ↗
37. Lu, S., Wang, L., Wen, S., Wang, Z., and Zhang, H. (2025). FedDTRE: Federated Dialogue Generation Models Powered by Trustworthiness Evaluation. arXiv.
38. Tsai, Y., Hsiao, H., and Lin, S.D. (2026, March 19). Detecting and Perturbing Privacy-Sensitive Neurons to Defend Embedding Inversion Attacks. Available online: https://openreview.net/pdf?id=DF5TVzpTW0.
39. Härle, R., Friedrich, F., Brack, M., Wäldchen, S., Deiseroth, B., Schramowski, P., and Kersting, K. (2025). Measuring and Guiding Monosemanticity. arXiv.
40. Loiseau, G., Sileo, D., Riquet, D., Meyer, M., and Tommasi, M. (2025). Tau-Eval: A Unified Evaluation Framework for Useful and Private Text Anonymization. Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, Association for Computational Linguistics.10.18653/v1/2025.emnlp-demos.16 ↗
41. Skapars, A., Manino, E., Sun, Y., and Cordeiro, L.C. (2025). GPT, But Backwards: Exactly Inverting Language Model Outputs. arXiv.
42. Garza, L., Kotal, A., Piplai, A., Elluri, L., Das, P., and Chadha, A. (2025). PRvL: Quantifying the Capabilities and Risks of Large Language Models for PII Redaction. arXiv.10.1109/TPS-ISA67132.2025.00025 ↗
43. Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. (2018). BERT: Pre-Training of Deep Bidirectional Transformers for Language Understanding. arXiv.
44. Brown, T.B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., and Askell, A. (2020). Language Models Are Few-Shot Learners. arXiv.
45. Chowdhery, A., Narang, S., Devlin, J., Bosma, M., Mishra, G., Roberts, A., Barham, P., Chung, H.W., Sutton, C., and Gehrmann, S. (2022). PaLM: Scaling Language Modeling with Pathways. arXiv.
46. Xia, M., Zhang, X., Zhang, R., Chen, H., and Li, X. (2022). A Survey of Model Compression and Acceleration for Pretrained Language Models. arXiv.
47. Tay, Y., Dehghani, M., Abnar, S., Chung, H., Fedus, W., Rao, J., Narang, S., Tran, V., Yogatama, D., and Metzler, D. (2022). Scaling Laws vs. Model Architectures: How Does Inductive Bias Influence Scaling?. arXiv.10.18653/v1/2023.findings-emnlp.825 ↗
48. Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer