+150 XP

AI-driven pricing and markdown optimization

# AI-driven pricing and markdown optimization

A fashion retailer walks into February with 40,000 winter coats still on the shelf. Each week they sit, they lose value: the coats go out of style, warehouse space costs money, and spring inventory is already arriving. The question is not *whether* to discount. It is *when*, *how deep*, and *which items* to cut, so the retailer clears stock without giving away margin it did not have to.

This is the markdown problem. It has haunted retail for decades. AI now attacks it with math that no human buyer could run by hand.

Why pricing is so hard in retail

Retail pricing looks simple: pick a number, sell the item. It is not.

A single fashion retailer might carry tens of thousands of SKUs (stock keeping units, meaning each unique product variant such as a red coat in size medium). Each SKU has its own demand curve, its own competitors, and its own shelf life. A wool coat behaves nothing like a basic white tee.

Three forces collide:

  • Margin: the profit left after cost. Discount too early and you burn it.
  • Sell-through: the percentage of inventory sold by season end. Discount too late and you are stuck with worthless stock.
  • Brand perception: constant deep discounting trains customers to wait for sales.

Human buyers traditionally used gut feel and simple rules ("mark down 20% after week 6"). AI replaces the rule of thumb with a model tuned to each product.

Price elasticity: the foundation

Price elasticity of demand measures how much sales volume changes when you change price. If a 10% price cut lifts units sold by 30%, demand is *elastic*: shoppers are price sensitive. If that same cut lifts sales only 3%, demand is *inelastic*: price barely moves them.

This is the core input for every pricing model.

A concrete example:

  • A trendy graphic sweatshirt is highly elastic. Shoppers comparison shop, so a small discount clears a lot of units.
  • A wardrobe staple like black socks is inelastic. People buy what they need regardless of a small price change.

AI estimates elasticity per product (or product cluster) from historical sales, promotions, weather, competitor prices, and web traffic. Where a product is new and has no history, the model borrows from similar items, a technique called *cold start* handling.

Here is a simplified log-log regression, the classic starting point elasticity teams still use:

python
import numpy as np
import statsmodels.api as sm

# Historical weekly data for one product
log_price = np.log(price)      # e.g. weekly price
log_units = np.log(units_sold) # e.g. weekly units

X = sm.add_constant(log_price)
model = sm.OLS(log_units, X).fit()

elasticity = model.params[1]   # the slope IS the elasticity
print(f"Elasticity: {elasticity:.2f}")
# -1.8 means a 1% price rise drops units ~1.8%: elastic

The slope of price against volume, on a log scale, *is* the elasticity. A value more negative than minus one means elastic; between zero and minus one means inelastic. Real systems layer in seasonality, competitor data, and machine learning models that beat plain regression, but the intuition holds.

If you want to go deeper on the economics, the OpenStax Principles of Economics chapter on elasticity is a free, solid primer.

Setting the base price

Before markdowns, AI sets the *base price*: the full ticket price at launch.

The model weighs:

  • Cost and target margin: the floor you will not sell below.
  • Competitor prices: often scraped daily from rival websites.
  • Willingness to pay: derived from elasticity.
  • Positioning: a premium brand may deliberately price above the market to signal quality.

The output is a price that maximizes expected profit given the demand curve, not just cost plus a fixed markup. This is why the same jacket can carry different prices at a discount chain versus a department store: their models, and their customers' elasticity, differ.

The markdown problem, and why timing is everything

Now back to those 40,000 coats.

A markdown is a permanent price cut for clearance, distinct from a temporary promotion. The goal: sell remaining units before their value hits zero at season end.

The trap is that markdowns compound. Cut 20% now and you may not need to cut 50% later. But cut too early on a product that would have sold at full price, and you have donated margin to customers who would have paid more.

This is a *sequential decision* problem. Each week's choice changes what is left and what you can do next. That structure is exactly what reinforcement learning is built for.

Reinforcement learning for markdowns

Reinforcement learning (RL) is a type of AI where an "agent" learns by trial and error to maximize a long-term reward. Think of it as learning to play a game: the agent takes actions, sees results, and adjusts.

Map it to markdowns:

  • State: current inventory, weeks left in season, current price, recent sell-through, competitor prices.
  • Action: hold price, or cut it by some amount.
  • Reward: profit earned, with a penalty for leftover stock at season end.

The agent learns a *policy*: a rule for what markdown to take in any state. Crucially, it optimizes across the *whole* season, not just this week. It might hold price now because the model predicts a demand spike (a holiday, a cold snap) that would waste an early discount.

Why RL beats fixed rules:

  • It reacts to real conditions. A warm winter that stalls coat sales triggers earlier, deeper cuts.
  • It balances short-term revenue against end-of-season risk automatically.
  • It learns interactions across products: discounting coats may cannibalize scarf sales, or lift them.

Retailers rarely let a model run fully autonomous on day one. Most use *human in the loop*: the AI recommends, a pricing manager approves, and overrides feed back into the model. Because pure trial and error on live prices is risky and slow, teams train RL agents in *simulation* first, using a demand model built from historical data as a synthetic sandbox.

Guardrails and constraints

An unconstrained model will do dumb things: undercut a flagship product to zero, or price identical items differently in ways that anger customers. Real systems bolt on business rules:

  • Price floors: never below cost plus a minimum margin.
  • Ending-in rules: prices end in .99 or .95 for perception.
  • Change frequency limits: avoid whiplash pricing that erodes trust.
  • Family consistency: the same shirt in five colors should usually share a price.

There are also legal lines. Pricing based on protected characteristics, or coordinating prices with competitors, can be illegal in many markets. And *dynamic pricing* (prices that shift by demand or time) draws consumer-protection scrutiny when it feels like surge gouging. Keep legal and compliance teams close. This lesson is not legal advice.

Knowledge check

1. Why is the markdown problem best described as a question of timing and depth rather than simply whether to discount?

2. A product whose sales volume barely increases when its price is cut is best described as having what kind of demand?

3. Why does AI offer an advantage over the traditional 'mark down 20% after week 6' rule of thumb?

MULTIPLE CHOICE

4. Select ALL correct answers about the competing forces that make retail pricing difficult.

Select all the correct answers.

MULTIPLE CHOICE

5. Select ALL correct answers about price elasticity of demand and its role in pricing models.

Select all the correct answers.

Putting it together: the coat example

Return to the 40,000 coats, ten weeks from season end.

Week 1: The elasticity model flags coats as moderately elastic. The RL agent sees healthy inventory and a cold-weather forecast. It recommends *holding* full price. Human manager approves.

Week 4: A mild spell slows sales. Inventory is behind plan. The agent recommends a 15% markdown on the slowest colors only, keeping bestsellers at full price. This is *targeted* markdown, not blanket.

Week 7: Still 12,000 units left. The agent, weighing the near-zero salvage value of leftover coats, steps to 35%. It times the cut to a weekend and a competitor's own sale, where elasticity is highest.

Week 10: Final clearance at 60% to hit a target sell-through and free the floor for spring.

The result the retailer wants: higher total margin than a fixed "20% after week 6" rule, because discounts were smaller, later, and aimed only where they moved units.

What it takes to make this work

The math is the easy part. The hard parts:

  • Clean data: accurate sales, inventory, and cost feeds. Garbage in, garbage priced.
  • Competitor data: legal, reliable price scraping or a data vendor.
  • Organizational trust: buyers must believe the model. Start with recommendations, prove lift, then expand autonomy.
  • Measurement: run A/B tests or holdout stores to prove the AI beats the old rules, rather than assuming it does.

Key Takeaways

  • Elasticity is the engine. Every pricing decision starts with how sensitive each product's demand is to price, estimated per SKU from history and context.
  • Markdowns are a sequential game, not a single choice. Reinforcement learning optimizes across the whole season, holding, then cutting, to protect margin while clearing stock.
  • Target, do not blanket. Discount slow movers and hold bestsellers; time cuts to peak elasticity moments like competitor sales or weekend traffic.
  • Guardrails are mandatory. Price floors, consistency rules, and legal limits on dynamic pricing keep the model from destroying margin or breaking the law.
  • Prove it before you trust it. Use human-in-the-loop approval and holdout testing to show the AI outperforms simple rules before granting more autonomy.