Large-Scale LLM Infrastructure for E-commerce Applications

coupang · E-commerce · 2024 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: E-commerce LLM platform infrastructure

Coupang needed to support LLM and multimodal model use across search, ads, catalog, recommendations, operations, and multilingual product understanding. The platform had to work in Korean, Mandarin, and English; handle limited labels; support fine-tuning, RAG, weak-label generation, categorization, and embeddings; and scale training and inference despite GPU shortages, high GPU cost, CPU-only legacy serving, and model-parallel training requirements.

Constraints:

Architecture

Coupang built a pragmatic LLM platform on Kubernetes using open-source model architectures, in-context learning, supervised fine-tuning, continued pretraining, weak-label generation, distillation, embedding extraction, batch inference, nearline inference, and GPU-backed serving. Exploration uses Zeppelin, Spark on Kubernetes, and GPU Jupyter notebooks. Training uses Polyaxon, PyTorchJob, model parallel training, DeepSpeed ZeRO, Hugging Face recipes, and shared hyperparameter defaults. Production paths use distilled smaller models for real-time inference, exported embeddings for ranking, Ray plus vLLM for batch and nearline pipelines, and Nvidia Triton on AWS EKS for real-time GPU serving. Infrastructure spans multi-region cloud clusters in APAC and the US plus on-prem high-end GPU clusters to mitigate GPU shortages and reduce training cost.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  teams["Product ML teams"] --> explore["Exploration notebooks"]
  explore --> training["Training platform"]
  training --> deepspeed["DeepSpeed ZeRO recipes"]
  training --> gpu["Hybrid GPU clusters"]
  training --> source["Source LLMs"]
  source --> distill["Distillation pipeline"]
  source --> embeddings["Embedding export pipeline"]
  source --> batch["Batch and nearline inference"]
  distill --> triton["Realtime Triton serving"]
  batch --> downstream["Downstream ML systems"]
  embeddings --> downstream
  triton --> inference["Inference platform"]
  batch --> inference
  gpu --> triton
  gpu --> batch
  inference --> teams
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Product ML teams Teams building search, discovery, catalog, recommendations, ads, content understanding, and operations models. Exploration notebooks, Training platform, Inference platform
Exploration notebooks Zeppelin, Spark-on-Kubernetes, and GPU Jupyter notebooks for data prep, prompt templates, model lines, and model-size experiments. Product ML teams, Training platform
Training platform Polyaxon and Kubernetes/PyTorchJob environment for supervised fine-tuning, continued pretraining, and model-parallel training. Exploration notebooks, DeepSpeed ZeRO recipes, Hybrid GPU clusters, Source LLMs
DeepSpeed ZeRO recipes Shared model-sharding recipes and smart defaults for optimizer, gradient accumulation, memory pinning, and Hugging Face architectures. Training platform, Source LLMs
Hybrid GPU clusters Cloud clusters across APAC and US plus on-prem A100/H100 capacity used to manage GPU supply and cost. Training platform, Inference platform
Source LLMs Fine-tuned or continued-pretrained LLMs used for weak labels, embeddings, distillation, and batch/nearline predictions. Training platform, Distillation pipeline, Embedding export pipeline, Batch and nearline inference
Distillation pipeline Trains smaller models from source LLM outputs for real-time serving. Source LLMs, Realtime Triton serving
Embedding export pipeline Exports LLM embeddings for use in smaller ranking and recommendation models. Source LLMs, Downstream ML systems
Batch and nearline inference Ray plus vLLM pipelines that combine CPU preprocessing and GPU inference for large datasets and event-adjacent workloads. Source LLMs, Hybrid GPU clusters, Downstream ML systems
Realtime Triton serving Nvidia Triton on AWS EKS for GPU-backed real-time model serving with batching and multi-model execution. Distillation pipeline, Hybrid GPU clusters, Inference platform
Inference platform Serving layer spanning Triton realtime, Ray/vLLM batch, and nearline inference modes. Product ML teams, Realtime Triton serving, Batch and nearline inference
Downstream ML systems Search, ads, catalog, recommendations, quality, categorization, and operations systems consuming labels, embeddings, and predictions. Embedding export pipeline, Batch and nearline inference

Data flow

ML teams explore model lines, sizes, and prompts in notebooks, then shortlist models for fine-tuning or continued pretraining based on compute budget, dataset size, and measured application performance. Source LLMs generate weak labels, produce embeddings, or feed distillation pipelines. For production, real-time workloads run on Triton/EKS, while batch and nearline workflows use Ray plus vLLM to combine CPU preprocessing with GPU inference. Outputs feed downstream recommendation, search, ads, catalog, categorization, attribute extraction, and ranking systems. Benchmarking and experimentation feed back into GPU choice, model size, quantization, offloading recipes, and framework selection.

4 supporting quotes
“developers use fine-tuning or pre-training from scratch depending on the compute budget, dataset size and comparing model performance.”article, stated
“Distill a smaller model from the trained source LLM. The smaller model is used in real-time inference.”article, stated
“Batch and nearline inference on GPUs is the most popular way to extract predictions from the source LLMs at scale”article, stated
“We do all realtime inference using Nvidia Triton [2.9] on AWS EKS.”article, stated

Why this architecture

Coupang chooses open-source architectures and adaptation rather than training foundation models from scratch because it saves time and compute while still allowing domain-specific performance. It separates exploration, training, batch/nearline inference, distillation, and real-time serving because LLM use cases have different latency, cost, and hardware needs. Hybrid cloud/on-prem multi-region GPU sourcing reduces cloud capacity waits, while tiered GPU selection and smaller model variants prevent high-end GPUs from being wasted on early experiments.

4 supporting quotes
“taking OSS model architectures and fine-tuning them with domain data provides an effective approach to apply LLMs to business problems.”article, stated
“saving both time and computational resources.”article, stated
“we implemented a multi-region deployment strategy for our ML infrastructure.”article, stated
“Given that each LLM family is available in multiple parameter sizes, it is highly cost-effective to use a device with lower performance for testing smaller versions”article, stated

Models used: Qwen · LLAMA · T5 · Phi · Polyglot · CLIP · TrOCR · DeepSpeed ZeRO · vLLM · Nvidia Triton · Ray · Polyaxon · PyTorchJob

Scale

Alternatives considered (roads not taken)

Train foundation models from scratch as the default

Rejected because: Coupang favors open-source architectures plus domain fine-tuning to save time and compute.

“taking OSS model architectures and fine-tuning them with domain data provides an effective approach”article, stated
“saving both time and computational resources.”article, stated

Serve large source LLMs directly for all real-time use cases

Rejected because: Coupang often distills smaller models or exports embeddings for downstream models to make production serving practical.

“Distill a smaller model from the trained source LLM. The smaller model is used in real-time inference.”article, stated
“Embeddings can be exported from the LLMs and used in smaller models.”article, stated

Use data parallelism alone for LLM training

Rejected because: Large models do not fit into a single GPU, so Coupang uses model sharding strategies such as DeepSpeed ZeRO.

“the typical method of distributed training — data parallelism alone is insufficient.”article, stated
“the most popular being DeepSpeed Zero [2.8] due to its quick setup time”article, stated

Use only one inference mode

Rejected because: Coupang built separate real-time, batch, and nearline inference paths because workloads differ in latency, throughput, CPU/GPU mix, and resource footprint.

“Coupang built out three distinct inference modes, each addressing different latency and throughput requirements.”summary, stated
“Nearline inference combines the efficiency of batch inference (using small batches) and the responsiveness of being near real-time inference”article, stated

Patterns

fine-tuning-adaptation (model-adaptation)

Coupang fine-tunes open-source LLM architectures with domain data for business tasks instead of building foundation models from scratch.

“taking OSS model architectures and fine-tuning them with domain data provides an effective approach”article, stated
“A fine-tuned model on a high quality domain dataset often surpasses the base LLM performance.”article, stated

model-distillation (serving)

Coupang distills smaller models from trained source LLMs so real-time inference can run with lower resource cost.

“Distill a smaller model from the trained source LLM. The smaller model is used in real-time inference.”article, stated

batch-offline-processing (inference)

Batch GPU inference extracts source-LLM predictions at scale for distillation and embeddings, using Ray plus vLLM for heterogeneous CPU/GPU pipelines.

“Batch and nearline inference on GPUs is the most popular way to extract predictions from the source LLMs at scale”article, stated
“Developers use Ray + vLLM [2.6, 2.7] to write inference pipelines requiring both CPU and GPU processing.”article, stated

cost-aware-routing (infrastructure)

Coupang matches model sizes and GPU types to workload phase, uses multi-region/on-prem capacity, and avoids expensive devices for early experiments.

“regular benchmarking with model-building teams to evaluate the price-to-performance ratio of different GPUs for each model line.”article, stated
“it is highly cost-effective to use a device with lower performance for testing smaller versions of the LLM.”article, stated

rag-retrieval (grounding)

Coupang uses RAG where generated responses need grounding in external knowledge such as document corpora or product catalogs.

“RAG is a technique where LLM generated responses are grounded with facts fetched from external sources”article, stated
“knowledge bases such as a corpus of documents, catalog of products, etc”article, stated

latency-optimization (serving)

Coupang uses Triton dynamic batching, Ray/vLLM throughput improvements, nearline small batches, and model distillation to fit latency/resource constraints.

“Nvidia Triton offers a containerized inference solution, complete with features such as dynamic batching”article, stated
“vLLM provided us nearly ~20x throughput improvement in multiple workloads”article, stated

data-quality-loop (labeling)

LLM-generated weak labels pass quality checks and then train downstream models, helping with label scarcity in multilingual segments.

“Once these generated labels pass some quality checks, they can serve as weak supervision labels for training various models.”article, stated
“weak labels can enhance the quality of relevance models and have the potential of overcoming the challenges of label scarcity”article, stated

Tradeoffs

Primary model adaptation strategy

Chose Open-source architecture plus fine-tuning over Training foundation models from scratch.

Rationale: Fine-tuning lets teams use state-of-the-art pre-trained models with less time and compute.

“leverage state of the art pre-trained models and efficient architectures”article, stated
“saving both time and computational resources.”article, stated

Prototype pattern

Chose In-context learning before heavier training over Fine-tuning or pretraining first for every idea.

Rationale: ICL is fast, cheap, reusable across tasks, and useful for evaluating whether LLMs can solve a product problem.

“This is very fast to set up and iterate, cheap — as it involves no training”article, stated
“popular ways of prototyping and evaluating usage of LLM in a product.”article, stated

Production serving path

Chose Distillation or embedding extraction for many use cases over Serve the full source LLM directly in real time.

Rationale: Smaller real-time models and embeddings bridge LLM quality into production systems with lower serving cost and latency.

“The smaller model is used in real-time inference.”article, stated
“Embeddings can be exported from the LLMs and used in smaller models.”article, stated

GPU sourcing

Chose Hybrid cloud multi-region plus on-prem clusters over Single-region cloud GPU dependence.

Rationale: Multi-region and on-prem capacity mitigated cloud GPU wait times and reduced overall training cost.

“we implemented a multi-region deployment strategy for our ML infrastructure.”article, stated
“instrumental in alleviating the shortage of GPUs from the cloud provider and reducing overall cost of training.”article, stated

Gotchas (what bit them)

Under-resourced languages change both model and tokenizer choices.

Root cause: Korean and Mandarin have limited training data, character-based structure, spacing differences, and larger vocabularies.

Resolution: Favor multilingual-capable architectures and domain adaptation rather than assuming English-centric models are sufficient.

“Training data for most ML tasks is relatively small in both Korean and Mandarin.”article, stated
“Key differences include the use of spacing, the character-based nature of these languages”article, stated

GPU shortages can block execution plans.

Root cause: High-memory GPUs are expensive, scarce, and have significant wait times from cloud vendors.

Resolution: Use multi-region cloud clusters, on-prem high-end GPUs, and lower-performance GPUs for testing smaller models.

“GPUs offered by cloud vendors have a significant wait time.”article, stated
“By leveraging cloud service clusters across various regions (Asia-Pacific & US), we ensure faster access to GPUs”article, stated

Existing MLOps stacks may not be ready for LLM model parallelism.

Root cause: Models cannot fit in one GPU and data parallelism alone is insufficient.

Resolution: Add Kubernetes/PyTorchJob model-parallel training with DeepSpeed ZeRO and shared recipes.

“Our training stack was not equipped for distributed training (especially model parallel).”article, stated
“the typical method of distributed training — data parallelism alone is insufficient.”article, stated

Serving large LLMs directly can be too slow or expensive for e-commerce.

Root cause: Pre-LLM serving was CPU-only, and multi-billion-parameter models require GPU serving and careful latency/throughput design.

Resolution: Use Triton for real-time GPU serving, distill smaller models, export embeddings, and use batch/nearline inference where possible.

“Before LLMs, our serving was entirely on CPUs which are too slow for the multi-billion parameter models.”article, stated
“Batch and nearline inference on GPUs is the most popular way to extract predictions from the source LLMs at scale”article, stated

Hybrid multi-region infrastructure adds consistency overhead.

Root cause: Cloud and on-prem clusters need consistent storage, networking, and developer experience.

Resolution: Accept the complexity where GPU availability and training-cost benefits outweigh the operational burden.

“it also presents its own set of challenges, such as ensuring consistent infrastructure (storage & networking) and developer experience.”article, stated

Evaluation

Coupang evaluates models and infrastructure through application performance comparisons during training, price-to-performance GPU benchmarking, model-size ROI experiments, quality checks for weak labels, throughput experiments with vLLM, and production quality indicators across search, discovery, catalog, operations, ads, relevance, and categorization.

Metrics: model performance on the application · compute budget · dataset size · model-size ROI · price-to-performance ratio by GPU and model line · weak-label quality checks · relevance model quality · categorization precision gains · vLLM throughput improvement · resource efficiency of GPU training and inference stacks

4 supporting quotes
“developers use fine-tuning or pre-training from scratch depending on the compute budget, dataset size and comparing model performance.”article, stated
“regular benchmarking with model-building teams to evaluate the price-to-performance ratio”article, stated
“Once these generated labels pass some quality checks, they can serve as weak supervision labels for training various models.”article, stated
“vLLM provided us nearly ~20x throughput improvement in multiple workloads”article, stated

Outcomes

The case covers Coupang's shopping/eats/play surfaces, over 100 fulfillment centers, millions of products, Korean/Mandarin/English data, favored 3B-20B models, explicit 70B+ versus sub-10B ROI checks, A100-80GB training for >1B mixed-precision models, A10G-24GB testing, APAC/US cloud clusters, on-prem A100/H100 clusters, Triton on AWS EKS, and nearly 20x vLLM throughput improvements.

4 supporting quotes
“LLMs have improved various production ML systems and shown promise in several areas including search & discovery, catalog, operations, and ads quality”article, stated
“weak labels can enhance the quality of relevance models and have the potential of overcoming the challenges of label scarcity”article, stated
“This resulted in a single LLM powered categorizer for all categories with gains in precision across most categories.”article, stated
“We are continuously investing in our training to train larger models and improve resource efficiency of our GPU training and inference stacks.”article, stated