arXiv:2611.00165cs.AIOct 2026

Manuscript Offprint

arXiv:2611.00165

Learning to bid and bundle: a posterior-sampling agent for online retail

Hadi Mohammadi

Abstract

An online retailer launching a perishable product bids for sponsored-search clicks, discounts a bundle with an always-stocked staple and displays its remaining stock, which raises willingness to pay. It knows neither how clicks respond to its bid nor how strong and dispersed its market is, and learns both over repeated seasons from data its own decisions censor: a zero bid reveals nothing about paid clicks, and choices follow only clicks. We design a posterior-sampling agent for it. Each period it draws a market from an exact posterior and posts the bid and discount of that market's exactly solved season plan, so every action is one a fully informed seller could take. In a simulated online florist it has the lowest regret averaged over markets. In weak markets it gives up 12% to 23% of one season's revenue over 500 seasons, four to seven times less than drawing once per season. A planner acting on point estimates can stop bidding and never learn that bidding pays. The agent escapes after about three seasons on average, against fifty with one draw per season. Where displayed scarcity keeps willingness to pay above the posted price, the discount needs no learning. Customers waiting for the discount to return to its recent level look like lost sales, so frequent waiting makes the agent underrate its market. One discount per season removes waiting at a cost of 5.9% of clairvoyant revenue in a weak market and none in a strong one.

Keywords: Online retailing, Sponsored search advertising, Bundle pricing, Dynamic pricing, Thompson sampling, Reinforcement learning, Scarcity effect

1. Introduction

Online retailers buy traffic through sponsored search, offer a second item at a discount on the product page, and show shoppers how many units are left. Each lever matters on its own: paid listings partly take traffic that organic results would otherwise bring (Moshary, 2025), scarcity cues raise booking intentions on hospitality platforms, partly through perceived value (Teubner & Graul, 2020), and when to disclose limited inventory is itself a decision that shapes sales (Z.

*Corresponding author. Email address: h.mohammadi@uu.nl (Hadi Mohammadi)

Liu et al., 2026). An online florist with fresh-cut bouquets to sell before the week is out uses all three. Each period it bids for the search keyword that brings shoppers to its page and sets a discount on a bouquet bought with a glass vase, while the page shows how many bouquets are left. With demand known, the bid and the discount can be planned together by dynamic programming (Mohammadi, Akrami, et al., 2026; Tunuguntla et al., 2019; Ye et al., 2015). At launch the florist knows little. It does not know how strongly clicks respond to its bid, how much its shoppers will pay, or how dispersed they are, and it has to learn all three from the clicks and sales that its own bids and discounts generate.

Two features make this harder than learning a posted price. The instruments censor the data. Organic visitors keep arriving without a bid, but only a positive bid reveals how paid clicks respond, and a purchase choice is seen only after a click. A seller that concludes advertising does not pay and stops bidding will never see evidence to the contrary. The discount, in turn, reaches customers who can wait: when it moves within the season, patient shoppers hold out for a better one, and in the seller's data a waiting shopper looks like a lost sale. Displayed scarcity adds a twist of its own. Deep scarcity lifts every shopper's willingness to pay above the posted price, so low-stock periods say little about the market.

We design and test a decision agent for this setting, with an offline planning module and an online learning loop. Offline, it solves the season program exactly by backward induction for every candidate market and click curve on a grid and stores the plans. Online, it keeps an exact posterior over the candidates, which splits into a click part and a choice part, and in each period draws a candidate and posts the bid and discount that the candidate's plan prescribes at the current stock and time. A decision is a table lookup, and every action is one a fully informed seller would take in some market the data still allow. Drawing once per season instead gives posterior sampling for reinforcement learning (Osband et al., 2013), which is easier to analyze and underlies a variant that holds one discount for the whole season. We test both in a seeded simulation of an online florist against certainty equivalence, randomized and scripted exploration, model-free learners, and oracles that know part of the truth.

Four findings stand out. Drawing every period is the version to deploy. It has the lowest regret averaged over markets (33.6over500seasons,against33.6 over 500 seasons, against74.0 for certainty equivalence and 109.4foronedrawperseason),andinweakmarketsitgivesup12109.4 for one draw per season), and in weak markets it gives up 12% to 23% of one season's revenue over 500 seasons, four to seven times less than drawing once per season. Certainty equivalence does slightly better only where its own plans keep producing informative data, as in the strong market (11 against $25), and it is the policy that can stop bidding for good. Tabular Q-learning, which needs no demand model, still earns 9% less than the oracle after 500 seasons in the strong market. Under a pessimistic prior that trap occurs, and posterior sampling escapes it at a rate we can predict. With 2% prior weight on responsive click curves, certainty equivalence never bids and forgoes more than half of the clairvoyant revenue every season, while one draw per season first bids after fifty seasons on average and one draw per period after three. Displayed scarcity decides what must be learned. Where it keeps every shopper's willingness to pay above the posted price, the optimal discount is a harvest level that depends only on known quantities, and the only market question left is whether the market is of that kind. Customers who wait contaminate learning. Waited bundles are recorded as no-sales, so once waiting is frequent the agent's beliefs drift toward weaker markets, whichever schedule it uses. Holding one discount for the season removes waiting at a cost of 5.9% of clairvoyant revenue in a weak market and none in a strong one.

The paper adds to work on learning agents for e-commerce decisions in design, testing and guidance. On design, the agent learns a per-click bid and a bundle discount together from data censored twice, with an exact posterior and an offline library of exactly solved plans, so its actions stay readable and its computation small. On testing, it is compared with standard and model-free learners in strong and weak markets and under two stress tests: a pessimistic prior that traps certainty equivalence, for which we derive how fast posterior sampling escapes under each sampling schedule (Proposition 3), and customers who wait for a better discount, whose waits bias the agent once they are frequent (Lemma 2 gives the threshold for a frozen plan). The analysis also shows that displayed scarcity can make discount learning unnecessary (Proposition 2). On guidance, Section 8 turns the results into deployment rules with the signals a seller can watch.

Two unpublished manuscripts are closest to this one. Mohammadi, Akrami, et al. (2026) solves the season model used here with demand known. We restate that model in full, so the paper can be read on its own, with one change, and study it under learning, which that work does not address. Mohammadi, Rabbani, and Nili Ahmadabadi (2026) studies a seller with unlimited inventory that learns which of a few prices to post, with no bid or bundle, against customers who wait. Section 7 applies its buy-wait-leave rule, which it takes from Nabi-Abdolyousefi (2018), to the bundle discount. Section 2 sets out what each contributes here.

Section 2 reviews related work. Sections 3 to 5 present the model, the agent with its computing cost, and the analytical results, Sections 6 and 7 the experiments, and Section 8 the rules for deployment. Section 9 concludes. Proofs are in Appendix A. The online supplement holds numerical checks and additional exhibits but no proofs.

References (69)