Redakto - The Incognito Tab for LLMs
把文本喂给AI大模型前先自动抹掉姓名地址,一款开源工具证明脱敏不掉性能
Redakto是一款开源工具,能在文本进入大语言模型(LLM)之前自动识别并抹除或替换姓名、地址等个人身份信息(PII)。研究团队在电子邮件、临床病历和法律文书三类数据上做了测试,并提供网页应用、REST API以及可供LLM助手直接调用的Model Context Protocol(MCP)接口。实验显示,脱敏后的文本在两个下游任务上的表现与未处理的原文相差不大。
METAL MEDIA 解读图
把文本喂给AI大模型前先自动抹掉姓名地址,一款开源工具证明脱敏不掉性能
- 01在德语邮件数据集CodE Alltag和法律文书数据集LER上,个人信息检测准确率(macro F1)达到约0.95;而标注数据较少的临床语料GraSCCo上表现较低,原因被归结为训练数据不足而非模型结构问题
- 02对比了三种脱敏方式:替换成语义相近的占位词、随机遮蔽、通用遮蔽,其中语义占位词方式最能保留原文可用性
- 03用两个下游任务直接检验脱敏文本的实用性:识别医生在问诊对话中的意图,以及判断欧洲人权法院案例文书中是否存在人权侵犯
- 04即便文档中个人信息密度极高(平均每篇约86个,最多可达数百个),性能下降主要来自文档变长变复杂,而非脱敏操作本身
- 05系统由Streamlit前端和FastAPI后端组成,支持Docker和Kubernetes容器化部署,代码和模型均已开源
他们做了什么
- 在德语邮件数据集CodE Alltag和法律文书数据集LER上,个人信息检测准确率(macro F1)达到约0.95;而标注数据较少的临床语料GraSCCo上表现较低,原因被归结为训练数据不足而非模型结构问题
- 对比了三种脱敏方式:替换成语义相近的占位词、随机遮蔽、通用遮蔽,其中语义占位词方式最能保留原文可用性
- 用两个下游任务直接检验脱敏文本的实用性:识别医生在问诊对话中的意图,以及判断欧洲人权法院案例文书中是否存在人权侵犯
- 即便文档中个人信息密度极高(平均每篇约86个,最多可达数百个),性能下降主要来自文档变长变复杂,而非脱敏操作本身
- 系统由Streamlit前端和FastAPI后端组成,支持Docker和Kubernetes容器化部署,代码和模型均已开源
| Model | Prec | Rec | F1 |
|---|---|---|---|
| xlm-roberta-large | 0.9442 ±0.0 | 0.9358 ±0.0 | 0.9399 ±0.0 |
| gelectra-large | 0.9433 ±0.0 | 0.9371 ±0.0 | 0.9401 ±0.0 |
| bert-base-german-cased | 0.9251 ±0.0 | 0.9160 ±0.0 | 0.9204 ±0.0 |
| Model | Prec | Rec | F1 |
|---|---|---|---|
| xlm-roberta-large | 0.94 | 0.95 | 0.94 |
| gelectra-large | 0.95 | 0.96 | 0.95 |
| bert-base-german-cased | 0.95 | 0.94 | 0.95 |
| Version | Text |
|---|---|
| Original | miss edwards is here for evaluation of facial pain this is a 54-year-old female |
| Semantic Label Masking | miss [PERSON] is here for evaluation of facial pain this is a [DATE] female |
| Random Masking | miss lhyZXSX is here for evaluation of facial pain this is a vejE4fPRUxkG female |
| Generic Masking | miss XXXX is here for evaluation of facial pain this is a XXXX female |
| Redaction Strategy | xlm-roberta-large | bert-large-cased | electra-large-discri. |
|---|---|---|---|
| No Redaction | 0.86 ±0.01 | 0.85 ±0.01 | 0.84 ±0.01 |
| Semantic Label Masking | 0.86 ±0.01 | 0.84 ±0.01 | 0.82 ±0.02 |
| Random Masking | 0.85 ±0.01 | 0.82 ±0.02 | 0.82 ±0.01 |
| Generic Masking | 0.84 ±0.02 | 0.85 ±0.01 | 0.82 ±0.02 |

为什么重要
欧盟隐私相关法规让医院、法律机构和政府部门在使用LLM时顾虑重重,而这项研究用实验证据表明脱敏不会明显损害任务效果,直接回应了这一顾虑。由于工具开源且可自行部署,开发者和研究者无需把敏感数据发给第三方服务,就能安全地把LLM用起来。
本文术语
- 个人身份信息(PII) · 姓名、地址、出生日期等能识别特定个人的信息
- 大语言模型(LLM) · 基于海量文本训练、能理解和生成语言的AI模型
- 假名化(pseudonymization) · 不直接删除个人信息,而是替换成其他标识,保持文本可读
- Model Context Protocol(MCP) · 让LLM助手或智能体能够直接调用外部工具的一种连接标准
- macro F1 · 对各类别准确率取平均得到的指标,避免结果被某一类别主导
无法转载的图表
- Figure 5: Entity density wise performance (Macro-F1) comparison for different redaction strategies (electra-large-discriminator)
论文原文摘要(英文)
Large Language Models (LLMs) are being increasingly used in everyday applications. A major challenge in the context of LLMs or Artificial Intelligence (AI) in general is to ensure privacy when using them, meaning that personally identifiable information (PII) is removed from any text that enters an LLM. These challenges have become more urgent with novel EU legislation. Uncertainty around LLM usage with respect to privacy concerns in EU countries can be a major blocker for the speed of innovation and transfer from research to applications. Here we present \textbf{Redakto}, a tool that can be used for anonymizing text prior to feeding it to an LLM or other downstream text processing. We provide state-of-the-art functionalities for both redaction of PII but also when used for pseudonymization. These functionalities are exposed such that they can easily be used by end-users, through the Redakto web application, and by developers and researchers, via REST APIs and model context protocol (MCP) hooks. The implementation is fully open source, requires modest compute resources, and can be readily deployed on local hardware. In contrast to prior work and in order to better assess the quality of the anonymized texts, we conduct extensive empirical evaluations on textual data from legal and medical domain with respect to both privacy and utility of the redacted texts. Our empirical results demonstrate that the texts anonymized with different redaction strategies achieve utility scores on par with the original texts, suggesting that anonymization with Redakto can be used for LLM tasks without substantial negative impact for the tasks we explored.
在 arXiv 阅读最新论文
- SWE-bench Science: Can Coding Agents Resolve Engineering Tasks in Science?让AI编程助手去修复真实科学软件,连最强的那个也有一半以上任务没做对
- FlashPrefill V2: Block-Sparse Prefill Attention for Long-Context LLM Serving把稀疏注意力从论文原型变成能真正上线服务的加速方案
- PolicyGuide: From Guarding One Action to Guiding the Whole Workflow for Policy-Compliant LLM Agents让客服AI坐席不只是拦住一个危险动作,而是把整个流程走对
- EXIMO: VLM Guided Exploration of VLA Policies不用人工遥控演示,让会说话的AI来教机械臂做新家务
- EnvHarness: Awakening Static Worlds for Agent Learning不重新搭建训练环境,而是给现有环境套一层可插拔组件,针对每个智能体的具体弱点重新塑形
- Bounded Sovereignty and the Control Tax: Pricing AI Oversight When the Deployer Does Not Own the Model租用AI而非拥有AI的机构,安全监管能力只剩一半
- Beyond Imitation: Filtering On-Policy Distillation by Reasoning ProgressAI模仿老师模型学习时,会误伤本来推理正确的步骤,新方法专门过滤掉这种误伤
- PersonalBench: Measuring the Authorship Gap in LLM Personalization让AI模仿某人的文风,结果发现它始终摆脱不了自己的腔调
METAL MEDIA 最新报道
图片来源: Saurav Kumar Saha et al., arXiv:2608.18260, CC BY-SA 4.0