AI Cloud Architect

Model-agnostic PII detection with LLMs

AWSHow-to by Christophe Dupuy and Rahul GuptaAWS Artificial Intelligence Blog

A configurable, model-agnostic detector that turns any large language model on Amazon Bedrock into a PII detector. Because the entities to detect live in a prompt rather than in code, one detector adapts to new entity types without retraining, and it outperforms an off-the-shelf tool across five public corpora and nine LLM-based detectors.

Read the original (opens the source's page in a new tab)

AI: Summary

What it is

A prompt-driven PII detector runs on any Amazon Bedrock LLM, so new entity types are added by editing the prompt rather than retraining.

Who it is for

Teams preparing text datasets for ML or fine-tuning that need PII detection and want to swap models or entity types without retraining.

Key points

  • Reported Core F1 ranges 74.9% to 83.1% across nine LLM-based detectors on five public corpora (AWS's benchmark).
  • Extended-entity F1 rises from about 12% to about 73% with an instruction-only change, per AWS.
  • Runs on Amazon Bedrock Converse models or a self-hosted open model on a GPU for air-gapped setups.
  • Sample code is in the pii-detector package in the sample-llm-pii-detection repository.

The same at other vendors

Timeline

  1. Customer storyHow Clario technology detects PHI/PII in DICOM images using Amazon Bedrock · AWS · Customer story
  2. This postModel-agnostic PII detection with LLMs

Go deeper