0:00 0:00
computer

fem[dot]nz

laptop

A Hypothetical Method for Document Anonymization with LLM-Friendly Entity Abstraction

Introduction

This page presents a purely hypothetical method for document anonymization that preserves entity relationships for Large Language Model (LLM) processing. The goal is to share an interesting idea that may inspire others to build upon or explore further.


The Problem

Traditional document redaction methods often struggle to maintain meaningful context for LLM analysis. Simple removal or random substitution of sensitive information can hinder an LLM's ability to reason effectively about the entities and their relationships within a document.


Proposed Solution

Here's a potential workflow to address this challenge:


1. Entity Recognition Use a Named Entity Recognition (NER) model to identify entities for redaction.

2. Embedding Generation Create embeddings for the identified entities.

3. Similarity Grouping Group embeddings within a defined similarity threshold to identify multiple instances of the same entity (e.g., "John Doe" and "John" likely refer to the same person).

4. Placeholder Substitution Replace original content with abstract placeholders representing each unique entity.


Consider this original text:

Alice dislikes Bob, because Bob is constantly trying to steal secrets from her computer. Luckily, Alice is very secure and lives on 123 Alice Street.


After processing, it could become:

{A} dislikes {B}, because {B} is constantly trying to steal secrets from her computer. Luckily, {A} is very secure and lives on {C}.


Benefits

This approach:

- Retains minimal specific data from the original document

- Is resistant to different-but-similar entity names (e.g. Johnny should be semantically close to John, but might not be caught by a simple string-comparison)

- Allows LLMs to refer to distinct entities in an abstract manner

- - This should reduce bias around the specific entity names, since this information is withheld from the LLM

- Enables reconstitution of original entity names in LLM responses if needed


While I'm not an expert in the current state-of-the-art for such tasks, I believe this or similar problems may have been addressed elsewhere. I welcome thoughts, improvements, or information about existing solutions via the guestbook. Please note that all comments will be public.


---

  • Note: This is a hypothetical method presented for discussion and inspiration. It has not been tested or implemented.*