The architecture of a neural network
Input layer Hidden layers (deep) Output layer
────────── ──────────────────── ─────────────
User features → Layer 1: basic Product
Item features → patterns → recommendation
Context → Layer 2: combinations → (probability of
→ Layer N: high-level → click or purchase)
concepts
Deep learning in e-commerce: applications
| Task | Architecture | Example |
|---|---|---|
| Recommendations | Two-tower, NCF, DLRM | Frequently bought together |
| Semantic search | BERT, bi-encoder | “green dress for an evening out” |
| AI shopping assistant | LLM plus RAG | Answering questions about products |
| Visual search | CNN, Vision Transformer | Finding a product from a photo |
| Churn prediction | LSTM, Transformer | Predicting churn from an event sequence |
Deep learning versus classical ML
| Dimension | Classical ML | Deep learning |
|---|---|---|
| Feature engineering | Manual | Automatic |
| Data volume | Works on small samples | Needs large volumes |
| Interpretability | High | Low (a black box) |
| Training speed | Fast | Slow, GPU required |
| Inference | Fast | Depends on model size |
| Preferred when | Tabular data, modest volume | Text, images, large volume |
The two-tower architecture for recommendations
The most widely deployed deep learning architecture for production recommender systems:
User tower: user ID, purchase history, affinity → user embedding (128-dim)
Item tower: item ID, category, attributes, price → item embedding (128-dim)
Score = dot_product(user_emb, item_emb)
The top-K items by score become the recommendations
The advantage is operational: the item tower is precomputed offline, and the top-K lookup runs in
milliseconds through an ANN index such as FAISS or ScaNN.