Skip to content

Fine-Tuning Qwen for PII with SageMaker AI

Documentation reviewed: 2026-09-12. AWS provisioning outcomes refer to the historical 2026-09-01 experiment.

This guide describes a QLoRA experiment design and component-tested package for Qwen/Qwen3-30B-A3B-Instruct-2507. Managed SageMaker Training Jobs and ephemeral EKS GPU Jobs are configured to share source, synthetic data and evaluation code. It is not evidence of successful end-to-end GPU training on either path.

The pinned PyTorch 2.8 DLC reached end of patch on 2026-08-06, so resource creation and GPU execution are blocked. Upgrade the image/dependency cohort; the execution chapter explains local checks and resumption requirements.

The model emits TYPE<TAB>ORIGINAL candidates; Python code validates, replaces and restores them. Deterministic replacement or successful round trips do not guarantee complete PII detection, masking or anonymity. Evaluate missed and misclassified entities separately.

Five-part learning path

PartTopic
1Platform responsibilities and target architecture
2Synthetic data, replacement and evaluation limits
3SageMaker/EKS execution contracts and MLflow
4Unified Studio domains/projects/membership
5What ran and what was not measured

Validation record

EvidenceScope
2026-09-12 local recheckInitial 30 tests followed by added tokenization, evaluation, execution, and cleanup regressions; no GPU or AWS API execution
2026-09-01 AWS recordQuotas, MLflow App and project-provisioning failure paths
Unexecuted in that recordSageMaker Training Job / EKS GPU Job
Historical cleanupExperiment App/S3/IAM resources reclaimed; one Unified Studio project remained

The current AWS account was not queried, so this does not assert that the project still exists. Verify current ownership/inventory before resuming. Fine-tuned F1, GPU peak memory, training duration and cost are not reported as measured results.

Experiment policy and limits

  • Use seed-42 synthetic data and record split hashes.
  • Design ordinary logs/MLflow to exclude source text, extracted values, mappings and raw completions. Validate autologging/tracing and artifact contents during actual execution.
  • Private inventory can retain resource IDs/ARNs needed for cleanup; public reports summarize them. Treat presigned URLs as temporary access credentials.
  • Base smoke/full progression on reviewed execution results and limit cleanup to this run's owned resources.
  • Model IDs, seeds and direct dependency pins do not ensure complete reproducibility or equivalent security across environments.

Example package: examples/ai-ml/qwen-pii-finetuning/.

References