Concept
Validating AI training data integrity
Check prompt-response pairs, screen content and PII, and guard against poisoning and noisy labels.
- 1Collect the files.
- 2Validate the format and fields of every line.
- 3Remove exact and near duplicates.
- 4Screen for harmful content and PII, then approve what passes.
Step by step
- 1Collect the files.
- 2Validate the format and fields of every line.
- 3Remove exact and near duplicates.
- 4Screen for harmful content and PII, then approve what passes.
Data passes schema, duplicate and safety checks, or goes to quarantine.
Personal data
- Check
- Detect and mask
- Tool
- Comprehend, Macie
Harmful content
- Check
- Content filters
- Tool
- Guardrails, Rekognition
Poisoning
- Check
- Source control, outliers
- Tool
- Versioning, review
Label noise
- Check
- Compare labels to a model
- Tool
- Human review
| Risk | Check | Tool |
|---|---|---|
| Personal data | Detect and mask | Comprehend, Macie |
| Harmful content | Content filters | Guardrails, Rekognition |
| Poisoning | Source control, outliers | Versioning, review |
| Label noise | Compare labels to a model | Human review |
What it is
Validate data before every customization or training run. For prompt-response pairs, check the schema (valid JSON on every line, required fields present), no empty prompts or answers, length inside the token limit of the model, and no exact or near duplicates. Check that each response answers its prompt, and sample records by hand. One bad line can fail a whole job or teach the model a bad habit.
What it is
Screen the content. The Bedrock Guardrails ApplyGuardrail API checks text against your content filters, denied topics and PII rules without calling a model. Amazon Comprehend detects PII and toxic content. Amazon Rekognition content moderation flags unsafe images and video. Remove or fix what is flagged, and send failures to a quarantine prefix so people can review them.
What it is
Guard against attack and error. Data poisoning slips malicious or misleading examples into training data to change behavior: accept data from approved sources only, control who can write to the buckets, version the data, and look for outliers and odd clusters. Label noise is wrong labels: compare labels with a model trained on the data and have people review the examples where they disagree. Keep provenance: for each file, record the source, owner, license, collection date and a checksum, so you can trace and remove data later.
Remember
- Pair checks: schema, empties, length, duplicates, answer matches prompt.
- ApplyGuardrail screens text with no model call. Comprehend finds PII and toxicity. Rekognition moderates images.
- Quarantine failures for review. Do not silently drop them.
- Poisoning: approved sources, write control, versioning, outlier checks.
Remember
- Label noise: compare to a model, review the disagreements.
- Provenance: source, license, date and checksum per file.
On the exam
- “Screen training text for harmful content without invoking a model” points to the Guardrails ApplyGuardrail API.
- “Someone may have inserted malicious examples” points to source control, versioning and outlier review.
- “Prove where each training file came from” points to provenance records with checksums.