SageMaker HyperPod Data Capture: Building a Model Improvement Flywheel with Real-Time Inference Data

AWS has unveiled the Data Capture feature built into SageMaker HyperPod. It automates drift detection, failure pattern analysis, and real data fine-tuning by storing inference inputs and outputs in S3 in a three-tier structure. A five-step flywheel was demonstrated, capturing → Athena analysis → SQL labeling → fine-tuning → redeployment. The accuracy of new product classification was empirically improved using the Qwen2.5-3B-Instruct model.

Real-Time Inference Data: The Final Puzzle for Model Improvement

Teams deploying foundation models in production environments face a dilemma. Real-time influx of domain-specific jargon, unexpected input formats, new product launches, and changes in user behavior cannot be covered by pre-curated datasets, yet there is a lack of a systematic pipeline to collect this data for model improvement. Amazon Web Services (AWS) has filled this gap by officially adding Amazon SageMaker HyperPod Data Capture as a feature in November 2024.

"Foundation models deployed on Amazon SageMaker HyperPod meet inputs that no pre-curated dataset covers: domain-specific jargon, unexpected formats, new products, and changing user behavior. Without a record of production inference data, teams can't detect drift, find failure patterns, or use real interactions to improve the model."

This feature automatically records inference requests and responses to Amazon S3, minimizing latency impact and having zero impact on model availability. It enables the implementation of a complete flywheel that proceeds from capture → analysis → labeling → fine-tuning → redeployment on a single HyperPod cluster.

Three-Tier Architecture: Capture Strategies for Different Purposes

HyperPod Data Capture provides three independent tiers that operate at different points along the request path. Within a single `dataCapture` block, desired combinations can be activated simultaneously.

TierRecording PointStored ContentMain UseSampling Default
Tier 1Before and after model inferenceFull payload (input/output)Compliance, Model Monitor integration100%
Tier 2Proxy levelOnly metadata (timestamp, latency, status code, etc.)Traffic monitoring, cost optimization100%
Tier 3Proxy levelFull payload (input/output)Reuse of training data, pattern analysis100%

"Tiers 1 and 3 both store full payloads, so enabling both stores every record twice. Use Tier 1 for compliance and Model Monitor, Tier 2 when you only need traffic metadata, and Tier 3 when you intend to use the payloads."

The walkthrough will proceed with only Tier 3 activated. Tier 3 stores complete payloads, which means personal identifiable information (PII) such as names, addresses, and order numbers may be included. Therefore, before converting capture data into training data, protective measures such as sampling rate adjustment, AWS KMS encryption (`kmsKeyId`), S3 lifecycle rules, and Amazon Comprehend-based PII obfuscation must be implemented.

Five-Step Flywheel Walkthrough: New Product Adaptation for Appliance Support Router

AWS has publicly demonstrated the entire process in a reproducible form on a single HyperPod cluster. The scenario involves a customer support ticket router for an appliance distributor. It classifies tickets into six categories (`ProductFridge`, `ProductWasher`, `ProductOven`, `ProductDryer`, `ProductDishwasher`, `Other`) using `vLLM guided JSON decoding`.

  1. Real-time inference capture (S3) → Pattern analysis with Athena → Labeling with SQL policy → Fine-tuning with Training Operator → New endpoint side-by-side deployment

Steps 0-2: Setting Environment Variables, Staging Base Model, Configuring IAM Permissions

"If this is missing, the endpoint stays healthy and requests succeed, but no captures appear. See Mountpoint for Amazon S3 CSI driver."

Steps 3-5: Deploying Tier 3 Capture Activation, Confirming Pod Startup, Validating Capture

```yaml # Key: dataCapture.modelPod.enabled: true modelPod: enabled: true # sampling: 1.0 # default 100% # captureInput: true # default true # captureOutput: true # default true ```

The capture activation pod consists of four containers: `model`, `sidecar-reverse-proxy` (NGINX), `otel-collector`, `s3-uploader`. After `kubectl apply`, it takes about 5 minutes to reach Ready status, mostly due to weight download time.

Important: Inference requests must be sent to port 8081 (capture proxy) to be recorded. If requests are sent to port 8000, which the model directly listens to, they will bypass the proxy and will not be captured.

Capture files are stored in the path `{s3Uri}/{uniqueID}/pod/{variant}/{YYYY}/{MM}/{DD}/{HH}/` in `.jsonl` format, with each line following the SageMaker data capture format. The request and response bodies are stored Base64 encoded, so decoding and JSON parsing are required during analysis.

Steps 6-7: Athena Analysis → SQL Labeling → Fine-Tuning → Redeployment

1. Scan capture logs with Athena, discovering patterns where new product-related tickets (e.g., `ProductAirPurifier`) are incorrectly classified as `Other` 2. Assign correct labels to those records using SQL policy 3. The Training Operator (`HyperPodPyTorchJob`) performs fine-tuning on the second GPU 4. Deploy a new endpoint while maintaining capture functionality — completing the flywheel

Operational Considerations: Security, Cost, Governance Checklist

So What? Specific Implications for Developers, Companies, and Industries

Developer and ML Engineer Perspective

Company and Platform Team Perspective

Industry and Ecosystem Perspective

Limitations and Future Challenges

---

Summary: SageMaker HyperPod Data Capture provides an infrastructure-level flywheel primitive that transforms the "forget after deployment" pattern into "improve with data after deployment." The separation of purposes by tier, zero-impact capture, and native analysis and training linkage are strengths, but in real operations, security, cost, and governance layers must be designed separately. It is recommended to use the manifest, SQL, and synthetic datasets from the GitHub repository as a starting point to build a flywheel tailored to your domain.

Verified figures

Our take

HyperPod Data Capture represents a significant advancement in addressing the 'monitoring → automated re-training' stage of the MLOps maturity model natively at the infrastructure level. However, operational burdens remain, such as the need to build separate pipelines for PII obfuscation, sampling, and cost governance, indicating that adding an enterprise-grade managed governance layer is the next step.

Open questions

Source

Back to catalog