基于强化学习的自动出价论文阅读笔记(2)

书接上回《基于强化学习的自动出价论文阅读笔记(1)》。上一篇笔记介绍了基于无模型强化学习的自动出价算法-DRLB,该算法构建自动出价智能体,先将其应用在离线训练环境中、与仿真竞价系统交互,收集数据,进行学习,更新策略,再将其应用在在线预测环境中、与真实竞价系统交互,基于已训练策略进行出价,实现预算约束下的广告流量价值最大化。本篇笔记继续介绍延续先离线与仿真竞价系统交互进行训练、再在线与真实竞价系统交互进行预测这一思路的另外两篇论文。如有不足之处,请指正。

带约束自动出价统一方案-USCB

2021年阿里妈妈发表的论文《A Unified Solution to Constrained Bidding in Online Display Advertising》针对带约束自动出价除预算约束以外、还存在其他多种类型约束的问题,提出了带约束自动出价统一方案------USCB(Unified Solution to Constrained Bidding)。该方案对各种类型约束下的自动出价进行统一建模,推导出通用的出价计算公式,并使用无模型强化学习中同时学习价值函数和策略函数的Actor-Critic算法之一------DDPG算法,先离线与仿真竞价系统交互进行训练、再在线与真实竞价系统交互进行预测,输出出价计算公式中各参数最优值,从而计算出价并竞价,最终实现各种类型约束下广告流量价值的最大化

问题建模

上一篇笔记已介绍若只考虑预算约束,自动出价目标可由下式表示:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> max ⁡ ∑ i = 1 ... N x i v i s.t. ∑ i = 1 N x i c i ≤ B \begin{align} \max{\sum_{i=1\dots N}{x_iv_i}}\\ \text{s.t.}\space\sum_{i=1}^N{x_ic_i\le B} \end{align} </math>maxi=1...N∑xivis.t. i=1∑Nxici≤B

其中,每天共有 <math xmlns="http://www.w3.org/1998/Math/MathML"> N N </math>N次广告流量,对于 <math xmlns="http://www.w3.org/1998/Math/MathML"> i i </math>i次广告流量, <math xmlns="http://www.w3.org/1998/Math/MathML"> v i v_i </math>vi表示广告流量对于广告主的价值, <math xmlns="http://www.w3.org/1998/Math/MathML"> b i b_i </math>bi表示广告主对于广告流量的出价, <math xmlns="http://www.w3.org/1998/Math/MathML"> x i x_i </math>xi表示根据广告主的出价和其他广告主进行竞价后的结果(出价高者竞胜,1表示竞胜,0表示未竞胜), <math xmlns="http://www.w3.org/1998/Math/MathML"> c i c_i </math>ci表示广告主在竞胜后需要支付的费用(一般由广告平台投放系统按照GSP机制使用竞价排序中下一位广告主的出价计算所得),则自动出价问题即需要为广告主提供一个策略,该策略可根据广告流量价值计算广告出价,使得最终广告投放费用在不超过预算的前提下,最大化广告流量价值。

另外,不同的广告主在投放广告时,除了引入预算约束外,还会引入其他类型的效果指标作为约束条件,这些约束条件可以分为两大类:一类是成本相关的约束条件(Cost-Related,CR),包括单次点击成本(Cost Per Click,CPC)和单次转化成本(Cost Per Action,CPA)等;另一类是非成本相关的约束条件(Non-Cost-Related,NCR),包括点击率(Click Through Rate,CTR)和转化率(Conversion Per Impression,CPI)等。上述两类约束条件中的每一个约束条件可由下式统一表示:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> ∑ i c i j x i ∑ i p i j x i ≤ k j \frac{\sum_i{\mathbf{c}{ij}x_i}}{\sum_i{\mathbf{p}{ij}x_i}}\le \mathbf{k}_j </math>∑ipijxi∑icijxi≤kj

其中, <math xmlns="http://www.w3.org/1998/Math/MathML"> k j \mathbf{k}j </math>kj表示约束条件 <math xmlns="http://www.w3.org/1998/Math/MathML"> j j </math>j的上界, <math xmlns="http://www.w3.org/1998/Math/MathML"> p i j \mathbf{p}{ij} </math>pij表示约束条件 <math xmlns="http://www.w3.org/1998/Math/MathML"> j j </math>j下、展现 <math xmlns="http://www.w3.org/1998/Math/MathML"> i i </math>i的某个效果指标或常量, <math xmlns="http://www.w3.org/1998/Math/MathML"> c i j \mathbf{c}{ij} </math>cij可由下式计算:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> c i j = c i 1 C R j + q i j ( 1 − 1 C R j ) \mathbf{c}
{ij}=c_i\mathbf{1}{CR_j}+\mathbf{q}{ij}(1-\mathbf{1}{CR{j}}) </math>cij=ci1CRj+qij(1−1CRj)

其中, <math xmlns="http://www.w3.org/1998/Math/MathML"> 1 C R j \mathbf{1}{CR_j} </math>1CRj表示是否为成本相关的约束条件(1表示是,0表示否),即对于成本相关的约束条件, <math xmlns="http://www.w3.org/1998/Math/MathML"> c i j \mathbf{c}{ij} </math>cij为广告主在竞胜展现 <math xmlns="http://www.w3.org/1998/Math/MathML"> i i </math>i后需要支付的费用成本 <math xmlns="http://www.w3.org/1998/Math/MathML"> c i c_i </math>ci,对于非成本相关的约束条件, <math xmlns="http://www.w3.org/1998/Math/MathML"> c i j \mathbf{c}{ij} </math>cij为约束条件 <math xmlns="http://www.w3.org/1998/Math/MathML"> j j </math>j下、展现 <math xmlns="http://www.w3.org/1998/Math/MathML"> i i </math>i的某个效果指标或常量 <math xmlns="http://www.w3.org/1998/Math/MathML"> q i j \mathbf{q}{ij} </math>qij。

论文进一步列出多个具体约束条件中、上述统一表示公式各项的取值,如图1所示。例如,对于单次点击成本(CPC)约束, <math xmlns="http://www.w3.org/1998/Math/MathML"> c i j \mathbf{c}{ij} </math>cij为 <math xmlns="http://www.w3.org/1998/Math/MathML"> c i c_i </math>ci, <math xmlns="http://www.w3.org/1998/Math/MathML"> p i j \mathbf{p}{ij} </math>pij为 <math xmlns="http://www.w3.org/1998/Math/MathML"> CTR i \text{CTR}i </math>CTRi,则统一表示公式的分子为费用成本和,分母为点击次数,相除后为单次点击成本, <math xmlns="http://www.w3.org/1998/Math/MathML"> k j \mathbf{k}j </math>kj为单次点击成本的上界;对于点击率(CTR)约束, <math xmlns="http://www.w3.org/1998/Math/MathML"> c i j \mathbf{c}{ij} </math>cij为1, <math xmlns="http://www.w3.org/1998/Math/MathML"> p i j \mathbf{p}{ij} </math>pij为 <math xmlns="http://www.w3.org/1998/Math/MathML"> CTR i \text{CTR}_i </math>CTRi,则统一表示公式的分子为展现次数,分母为点击次数,相除后为点击率的倒数, <math xmlns="http://www.w3.org/1998/Math/MathML"> k j \mathbf{k}_j </math>kj为点击率下界的倒数。

图1 多个具体约束条件中、上述统一表示公式各项的取值

基于上述约束条件的统一表示,论文给出带约束自动出价问题的统一表示:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> max ⁡ x i ∑ i v i x i s.t. ∑ i c i x i ≤ B ∑ i c i j x i ∑ i p i j x i ≤ k j , ∀ j x i ≤ 1 , ∀ i x i ≥ 0 , ∀ i (LP1) \begin{align} \max_{x_i}\space\sum_i{v_ix_i} \\ \text{s.t.}\space\sum_i{c_ix_i}\le B\\ \frac{\sum_i{\mathbf{c}{ij}x_i}}{\sum_i{\mathbf{p}{ij}x_i}}\le \mathbf{k}_j,\space\forall j\\ x_i\le 1,\space\forall i\\ x_i\ge 0,\space\forall i\\ \end{align} \tag{LP1} </math>ximax i∑vixis.t. i∑cixi≤B∑ipijxi∑icijxi≤kj, ∀jxi≤1, ∀ixi≥0, ∀i(LP1)

即在上篇笔记所定义表达式的基础上,增加预算以外的约束条件。

论文进一步推导出上述线性规划问题取得最优解时,每次展现的出价可由下式表示:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> b i ∗ = w 0 ∗ v i − ∑ j w j ∗ ( q i j ( 1 − 1 C R j ) − k j p i j ) b_i^*=w_0^*v_i-\sum_j{w_j^*(\mathbf{q}{ij}(1-\mathbf{1}{CR_j})-\mathbf{k}j\mathbf{p}{ij})} </math>bi∗=w0∗vi−j∑wj∗(qij(1−1CRj)−kjpij)

笔者此处略去具体推导过程。从上式可以看出,每次展现的出价依赖参数 <math xmlns="http://www.w3.org/1998/Math/MathML"> { w k ∗ } k = 0 M \{w_k^*\}_{k=0}^M </math>{wk∗}k=0M,即将自动出价问题转化为该 <math xmlns="http://www.w3.org/1998/Math/MathML"> M + 1 M+1 </math>M+1个参数的求解。

解决方案

MDP

本篇论文和上一篇笔记介绍的DRLB算法相同,也使用马尔科夫决策过程(Markov Decision Process,MDP)对自动出价问题进行建模,将一天内的广告投放划分为96个时间段,每个时间段为15分钟,在第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t步,自动出价智能体使用策略 <math xmlns="http://www.w3.org/1998/Math/MathML"> π : S ↦ A \pi:\mathcal{S}\mapsto\mathcal{A} </math>π:S↦A,根据状态 <math xmlns="http://www.w3.org/1998/Math/MathML"> s t ∈ S s_t\in\mathcal{S} </math>st∈S,选择动作 <math xmlns="http://www.w3.org/1998/Math/MathML"> a 0 t , a 1 t , ... , a M t ∈ A a_{0t},a_{1t},\dots,a_{Mt}\in\mathcal{A} </math>a0t,a1t,...,aMt∈A( <math xmlns="http://www.w3.org/1998/Math/MathML"> A = A 0 × A 1 × ⋯ × A M ⊆ R M + 1 \mathcal{A}=\mathcal{A}_0\times\mathcal{A}_1\times\dots\times\mathcal{A}M\subseteq\reals^{M+1} </math>A=A0×A1×⋯×AM⊆RM+1),修改出价公式相应各参数,然后自动出价智能体基于修改后的参数和竞价系统进行交互,计算出价并竞价,将第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t步和第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t + 1 t+1 </math>t+1步之间竞得的广告流量价值之和作为第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t步所获得的奖励 <math xmlns="http://www.w3.org/1998/Math/MathML"> r t : S × A ↦ R ⊆ R r_t:\mathcal{S}\times\mathcal{A}\mapsto\mathcal{R}\subseteq\reals </math>rt:S×A↦R⊆R,自动出价智能体的优化目标即最大化一天内的奖励之和 <math xmlns="http://www.w3.org/1998/Math/MathML"> R = ∑ t = 1 T γ t − 1 r t R=\sum{t=1}^T{\gamma^{t-1}r_t} </math>R=∑t=1Tγt−1rt。 对于上述自动出价场景下的马尔可夫决策过程,其相应的各元素具体含义如下:

  • 状态集合 <math xmlns="http://www.w3.org/1998/Math/MathML"> S \mathcal{S} </math>S,自动出价智能体每一步的状态属性包括剩余时间、剩余预算、预算消费速度、各约束条件当前值和边界值的比例( <math xmlns="http://www.w3.org/1998/Math/MathML"> ∑ i c i j x i / ∑ i p i j x i k j \frac{\sum_i{\mathbf{c}{ij}x_i}/\sum_i{\mathbf{p}{ij}x_i}}{\mathbf{k}_j} </math>kj∑icijxi/∑ipijxi)等。
  • 动作集合 <math xmlns="http://www.w3.org/1998/Math/MathML"> A \mathcal{A} </math>A,自动出价智能体在第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t步的动作为 <math xmlns="http://www.w3.org/1998/Math/MathML"> M + 1 M+1 </math>M+1维动作向量 <math xmlns="http://www.w3.org/1998/Math/MathML"> a → t = ( a 0 t , ... , a M t ) \overrightarrow{a}t=(a{0t},\dots,a_{Mt}) </math>a t=(a0t,...,aMt),且 <math xmlns="http://www.w3.org/1998/Math/MathML"> a k t ∈ ( − 1.0 , + ∞ ) , ∀ k ∈ [ 0 , ... , M ] a_{kt}\in(-1.0,+\infin),\forall k\in[0,\dots,M] </math>akt∈(−1.0,+∞),∀k∈[0,...,M],并按照下式对出价公式中的 <math xmlns="http://www.w3.org/1998/Math/MathML"> M + 1 M+1 </math>M+1维参数向量 <math xmlns="http://www.w3.org/1998/Math/MathML"> w → t − 1 = ( w 0 ( t − 1 ) , ... , w M ( t − 1 ) ) \overrightarrow{w}{t-1}=(w{0(t-1)},\dots,w_{M(t-1)}) </math>w t−1=(w0(t−1),...,wM(t−1))进行修改: <math xmlns="http://www.w3.org/1998/Math/MathML"> w → t = w → t − 1 ⋅ ( 1 + a → t ) \overrightarrow{w}{t}=\overrightarrow{w}{t-1}\cdot(1+\overrightarrow{a}_t) </math>w t=w t−1⋅(1+a t)。
  • 奖励 <math xmlns="http://www.w3.org/1998/Math/MathML"> r t r_t </math>rt,自动出价智能体在第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t步的奖励为第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t步和第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t + 1 t+1 </math>t+1步之间竞得的广告流量价值之和,即 <math xmlns="http://www.w3.org/1998/Math/MathML"> r t = ∑ i ∈ O x i v i r_t=\sum_{i\in\mathcal{O}}{x_iv_i} </math>rt=∑i∈Oxivi,其中 <math xmlns="http://www.w3.org/1998/Math/MathML"> O \mathcal{O} </math>O为第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t步和第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t + 1 t+1 </math>t+1步之间的广告流量集合。
  • 状态转移函数 <math xmlns="http://www.w3.org/1998/Math/MathML"> T \mathcal{T} </math>T,论文基于无模型的强化学习算法,因此无需对环境进行建模,不求解状态转移函数。
  • 折扣因子 <math xmlns="http://www.w3.org/1998/Math/MathML"> γ \gamma </math>γ,因为各时段的奖励对于最大化当天累积奖励的目标来说有相等的权重,不会按时间衰减,所以折扣因子被固定为1。

DDPG

上一篇笔记已提到无模型的强化学习分为基于价值和基于策略的算法,基于价值的算法主要是学习价值函数,然后根据价值函数导出一个策略,学习过程中并不存在一个显式的策略,而基于策略的算法则是直接显式地学习一个策略函数,另外,基于策略的算法中还有一类Actor-Critic算法,其会同时学习价值函数和策略函数。

上一篇笔记介绍的DRLB算法具体使用了基于价值算法中的DQN算法,而本篇论文则具体使用了Actor-Critic算法中的DDPG算法。笔者这里简单介绍一下DDPG算法。DDPG算法使用Actor网络和Critic网络分别拟合策略函数和价值函数。DDPG算法在和环境的交互中,先使用Actor网络根据状态得到动作,再使用Critic网络根据状态和动作得到动作价值。

图2 DDPG算法中的Actor网络和Critic网络

DDPG算法的具体流程如下:

  • 随机噪声可以用 <math xmlns="http://www.w3.org/1998/Math/MathML"> N \mathcal{N} </math>N来表示,用随机的网络参数 <math xmlns="http://www.w3.org/1998/Math/MathML"> w w </math>w和 <math xmlns="http://www.w3.org/1998/Math/MathML"> θ \theta </math>θ分别初始化Critic网络 <math xmlns="http://www.w3.org/1998/Math/MathML"> Q w ( s , a ) Q_w(s,a) </math>Qw(s,a)和Actor网络 <math xmlns="http://www.w3.org/1998/Math/MathML"> R θ ( s ) R_\theta(s) </math>Rθ(s)

  • 复制相同的参数 <math xmlns="http://www.w3.org/1998/Math/MathML"> w − ← w w^-\leftarrow w </math>w−←w和 <math xmlns="http://www.w3.org/1998/Math/MathML"> θ − ← θ \theta^-\leftarrow\theta </math>θ−←θ,分别初始化目标网络 <math xmlns="http://www.w3.org/1998/Math/MathML"> Q w − Q_{w^-} </math>Qw−和 <math xmlns="http://www.w3.org/1998/Math/MathML"> R θ − R_{\theta^-} </math>Rθ−

  • 初始化经验回访池 <math xmlns="http://www.w3.org/1998/Math/MathML"> D D </math>D

  • for 序列 <math xmlns="http://www.w3.org/1998/Math/MathML"> e = 1 → E e=1\rightarrow E </math>e=1→E do:

    • 初始化随机过程 <math xmlns="http://www.w3.org/1998/Math/MathML"> N \mathcal{N} </math>N用于动作探索
    • 获取环境初始状态 <math xmlns="http://www.w3.org/1998/Math/MathML"> s 1 s_1 </math>s1
    • for 时间步 <math xmlns="http://www.w3.org/1998/Math/MathML"> t = 1 → T t=1\rightarrow T </math>t=1→T do:
      • 根据当前策略和噪声选择动作 <math xmlns="http://www.w3.org/1998/Math/MathML"> a t = R θ ( s t ) + N a_t=R_\theta(s_t)+\mathcal{N} </math>at=Rθ(st)+N

      • 执行动作 <math xmlns="http://www.w3.org/1998/Math/MathML"> a t a_t </math>at,获得奖励 <math xmlns="http://www.w3.org/1998/Math/MathML"> r e t re_t </math>ret,环境状态变为 <math xmlns="http://www.w3.org/1998/Math/MathML"> s t + 1 s_{t+1} </math>st+1

      • 将 <math xmlns="http://www.w3.org/1998/Math/MathML"> ( s t , a t , r e t , s t + 1 ) (s_t,a_t,re_t,s_{t+1}) </math>(st,at,ret,st+1)存储进回放池 <math xmlns="http://www.w3.org/1998/Math/MathML"> D D </math>D

      • 从 <math xmlns="http://www.w3.org/1998/Math/MathML"> D D </math>D中采样 <math xmlns="http://www.w3.org/1998/Math/MathML"> N N </math>N个元组 <math xmlns="http://www.w3.org/1998/Math/MathML"> { ( s i , a i , r e i , s i + 1 ) } i = 1 , . . . , N \{(s_i,a_i,re_i,s_{i+1})\}_{i=1,...,N} </math>{(si,ai,rei,si+1)}i=1,...,N

      • 对每个元组,用目标网络计算 <math xmlns="http://www.w3.org/1998/Math/MathML"> y i = r e i + γ Q w − ( s i + 1 , R θ − ( s i + 1 ) ) y_i=re_i+\gamma Q_{w^-}(s_{i+1},R_{\theta^-}(s_{i+1})) </math>yi=rei+γQw−(si+1,Rθ−(si+1))

      • 最小化目标损失 <math xmlns="http://www.w3.org/1998/Math/MathML"> L ( Q w ) = 1 N ∑ i = 1 N ( y i − Q w ( s i , a i ) ) 2 \mathcal{L}(Q_w)=\frac{1}{N}\sum_{i=1}^N(y_i-Q_w(s_i,a_i))^2 </math>L(Qw)=N1∑i=1N(yi−Qw(si,ai))2,以此更新当前Critic网络

      • 计算采样的策略梯度,以此更新当前Actor网络: <math xmlns="http://www.w3.org/1998/Math/MathML"> ∇ θ J ≈ 1 N ∑ i = 1 N ∇ θ R θ ( s i ) ∇ a Q w ( s i , a ) ∣ a = R θ ( s i ) \nabla_\theta J\approx\frac{1}{N}\sum_{i=1}^N\nabla_\theta R_\theta(s_i)\nabla_aQ_w(s_i,a)|{a=R\theta(s_i)} </math>∇θJ≈N1∑i=1N∇θRθ(si)∇aQw(si,a)∣a=Rθ(si)

    • 更新目标网络: <math xmlns="http://www.w3.org/1998/Math/MathML"> w − ← τ w + ( 1 − τ ) w − , θ − ← τ θ + ( 1 − τ ) θ − w^-\leftarrow\tau w+(1-\tau)w^-,\theta^-\leftarrow\tau\theta+(1-\tau)\theta^- </math>w−←τw+(1−τ)w−,θ−←τθ+(1−τ)θ−
  • end for

  • end for

上述算法通过与环境的多轮交互、不断更新Actor网络和Critic网络,其中几处细节是:

  • DDPG在Actor网络所输出动作的基础上增加随机噪声用于探索;
  • DDPG也使用了经验回放,从缓存中采样过去的轨迹数据用于Actor网络和Critic网络的训练;
  • DDPG中,Critic网络的损失函数和DQN中Q网络的损失函数相同,即网络输出和时序差分目标的均方误差,最小化上述损失函数,求取梯度进行网络参数更新;
  • DDPG中,Actor网络采用策略梯度进行网络参数更新,即最大化采样数据的动作价值之和;
  • DDPG也使用了目标网络以提升训练稳定性,Actor网络和Critic网络均有相应的目标网络,且目标网络采用软更新方式,将原网络参数按一定比例更新至目标网络。

关于DDPG算法的更多细节可以阅读《动手学强化学习-DDPG算法》

USCB

论文进一步证明,在自动出价场景下的马尔可夫决策过程中,自动出价智能体每一步的最优动作是将出价公式中的参数 <math xmlns="http://www.w3.org/1998/Math/MathML"> w → t − 1 \overrightarrow{w}_{t-1} </math>w t−1修改至最优参数 <math xmlns="http://www.w3.org/1998/Math/MathML"> w → t ∗ \overrightarrow{w}_t^* </math>w t∗,并在后续的各时间段保持参数不变

对于上述结论的证明,论文仍是先进行问题建模,即在马尔科夫决策过程中的每一步,由于广告主已在该步之前竞胜部分广告流量,获得部分流量价值,消耗部分广告预算,因此对于该步及其后续的自动出价问题可由下式统一表示:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> max ⁡ x i , i ∈ O ∑ i v i x i + v # s.t. ∑ i c i x i + c # ≤ B ∑ i c i j x i + c j # ∑ i p i j x i + p j # ≤ k j , ∀ j x i ≤ 1 , ∀ i ∈ O x i ≥ 1 , ∀ i ∈ O (LP3) \begin{align} \max_{x_i,i\in\mathcal{O}}\space\sum_{i}{v_ix_i}+v^{\#}\\ \text{s.t.}\space\sum_{i}{c_ix_i}+c^{\#}\le B\\ \frac{\sum_{i}{\mathbf{c}{ij}x_i}+\mathbf{c}j^{\#}}{\sum{i}{\mathbf{p}{ij}x_i}+\mathbf{p}_j^{\#}}\le\mathbf{k}_j,\space\forall j\\ x_i\le 1,\space\forall i\in\mathcal{O}\\ x_i\ge 1,\space\forall i\in\mathcal{O} \end{align} \tag{\text{LP3}} </math>xi,i∈Omax i∑vixi+v#s.t. i∑cixi+c#≤B∑ipijxi+pj#∑icijxi+cj#≤kj, ∀jxi≤1, ∀i∈Oxi≥1, ∀i∈O(LP3)

其中, <math xmlns="http://www.w3.org/1998/Math/MathML"> v # v^{\#} </math>v#表示该步之前已获得流量价值, <math xmlns="http://www.w3.org/1998/Math/MathML"> c # c^{\#} </math>c#表示该步之前已消耗广告预算, <math xmlns="http://www.w3.org/1998/Math/MathML"> c j # \mathbf{c}j^{\#} </math>cj#、 <math xmlns="http://www.w3.org/1998/Math/MathML"> p j # \mathbf{p}j^{\#} </math>pj#表示该步之前约束条件 <math xmlns="http://www.w3.org/1998/Math/MathML"> j j </math>j相应的效果指标在已竞得广告流量下的值, <math xmlns="http://www.w3.org/1998/Math/MathML"> O \mathcal{O} </math>O表示该步之后的广告流量集合,其他变量含义与LP1一致。和LP1可推导出最优出价计算公式类似,LP3也可推导出相应的最优出价计算公式。笔者此处略去具体推导过程,直接列出论文中推导的最优出价计算公式:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> b i t ∗ = w 0 t ∗ v i − ∑ j w j t ∗ ( q i j ( 1 − 1 C R j ) − k j p i j ) b
{it}^*=w
{0t}^*v_i-\sum_{j}{w_{jt}^*(\mathbf{q}{ij}(1-\mathbf{1}{CR_j})-\mathbf{k}j\mathbf{p}{ij})} </math>bit∗=w0t∗vi−j∑wjt∗(qij(1−1CRj)−kjpij)

其中, <math xmlns="http://www.w3.org/1998/Math/MathML"> w → t ∗ = ( w 0 t ∗ , w 1 t ∗ , ... , w M t ∗ ) \overrightarrow{w}t^*=(w{0t}^*,w_{1t}^*,\dots,w_{Mt}^*) </math>w t∗=(w0t∗,w1t∗,...,wMt∗)是第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t步的最优出价参数。自动出价智能体在第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t步的动作为 <math xmlns="http://www.w3.org/1998/Math/MathML"> M + 1 M+1 </math>M+1维动作向量 <math xmlns="http://www.w3.org/1998/Math/MathML"> a → t = ( a 0 t , ... , a M t ) \overrightarrow{a}t=(a{0t},\dots,a_{Mt}) </math>a t=(a0t,...,aMt),并按照下式对出价公式中的 <math xmlns="http://www.w3.org/1998/Math/MathML"> M + 1 M+1 </math>M+1维参数向量 <math xmlns="http://www.w3.org/1998/Math/MathML"> w → t − 1 = ( w 0 ( t − 1 ) , ... , w M ( t − 1 ) ) \overrightarrow{w}{t-1}=(w{0(t-1)},\dots,w_{M(t-1)}) </math>w t−1=(w0(t−1),...,wM(t−1))进行修改: <math xmlns="http://www.w3.org/1998/Math/MathML"> w → t ∗ = w → t − 1 ⋅ ( 1 + a → t ) \overrightarrow{w}{t}^*=\overrightarrow{w}{t-1}\cdot(1+\overrightarrow{a}_t) </math>w t∗=w t−1⋅(1+a t),并在后续的各时间段保持参数不变。

基于上述结论以及上一节介绍的DDPG算法,论文最终给出USCB算法的具体流程,如图3所示,其整体流程与DDPG算法基本一致,其中几处细节是:

  • USCB算法的每轮迭代,随机选择一个广告计划,并使用模拟竞价系统作为环境,以模拟该广告计划在一天内的广告投放,投放中,自动出价智能体与环境进行多步交互,每步交互根据状态选择动作调整出价参数,并使用调整后的出价参数对后续广告流量计算出价、参与竞价。
  • 自动出价智能体与环境的每步交互中,首先使用策略网络根据状态 <math xmlns="http://www.w3.org/1998/Math/MathML"> s t s_t </math>st预测动作,并在预测结果上增加随机噪声,得到最终的动作 <math xmlns="http://www.w3.org/1998/Math/MathML"> a → t = π θ ( s t ) + E \overrightarrow{a}t=\pi\theta(s_t)+\mathcal{E} </math>a t=πθ(st)+E,并根据动作 <math xmlns="http://www.w3.org/1998/Math/MathML"> a → t \overrightarrow{a}t </math>a t调整出价参数: <math xmlns="http://www.w3.org/1998/Math/MathML"> w → t = w → t − 1 ⋅ ( 1 + a → t ) \overrightarrow{w}{t}=\overrightarrow{w}_{t-1}\cdot(1+\overrightarrow{a}_t) </math>w t=w t−1⋅(1+a t)。
  • 自动出价智能体与环境的每步交互中,对该步及其后续所有步的广告流量使用该步调整的出价参数计算出价、参与竞价,使用 <math xmlns="http://www.w3.org/1998/Math/MathML"> R R </math>R保存该步之前各步竞得广告流量的奖励之和,使用 <math xmlns="http://www.w3.org/1998/Math/MathML"> V V </math>V保存该步之和各步竞得广告流量的奖励之和,则 <math xmlns="http://www.w3.org/1998/Math/MathML"> R + V R+V </math>R+V为一轮迭代各步竞得广告流量的奖励之和。
  • 自动出价智能体与环境的每步交互中,使用以下公式计算各约束条件若当前被违反的惩罚值 <math xmlns="http://www.w3.org/1998/Math/MathML"> p j p_j </math>pj: <math xmlns="http://www.w3.org/1998/Math/MathML"> p j = λ e x r j − 1 p_j=\lambda^{exr_j}-1 </math>pj=λexrj−1,其中, <math xmlns="http://www.w3.org/1998/Math/MathML"> λ ∈ ( 1 , + ∞ ) \lambda\in(1,+\infin) </math>λ∈(1,+∞),为控制惩罚强度的超参, <math xmlns="http://www.w3.org/1998/Math/MathML"> e x r j = max ⁡ ( 0 , k j a c t u a l / k j − 1 ) , k j a c t u a l = ∑ i c i j x i / ∑ i p i j x i exr_j=\max(0,\mathbf{k}_j^{actual}/\mathbf{k}j-1),\mathbf{k}j^{actual}=\sum_i{\mathbf{c}{ij}x_i}/\sum_i{\mathbf{p}{ij}x_i} </math>exrj=max(0,kjactual/kj−1),kjactual=∑icijxi/∑ipijxi,为约束条件 <math xmlns="http://www.w3.org/1998/Math/MathML"> j j </math>j当前真实值大于边界值的程度。
  • 自动出价智能体与环境的每步交互中,不同于DDPG算法使用时序差分目标( <math xmlns="http://www.w3.org/1998/Math/MathML"> r t + γ Q ( s t + 1 , π ( s t + 1 ) ) r_t+\gamma Q(s_{t+1},\pi(s_{t+1})) </math>rt+γQ(st+1,π(st+1)))作为动作价值网络输出的逼近值,使用动作价值网络输出和时序差分目标的均方误差作为动作价值网络的损失函数,USCB算法使用以下公式计算动作价值网络输出的逼近值: <math xmlns="http://www.w3.org/1998/Math/MathML"> G = min ⁡ ( ( R + V ) / R ∗ , 1.0 ) − ∑ j p j \mathcal{G}=\min((R+V)/R^*,1.0)-\sum_j{p_j} </math>G=min((R+V)/R∗,1.0)−∑jpj**,其中,** <math xmlns="http://www.w3.org/1998/Math/MathML"> R ∗ R^* </math>R∗为理论上可竞得广告流量奖励之和的最大值,并使用上述逼近值和动作价值网络输出的均方误差作为动作价值网络的损失函数,即尽量减小约束条件的惩罚值,增大广告流量的奖励值。
  • 自动出价智能体与环境的每步交互中,先使用上述损失函数计算梯度更新动作价值网络的参数,再根据策略梯度更新策略网络的参数。
图3 USCB算法的具体流程

实验评估

USCB算法为不同类型约束条件下的自动出价问题提供了统一方案,因此,论文选择三种约束条件下的自动出价问题进行实验评估:

  • CB{clicks}:约束条件仅有预算约束( <math xmlns="http://www.w3.org/1998/Math/MathML"> ∑ i c i x i ≤ B \sum_{i}{c_ix_i}\le B </math>∑icixi≤B),流量价值为点击,因此该带约束出价问题是在预算约束下,最大化点击,其对于展现 <math xmlns="http://www.w3.org/1998/Math/MathML"> i i </math>i的最优出价公式为:

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> b i = w 0 pCTR i b_i=w_0\text{pCTR}_i </math>bi=w0pCTRi

  • CB{click-CPC}:约束条件除预算约束外,增加单次点击成本约束,流量价值为点击,因此该带约束出价问题是在预算、单次点击成本约束下,最大化点击,其对于展现 <math xmlns="http://www.w3.org/1998/Math/MathML"> i i </math>i的最优出价公式为:

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> b i = w 0 pCTR i + w 1 k C P C pCTR i b_i=w_0\text{pCTR}i+w_1\mathbf{k}{CPC}\text{pCTR}_i </math>bi=w0pCTRi+w1kCPCpCTRi

  • CB{conversion-CPC}:约束条件除预算约束外,增加单次点击成本约束,流量价值为转化,因此该带约束出价问题是在预算、单次点击成本约束下,最大化转化,其对于展现 <math xmlns="http://www.w3.org/1998/Math/MathML"> i i </math>i的最优出价公式为:

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> b i = w 0 pCVR i + w 1 k C P C pCTR i b_i=w_0\text{pCVR}i+w_1\mathbf{k}{CPC}\text{pCTR}_i </math>bi=w0pCVRi+w1kCPCpCTRi

实验评估基于淘宝展现广告的线上竞价日志为上述三种约束条件下的自动出价问题分别构建数据集。每个数据集对应于某种自动出价问题,包含使用该种自动出价的数千个广告计划在8天内的竞价数据,每条竞价数据可表示为 <math xmlns="http://www.w3.org/1998/Math/MathML"> ( t i , c i d , p C T R i , p C V R i , c i ) (t_i,cid,pCTR_i,pCVR_i,c_i) </math>(ti,cid,pCTRi,pCVRi,ci),其包含展现 <math xmlns="http://www.w3.org/1998/Math/MathML"> i i </math>i的时间戳 <math xmlns="http://www.w3.org/1998/Math/MathML"> t i t_i </math>ti,广告计划 <math xmlns="http://www.w3.org/1998/Math/MathML"> c i d cid </math>cid在该展现中的预估点击率、预估点击率和费用成本。论文将每个数据集中,前7天的竞价数据作为训练和验证集,最后1天的竞价数据作为测试集。

实验评估的效果指标和USCB算法流程中动作价值网络的逼近值一致:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> G = min ⁡ ( R R ∗ , 1.0 ) − ∑ j p j G=\min(\frac{R}{R^*},1.0)-\sum_j{p_j} </math>G=min(R∗R,1.0)−j∑pj

即算法应尽量减小约束条件的惩罚值,增大广告流量的奖励值。

实验评估的基线模型包括:

  • Fixed Parameter(FP):即根据历史数据计算最优出价参数,并在测试阶段保持参数不变;
  • Deep Reinforcement Learning to Bid(DRLB):即上一篇笔记中介绍的算法,此处不再介绍;
  • Model predictive PID(M-PID):模型预测控制算法。

论文进行了大量的实验以对比各基线模型、分析算法收敛性能和约束惩罚影响等,以下仅列出USCB算法和各基线模型的对比结果。从图中可以看出,在不同的出价参数初始值下,USCB在三种约束条件下的自动出价问题中均取得最好的效果。

图4 USCB算法和各基线模型的对比结果

个性化自动出价方案-PerBid

2023年阿里妈妈发表的论文《A Personalized Automated Bidding Framework for Fairness-aware Online Advertising》指出不同的广告主其广告投放目标和过程并不相同,基于统一方案构建一个自动出价智能体并应用于多个广告主,可能会导致该智能体为各广告主自动出价所带来的投放效果参差不齐,影响广告投放的整体公平性,因此该论文在USCB算法的基础上,提出了个性化自动出价方案------PerBid,该方案首先通过广告计划画像网络输出广告计划画像表征,能够表征广告计划的静态属性特征和动态环境特征,在此基础上,将广告计划划分为多个类簇,为每个类簇构建一个自动出价智能体,并且每个自动出价智能体将广告计划画像表征作为状态输入之一、从而感知不同广告计划动态环境的上下文,论文通过实验论证,该方案在保障投放效果的同时,也能提升广告投放的公平性

问题建模

和USCB算法类似,本篇论文首先对带约束自动出价问题进行建模:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> max ⁡ x ∑ i = 1 n x i × v i s.t. ∑ i = 1 n x i × c o s t i ≤ B u d g e t ∑ i = 1 n x i × c o s t i ∑ i = 1 n x i × c t r i ≤ P P C x i ∈ { 0 , 1 } , ∀ i ∈ [ 1 , n ] \begin{align} \max_{\mathbf{x}}{\sum_{i=1}^{n}{x_i\times v_i}}\\ \text{s.t.}\space\sum_{i=1}^{n}{x_i\times cost_i}\le Budget\\ \frac{\sum_{i=1}^{n}{x_i\times cost_i}}{\sum_{i=1}^{n}{x_i\times ctr_i}}\le PPC\\ x_i\in\{0,1\},\forall i\in[1,n] \end{align} </math>xmaxi=1∑nxi×vis.t. i=1∑nxi×costi≤Budget∑i=1nxi×ctri∑i=1nxi×costi≤PPCxi∈{0,1},∀i∈[1,n]

即在预算和单次点击成本约束下,最大化竞得的广告流量价值之和。

和USCB算法类似,本篇论文也推导出最优出价公式:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> b i d i ∗ = ( α ∗ × v i c t r i a v e r a g e ( v i c t r i ) + β ∗ ) × P P C bid_i^*=\left(\alpha^*\times\frac{\frac{v_i}{ctr_i}}{average(\frac{v_i}{ctr_i})}+\beta^*\right)\times PPC </math>bidi∗=(α∗×average(ctrivi)ctrivi+β∗)×PPC

其中, <math xmlns="http://www.w3.org/1998/Math/MathML"> α ∗ \alpha^* </math>α∗和 <math xmlns="http://www.w3.org/1998/Math/MathML"> β ∗ \beta^* </math>β∗是需要求解的最优出价参数。

和USCB算法类似,本篇论文也将自动出价问题转化为马尔科夫决策过程,自动出价智能体在第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t步,根据状态 <math xmlns="http://www.w3.org/1998/Math/MathML"> s t s_t </math>st,通过策略 <math xmlns="http://www.w3.org/1998/Math/MathML"> π \pi </math>π,输出动作 <math xmlns="http://www.w3.org/1998/Math/MathML"> a t a_t </math>at,调节出价参数,随后根据出价参数计算出价并竞价,获得奖励 <math xmlns="http://www.w3.org/1998/Math/MathML"> r t r_t </math>rt,并在第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t + 1 t+1 </math>t+1步,状态转移至 <math xmlns="http://www.w3.org/1998/Math/MathML"> s t + 1 s_{t+1} </math>st+1。令根据状态 <math xmlns="http://www.w3.org/1998/Math/MathML"> s t s_t </math>st选择动作 <math xmlns="http://www.w3.org/1998/Math/MathML"> a t a_t </math>at所获得的长期价值期望为 <math xmlns="http://www.w3.org/1998/Math/MathML"> G ( s t , a t ) G(s_t,a_t) </math>G(st,at),则策略 <math xmlns="http://www.w3.org/1998/Math/MathML"> π \pi </math>π的优化目标即最大化上述长期价值期望,即 <math xmlns="http://www.w3.org/1998/Math/MathML"> π ( s ) = arg ⁡ max ⁡ a G ( s , a ) \pi(s)=\arg\max_a{G(s,a)} </math>π(s)=argmaxaG(s,a)。

进一步解释相关变量的含义:

  • <math xmlns="http://www.w3.org/1998/Math/MathML"> s t s_t </math>st表示广告计划在第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t步的实时状态,包括广告计划剩余投放时间、剩余预算、实时点击成本、平均点击成本等。
  • <math xmlns="http://www.w3.org/1998/Math/MathML"> a t a_t </math>at表示广告计划在第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t步对出价参数的调整值,即 <math xmlns="http://www.w3.org/1998/Math/MathML"> { α t , β t } = { α t − 1 , β t − 1 } + a t \{\alpha_t,\beta_t\}=\{\alpha_{t-1},\beta_{t-1}\}+a_t </math>{αt,βt}={αt−1,βt−1}+at,其中, <math xmlns="http://www.w3.org/1998/Math/MathML"> a t = ( a t α , a t β ) a_t=(a_t^\alpha,a_t^\beta) </math>at=(atα,atβ), <math xmlns="http://www.w3.org/1998/Math/MathML"> a t a_t </math>at由 <math xmlns="http://www.w3.org/1998/Math/MathML"> s t s_t </math>st通过策略 <math xmlns="http://www.w3.org/1998/Math/MathML"> π \pi </math>π得到,即 <math xmlns="http://www.w3.org/1998/Math/MathML"> a t = π ( s t ) a_t=\pi(s_t) </math>at=π(st)。
  • <math xmlns="http://www.w3.org/1998/Math/MathML"> r t r_t </math>rt表示广告计划在第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t步和第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t + 1 t+1 </math>t+1步之间获得的奖励,令 <math xmlns="http://www.w3.org/1998/Math/MathML"> R t R_t </math>Rt表示第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t步之前的累计奖励, <math xmlns="http://www.w3.org/1998/Math/MathML"> R − t R_{-t} </math>R−t表示第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t步之后的累计奖励, <math xmlns="http://www.w3.org/1998/Math/MathML"> P P </math>P表示违反单次点击成本约束的惩罚值,则长期价值期望为 <math xmlns="http://www.w3.org/1998/Math/MathML"> G ( s t , a t ) G(s_t,a_t) </math>G(st,at)可由下式表示,该式与USCB中动作价值网络的逼近值一致:

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> G ( s t , a t ) = R t + R − t R ∗ − P G(s_t,a_t)=\frac{R_t+R_{-t}}{R^*}-P </math>G(st,at)=R∗Rt+R−t−P

公平性分析

论文进一步分析了若使用一个自动出价智能体所带来的公平性问题。论文指出在阿里巴巴展示广告平台中使用一个自动出价智能体,则投放效果最差(尾部10%)的广告计划相比投放效果最好(头部10%)的广告计划,前者投放效果只有后者的76%。论文分析导致上述不公平问题的原因有两点:广告环境差异和状态探索不平衡。

广告环境差异是指不同广告计划的投放设置(例如目标人群)不同,导致不同广告计划的展示量和点击率差异很大,一个自动出价智能体并不能适用所有广告计划。

状态探索不平衡是指不同广告计划的广告环境差异较大,导致不同广告计划的状态分布差异也较大,一个自动出价智能体所探索的状态空间对于不同广告计划并不平衡,有的广告计划的状态空间被探索的多,有的广告计划的状态空间被探索的少,而强化学习需要与环境交互、探索尽可能多的状态,防止发生OOD问题。

论文指出可将广告计划分为三种类型:预算敏感型(更关注预算约束),占比59.61%;单次点击成本敏感型(更关注单次点击成本约束),占比20.20%;混合敏感型(同时关注预算和单次点击成本约束),占比20.19%。

而预算敏感型广告计划和单次点击成本敏感型广告计划的状态分布如图5所示,其中,横坐标是预算消耗速度,纵坐标是平均点击成本,从中可以看出,预算敏感型广告计划会采用预算平滑控制预算消耗速度,因此状态多分布于坐标轴的中右侧,而单次点击成本敏感型广告计划聚焦于成本控制,因此状态多分布于坐标轴的左上侧,两者的状态分布差异较大。

图5 预算敏感型广告计划和单次点击成本敏感型广告计划的状态分布

解决方案

整体框架

为解决公平性问题,论文提出了个性化自动出价方案------PerBid(Personalized Automated Bidding Framework),其整体框架如图6所示。该方案首先通过广告计划画像网络输出广告计划画像表征,能够表征广告计划的静态属性特征和动态环境特征,在此基础上,将广告计划划分为多个类簇,为每个类簇构建一个自动出价智能体,并且每个自动出价智能体将广告计划画像表征作为状态输入之一、从而感知不同广告计划动态环境的上下文。

图6 PerBid整体框架

广告计划画像网络

图7 广告计划画像网络

论文首先通过广告计划画像网络输出广告计划画像表征,该网络如图7所示。该网络同时考虑广告计划的静态属性特征和动态环境特征。广告计划的静态属性特征包括预算、单次点击成本和ID类特征(例如计划ID、目标人群、广告时间等),ID类特征的独热编码会通过Embedding层转化为相应的稠密向量。广告计划的动态环境特征包含广告计划在各个时间段的出价日志,是比较典型的序列特征,因此论文采用循环神经网络(具体采用GRU)对其进行序列建模,对每个时间段中的出价日志根据成本相关的效果指标(例如 <math xmlns="http://www.w3.org/1998/Math/MathML"> c o s t i v i \frac{cost_i}{v_i} </math>vicosti、 <math xmlns="http://www.w3.org/1998/Math/MathML"> c o s t i c t r i \frac{cost_i}{ctr_i} </math>ctricosti等)进行降序排序,并按照前10%、前30%、前50%等分位计算各时间段内的分位指标值,再加上各时间段的平均竞胜价格,组成各时间段的向量 <math xmlns="http://www.w3.org/1998/Math/MathML"> E t E_t </math>Et。循环神经网络的输入是广告计划在各时间段的效果指标向量的集合 <math xmlns="http://www.w3.org/1998/Math/MathML"> { E 1 , ... , E T } \{E_1,\dots,E_T\} </math>{E1,...,ET},输出是表征广告计划动态环境特征的隐状态 <math xmlns="http://www.w3.org/1998/Math/MathML"> h ( T ) h(T) </math>h(T)。循环神经网络的输出和广告计划的静态属性特征拼接在一起作为广告计划画像特征:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> P r o f i l e i = ( h ( T i ) , B u d g e t i , P P C , Embedding ( I D _ f e a t u r e s i ) ) Profile_i=(h(T_i),Budget_i,PPC,\text{Embedding}(ID\_features_i)) </math>Profilei=(h(Ti),Budgeti,PPC,Embedding(ID_featuresi))

论文将广告计划按照投放效果分为 <math xmlns="http://www.w3.org/1998/Math/MathML"> K K </math>K类,并使用独热编码 <math xmlns="http://www.w3.org/1998/Math/MathML"> y i y_i </math>yi标记广告计划 <math xmlns="http://www.w3.org/1998/Math/MathML"> i i </math>i的类别: <math xmlns="http://www.w3.org/1998/Math/MathML"> y i = ( y i 1 , ... , y i K ) y_i=\left(y_i^1,\dots,y_i^K\right) </math>yi=(yi1,...,yiK)。若 <math xmlns="http://www.w3.org/1998/Math/MathML"> y i j = 1 y_i^j=1 </math>yij=1,则广告计划 <math xmlns="http://www.w3.org/1998/Math/MathML"> i i </math>i属于类别 <math xmlns="http://www.w3.org/1998/Math/MathML"> j j </math>j。论文将广告计划画像特征加上出价参数 <math xmlns="http://www.w3.org/1998/Math/MathML"> α \alpha </math>α和 <math xmlns="http://www.w3.org/1998/Math/MathML"> β \beta </math>β,通过一个全连接网络,对广告计划的类别进行预测,并使用交叉熵损失函数对上述分类任务进行训练,学习广告计划画像网络中的参数:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> L o s s = − 1 N ∑ i = 1 N ∑ j = 1 K y i j log ⁡ ( f j ( P r o f i l e i , α i , β i ) ) Loss=-\frac{1}{N}\sum_{i=1}^{N}{\sum_{j=1}^{K}{y_i^j\log(f_j(Profile_i,\alpha_i,\beta_i))}} </math>Loss=−N1i=1∑Nj=1∑Kyijlog(fj(Profilei,αi,βi))

上下文感知的出价策略

在得到广告计划画像特征的基础上,论文使用广告计划画像特征中的隐状态 <math xmlns="http://www.w3.org/1998/Math/MathML"> h ( t ) h(t) </math>h(t)扩充马尔科夫决策过程中的状态 <math xmlns="http://www.w3.org/1998/Math/MathML"> s t s_t </math>st,使得出价策略能够感知广告计划动态竞价环境的上下文:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> s t = { s t a t u s t , c o n t e x t t } c o n t e x t t = h ( t ) s t a t u s t = { r e m a i n _ t i m e t , r e m a i n _ b u d g e t t , s p e n d _ s p e e d t , a v e r a g e _ p p c t , p p c t , α t , β t } \begin{align} &s_t=\{status_t,context_t\}\\ &context_t=h(t)\\ &status_t=\{remain\_time_t,remain\_budget_t,spend\_speed_t,average\_ppc_t,ppc_t,\alpha_t,\beta_t\} \end{align} </math>st={statust,contextt}contextt=h(t)statust={remain_timet,remain_budgett,spend_speedt,average_ppct,ppct,αt,βt}

候选出价策略构建

在出价策略能够感知广告计划动态竞价环境上下文的基础上,论文构建多个候选出价策略,每个候选出价策略适配一类广告计划。候选出价策略构建的流程如图8所示,包含三步:

  • 类簇初始化,根据预定义规则将广告计划划分至不同的类簇。
  • 自动出价智能体训练,并行为每个类簇训练一个自动出价智能体,每个自动出价智能体的训练流程和USCB算法一致,此处不再介绍。
  • 类簇重分配,对当前类簇中的每个广告计划使用所有类簇的自动出价智能体在模拟竞价系统中进行广告投放,若某个广告计划获得最优投放效果的智能体非当前类簇的智能体,且最优投放效果和当前类簇的智能体所获得投放效果的差值超过一定阈值,则将该广告计划划分至获得最优投放效果的智能体所属的类簇中。

自动出价智能体训练和类簇重分配会迭代多次,直至收敛。

图8 候选出价策略构建流程

出价策略匹配

当某个广告计划在某天在线竞价时,从其过去若干天的历史投放数据中进行采样,并使用所有类簇的自动出价智能体在模拟竞价系统中对该计划进行广告投放,选取效果最好的自动出价智能体作为当天该计划的自动出价智能体。

实验评估

实验评估的效果指标如下:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> R e s = min ⁡ ( ∑ i = 1 T r i R ∗ × 1 max ⁡ ( P P C _ r a t i o , 1 ) , 1 ) Res=\min\left(\frac{\sum_{i=1}^T{r_i}}{R^*}\times \frac{1}{\max(PPC\_ratio,1)},1\right) </math>Res=min(R∗∑i=1Tri×max(PPC_ratio,1)1,1)

其中, <math xmlns="http://www.w3.org/1998/Math/MathML"> P P C _ r a t i o PPC\_ratio </math>PPC_ratio为实际单次点击成本和单次点击成本约束边界值的比例,上式的含义即算法应尽量增大广告流量的奖励值,减小单次点击成本。

另外引入基尼系数以衡量公平性,该值越小,公平性越高:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> G i n i = ∑ i = 1 N ∑ j = 1 N ∣ R e s i − R e s j ∣ 2 × N 2 × R e s ‾ Gini=\frac{\sum_{i=1}^N{\sum_{j=1}^N{|Res_i-Res_j|}}}{2\times N^2\times \overline{Res}} </math>Gini=2×N2×Res∑i=1N∑j=1N∣Resi−Resj∣

论文比较了以下算法:

  • Baseline,即USCB算法;
  • Baseline w. Profile,在USCB算法基础上,使用广告计划画像特征中的隐状态扩充马尔科夫决策过程中的状态;
  • Fixed Agents(OPT),将广告计划固定分为多类,且为每类训练一个自动出价智能体;
  • PerBid(OPT),将广告计划分为多类,且为每类训练一个自动出价智能体,并在训练阶段进行类簇重分配;
  • PerBid(Match),将广告计划分为多类,且为每类训练一个自动出价智能体,并在训练阶段进行类簇重分配,在线竞价时根据历史投放数据的模拟竞价结果选择自动出价智能体。

结果如图9所示,PerBid(OPT)在取得较优投放效果的同时,公平性也较高。

图9 不同算法的结果

参考文献

相关推荐
pzx_0012 分钟前
【内积】内积计算公式及物理意义
数据结构·python·opencv·算法·线性回归
元气代码鼠4 分钟前
C语言程序设计(进阶)
c语言·开发语言·算法
AIPaPerPass写论文9 分钟前
写论文去哪个网站?2024最佳五款AI毕业论文学术网站
人工智能·深度学习·chatgpt·powerpoint·ai写作
5pace32 分钟前
PyTorch深度学习快速入门教程【土堆】基础知识篇
人工智能·pytorch·深度学习
十雾九晴丶38 分钟前
攻防世界--->gametime
算法
Aurora_th1 小时前
树与图的深度优先遍历(dfs的图论中的应用)
c++·算法·深度优先·图论·dfs·树的直径
马剑威(威哥爱编程)3 小时前
除了递归算法,要如何优化实现文件搜索功能
java·开发语言·算法·递归算法·威哥爱编程·memoization
AI完全体3 小时前
AI小项目4-用Pytorch从头实现Transformer(详细注解)
人工智能·pytorch·深度学习·机器学习·语言模型·transformer·注意力机制
AI知识分享官3 小时前
智能绘画Midjourney AIGC在设计领域中的应用
人工智能·深度学习·语言模型·chatgpt·aigc·midjourney·llama
算法萌新——13 小时前
洛谷P2240——贪心算法
算法·贪心算法