Digitala Vetenskapliga Arkivet

Planned maintenance
A system upgrade is planned for 17/11-2026, at 12:00-13:00. During this time DiVA will be unavailable.
Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Handling Confidential Data in LLM Prompts
Mälardalen University, School of Innovation, Design and Engineering.
2025 (English)Independent thesis Advanced level (degree of Master (One Year)), 40 credits / 60 HE creditsStudent thesis
Abstract [en]

Increase in popularity of Large Language Models (LLMs) throughout different applications led to important privacy challenges, especially when it comes to handling Personally Identifiable Information (PII) that is embedded in prompts of users. PII being exposed to LLMs, or to third party providers that are managing them can lead to privacy breaches and regulatory non-compliance. This work investigates several methods for protecting confidential data inside LLM prompts by anonymizing PII before model input and de-anonymyzing the output. To address this, the custom Named Entity Recognition (NER) model trained on ai4privacy/pii-masking-200k dataset was developed in order to identify PII spans. These spans are replaced by placeholder tokens and a mapping to original value is stored. Two approaches are compared for de-anonymization: (1) fine-tuned seq2seq “Seek” models (T5, mBART, BART) that predict original text from anonymized text and evaluated using BLEU and ROUGE metrics; and (2) a mapping-based approach that simply replaces placeholders with the stored originals. While fine tuned “seek models” can generate understandable de-anonymized text, they mostly hallucinate incorrect details. Mapping approach achieves 100% accuracy and semantic consistency. Besides its accuracy, the mapping strategy is preferred for reliability and performance (does not have to generate new words). This work demonstrates an effective end-to-end pipeline for PII protection which contributes clear guidelines for safer LLM utilization.

Place, publisher, year, edition, pages
2025. , p. 36
Keywords [en]
Large Language Models, Privacy, Security, Artificial Intelligence, BERT
National Category
Computer Sciences Natural Language Processing
Identifiers
URN: urn:nbn:se:mdh:diva-72538OAI: oai:DiVA.org:mdh-72538DiVA, id: diva2:1980696
Subject / course
Computer Science
Presentation
2025-06-03, U2-016, Universitetsplan 1, Västerås, 13:45 (English)
Supervisors
Examiners
Available from: 2025-08-04 Created: 2025-07-02 Last updated: 2025-10-10Bibliographically approved

Open Access in DiVA

fulltext(827 kB)523 downloads
File information
File name FULLTEXT01.pdfFile size 827 kBChecksum SHA-512
ac54c54ff4264f337392fc4edc3cc9f8efcd7847ab2d011314363522d41875551de5d5b36ac3cfd7938827cb5f7d157cb152646809cf38e628a4db3a86840c0d
Type fulltextMimetype application/pdf

Search in DiVA

By author/editor
Karavdić, Nedim
By organisation
School of Innovation, Design and Engineering
Computer SciencesNatural Language Processing

Search outside of DiVA

GoogleGoogle Scholar
Total: 527 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 1195 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf