Skip to content

Use cases

PII redaction with a model of your own

Redacting personal data is a job a small model does well: the same kind of call, many times a day, with an answer you can check. Sous trains one on your own data, in any language and with your own types of personal data, and switches your app over only when it matches your current model on calls it never saw.

The short answer

  • What it is. A model that finds personal data in text and removes or masks it before the text is stored, shared, or sent on.
  • Why a small model. It costs a fraction of a frontier model per call and answers faster, so you can redact every message, not a sample.
  • What Sous measured. The example PII redactor learned from 128 calls from an app, gave the frontier model’s answer on 84% of held-out calls, and costs 8.5× less per call.

What counts as personal data

Definitions vary by law and by policy. NIST describes PII as information that can distinguish or trace a person’s identity, or that is linked or linkable to a person. The GDPR covers any information relating to an identified or identifiable person. In practice, a redaction model usually looks for these:

TypeExamples
NamesPeople, and the relatives or colleagues a message mentions
Contact detailsEmail addresses, phone numbers, street addresses
Government IDsSocial Security, passport, and driver’s license numbers
Financial detailsCard and bank account numbers
Online identifiersIP addresses, device IDs, account handles
Your own typesMember IDs, case numbers, internal account codes, anything your policy covers

Rules, libraries, or a model of your own

ApproachGood atMisses or costs
Regular expressionsFixed formats like emails and card numbersNames, addresses, and anything that depends on context
Off-the-shelf PII librariesCommon entity types in widely used languagesYour own types, your domain’s language, and mixed or rarer languages
A frontier model with a promptContext and many languagesCost and latency on every call, and personal data sent to another provider
A small model trained on your dataYour types, your languages, at a low cost per callIt needs examples to learn from: Sous starts at 30

Many teams combine them: a pattern for card numbers, a model for names and context. A model trained on your own calls covers the cases rules and generic libraries miss, without sending every message to a frontier model.

How to train one with Sous

  1. Connect the calls. Wrap the client your app already uses for redaction, or upload past examples as files.
  2. Say what counts. List the types your policy covers, including your own, and check a few of the current model’s answers.
  3. Train and compare. Sous holds back about 20% of calls, trains up to 4 candidate small models on the rest, and scores each on the calls it never saw.
  4. Switch safely. Your app moves to the small model only when one matches. Until then, it keeps calling the model it uses today.
  5. Keep it current. Sous retrains as new calls arrive, so the model keeps up with new formats and types.

Training starts at 30 calls, and 50 or more train better. See the guide to fine-tuning without an ML team for the full process.

How to measure a redaction model

  • Misses first. Personal data the model leaves in is the costly error. Count misses by type.
  • Then over-redaction. Masking words that aren’t personal data makes text less useful. Watch it, but weigh it below misses.
  • Test on held-out calls. Score the model on real calls it never trained on, in every language and format you see.
  • Recheck as inputs change. New products, markets, and forms bring new formats. Keep scoring after you switch.

Questions people ask

What is PII redaction?

Finding personal data in text, such as names, contact details, and ID numbers, and removing or masking it before the text is stored, shared, logged, or sent to another system.

Is a small model accurate enough to redact PII?

For one well-defined job, often yes. Sous’s PII redactor gave the same answer as the frontier model it learned from on 84% of calls it never saw, at 8.5× lower cost. Measure on your own data before you switch, and pay most attention to personal data the model misses.

Which languages does it work in?

Any language your data is in. The model learns from your own examples, so it handles the languages and formats your app actually sees.

Can I add my own types of personal data?

Yes. Tell Sous what your policy covers, such as member IDs or internal account numbers, and the model learns to catch those too.

Is there a PII redaction API?

Yes. Your trained model answers through Sous’s OpenAI-compatible API, so your app calls it the way it calls a frontier model today.

How much does it cost?

Sous charges per token at the small model’s rate, from $0.05 per million input tokens and $0.40 per million output tokens. The example PII redactor cost $5.02 to train.

Is Sous secure enough for personal data?

Sous is SOC 2 Type I and Type II compliant. Data travels encrypted, connection credentials are encrypted before they are stored, and you can delete datasets and connections at any time.

Try the PII redactor in the sandbox, or read the docs.

Sources

Train your first model

Wrap your client and keep calling your model. Sous trains a small one on your calls and switches you over when it’s ready. Every account starts with $20 of credit, and a training that fails costs nothing.

Four steps, from your app’s calls to a small model

  1. 1Make a model and an API keyin the app
  2. 2Wrap your clientSous(OpenAI(), model=…)
  3. 3Use your app as usualSous keeps each call
  4. 4Let it switchwhen a student is ready