预算平滑论文阅读笔记(2)

在线广告预算平滑领域有两篇比较经典的论文,分别是2014年LinkedIn发表的《Budget Pacing for Targeted Online Advertisements at LinkedIn》和2015年Yahoo发表的《Smart Pacing for Effective Online Ad Campaign Optimization》。第一篇论文主要介绍了一种基于曝光曲线的预算平滑算法,第二篇论文在前者基础上,进一步优化算法以保障广告主效果。本文主要是对第二篇论文的阅读笔记。虽然目前预算平滑的具体算法大多采用控制领域的PID算法,但预算平滑的基本原理还是基于上述经典论文中设计的机制------通过反馈控制调节参竞率或出价,进而使得各时段的实际消耗逼近各时段的预期预算。

背景

《Smart Pacing for Effective Online Ad Campaign Optimization》这篇论文的应用场景是基于广告位拍卖的广告交易。在这个场景下,DSP作为广告主的代理,管理大量的广告,这些广告既包括品牌广告,也包括效果广告,品牌广告的目标是在一定的预算约束下,将广告投放至尽可能多的受众,而效果广告的目标是在一定的预算约束下,将广告投放至高点击、高转化的人群,达成效果目标,比如平均点击成本需小于某个上限。在满足上述目标的同时,DSP还需设计一定的预算平滑机制,比较平滑地消耗预算,使得广告主的广告能够在每天的各个时段都能投放出来,而不是在每天的开始阶段能投尽投,导致预算过早被消耗完,而无法投放到当天其他时段。

较理想的预算平滑机制如图1所示,一种是平均平滑(Even Pacing),即将预算平均分配到每天各个时段,另一种是基于流量的平滑(Traffic Based Pacing),即根据每天各时段的流量多少对预算进行分配,流量多的时段分配的预算多,还有一种图中未列出的是基于效果的平滑(Performance Based Pacing),即根据每天各时段的效果优劣对预算进行分配,效果好的时段分配的预算多。 论文指出其进行预算平滑的一个前提假设是流量远大于广告主的需求,即预算平滑不会出现因前期限制投放、后期流量不足导致预算剩余的情况。在这个前提假设下,预算平滑主要解决的问题将当天预算按一定机制分配到各个时间段,在每个时间段中,挑选流量进行投放,使得各个时段段的实际消耗逼近预期预算,并达成效果目标。

在广告投放流程中,DSP首先接收到流量侧的告请求,根据当前请求召回相关的广告,预估点击率,将广告及其出价返回给流量侧,而流量侧可能根据一定的拍卖机制决定该广告是否竞胜,广告竞胜的概率被称为竞胜率(Win Rate),若广告竞胜,其在流量侧被曝光、点击,并被计费,这些数据反馈至DSP后,DSP扣减预算,并统计相关效果指标。论文指出在上述流程中,有两种预算平滑方法,如图2所示:

  • Probabilistic throttling,通过设置参竞率(Pacing Rate)控制广告是否参竞,从而实现对流量的挑选,进而实现预算平滑;
  • Bid modification,通过调整出价控制广告是否竞胜,从而实现对流量的挑选,进而实现预算平滑。

论文指出Bid modification存在以下不足:

  • Probabilistic throttling直接控制参竞率,而Bid modification通过调整出价间接控制竞胜率,而RTB下的竞价环境是不断变化的,竞胜率并不只受广告本身的出价影响,还会受其他参竞者的出价影响,从而无法通过调整出价精准控制竞胜率、进而实现预算平滑;
  • 流量侧一般都会设置保留价,如果Bid modification调整出价后,导致出价低于保留价,则会导致竞价失败,进而导致预算平滑失败;
  • Bid modification将出价计算和预算平滑耦合在一起,无法分别单独进行优化。

因此论文采用Probabilistic throttling这一方法,设计了Smart Pacing算法用于不同类型广告的预算平滑。

问题建模

论文首先进行问题建模:令某个广告为 <math xmlns="http://www.w3.org/1998/Math/MathML"> A d Ad </math>Ad,广告的天级预算为 <math xmlns="http://www.w3.org/1998/Math/MathML"> B B </math>B,若广告存在效果目标(如平均点击成本不超过2元),则令效果目标为 <math xmlns="http://www.w3.org/1998/Math/MathML"> G G </math>G,将每天划分为 <math xmlns="http://www.w3.org/1998/Math/MathML"> K K </math>K个时间段,则广告每天各时段的消耗计划(Spending Plan)是由各时段预算组成的序列,令其为 <math xmlns="http://www.w3.org/1998/Math/MathML"> B = { B ( 1 ) , ... , B ( K ) } \mathbf{B}=\{B^{(1)},\dots,B^{(K)}\} </math>B={B(1),...,B(K)},并满足 <math xmlns="http://www.w3.org/1998/Math/MathML"> B ( t ) > 0 B^{(t)}>0 </math>B(t)>0, <math xmlns="http://www.w3.org/1998/Math/MathML"> ∑ t = 1 K B ( t ) = B \sum_{t=1}^K{B^{(t)}}=B </math>∑t=1KB(t)=B。

这里需要说明一下,若采用平均平滑,则 <math xmlns="http://www.w3.org/1998/Math/MathML"> B ( t ) = B K B^{(t)}=\frac{B}{K} </math>B(t)=KB,若采用基于流量的平滑,则需先预估流量,再根据预估的流量进行各时段预算分配。论文并未详细说明如何预估流量,后续笔者通过另一篇文章单独介绍流量预估相关的方法。

令 <math xmlns="http://www.w3.org/1998/Math/MathML"> R e q i Req_i </math>Reqi表示DSP在一天中接收到的第 <math xmlns="http://www.w3.org/1998/Math/MathML"> i i </math>i次请求,令 <math xmlns="http://www.w3.org/1998/Math/MathML"> r i r_i </math>ri表示当前广告对于 <math xmlns="http://www.w3.org/1998/Math/MathML"> R e q i Req_i </math>Reqi的参竞率(Pacing Rate), <math xmlns="http://www.w3.org/1998/Math/MathML"> s i s_i </math>si表示广告对于 <math xmlns="http://www.w3.org/1998/Math/MathML"> R e q i Req_i </math>Reqi是否参竞(1为参竞,0为不参竞), <math xmlns="http://www.w3.org/1998/Math/MathML"> w i w_i </math>wi表示广告在 <math xmlns="http://www.w3.org/1998/Math/MathML"> R e q i Req_i </math>Reqi中是否竞胜, <math xmlns="http://www.w3.org/1998/Math/MathML"> c i c_i </math>ci表示广告在 <math xmlns="http://www.w3.org/1998/Math/MathML"> R e q i Req_i </math>Reqi中竞胜后的消耗, <math xmlns="http://www.w3.org/1998/Math/MathML"> p i p_i </math>pi表示广告在 <math xmlns="http://www.w3.org/1998/Math/MathML"> R e q i Req_i </math>Reqi中的点击率, <math xmlns="http://www.w3.org/1998/Math/MathML"> p i = P r ( r e s p o n d ∣ R e q i , A d ) p_i=Pr(respond|Req_i,Ad) </math>pi=Pr(respond∣Reqi,Ad), <math xmlns="http://www.w3.org/1998/Math/MathML"> q i q_i </math>qi表示计划在 <math xmlns="http://www.w3.org/1998/Math/MathML"> R e q i Req_i </math>Reqi中是否被点击。

令 <math xmlns="http://www.w3.org/1998/Math/MathML"> C = ∑ i s i × w i × c i C=\sum_i{s_i\times w_i\times c_i} </math>C=∑isi×wi×ci,表示广告在一天中的总消耗,即该广告所有参竞且竞胜的请求的消耗和。

令 <math xmlns="http://www.w3.org/1998/Math/MathML"> P = C / ∑ i s i × w i × q i P=C/\sum_i{s_i\times w_i\times q_i} </math>P=C/∑isi×wi×qi,表示广告在一天中的效果指标,分子是一天中的总消耗,分母是一天中的总点击, <math xmlns="http://www.w3.org/1998/Math/MathML"> P P </math>P即每次点击的平均成本;

广告每天各时段的实际消耗(Spending Pattern)是由各时段消耗组成的序列,令其为 <math xmlns="http://www.w3.org/1998/Math/MathML"> C = ( C ( 1 ) , ... , C ( K ) ) \mathbf{C}=(C^{(1)},\dots,C^{(K)}) </math>C=(C(1),...,C(K)),并满足 <math xmlns="http://www.w3.org/1998/Math/MathML"> C ( t ) ≥ 0 C^{(t)}\ge0 </math>C(t)≥0, <math xmlns="http://www.w3.org/1998/Math/MathML"> ∑ t = 1 K C ( t ) = C \sum_{t=1}^K{C^{(t)}}=C </math>∑t=1KC(t)=C。

预算平滑的目标是使得每个时段的消耗 <math xmlns="http://www.w3.org/1998/Math/MathML"> C ( t ) C^{(t)} </math>C(t)与预算 <math xmlns="http://www.w3.org/1998/Math/MathML"> B ( t ) B^{(t)} </math>B(t)尽量接近,即最小化以下损失项:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> Ω ( C , B ) = 1 K ∑ t = 1 K ( C ( t ) − B ( t ) ) 2 (1) \Omega(\mathbf{C},\mathbf{B})=\sqrt{\frac{1}{K}\sum_{t=1}^K{(C^{(t)}-B^{(t)})^2}} \tag{1} </math>Ω(C,B)=K1t=1∑K(C(t)−B(t))2 (1)

对于没有效果目标的广告进行预算平滑,其优化问题可表示为:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> min ⁡ r i P s . t . C = B , Ω ( C , B ) ≤ ϵ (2) \begin{aligned} \min_{r_i} \space&\space P\\ s.t. \space&\space C=B,\Omega(\mathbf{C},\mathbf{B})\le\epsilon \end{aligned} \tag{2} </math>rimin s.t. P C=B,Ω(C,B)≤ϵ(2)

即在满足以下两个约束的前提下------天级消耗等于天级预算、各时段消耗和各时段预算的差值在一定偏差内,尽可能最小化每次点击的平均成本。

对于有效果目标的广告进行预算平滑,其优化问题可表示为:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> min ⁡ r i Ω ( C , B ) s . t . P ≤ G , B − C ≤ ϵ (3) \begin{aligned} \min_{r_i} \space&\space \Omega(\mathbf{C},\mathbf{B})\\ s.t. \space&\space P\le G,B-C\le\epsilon \end{aligned} \tag{3} </math>rimin s.t. Ω(C,B) P≤G,B−C≤ϵ(3)

即在满足以下两个约束的前提下------平均点击成本小于目标成本、天级预算未消耗的部分在一定偏差内,尽可能最小化各时段消耗和各时段预算的差值。

针对上述两种优化问题,论文分析了不同类型的广告如何求解:

  • 以CPM方式计费的广告,在广告的每次展现上计费,且价格固定。对于CPM方式计费的品牌广告,其优化问题由公式2表示,只要预算全部消耗完,且各时段消耗和各时段预算对齐,那么更高点击率的优质流量应该有更高的参竞率,这样效果就会得到优化,对于CPM方式计费的效果广告,其优化问题由公式3表示,也是更高点击率的优质流量应该有更高的参竞率,这样才能达成效果目标 <math xmlns="http://www.w3.org/1998/Math/MathML"> P ≤ G P\le G </math>P≤G;
  • 以CPC或CPA方式计费的广告,在广告的每次点击或转化上计费,因为有效果目标,所以更高点击率的优质流量也应该有更高的参竞率;
  • 以动态CPM方式计费的广告,在广告的每次展现上计费,但价格不固定,因为一般也有效果目标,所以更高点击率的优质流量也应该有更高的参竞率。

基于上述观察和分析,论文提出了基于反馈控制的算法------Smart Pacing:

第一步,对点击率进行预估,区分高质和低质流量;

第二步,对流量根据质量(点击率)进行分组,同组内的流量共用一个参竞率(pacing rate),降低问题求解复杂度;

第三步,基于反馈控制,动态对每组的参竞率进行调整,使得每个时间段的消耗和预算接近、实现预算平滑的同时,保证更高点击率的优质流量也应该有更高的参竞率,从而达成更好的效果目标。

点击率预估

点击率 <math xmlns="http://www.w3.org/1998/Math/MathML"> p i p_i </math>pi的预估,这里不详细展开介绍。

预算控制

分层表示

对于每个广告,论文将流量侧的请求根据该广告的点击率分成若干个组,每个组有该广告在当前组请求下的平均点击率、优先级、参竞率(Pacing Rate)、最近一个时间段内的消耗等信息。点击率越高的组,优先级越高,参竞率也越高。对于每个广告,DSP接收到广告请求后,定位该广告、该请求所属的分组,根据该分组的参竞率作为概率,判断该广告是否对该请求竞价。

在线调整参竞率

令每个广告的请求分组数为 <math xmlns="http://www.w3.org/1998/Math/MathML"> L L </math>L,各分组的预估点击率集合为 <math xmlns="http://www.w3.org/1998/Math/MathML"> p = ( p 1 , ... , p L ) \mathbf{p}=(p_1,\dots,p_L) </math>p=(p1,...,pL),各分组的eCPC集合为 <math xmlns="http://www.w3.org/1998/Math/MathML"> e = ( e 1 , ... , e L ) \mathbf{e}=(e_1,\dots,e_L) </math>e=(e1,...,eL),其中, <math xmlns="http://www.w3.org/1998/Math/MathML"> e i = C P M 1000 × p i e_i=\frac{CPM}{1000\times p_i} </math>ei=1000×piCPM。令第 <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 − 1 ) = ( r 1 ( t − 1 ) , ... , r L ( t − 1 ) ) \mathbf{r}^{(t-1)}=(r_1^{(t-1)},\dots,r_L^{(t-1)}) </math>r(t−1)=(r1(t−1),...,rL(t−1)),各分组的消耗集合 <math xmlns="http://www.w3.org/1998/Math/MathML"> c ( t − 1 ) = ( c 1 ( t − 1 ) , ... , c L ( t − 1 ) ) \mathbf{c}^{(t-1)}=(c_1^{(t-1)},\dots,c_L^{(t-1)}) </math>c(t−1)=(c1(t−1),...,cL(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 ) = ( r 1 ( t ) , ... , r L ( t ) ) \mathbf{r}^{(t)}=(r_1^{(t)},\dots,r_L^{(t)}) </math>r(t)=(r1(t),...,rL(t))。

论文区分无效果目标的广告投放、有效果目标的广告投放这两种情况,分别设计参竞率的调整算法。

无效果目标的广告投放

令经过前 <math xmlns="http://www.w3.org/1998/Math/MathML"> m m </math>m个时间段后,剩余的预算为 <math xmlns="http://www.w3.org/1998/Math/MathML"> B m B_m </math>Bm,需要推导当天剩余各个时段的预期消耗 <math xmlns="http://www.w3.org/1998/Math/MathML"> C ^ ( m + 1 ) ... C ^ ( K ) \hat{C}^{(m+1)}\dots \hat{C}^{(K)} </math>C^(m+1)...C^(K),满足以下公式:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> arg min ⁡ C ^ ( m + 1 ) , ... , C ^ ( K ) Ω s . t . ∑ t = m + 1 K C ^ ( t ) = B m (4) \begin{aligned} \argmin_{\hat{C}^{(m+1)},\dots,\hat{C}^{(K)}} \space&\space \Omega \\ s.t. \space&\space \sum_{t=m+1}^K{\hat{C}^{(t)}=B_m} \end{aligned} \tag{4} </math>C^(m+1),...,C^(K)argmin s.t. Ω t=m+1∑KC^(t)=Bm(4)

根据上式,论文直接给出当天第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t个时段的预期消耗,如下所示:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> C ^ ( t ) = B ( t ) + B m − ∑ t = m + 1 K B ( t ) K − m \hat{C}^{(t)}=B^{(t)}+\frac{B_m-\sum_{t=m+1}^K{B^{(t)}}}{K-m} </math>C^(t)=B(t)+K−mBm−∑t=m+1KB(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个时段的实际消耗和参竞率进行参竞率调整的算法如图3所示。 当前共有 <math xmlns="http://www.w3.org/1998/Math/MathML"> L L </math>L个流量分组,分组序号越大,分组优先级越高,流量质量越好,参竞率越大,令 <math xmlns="http://www.w3.org/1998/Math/MathML"> l ′ l' </math>l′为参竞率大于0的最小的分组序号,并令 <math xmlns="http://www.w3.org/1998/Math/MathML"> R = C ^ ( t ) − C ( t − 1 ) R=\hat{C}^{(t)}-C^{(t-1)} </math>R=C^(t)−C(t−1)。

若 <math xmlns="http://www.w3.org/1998/Math/MathML"> R R </math>R等于0,则不需要对参竞率进行调整。

若 <math xmlns="http://www.w3.org/1998/Math/MathML"> R R </math>R大于0,则说明广告投放需要加速,对各分组按序号从大到小进行遍历,直至第 <math xmlns="http://www.w3.org/1998/Math/MathML"> l ′ l' </math>l′组,调大每组的参竞率,序号越大的组,流量质量越好,参竞率上调的幅度越大。以第 <math xmlns="http://www.w3.org/1998/Math/MathML"> l l </math>l组为例,调大参竞率的公式如下所示:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> r l ( t ) = min ⁡ ( 1.0 , r l ( t − 1 ) × c l ( t − 1 ) + R c l ( t − 1 ) ) r_l^{(t)}=\min(1.0,r_l^{(t-1)}\times\frac{c_l^{(t-1)}+R}{c_l^{(t-1)}}) </math>rl(t)=min(1.0,rl(t−1)×cl(t−1)cl(t−1)+R)

上式即使用 <math xmlns="http://www.w3.org/1998/Math/MathML"> R c l ( t − 1 ) \frac{R}{c_l^{(t-1)}} </math>cl(t−1)R作为上调比例,对 <math xmlns="http://www.w3.org/1998/Math/MathML"> r l ( t − 1 ) r_l^{(t-1)} </math>rl(t−1)进行上调,得到 <math xmlns="http://www.w3.org/1998/Math/MathML"> r l ( t ) r_l^{(t)} </math>rl(t)。另外, <math xmlns="http://www.w3.org/1998/Math/MathML"> r l ( t ) r_l^{(t)} </math>rl(t)作为概率,上限不能大于1。

然后,调低 <math xmlns="http://www.w3.org/1998/Math/MathML"> R R </math>R值,如下:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> R = R − c l ( t − 1 ) × r l ( t ) − r l ( t − 1 ) r l ( t − 1 ) R=R-c_l^{(t-1)}\times\frac{r_l^{(t)}-r_l^{(t-1)}}{r_l^{(t-1)}} </math>R=R−cl(t−1)×rl(t−1)rl(t)−rl(t−1)

各分组从大到小, <math xmlns="http://www.w3.org/1998/Math/MathML"> R R </math>R值逐渐减小,也就是说参竞率上调的幅度逐渐减小。

以上循环直至第 <math xmlns="http://www.w3.org/1998/Math/MathML"> l ′ l' </math>l′组,若第 <math xmlns="http://www.w3.org/1998/Math/MathML"> l ′ l' </math>l′组不是第一组,且 <math xmlns="http://www.w3.org/1998/Math/MathML"> r l ′ ( t ) r_{l'}^{(t)} </math>rl′(t)大于Trial Rate(Trial Rate的值和作用在冷启动部分介绍),则让第 <math xmlns="http://www.w3.org/1998/Math/MathML"> ( l ′ − 1 ) (l'-1) </math>(l′−1)组的参竞率 <math xmlns="http://www.w3.org/1998/Math/MathML"> r l ′ − 1 ( t ) r_{l'-1}^{(t)} </math>rl′−1(t)为Trial Rate。为后续的加速投放积累数据。

若 <math xmlns="http://www.w3.org/1998/Math/MathML"> R R </math>R小于0,则说明广告投放需要减速,对各分组从第 <math xmlns="http://www.w3.org/1998/Math/MathML"> l ′ l' </math>l′组开始、按序号从小到大进行遍历,调小每组的参竞率,序号越大的组,流量质量越好,参竞率下调的幅度越小。以第 <math xmlns="http://www.w3.org/1998/Math/MathML"> l l </math>l组为例,调小参竞率的公式如下所示:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> r l ( t ) = max ⁡ ( 0.0 , r l ( t − 1 ) × c l ( t − 1 ) + R c l ( t − 1 ) ) r_l^{(t)}=\max(0.0,r_l^{(t-1)}\times\frac{c_l^{(t-1)}+R}{c_l^{(t-1)}}) </math>rl(t)=max(0.0,rl(t−1)×cl(t−1)cl(t−1)+R)

同样使用 <math xmlns="http://www.w3.org/1998/Math/MathML"> R c l ( t − 1 ) \frac{R}{c_l^{(t-1)}} </math>cl(t−1)R(其为负数)作为下调比例,对 <math xmlns="http://www.w3.org/1998/Math/MathML"> r l ( t − 1 ) r_l^{(t-1)} </math>rl(t−1)进行下调,得到 <math xmlns="http://www.w3.org/1998/Math/MathML"> r l ( t ) r_l^{(t)} </math>rl(t)。另外, <math xmlns="http://www.w3.org/1998/Math/MathML"> r l ( t ) r_l^{(t)} </math>rl(t)作为概率,下限不能小于0。

然后,调大 <math xmlns="http://www.w3.org/1998/Math/MathML"> R R </math>R值,如下:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> R = R − c l ( t − 1 ) × r l ( t ) − r l ( t − 1 ) r l ( t − 1 ) R=R-c_l^{(t-1)}\times\frac{r_l^{(t)}-r_l^{(t-1)}}{r_l^{(t-1)}} </math>R=R−cl(t−1)×rl(t−1)rl(t)−rl(t−1)

以上循环直至第 <math xmlns="http://www.w3.org/1998/Math/MathML"> L L </math>L组或 <math xmlns="http://www.w3.org/1998/Math/MathML"> R R </math>R大于0,对于最后更新的第 <math xmlns="http://www.w3.org/1998/Math/MathML"> l l </math>l组,若第 <math xmlns="http://www.w3.org/1998/Math/MathML"> l l </math>l组不是第一组,且 <math xmlns="http://www.w3.org/1998/Math/MathML"> r l ′ ( t ) r_{l'}^{(t)} </math>rl′(t)大于Trial Rate,则让其前一个组的参竞率 <math xmlns="http://www.w3.org/1998/Math/MathML"> r l − 1 ( t ) r_{l-1}^{(t)} </math>rl−1(t)为Trial Rate。

论文对广告投放加速情况和减速情况下的参竞率调整分别进行了示例说明。令 <math xmlns="http://www.w3.org/1998/Math/MathML"> C ( t − 1 ) = 2800 C^{(t-1)}=2800 </math>C(t−1)=2800, <math xmlns="http://www.w3.org/1998/Math/MathML"> L = 3 L=3 </math>L=3,各分组在第 <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"> c 1 ( t − 1 ) = 300 c_1^{(t-1)}=300 </math>c1(t−1)=300, <math xmlns="http://www.w3.org/1998/Math/MathML"> r 1 t − 1 = 0.001 r_1^{t-1}=0.001 </math>r1t−1=0.001;
  • <math xmlns="http://www.w3.org/1998/Math/MathML"> c 2 ( t − 1 ) = 1500 c_2^{(t-1)}=1500 </math>c2(t−1)=1500, <math xmlns="http://www.w3.org/1998/Math/MathML"> r 2 t − 1 = 0.5 r_2^{t-1}=0.5 </math>r2t−1=0.5;
  • <math xmlns="http://www.w3.org/1998/Math/MathML"> c 3 ( t − 1 ) = 1000 c_3^{(t-1)}=1000 </math>c3(t−1)=1000, <math xmlns="http://www.w3.org/1998/Math/MathML"> r 3 t − 1 = 1.0 r_3^{t-1}=1.0 </math>r3t−1=1.0。

广告投放加速情况下的参竞率调整示例如图4所示。令 <math xmlns="http://www.w3.org/1998/Math/MathML"> C ^ ( t ) = 5500 \hat{C}^{(t)}=5500 </math>C^(t)=5500,则 <math xmlns="http://www.w3.org/1998/Math/MathML"> R = 2700 R=2700 </math>R=2700,说明广告投放需要加速,根据上述算法,对各分组按序号从大到小进行遍历,直至到第 <math xmlns="http://www.w3.org/1998/Math/MathML"> l ′ l' </math>l′组。

对于第三组:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> r 3 ( t ) = min ⁡ ( 1.0 , r 3 ( t − 1 ) × c 3 ( t − 1 ) + R c 3 ( t − 1 ) ) = min ⁡ ( 1.0 , 1.0 × 1000 + 2700 1000 ) = 1.0 \begin{align} r_3^{(t)}&=\min(1.0,r_3^{(t-1)}\times\frac{c_3^{(t-1)}+R}{c_3^{(t-1)}}) \\ &=\min(1.0,1.0\times\frac{1000+2700}{1000}) \\ &=1.0 \end{align} </math>r3(t)=min(1.0,r3(t−1)×c3(t−1)c3(t−1)+R)=min(1.0,1.0×10001000+2700)=1.0
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> R = R − c 3 ( t − 1 ) × r 3 ( t ) − r 3 ( t − 1 ) r 3 ( t − 1 ) = 2700 − 1000 × 1.0 − 1.0 1.0 = 2700 \begin{align} R&=R-c_3^{(t-1)}\times\frac{r_3^{(t)}-r_3^{(t-1)}}{r_3^{(t-1)}} \\ &=2700-1000\times\frac{1.0-1.0}{1.0} \\ &=2700 \end{align} </math>R=R−c3(t−1)×r3(t−1)r3(t)−r3(t−1)=2700−1000×1.01.0−1.0=2700

对于第二组:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> r 2 ( t ) = min ⁡ ( 1.0 , r 2 ( t − 1 ) × c 2 ( t − 1 ) + R c 2 ( t − 1 ) ) = min ⁡ ( 1.0 , 0.5 × 1500 + 2700 1500 ) = 1.0 \begin{align} r_2^{(t)}&=\min(1.0,r_2^{(t-1)}\times\frac{c_2^{(t-1)}+R}{c_2^{(t-1)}}) \\ &=\min(1.0,0.5\times\frac{1500+2700}{1500}) \\ &=1.0 \end{align} </math>r2(t)=min(1.0,r2(t−1)×c2(t−1)c2(t−1)+R)=min(1.0,0.5×15001500+2700)=1.0
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> R = R − c 2 ( t − 1 ) × r 2 ( t ) − r 2 ( t − 1 ) r 2 ( t − 1 ) = 2700 − 1500 × 1.0 − 0.5 0.5 = 1200 \begin{align} R&=R-c_2^{(t-1)}\times\frac{r_2^{(t)}-r_2^{(t-1)}}{r_2^{(t-1)}} \\ &=2700-1500\times\frac{1.0-0.5}{0.5} \\ &=1200 \end{align} </math>R=R−c2(t−1)×r2(t−1)r2(t)−r2(t−1)=2700−1500×0.51.0−0.5=1200

对于第一组:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> r 1 ( t ) = min ⁡ ( 1.0 , r 1 ( t − 1 ) × c 1 ( t − 1 ) + R c 1 ( t − 1 ) ) = min ⁡ ( 1.0 , 0.001 × 300 + 1200 300 ) = 0.005 \begin{align} r_1^{(t)}&=\min(1.0,r_1^{(t-1)}\times\frac{c_1^{(t-1)}+R}{c_1^{(t-1)}}) \\ &=\min(1.0,0.001\times\frac{300+1200}{300}) \\ &=0.005 \end{align} </math>r1(t)=min(1.0,r1(t−1)×c1(t−1)c1(t−1)+R)=min(1.0,0.001×300300+1200)=0.005
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> R = R − c 1 ( t − 1 ) × r 1 ( t ) − r 1 ( t − 1 ) r 1 ( t − 1 ) = 2700 − 1500 × 1.0 − 0.5 0.5 = 1200 \begin{align} R&=R-c_1^{(t-1)}\times\frac{r_1^{(t)}-r_1^{(t-1)}}{r_1^{(t-1)}} \\ &=2700-1500\times\frac{1.0-0.5}{0.5} \\ &=1200 \end{align} </math>R=R−c1(t−1)×r1(t−1)r1(t)−r1(t−1)=2700−1500×0.51.0−0.5=1200

广告投放减速情况下的参竞率调整示例如图5所示。令 <math xmlns="http://www.w3.org/1998/Math/MathML"> C ^ ( t ) = 900 \hat{C}^{(t)}=900 </math>C^(t)=900,则 <math xmlns="http://www.w3.org/1998/Math/MathML"> R = − 1900 R=-1900 </math>R=−1900,说明广告投放需要减速,对各分组从第 <math xmlns="http://www.w3.org/1998/Math/MathML"> l ′ l' </math>l′组(即第一组)开始、按序号从小到大进行遍历,调小每组的参竞率。

图5 广告投放减速情况下的参竞率调整示例

对于第一组:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> r 1 ( t ) = max ⁡ ( 0.0 , r 1 ( t − 1 ) × c 1 ( t − 1 ) + R c 1 ( t − 1 ) ) = max ⁡ ( 0.0 , 0.001 × 300 − 1900 300 ) = 0.0 \begin{align} r_1^{(t)}&=\max(0.0,r_1^{(t-1)}\times\frac{c_1^{(t-1)}+R}{c_1^{(t-1)}}) \\ &=\max(0.0,0.001\times\frac{300-1900}{300}) \\ &=0.0 \end{align} </math>r1(t)=max(0.0,r1(t−1)×c1(t−1)c1(t−1)+R)=max(0.0,0.001×300300−1900)=0.0
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> R = R − c 3 ( t − 1 ) × r 3 ( t ) − r 3 ( t − 1 ) r 3 ( t − 1 ) = − 1900 − 300 × 0.0 − 0.001 0.001 = − 1600 \begin{align} R&=R-c_3^{(t-1)}\times\frac{r_3^{(t)}-r_3^{(t-1)}}{r_3^{(t-1)}} \\ &=-1900-300\times\frac{0.0-0.001}{0.001} \\ &=-1600 \end{align} </math>R=R−c3(t−1)×r3(t−1)r3(t)−r3(t−1)=−1900−300×0.0010.0−0.001=−1600

对于第二组:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> r 2 ( t ) = max ⁡ ( 0.0 , r 2 ( t − 1 ) × c 2 ( t − 1 ) + R c 2 ( t − 1 ) ) = max ⁡ ( 0.0 , 0.5 × 1500 − 1600 1500 ) = 0.0 \begin{align} r_2^{(t)}&=\max(0.0,r_2^{(t-1)}\times\frac{c_2^{(t-1)}+R}{c_2^{(t-1)}}) \\ &=\max(0.0,0.5\times\frac{1500-1600}{1500}) \\ &=0.0 \end{align} </math>r2(t)=max(0.0,r2(t−1)×c2(t−1)c2(t−1)+R)=max(0.0,0.5×15001500−1600)=0.0
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> R = R − c 2 ( t − 1 ) × r 2 ( t ) − r 2 ( t − 1 ) r 2 ( t − 1 ) = − 1600 − 1500 × 0.0 − 0.5 0.5 = − 100 \begin{align} R&=R-c_2^{(t-1)}\times\frac{r_2^{(t)}-r_2^{(t-1)}}{r_2^{(t-1)}} \\ &=-1600-1500\times\frac{0.0-0.5}{0.5} \\ &=-100 \end{align} </math>R=R−c2(t−1)×r2(t−1)r2(t)−r2(t−1)=−1600−1500×0.50.0−0.5=−100

对于第三组:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> r 3 ( t ) = max ⁡ ( 0.0 , r 3 ( t − 1 ) × c 3 ( t − 1 ) + R c 3 ( t − 1 ) ) = max ⁡ ( 0.0 , 1.0 × 1000 − 100 1000 ) = 0.9 \begin{align} r_3^{(t)}&=\max(0.0,r_3^{(t-1)}\times\frac{c_3^{(t-1)}+R}{c_3^{(t-1)}}) \\ &=\max(0.0,1.0\times\frac{1000-100}{1000}) \\ &=0.9 \end{align} </math>r3(t)=max(0.0,r3(t−1)×c3(t−1)c3(t−1)+R)=max(0.0,1.0×10001000−100)=0.9
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> R = R − c 3 ( t − 1 ) × r 3 ( t ) − r 3 ( t − 1 ) r 3 ( t − 1 ) = − 100 − 1000 × 0.9 − 1.0 1.0 = 0 \begin{align} R&=R-c_3^{(t-1)}\times\frac{r_3^{(t)}-r_3^{(t-1)}}{r_3^{(t-1)}} \\ &=-100-1000\times\frac{0.9-1.0}{1.0} \\ &=0 \end{align} </math>R=R−c3(t−1)×r3(t−1)r3(t)−r3(t−1)=−100−1000×1.00.9−1.0=0

循环结束后,对于循环的最后一组(即第三组),因为 <math xmlns="http://www.w3.org/1998/Math/MathML"> r 3 ( t ) = 0.9 r_3^{(t)}=0.9 </math>r3(t)=0.9,大于0,所以将其下一个组(即第二组)的 <math xmlns="http://www.w3.org/1998/Math/MathML"> r 2 ( t ) r_2^{(t)} </math>r2(t)置为Trial Rate,即0.001。

有效果目标的广告投放

有效果目标的广告投放的优化问题如公式3描述,需使平均点击成本小于目标成本。这里首先介绍以下公式,计算第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t个时段从分组 <math xmlns="http://www.w3.org/1998/Math/MathML"> i i </math>i开始各分组的总体预计平均点击成本:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> ExpPerf ( c ( t − 1 ) , r ( t − 1 ) , r ( t ) , e , i ) = ∑ j = i L c j ( t − 1 ) × r j ( t ) r j ( t − 1 ) ∑ j = i L c j ( t − 1 ) × r j ( t ) r j ( t − 1 ) × e j \text{ExpPerf}(\mathbf{c}^{(t-1)},\mathbf{r}^{(t-1)},\mathbf{r}^{(t)},\mathbf{e},i)=\frac{\sum_{j=i}^L{\frac{c_j^{(t-1)}\times r_j^{(t)}}{r_j^{(t-1)}}}}{\sum_{j=i}^L{\frac{c_j^{(t-1)}\times r_j^{(t)}}{r_j^{(t-1)}\times e_j}}} </math>ExpPerf(c(t−1),r(t−1),r(t),e,i)=∑j=iLrj(t−1)×ejcj(t−1)×rj(t)∑j=iLrj(t−1)cj(t−1)×rj(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"> i i </math>i个分组开始各流量分组的消耗,根据其参竞率的变化幅度进行调整,作为第 <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 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 − 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"> t t </math>t个时段的预计平均点击成本。 有效果目标的广告投放的参竞率调整算法如图6所示。首先基于上一节无效果目标的广告投放的参竞率调整算法,计算第 <math xmlns="http://www.w3.org/1998/Math/MathML"> t t </math>t个时段各分组参竞率 <math xmlns="http://www.w3.org/1998/Math/MathML"> r t \mathbf{r}^t </math>rt,然后计算总体预估平均点击成本 <math xmlns="http://www.w3.org/1998/Math/MathML"> ExpPerf ( c ( t − 1 ) , r ( t − 1 ) , r ( t ) , e , 1 ) \text{ExpPerf}(\mathbf{c}^{(t-1)},\mathbf{r}^{(t-1)},\mathbf{r}^{(t)},\mathbf{e},1) </math>ExpPerf(c(t−1),r(t−1),r(t),e,1)。若总体预估平均点击成本不大于目标成本,则直接采用已计算的参竞率 <math xmlns="http://www.w3.org/1998/Math/MathML"> r t \mathbf{r}^t </math>rt,若总体预估平均点击成本大于目标成本,则对各分组按序号从小到大进行遍历,对于第 <math xmlns="http://www.w3.org/1998/Math/MathML"> l l </math>l个分组,计算从第 <math xmlns="http://www.w3.org/1998/Math/MathML"> ( l + 1 ) (l+1) </math>(l+1)个分组开始的预估平均点击成本 <math xmlns="http://www.w3.org/1998/Math/MathML"> ExpPerf ( c ( t − 1 ) , r ( t − 1 ) , r ( t ) , e , l + 1 ) \text{ExpPerf}(\mathbf{c}^{(t-1)},\mathbf{r}^{(t-1)},\mathbf{r}^{(t)},\mathbf{e},l+1) </math>ExpPerf(c(t−1),r(t−1),r(t),e,l+1),若从第 <math xmlns="http://www.w3.org/1998/Math/MathML"> ( l + 1 ) (l+1) </math>(l+1)个分组开始的预估平均点击成本大于目标成本,则将第 <math xmlns="http://www.w3.org/1998/Math/MathML"> l l </math>l个分组的参竞率 <math xmlns="http://www.w3.org/1998/Math/MathML"> r l ( t ) r_l^{(t)} </math>rl(t)置为0,若从第 <math xmlns="http://www.w3.org/1998/Math/MathML"> ( l + 1 ) (l+1) </math>(l+1)个分组开始的预估平均点击成本不大于目标成本,则按以下公式调整 <math xmlns="http://www.w3.org/1998/Math/MathML"> r l ( t ) r_l^{(t)} </math>rl(t):
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> r l ( t ) = r l ( t − 1 ) × ∑ i = l + 1 , ... , L c i ( t − 1 ) × ( g o a l e i − 1 ) c l ( t − 1 ) × ( 1 − g o a l e l ) r_l^{(t)}=r_l^{(t-1)}\times\frac{\sum_{i=l+1,\dots,L}{c_i^{(t-1)}\times(\frac{goal}{e_i}-1)}}{c_l^{(t-1)}\times(1-\frac{goal}{e_l})} </math>rl(t)=rl(t−1)×cl(t−1)×(1−elgoal)∑i=l+1,...,Lci(t−1)×(eigoal−1)

并将相邻序号较小的分组的参竞率置为Trial Rate,然后跳出循环,不再调整序号更大的分组的参竞率。上述循环的思想是对各分组按序号从小到大,先将序号小、质量差的分组参竞率调整为0,从而能够降低总体平均点击成本。

冷启动

以上分别介绍了无效果目标和有效果目标的广告投放的参竞率调整算法。对于算法的冷启动,论文指出,在启动阶段,设置一个全局参竞率 <math xmlns="http://www.w3.org/1998/Math/MathML"> r G r_G </math>rG,相应的流量分组数 <math xmlns="http://www.w3.org/1998/Math/MathML"> L = ⌈ 1 r G ⌉ L=⌈\frac{1}{r_G}⌉ </math>L=⌈rG1⌉,待启动阶段收集投放数据后,在下一个时段,将流量划分到不同的分组中,每个组有该广告的平均点击率、优先级、参竞率(Pacing Rate)、最近一个时段内的消耗,优先级最高的组参竞率为1,优先级最低的组参竞率为0。

参竞率调整的算法中提到,算法会将按序号从大到小最后一个参竞率大于0的分组的下一个分组 <math xmlns="http://www.w3.org/1998/Math/MathML"> l ′ l' </math>l′的参竞率设置为Trail Rate,使得该组能够收集到一定的投放数据,用于在下一个时间段中若广告投放需要加速、让更多组参竞时,可以有前一个时段的数据用于参竞率的计算。论文指出,Trail Rate的取值能让 <math xmlns="http://www.w3.org/1998/Math/MathML"> C ^ ( t ) \hat{C}^{(t)} </math>C^(t)有一定比例 <math xmlns="http://www.w3.org/1998/Math/MathML"> λ \lambda </math>λ( <math xmlns="http://www.w3.org/1998/Math/MathML"> λ \lambda </math>λ可取值1%)用于分组 <math xmlns="http://www.w3.org/1998/Math/MathML"> l ′ l' </math>l′的广告投放,具体计算公式如下:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> t r i a l r a t e = r l ′ ( ∗ ) × λ × C ^ ( t ) c l ′ ( ∗ ) trial\space rate=r_{l'}^{(*)}\times\frac{\lambda\times\hat{C}^{(t)}}{c_{l'}^{(*)}} </math>trial rate=rl′(∗)×cl′(∗)λ×C^(t)

其中, <math xmlns="http://www.w3.org/1998/Math/MathML"> c l ′ ( ∗ ) c_{l'}^{(*)} </math>cl′(∗)和 <math xmlns="http://www.w3.org/1998/Math/MathML"> r l ′ ( ∗ ) r_{l'}^{(*)} </math>rl′(∗)分别是分组 <math xmlns="http://www.w3.org/1998/Math/MathML"> l ′ l' </math>l′当天累计的消耗和参竞率。

实验评估

论文分别进行了在线AB实验和离线模拟实验,图7是在线AB实验结果,每个图表对应一个广告,每个广告分别使用Smart Pacing和基线算法进行预算平滑,使得预算被平均消耗的同时(图表中绿色和红色曲线分别表示Smart Pacing和基线算法的消耗曲线),Smart Pacing算法的平均点击成本明显下降(图表中粉色和蓝色曲线分别表示Smart pacing和基线算法的平均点击成本曲线)。

系统实现

图8是预算平滑系统实现。该系统实现需要解决的技术难点是实时、稳定地获取广告投放后的反馈数据,以进行消耗、点击成本等指标统计,从而进一步基于这些统计指标,实现基于反馈控制的预算平滑。该系统通过消息队列实现展现、点击日志的异步处理,将消息发送和消息接收解耦以实现高吞吐和低延时。控制模块接收展现、点击日志消息进行指标统计,将各广告各分组的统计指标保存至内存数据库,基于统计指标进行预算平滑,并通过同步的RPC调用确保将参竞率同步至竞价模块。

参考文献

相关推荐
马剑威(威哥爱编程)25 分钟前
除了递归算法,要如何优化实现文件搜索功能
java·开发语言·算法·递归算法·威哥爱编程·memoization
算法萌新——11 小时前
洛谷P2240——贪心算法
算法·贪心算法
湖北二师的咸鱼1 小时前
专题:二叉树递归遍历
算法·深度优先
重生之我要进大厂1 小时前
LeetCode 876
java·开发语言·数据结构·算法·leetcode
KBDYD10102 小时前
C语言--结构体变量和数组的定义、初始化、赋值
c语言·开发语言·数据结构·算法
Crossoads2 小时前
【数据结构】排序算法---桶排序
c语言·开发语言·数据结构·算法·排序算法
自身就是太阳2 小时前
2024蓝桥杯省B好题分析
算法·职场和发展·蓝桥杯
孙小二写代码3 小时前
[leetcode刷题]面试经典150题之1合并两个有序数组(简单)
算法·leetcode·面试
little redcap3 小时前
第十九次CCF计算机软件能力认证-1246(过64%的代码-个人题解)
算法
David猪大卫3 小时前
数据结构修炼——顺序表和链表的区别与联系
c语言·数据结构·学习·算法·leetcode·链表·蓝桥杯