Local Language Models for Context-Aware Adaptive Anonymization of Sensitive Text
Aisvarya Adeseye, Jouni Isoaho, Seppo Virtanen, Mohammad Tahir · 2026
Read Local Language Models for Context-Aware Adaptive Anonymization of Sensitive Text by Aisvarya Adeseye, Jouni Isoaho, Seppo Virtanen, Mohammad Tahir (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-14683.txt.
Introduction
Aisvarya Adeseye, Jouni Isoaho, Seppo Virtanen, and Mohammad Tahir work on privacy in qualitative research in this 2026 paper. Qualitative data often contain personal, contextual, and organizational details. Those details pose privacy risks if not handled appropriately. Manual anonymization is time-consuming and inconsistent. It frequently omits critical identifiers.
Existing automated tools tend to rely on pattern matching or fixed rules. Such tools fail to capture context and may alter the meaning of the data. The team uses local language models for context-aware adaptive anonymization of sensitive text. Local means the text never leaves the researcher's machine. Readers get a privacy tool that reads for meaning before it hides a name.
Catalog record
| CREATOR | Aisvarya Adeseye, Jouni Isoaho, Seppo Virtanen, Mohammad Tahir |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 30 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2601-14683
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Local Language Models for Context-Aware Adaptive Anonymization of Sensitive Text Aisvarya Adeseye, Jouni Isoaho, Seppo Virtanen, Mohammad Tahir Abstract Qualitative research often contains personal, contextual, and organizational details that pose privacy risks if not handled appropriately. Manual anonymization is time-consuming, inconsistent, and frequently omits critical identifiers. Existing automated tools tend to rely on pattern matching or fixed rules, which fail to capture context and may alter the meaning of the data. This study uses local Large Language Models (LLMs) to build a reliable, repeatable, and context-aware anonymization process for detecting and anonymizing sensitive data in qualitative transcripts. We introduce a Structured Framework for Adaptive Anonymizer (SFAA) that includes three steps: detection, classification, and adaptive anonymization. The SFAA incorporates four anonymization strategies: rule-based substitution, context-aware rewriting, generalization, and suppression. These strategies are applied based on the identifier type and the risk level. The identifiers handled by the SFAA are guided by major international privacy and research ethics standards, including the GDPR, HIPAA and National Standards TCPS 2, and OECD guidelines. This study followed a dual-method evaluation that combined manual and LLM-assisted processing. Two case studies were used to support the evaluation. The first includes 82 face-to-face interviews on gamification in organizations. The second involves 93 machine-led interviews using an AI-powered interviewer to test LLM awareness and workplace privacy. Two local models, LLaMA and Phi were used to evaluate the performance of the proposed framework. The results indicate that the LLMs found more sensitive data than a human reviewer. Phi outperformed LLaMA in finding sensitive data, but made slightly more errors. Phi was able to find over 91% of the sensitive data and 94.8% kept the same sentiment as the original text, which means it was very accurate, hence, it does not affect the analysis of the qualitative data. 1 Introduction Qualitative research can provide valuable insights by collecting narratives from real-life situations [ 1 ] . However, these narratives often contain personal, organizational, and location-specific information that can pose privacy risks [ 2 ] . Anonymization is important in academic and applied fields because failure to do it will lead to a breach of ethical obligations, privacy regulations, and a lack of trust in the research process [ 3 ] . Moreover, manual anonymization remains the most dominant method. However, they are time-consuming, labor-intensive, and error-prone. Although automated tools that use pattern or static rules exist, nevertheless, these tools are inflexible despite being fast, they also struggle to understand human language nuances [ 5 ] , and may often distort the original meaning when rewriting sensitive information. Human understanding of context and machines’ ability to process information vary, which creates a problem of how to create an anonymization method that is both fast and accurate. Recent advances in large Language models (LLMs) create an opportunity to bridge this gap. Consequently, locally hosted LLMs can be customized to understand information context [ 16 ] , preserve data sovereignty without relying on external cloud services. To address this problem, this study develops a Structured Framework for an Adaptive Anonymizer (SFAA) using local LLMs to detect, classify, and adaptively anonymize sensitive information in qualitative texts. The goal is to protect privacy and ensure compliance with the data protection standards. We define the following research questions to achieve the aim of this study. • RQ1: How accurately does a local LLM detect and classify sensitive information compared to independent expert manual analysis? • RQ2: How effective are the different adaptive anonymization strategies for privacy protection while preserving meaning and maintaining the integrity of qualitative analysis results? This study makes two key contributions to the literature. First, it presents a precise and repeatable three-step anonymization method tested with human and LLM-based approaches. Second, it proves that LLMs can find and anonymize sensitive text while maintaining its meaning, reducing the need for time-consuming manual work. 2 Literature Review Anonymization is the process of removing or altering personal details in data so that individuals cannot be identified [ 6 ] . In qualitative research, certain parts of information could reveal someone’s identity, such as names, locations, job roles, or unique stories. The goal is to protect people’s privacy while still keeping the data useful and meaningful [ 7 ] . However, anonymization is not pseudonymization. Pseudonymization replaces identifiers, but does not fully prevent re-identification in some cases [ 8 ] . True anonymization should prevent re-identification. It supports ethical research practice that meets legal and regulatory requirements, such as the General Data Protection Regulation (GDPR) in Europe, The Health Insurance Portability and Accountability Act (HIPAA) in the United States, and the Australian National Statements on Ethical Conduct in Human Research (National Statement) in Australia [ 18 ] . These and other standards provide the foundation for the collection, storage, and sharing of data. If anonymization is done incorrectly, researchers could face serious ethical and legal problems. Several tools exist that can help with anonymization, such as Dedoose, NVivo, and Atlas.ti. These tools support manual coding and offer some features for tagging or hiding identifiers [ 10 ] . Some other automated tools that use pattern-matching rules to remove sensitive terms like names, addresses, or emails [ 11 ] also exist, for example MITRE Identification Scrubber Toolkit (MIST) and ARX Data Anonymization Tool. Furthermore, more advanced tools like Presidio by Microsoft use natural language processing (NLP) to find and mask personal details [ 12 ] . Consequently, these tools work well for direct identifiers but miss indirect or context-based information and may sometimes change the meaning of the text, which makes it difficult to utilize them for data analysis. For example, a phrase like "the only woman who is an IT manager in our department" does not mention a specific name, but still clearly indicates a particular person because of the context. Also, most existing tools are not designed to handle qualitative data in its raw format, which is important for understanding people’s thoughts and feelings. Interview transcripts are more complex as their meaning depends on the context, tone, and flow of language. These tools are usually made for structured formats like spreadsheets or forms. Consequently, many researchers prefer to do this manually [ 13 ] . Manual methods can be more accurate when dealing with complex but short qualitative data. However, these methods are time-consuming, inconsistent, and depend on the skill of the analyst performing the task [ 13 ] . Also, this method is unsustainable when the data is large or when working under strict deadlines. Current literature indicates that there is no reliable, scalable, and context-aware method available for qualitative data anonymization. Large language models like ChatGPT and Gemini offer potential in mitigating this gap. However, these commercial cloud-based systems raise privacy and ethical concerns [ 17 ] . Additionally, local LLM alternatives like LLaMA and Phi are unexplored. Therefore, this study proposes a structured framework for local LLMs to detect, classify, and anonymize sensitive information in qualitative transcripts. The proposed approach provides a private and context-aware approach to anonymization, filling a critical gap in the literature. 3 Methodology When anonymizing transcripts, it is important to strike a balance between context sensitivity and processing efficiency. Therefore, we adopted a hybrid anonymization workflow (Figure 1 ) that