Uplift Modeling for Personalized Promotions

We design and deploy artificial intelligence systems: from prototype to production-ready solutions. Our team combines expertise in machine learning, data engineering and MLOps to make AI work not in the lab, but in real business.
Showing 1 of 1All 1564 services
Uplift Modeling for Personalized Promotions
Medium
~1-2 weeks
Frequently Asked Questions

AI Development Areas

AI Solution Development Stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1347
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1247
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    948
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1183
  • image_logo-advance_0.webp
    B2B Advance company logo design
    642
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    921

Promo Personalization via Uplift Modeling

A large retailer with a million customers spends hundreds of millions of rubles annually on discounts. Half goes to those who would have bought even without promo. We built an uplift model that reduced the discount budget by 35% in a two-week pilot while increasing revenue by 12%.

Mass "15% off everyone" campaigns look appealing, but 30–40% of recipients would have bought anyway. Money is wasted. Our AI system determines who to offer what discount and when—only to those who need it, and with the minimum incentive for conversion. This is a classic example of personalized promotions powered by AI retail and ML personalization.

Our team has 5+ years of experience in ML for retail and has delivered over 30 personalization projects, each involving customer-specific discounts and a promo personalization system.

How the AI System Personalizes Promotions

Uplift modeling predicts not the probability of purchase itself, but the increment in that probability due to a discount. We use a two-model approach: separately train a GradientBoostingClassifier on users who received the promo and those who did not. The difference in predictions gives the individual uplift.

import pandas as pd
import numpy as np
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.model_selection import cross_val_score

class PromoUpliftModel:
    """
    Uplift modeling: predicts not the purchase probability,
    but the INCREMENT in probability from a discount.
    """

    def __init__(self):
        # Two-model approach
        self.model_treatment = GradientBoostingClassifier(
            n_estimators=200, learning_rate=0.05, random_state=42
        )
        self.model_control = GradientBoostingClassifier(
            n_estimators=200, learning_rate=0.05, random_state=42
        )

    def train(self, df: pd.DataFrame, feature_cols: list):
        """
        df: user_id, received_promo (0/1), purchased (0/1), features...
        """
        X = df[feature_cols].fillna(0)
        y = df['purchased']

        # Train separately on those who received promo and those who did not
        treatment_mask = df['received_promo'] == 1
        control_mask = df['received_promo'] == 0

        X_t, y_t = X[treatment_mask], y[treatment_mask]
        X_c, y_c = X[control_mask], y[control_mask]

        self.model_treatment.fit(X_t, y_t)
        self.model_control.fit(X_c, y_c)

        print(f"Treatment model AUC: {cross_val_score(self.model_treatment, X_t, y_t, scoring='roc_auc', cv=3).mean():.3f}")
        print(f"Control model AUC: {cross_val_score(self.model_control, X_c, y_c, scoring='roc_auc', cv=3).mean():.3f}")

    def predict_uplift(self, X: pd.DataFrame) -> pd.Series:
        """Predict uplift for each user"""
        p_treatment = self.model_treatment.predict_proba(X)[:, 1]
        p_control = self.model_control.predict_proba(X)[:, 1]
        return pd.Series(p_treatment - p_control, index=X.index)


class PromoPersonalizationEngine:
    def __init__(self, uplift_model: PromoUpliftModel):
        self.uplift_model = uplift_model
        self.promo_tiers = [
            {'discount': 5, 'min_uplift': 0.05},
            {'discount': 10, 'min_uplift': 0.04},
            {'discount': 15, 'min_uplift': 0.03},
            {'discount': 20, 'min_uplift': 0.025},
            {'discount': 25, 'min_uplift': 0.02},
        ]

    def assign_promo(self, users_df: pd.DataFrame,
                      feature_cols: list,
                      budget_per_user: float = 50) -> pd.DataFrame:
        """Personalized assignment of promo discounts"""
        X = users_df[feature_cols].fillna(0)
        uplifts = self.uplift_model.predict_uplift(X)

        result = users_df[['user_id']].copy()
        result['predicted_uplift'] = uplifts.values
        result['segment'] = 'no_promo'
        result['discount_pct'] = 0
        result['expected_roi'] = 0

        for _, row in result.iterrows():
            idx = row.name
            uplift = result.at[idx, 'predicted_uplift']
            avg_order = users_df.at[idx, 'avg_order_value'] if 'avg_order_value' in users_df.columns else 100

            # Choose the minimum discount with positive ROI
            for tier in self.promo_tiers:
                if uplift >= tier['min_uplift']:
                    promo_cost = avg_order * tier['discount'] / 100
                    expected_revenue_lift = uplift * avg_order
                    roi = (expected_revenue_lift - promo_cost) / promo_cost

                    if roi > 0.5 and promo_cost <= budget_per_user:
                        result.at[idx, 'discount_pct'] = tier['discount']
                        result.at[idx, 'expected_roi'] = roi

                        # Segmentation
                        if uplift > 0.15:
                            result.at[idx, 'segment'] = 'persuadable_high'
                        elif uplift > 0.07:
                            result.at[idx, 'segment'] = 'persuadable_low'
                        else:
                            result.at[idx, 'segment'] = 'sure_thing'
                        break

        return result

    def calculate_promo_roi(self, results_df: pd.DataFrame) -> dict:
        """Calculate ROI of the promo campaign"""
        with_promo = results_df[results_df['discount_pct'] > 0]
        without_promo = results_df[results_df['discount_pct'] == 0]

        return {
            'total_users_targeted': len(with_promo),
            'avg_discount': with_promo['discount_pct'].mean(),
            'estimated_total_cost': (with_promo['discount_pct'] / 100 * 100).sum(),
            'segment_breakdown': results_df['segment'].value_counts().to_dict(),
            'expected_avg_roi': with_promo['expected_roi'].mean()
        }

Proper segmentation is key to budget savings. The uplift model identifies four groups:

  • Sure Things (~20%): will buy without a discount — do not waste budget.
  • Persuadables (~35%): need the right incentive — give minimal discount.
  • Lost Causes (~25%): will not buy even with a discount — do not waste.
  • Sleeping Dogs (~20%): discounts annoy them — leave alone.

Typical result: 40–50% reduction in promo budget while maintaining 85–90% of sales. For a chain with 500,000 clients, that is savings of up to 1.5 million rubles per month. Campaign ROI is 3–5x compared to 0.8x for mass campaigns. Another example: a hypermarket chain cut its discount budget by 38% in one quarter after implementing an uplift model, while revenue increased by 9% thanks to precise targeting. Additional profit reached 2.3 million rubles in that quarter.

Why Uplift Modeling Outperforms Mass Discounts

Parameter Mass 15% Discount Uplift Personalization
Reach 100% of customers ~35–40% with highest uplift
Promo costs High Reduced by 30–40%
ROI 0.5–1x 3–5x (5x better)
Customer irritation risk High Minimal

Real-world example: a hypermarket chain with 500,000 clients cut its discount budget by 38% in one quarter after implementing an uplift model, while revenue increased by 9% thanks to precise targeting. Additional profit reached 2.3 million rubles in that quarter. This clearly demonstrates the advantage of causal ML over traditional approaches.

Comparison of Uplift Modeling Approaches

Method Complexity Precision Interpretability
Two-model (our choice) Medium High Good
Transformed outcome Low Medium Low
Meta-learners (S,T,X) High High Medium

The two-model approach with XGBoost delivers stable results on moderately sized data (100k+ records) and scales easily to production. Source: Uplift Modeling: A Review

Implementation Process: From Analytics to Deployment

We work according to a proven plan:

  1. Data audit — gather and verify transaction history, promo records, customer features.
  2. Model building — implement two-model uplift (GradientBoosting, XGBoost) with cross-validation.
  3. Integration — connect the model to your CRM or promo platform via an API.
  4. A/B test — run a pilot on 10% of your audience, compare with a control group.
  5. Scaling — roll out to the entire base with real-time monitoring.

Timeline: from audit to pilot — 2 weeks; full launch — 8 weeks. Cost is calculated individually after analyzing your data.

More on model metrics:

To assess uplift model quality, we use the Qini curve and uplift AUC. In the two-model approach, separate AUC on treatment and control samples is also important. Typical values: AUC > 0.7 for treatment and > 0.65 for control. During validation, we check uplift on a holdout set — the difference in predictions must be positive and statistically significant.

Scope of Work

  • Ready-to-use personalization module with documentation and MLflow tracking.
  • Access to model source code and configurations.
  • Training for your team on system operation.
  • Technical support during the pilot and quality guarantee for results.

Contact us to get an assessment of your project within 2–3 days. Request a consultation: we will analyze your data and propose the optimal solution. Order an audit today — it is the first step to effective promo personalization.

Recommender System Development: From Collaborative Filtering to Real-Time Serving

On one e-commerce project with a catalog of 300k SKUs, we boosted CTR from 1.8% to 4.4% — a 2.4x increase. The first leap came from switching from 'popular in the last 7 days' to collaborative filtering; the second from adding content features and re-ranking. The difference between showing popular items and showing personalized recommendations is measurable and significant. Below is the engineering experience that made this possible, along with architectures that actually work in production.

Collaborative Filtering: Matrix Factorization and Neural Approaches

Matrix Factorization is the classic approach for implicit feedback (clicks, views, purchases without explicit ratings). ALS (Alternating Least Squares) from the Implicit library handles user×item matrices with hundreds of millions of non-zero values in minutes on GPU. Latent factors 64–256, regularization λ=0.01–0.1 are starting parameters. Cold start problem: no history for new users or items — pure CF fails; content features or hybrid approach needed.

Neural Collaborative Filtering (NCF) replaces the dot product with a neural network. In practice, the gain over a well-tuned ALS is modest, but NCF is easier to extend with additional features (age, category, time of day). Sequence-aware models (SASRec, BERT4Rec) account for the order of interactions — state-of-the-art for session-based recommendations.

How to Choose Recommender System Architecture?

The answer depends on data, load, and cold start requirements. Below are three main approaches with selection criteria.

Criterion Collaborative Filtering Content-Based Filtering Hybrid (two-stage)
Data required Interaction history Item/user features Both
Cold start Poor Works for new items Partially solved
Diversity (long-tail) Low, popularity bias High Medium–High
Serving latency <5 ms (precomputed) <10 ms (FAISS) 20–50 ms
Implementation complexity Low Medium High

Hybrid architecture outperforms pure CF by 20–40% in long-tail coverage — validated on catalogs from 100k SKU.

Content-Based Filtering: When Interaction History is Scarce

Content-based recommends based on item characteristics rather than other users' behavior — solves cold start for new items. Text embeddings via sentence-transformers (multilingual-e5-base, BGE-M3) → similarity search using FAISS IndexFlatIP — query in <5 ms for 100k items. Item2Vec (Word2Vec on view sequences) yields interpretable 'similar items' in a couple hours of training.

Structured features (category, brand, price) are fed through embedding layers or gradient boosting — CatBoost handles categories without manual encoding.

Why Hybrid Models Work Better?

Production systems are almost always two-level. Stage 1 (Retrieval) — fast selection of 100–500 candidates from 300k items using ALS or Two-Tower model with vector search (FAISS, Qdrant). Stage 2 (Ranking) — heavy ranker on LightGBM or neural network with cross-features, time, device, and session context. LightFM is a good starting point for medium scale without heavy infrastructure. Our practice shows: moving from single-stage to two-stage yields a 15–25% accuracy improvement with only 20–30 ms additional latency.

Real-Time Serving: Architecture Under Load

Latency SLA — 50–100 ms at thousands of requests per second. Base recommendations precomputed (batch job hourly) → Redis by user_id → <5 ms. Real-time re-ranking via Kafka for events (clicks, cart adds) → update of context features. Feature serving — Redis with TTL (views in 24 hours, last clicked item). At 10k req/s, we deploy Redis Cluster with replication.

A/B testing is the only reliable way to measure improvements. Offline metrics do not always correlate with online. Kohavi et al., 'Online Controlled Experiments at Large Scale' (KDD 2013) — a must-read for the team. Test on 5–10% of traffic, monitor CTR, conversion, revenue per session. One of our client systems after hybridization increased revenue by 18% over a month of A/B.

Recommender System Development Timeline

The stages and typical time frames are in the table below. Costs are calculated individually based on catalog scale and latency requirements.

Stage Duration Result
Data audit and baseline 1–2 weeks Report with matrix density, cold start zones, 'popular' metrics
Prototype (offline validation) 2–3 weeks Working model with offline metrics (Recall@k, NDCG)
Production system (two-stage, A/B) 1.5–2.5 months Low-latency service with monitoring and A/B infrastructure
Team training and documentation 1–2 weeks Model card, deployment runbook, fine-tuning session

What's Included in Turnkey Development

  1. Data audit — user×item matrix density (typically <0.1%), activity distribution, temporal patterns, cold start statistics.
  2. Baseline — 'popular' as a simple threshold that is often hard to beat.
  3. Iterative improvement — ALS → content features → two-stage → sequence-aware. Each step with A/B.
  4. Serving infrastructure — batch precomputation, Redis, real-time re-ranking, Grafana monitoring.
  5. Documentation — model card with metrics, deployment instructions, feature descriptions.
  6. Team training — session on interpreting results and model fine-tuning.
  7. Support — 1 month post-launch (incident fixes, pipeline tuning).

We are a team with 7+ years of experience in recommender systems, having delivered over 30 projects for e-commerce and media. We guarantee transparent A/B testing and documented metric improvements.

Want to assess the growth potential of your catalog? Contact us for a free data audit. Order recommender system development — first prototype within two weeks.

Example ALS config for implicit feedback
from implicit.als import AlternatingLeastSquares

model = AlternatingLeastSquares(
    factors=64,
    regularization=0.05,
    iterations=15,
    use_gpu=True
)
model.fit(user_item_matrix)

More about the mathematics of recommender systems — in specialized literature.