← Back to Index

Proof of Concept / Reinforcement Learning

Dynamic Pricing &
Contracting Simulator

Q-Learning Agent for Specialty Oncology Rebate Optimization

A tabular Q-learning reinforcement learning agent that discovers the revenue-maximizing rebate strategy for a specialty oncology drug across four payer archetypes. The agent learns to balance formulary access against net price by exploring a 144-state Markov decision process — converging on differentiated contracting strategies per payer segment after 500 training episodes. Built entirely in-browser with no backend dependencies.

Q-LearningReinforcement LearningMarkov Decision ProcessPayer StrategyFormulary OptimizationMarket AccessSpecialty Pharma

Disclaimer: This is a proof-of-concept demonstration using synthetic market parameters and simplified contracting dynamics. All payer characteristics, rebate thresholds, and revenue figures are illustrative. This tool does NOT represent actual contracting strategies, market access data, or pricing policies of any pharmaceutical company. Not intended for commercial decision-making.

Training RL agent — 500 episodes × 12 steps...

Exploring 144 states × 6 rebate actions with ε-greedy Q-learning

Technical Architecture

Tabular Q-Learning

A 144 × 6 Q-table (states × actions) stores learned value estimates for every (payer, competitive tier, formulary position, contract timing) × rebate action combination. The Bellman update Q(s,a) ← Q(s,a) + α(r + γ·max Q(s',a') − Q(s,a)) iterates toward the optimal policy using learning rate α=0.15 and discount γ=0.9.

Epsilon-Greedy Exploration

Early training uses high exploration (ε=0.5) to survey all 864 state-action pairs. Epsilon decays exponentially toward 0.05 over 500 episodes, ensuring thorough initial exploration before committing to learned optima. The decay schedule prevents premature convergence on locally optimal but globally suboptimal rebate strategies.

Stochastic Formulary Dynamics

Formulary tier transitions are probabilistic: meeting the preferred threshold yields preferred status with 85% probability (reflecting P&T committee variability). Competitor rebate evolves as a random walk each step. Contract renewal cycles reset every 4 steps. This stochasticity forces the agent to learn robust policies rather than deterministic one-time strategies.

References

  • Watkins CJCH, Dayan P. Q-Learning. Machine Learning. 1992;8(3-4):279-292.
  • Sutton RS, Barto AG. Reinforcement Learning: An Introduction. 2nd ed. MIT Press; 2018.
  • IQVIA Institute. Specialty and Orphan Medicines: US Market Dynamics. 2024.
  • CMS. Medicare Part D Formulary Reference File. 2025.
  • Academy of Managed Care Pharmacy. Formulary Management. AMCP Partnership Forum. 2020.
  • Mulberry32 PRNG: Steele G, Vigna S. Scrambled Linear Pseudorandom Number Generators. ACM TOMS. 2021;47(4):36.

Daniel Tran, PharmD

UC San Diego — Skaggs School of Pharmacy

Source code MIT. Content © 2026 Daniel Tran (CC BY-NC-SA 4.0).