A team prepares data to fine-tune a foundation model in Amazon Bedrock. Some prompt-response pairs have empty responses or unsafe content. What should the preparation step do?
- Exam domain
- Data Preparation for ML and AI28% of the exam
- Difficulty
- Medium
- In this mock
- 24 questions on this domainPractise this domain
Why the exam asks this
Task 1.3: Validate data quality and manage bias.
Objective in the exam guide: Skill 1.3.6: Validate AI training data integrity (for example, prompt-response pair validation, content safety screening).
Fine-tuning amplifies whatever is in the data. A few hundred bad pairs can teach a model to give empty or unsafe answers.
Why C is the answer
Validate every pair, remove empty or malformed ones, and screen content for safety before training
Fine-tuning data needs integrity checks: well-formed pairs, non-empty responses and safe content.
Remember: Validate fine-tuning pairs before training: format, completeness and safety.
How it works
Fine-tuning data for foundation models is usually a set of prompt-response pairs in a defined format.
Each pair should be checked: correct format, non-empty response, sensible length and safe content.
Bad pairs are removed before training, because the model learns from every example.
Clues in the question
The words that point to the answer, and what each one tells you.
- Empty responses or unsafe content
- Integrity and safety problems.
In detail
- Bedrock fine-tuning expects prompt-completion records in a defined format, such as JSON Lines.
- The same discipline applies to data for continued pre-training and distillation.
Side by side with look-alikes
| Check | Catches |
|---|---|
| Format validation | Malformed records |
| Completeness | Empty responses |
| Content safety screening | Unsafe examples |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Shorten every response to one wordWrong
One-word responses destroy the examples.
B. Train first and filter the outputs laterWrong
Unsafe patterns are learned during training.
C. Validate every pair, remove empty or malformed ones, and screen content for safety before trainingRight
Validate fine-tuning pairs before training: format, completeness and safety.
D. Keep all pairs, since more data is always betterWrongMost tempting
Bad pairs teach bad behavior.
Why it tempts: More data usually helps. But broken or unsafe examples teach the wrong behavior.
In practice
- Run the checks as a pipeline step before every fine-tuning job.
Use case
An illustrative scenario, not a real incident.
A validation script drops 4% of pairs that were empty, malformed or flagged by a content filter.
See how it works
flowchart LR
P["Prompt-response pair"] --> F{"Valid format?"}
F -->|"Yes"| E{"Non-empty?"}
E -->|"Yes"| S{"Safe content?"}
S -->|"Yes"| K["Keep"]
F -->|"No"| X["Drop"]
E -->|"No"| X
S -->|"No"| XHow to read this chart
- "Prompt-response pair" leads to "Valid format?".
- At "Valid format?": if "Yes", go to "Non-empty?"; if "No", go to "Drop".
- At "Non-empty?": if "Yes", go to "Safe content?"; if "No", go to "Drop".
- At "Safe content?": if "Yes", go to "Keep"; if "No", go to "Drop".