Interpretable Deep Learning Model for Online Multi-touch Attribution
Dongdong Yang Kevin Dyer Senzhang Wang
cs.IR cs.AI cs.LG


Action Localization through Continual Predictive Learning
    Sathyanarayanan N. Aakur^1 Sudeep Sarkar^2
    December 30, 2023
=========================================================




  In online advertising, users may be exposed to a range of different advertising campaigns, such as natural search or referral or organic search, before leading to a final transaction. Estimating the contribution of advertising campaigns on the user's journey is very meaningful and crucial. A marketer could observe each customer's interaction with different marketing channels and modify their investment strategies accordingly. Existing methods including both traditional last-clicking methods and recent data-driven approaches for the multi-touch attribution (MTA) problem lack enough interpretation on why the methods work. In this paper, we propose a novel model called DeepMTA, which combines deep learning model and additive feature explanation model for interpretable online multi-touch attribution. DeepMTA mainly contains two parts, the phased-LSTMs based conversion prediction model to catch different time intervals, and the additive feature attribution model combined with shaley values. Additive feature attribution is explanatory that contains a linear function of binary variables. As the first interpretable deep learning model for MTA, DeepMTA considers three important features in the customer journey: event sequence order, event frequency and time-decay effect of the event. Evaluation on a real dataset shows the proposed conversion prediction model achieves 91% accuracy. 




§ INTRODUCTION


In the digital world, ads reach everywhere and influence users across various channels such as paid search and social networks. Digital marketer observes each customer's interaction with different marketing channels. The advertisers could get users' feedback and modify their investment strategies accordingly. Attribution is critically important for online advertising so that the advertiser could know which channel attributes more. When advertisers know the contribution of their campaign touch points, they can make informed impression buying decisions based on the user’s final conversion. Aggregated attributions on advertising channels can provide useful guidance for advertisers to allocate budget on these advertising channels.




Given the multi-touch events across a customer journey, the multi-touch attribution (MTA) model aims at analyzing the channels' exposure effect inside the customer impression journey on their purchase decision. Attribution model uses observations to estimate the exposure of marketing channels on conversion events. Capture exposure by modeling the impact of marketing channels on the likelihood of a conversion event. The exposure effects explored in <cit.>, <cit.> are captured by using the non-linear parametric models such as a logistic regression model. As shown in Figure <ref>, users could reach a range of campaigns from multiple channels in their journeys before transaction. Thus it is important for advertisers to attribute the right conversion credit to each journey touch. The goal of MTA is to understand the importance of these touches. The touch across the customer journey could be regarded as an instance of a channel.

Data-driven methods have been explored in recent years, and have attracted rising research attention, unlike the tradtion rule-based methods such as last-click, linear and time decay model. For example, the most popular last-click model assumes that a user’s conversion is only caused by the last ad he clicked or viewed before. It gives a 100% weight to the last clicking event and assigns all transaction value to it. To utilize the data for improving attribution models, Shao etc. <cit.> proposed a data-driven multi-touch attribution model to allocate the contribution credit to different ad campaigns. <cit.> proposed a hidden Markov model of an individual user's behavior based on conversion funnels to attribute conversion. <cit.> utilized cooperative game theory with shapley value to approximately derive the channels attribution. <cit.> assumed that hazard rate which is defined in the time decaying across customer journey can be used to measure channel importance. <cit.> is a new neural network to tackle the MTA problem. 
Deep learning models are also used to solve MTA problem in different ways recently <cit.>. <cit.> proposed dual-attention recurrent neural network to learn the attribution values through an attention mechanism directly from the conversion estimation objective. However, the major limitation of current deep learning models is that they cannot generate interpretable values. In order to meet the requirement of real applications, the MTA model should be both interpretable and catch enough information about the previous journal for further usage. 






In this paper, we propose a novel method called DeepMTA, which combines deep learning model with the additive features explanation model. The framework of our proposal is shown in Figure <ref>. The upper part is conversion prediction model which is implemented by phased-LSTMs. The bottom part is additive features explanation model with shaley values. The additive feature model is a linear function of a binary variable based on a power set, and then uses linear regression to calculate the importance of the features. The additional factor model is a simplified version of the Shapley value, which assigns a unique distribution of the total surplus generated by the coalition of all participants. The ultimate goal of these participants is to make customers buy goods. It is generally assumed that all players are independent. Additionally, DeepMTA considers three important features of customer journey: event sequence order, event frequency, time-decay effect. The code of this work is publicly available [<https://github.com/donzzzzy/interpretable-deep-model-mta>].

The proposed model, DeepMTA, is the first deep learning framework to generate interpretation directly. The model we design is shown in the left part of Figure <ref>. The novel method uses the deep learning model and additive feature explanation model to generate the channel's importance with interpretation. We try to combine both deep learning and explanation model together to generate interpretable values for MTA. Our proposal mainly contains two stages. One is conversion prediction model using phased-LSTMs. Phased-LSTM is the new LSTM units that are able to catch different time intervals. The other part is to use additive features attribution models <cit.> combined with shaley values. Additive features attribution is an explanatory model that contains a linear function of binary variables. We combined it with shapley values in order to figure out the touch attribution. This paper will open the gate of tackling MTA problem in two stages. 



The major contributions of this work are summarized as follows:


    
  * We develop a novel interpretable deep learning model, DeepMTA, for online multi-touch attribution. To our knowledge, DeeMTA is the first model that combines deep learning and cooperative game theory.
    
  * We fully consider three important features in the customer journey: event Sequence order, event frequency and time-decay effect, while previous works only consider parts of the features.
    
  * We evaluate the conversion prediction model on a large real dataset with 91% accuracy, and could calculate specific channels importance for each customer journey instead of whole weight for each channel.


The remainder of the paper is organized as follows. We first review related works in MTA, deep learning and model interpretation in Section 2. Then we present an overview of the model architecture and discuss the details of the model in Section 3 followed by the implementation details in Section 4. The experiments are conducted in Section 5. Finally, we conclude this work and discuss future work in Section 6. 














§ RELATED WORK


In online advertising, conversion attribution is usually calculated by rule-based methods. Recently, many research works for MTA have been proposed for modeling attribution of sequential touch points on various channels. <cit.> proposed the first data-driven multi-touch attribution model based on a bagged Logistic regression model to estimate conversion rates based on ads viewed by users. The priority is to consider many customer journey features including channel frequency, channel sequence, channel attenuation effects and transition prediction. <cit.> considered the importance of time-weighted effects in the customer journey and designed a model for the problem of time decay. Based on extant marketing decision model acceptance literature, <cit.> put forward how to evaluate the model via channel credit allocation, accurate prediction of conversion events, stable and reproducible results, structure transparency and intuitive understanding, adaptability, and algorithm efficiency. <cit.> proposed budget allocations for online campaigns by determining advertiser effectiveness and defining appropriate compensation methods.



Deep learning models have been widely applied in many areas such as NLP <cit.>, data mining <cit.> and computer vision <cit.>. All of the sequence deep learning models help to serialize customer streaming journey data. Compared with vanilla LSTMs, Phased-LSTM considers different time intervals and adds one more time gate in vanilla LSTM units. Thus it achieves faster convergence than vanilla LSTMs on tasks that need to learn long sequences. Furthermore, interpretation on deep neural networks is also developing fast, such as LIME <cit.> and SHAP <cit.>. They are easy to understand and could be applied to the features used by the model. The input variables of interpretable model may need to be different from the features. The LIME <cit.> method explains the predictions of each model based on a model approximation around a given prediction locally. The SHAP <cit.> method combines LIME and Shapely Values together to build a unified approach for model predictions. 




§ FRAMEWORK


In order to build an interpretable multi-touch attribution model in marketing, we use the linear regression as a bridge between deep learning black box and human understanding. Linear regression has been used in various scenarios for its easy understanding. The base of additive features explanation model is actually linear regression. 

The proposed DeepMTA contains two stages as shown in Figure <ref>. The first stage is the deep learning model which aims to capture the information of the customer journey. The second stage is an additive features explanation model which is for interpreting the first stage part. It calculates the weight of each click touch based on shapley value <cit.> and linear regression. For more details, in the left part of Figure <ref>, deep learning model is built up with a kind of LSTM cells. In order to handle the clicking events with different timestamps, we use phased LSTMs <cit.> instead of regular LSTMs. 

After we train the deep learning model, the difficulty is to find the importance of sequence events of inputs. We need to know the importance of a clicking event and how much it contributes to the final prediction. It is to calculate the importance of the events instead of features inside the event. Briefly speaking, we build a powerset for additive feature attribution method, and then calculate the importance of the clicking events by using a linear regression. 



 §.§ Deep Learning Model


Given a customer journey, predicting the prediction possibility of conversion. Since the customer journey is built up with a sequence of clicking events, we intuitively model the scenarios by using RNN to consider channel frequency - the number of repetitive occurrences, channel sequence - order of occurrence and channel decay effect - channel exposure influence into conversion. To learn the customer journey information, we regard this problem as the prediction problem for conversion.



For feature embedding part of deep model, the features include channel id, campaign id and timestamp interval. The considered attributes should have relationship to click event itself. When interpreting the customer journey, some click event will be removed away from the journey for measuring the effect of it. Imaging that a removed event is critical, it means the prediction accuracy will drop rapidly. Otherwise the prediction will not be affected much. Therefore, if we set the features that are not related to the event itself, the final effect will also contain the effect of those unrelated features on the prediction.



The deep model considers the sequence of events across the customer journey as the input. One channel, eg. paid search, could occur many times and the same channel could be followed by the same channel. <cit.> aggregate many same channels into one for their customer journey when they build the Markov graph based on their assumptions. To consider the time decaying effect and not to aggregate the same channels, we use phased-lstm cells <cit.>, instead of vanilla LSTM, to learn the sequence of the customer journey. To catch the different time intervals, we use phased LSTMs with a additional time gate, compared with vanilla LSTMs. Time decaying problem means most recent events should have more impacts on the final result. <cit.> used the corresponding hazard rate to reflect the influence of an ad exposure for the time decaying problem. But we want RNN cells itself could handle time decaying issue. Then the model is evaluated by conversion prediction. 


    i_t    = σ_i(x_tW_xi + h_t-1W_hi + w_ci⊙ c_t-1 + b_i ) 
     
      f_t    = σ_f(x_tW_xf + h_t-1W_hf + w_cf⊙ c_t-1 + b_f ) 
    c_t   = f_t ⊙ c_t-1 + i_t ⊙σ_c(x_tW_xc + h_t-1W_hc + b_c ) 
    
      c_t    = k_t ⊙c_t + (1-k_t) * c_t-1
    
      o_t    = σ_o(x_tW_xo + h_t-1W_ho + w_co⊙ c_t-1 + b_f ) 
    h_t   = o_t ⊙σ_h(c_t) 
    
      h_t    = k_t ⊙h_t + (1-k_t) * h_t-1




The Phased LSTM cell extends the LSTM cell by adding a new time gate. The calculation is shown in Equation <ref> - <ref>. Three parameters control the opening and closing of the door. The cell state c_t and h_t are triggered only when the gate is open. τ controls the period of the oscillation. r_on controls the ratio of the duration of the open phase. s controls the phase shift of the oscillation to each LSTM cell. The gates use σ_i, σ_f, σ_o and σ_c, σ_h. The cell state c_t itself is updated by the previous cell state. The previous cell state is controlled by f_t. Input state ⊙ is from the element-wise product of i_t. All parameters can be learned during the training process.




The gate k_t has three phases as shown in Equation <ref> - <ref>, where τ is the period, s is the phase shift, and r_on is the ratio of the open period to the total period τ. In the first two stages, the gate openness increases from 0 to 1, and then decreases from 1 to 0. In the third phase, the gate is closed and the previous battery state is maintained. Leaks with a rate are active during the closing phase and propagate important gradient information even when the gate is closed. During the opening phase of the time gate, the linear slope of k_t allows the error gradient to be transmitted efficiently.


    ϕ_t = (t-s) mod τ/τ


k_t=
  2ϕ_t/r_on,    ϕ_t < 1/2r_on

  2-2ϕ_t/r_on,    1/2r_on < ϕ_t < r_on 

  αϕ_t,    otherwise
   








The objective function of our model uses softmax and cross-entropy function as shown in Equation <ref>, where M is the number of clicking events in a customer journey, y_i' is the ground-truth label, and y_i is the predicted label value after softmax function. For each event across the customer journey, the output will be 0 or 1. 0 means non-conversion and 1 means conversion. After the model converges, we freeze the model for the usage in the interpretation part.


    H_y'(y) = - ∑_i^M (y_i'log(y_i) + (1-y_i')log(1-y_i))





 §.§ Interpretation


To understand interpretation model part, we need to distinguish interpretable data representations from event characteristics. Interpretable model requires the use of human-understandable representations, regardless of the actual functions used by the model. Taking the classification problem as an example, the possible interpretable data representation is a binary vector. Even though the classifier may use more complex different features inside the event, the binary vector indicates the presence or absence of the event. We denote x ∈R^d as the original variable which needs to be explained, and x' ∈{0, 1} to be a binary variable for the interpretation.

In this part, the goal is to calculate the importance of different events across the customer journey with interpretation. After we train the conversion prediction model as shown in the left part of Figure <ref>, we use additive features explanation model to get the importance of events as shown in the right of the Figure <ref>. Three previous methods use classic equations from shapley value to compute explanations of model predictions: shapley regression values <cit.>, shapley sampling values <cit.> and quantitative input influence <cit.>. In our method, we use the shapley regression value for shorter customer journeys and the shaley sampled value for longer journeys. Shapley value method is a general credit distribution method in cooperative game theory. It is based on assessing the marginal contribution of each player in the game. Points are assigned to each individual player. The rough value is the expected value of the marginal contribution over all possible permutations of the player.


    ϕ_i = ∑_S ⊆ F ∖{i}|S|!(|F| - |S| - 1)!/|F|! [f_S ∪{i}(x_S ∪{i}) - f_S(x_S)]


Shapley regression values, in Equation <ref>, represent multicollinearity, the characteristic importance of linear models. This method requires retrain the model on all feature subsets S ⊆ F, where F is the set of all features. It assigns an weight to each feature. The weight of feature represents the impact on model predictions. To compute this effect, a model f_S ∪{i} is trained with that feature presentation, and another model f_S is trained with the feature withheld. Then, predictions from the two models are compared on the current input f_S ∪{i} (x_S ∪{i}) - f_S(x_S), where x_S represents the values of the input features in the set S. Because the effect of retaining features depends on other features in the model, previous differences are calculated for all possible subsets S ⊆ F ∖{i}. The Shapley value is then calculated and used as a feature attribution. They are a weighted average of all possible differences. For Shapley regression values, h_x will map 1 or 0 to the original input space, where 1 means the input is included in the model and 0 means the exclusion from the model. If we let ϕ_0 =f_ϕ(ϕ), the Shapley regression values match the additive feature attribution method, as Equation <ref> shows. In <ref>, z'∈{0, 1}^M, M denotes the number of clicking events in a customer journey, and ϕ_i ∈R, R denotes real number set. 


    g(z') = ϕ_0 + ∑_i=1^M ϕ_i z_i'


The additive feature attribution method has an explanatory model, which is a linear function of binary variables. An weight ϕ_i is for each feature, and the effects of all feature attributions are added to get the output of the original model.

  
    Y_acc = ∑_i^M (I(y_i', y_i) ⊙ mask^T)


The interpretation part of the model contains the following three steps. First, get the powerset of input and generate the mask matrix X_mask. The size of the mask matrix is [2^n, n], where n is the number of events in a customer engagement journey. This part is to mask the events across the customer journey to evaluate their effects. If the event is masked, the corresponding position in the mask matrix is set to 0; otherwise, the corresponding position is set to 1. The input of the conversion prediction model is X=[x_1, x_2, x_3, ..., x_n], where x_n is 1 or 0, denoting a customer journey containing a sequence of clicking events. Second, generate the new input using the mask matrix from the first step, put it into the conversion prediction model generated to get the prediction Pred. Then by comparing it to the ground truth label Label, we could know the effect of missing events. Finally, obtain the accuracy Y_acc for a specific input. In details, one row of the mask matrix X_mask is mask = [1, 1, 1, ..., 1, 0]^T, where the size of the mask is [1, n]. In this case, only the final event is masked and set to empty. Then the real input is X_real= X ⊙ mask. After putting it as an input of conversion model, Pred is obtained, where the size of Pred is [n, 1]. When we do a comparison between Pred and Label, the last digit of output is ignored since the last event of input is ignored. In this way, we could get Y_acc. The calculation equation is given in Equation <ref>, where I is an indicator function, y_i' is the ground-truth label and y_i is the predicted label value after softmax function. Finally, Use linear regression to calculate the weight. XW = Y_acc. Y_acc is the prediction accuracy and X is the mask matrix. For simplicity, we assume that every clicking event across the customer journey is independent to each other.




  
  * 
  * 
  * 





§ IMPLEMENTATION DETAILS




 §.§ Sampling

Sampling is to generated data and randomly select a fixed number of samples. The Shapley sample values <cit.> aims to explain any model by (1) applying the sample approximation to the equation <ref>, and (2) approximating the estimates from the model by removal effect of a variable. This eliminates the need to retrain the model and allows calculation of differences less than 2^|F|.



 §.§ Model training 

To avoid model over-fitting, we apply dropout and layer normalization. Dropout <cit.> is the random removal of units or their connections from the neural network during training. This prevents too much mutual adaptation between the units. The layer normalization method is to calculate the normalized statistics at each time step. The inputs in the recurrent layer are calculated from the current input x_t and previous vector of hidden states h_t-1 which are calculated as α_t = W_hh h_t-1 + W_xh x_t. 

Layer-normalized recursive layer re-centers and re-scales its activation in Equation <ref>, where u_t = 1/H∑_i=1^H a_t^i, σ_t = √(1/H∑_i=1^H (a_t^i-μ_t)^2)


    h_t = f[g/σ_t⊙ (α_t - μ_t) + b]





 §.§ Weight Clipping

The coefficent of linear regression might be negative, a filter is needed to ignore the negative weights before normalizing all weights. The sum of weights is equal to 1 through W_new = Norm(filter(W)), where W is the matrix we calculate for each customer journey, filter is a function to ignore negative values and Norm is a normalization function.




Paramters     Values 

Class Number     2 

Sequence Length     32 

Dropout     0.5 

Hidden Layer     2 

Hidden Cell Units     1024 

Batch Size     128 

Learning Rate     0.01 

Epoch Number     300 









§ EXPERIMENT

We conduct our experiments on a real large customer journey dataset. The evaluation metrics is the accuracy of conversion prediction in the ROC graph and comparing total GMV result for each channel with the last-clicking method. 





 §.§ Dataset





The data is collected on April 25th, 2018 from eBay dataware house. We trace back 10 days for each customer and record all events. Based on the transaction, a streaming customer journey is split into several customer journeys. The original dataset for each customer is a steaming of click events. Then based on conversion event, these events are split into separate journeys. In our experiments, the dataset only contains conversion journey without non-conversion in order to make the dataset representative. After analysis, the conversion events are less than 1%. 

In our experiments, 100k customer journeys are generated, 90% of which are used for training and validation and the remaining 10% are used for testing. For 90k training customer journeys, it contains 742,201 clicking events; for 10k testing customer journeys, it contains 81,530 clicking events. For each event, the attributes contains channel id (paid social, paid search, SEO, affiliates, etc.), user id, transaction timestamps, transaction type (mobile, desktop), click URL, publisher id, landing page URL, click event rank and transaction id. To build the customer journey, we group the events by user id and sort them by time. Finally based on the clicking event rankings, the clicking streaming is split into multiple journeys.




 §.§ Parameters Setting




Table <ref> shows the parameter settings. We set some parameters empirically, such as the batch size, dropout rate, the number of epochs. We set the learning rate as 10^-2, which is chosen from {10^-1, 10^-2, 10^-3, 10^-4, 10^-5}. We select 1024 LSTM units from the set {256, 512, 1024, 2048}. Training epoch is set to 300 for model converge. The class number is 2 since for each step of a sequence it only generates two states. The batch size is set to 128 which is selected from {32, 64, 128, 256, 512, 1024} so that the model does not converge too fast or too slow.





 §.§ Experiment Results and Analysis





In this part, we get an overview of DeepMTA performance. Following the previous work <cit.>, which proposed the data-driven method in MTA and 6 criteria evaluation methods in related work, we evaluate our method in two ways. The first is to get the ROC to evaluate the model conversion prediction performance, and the other one is to gather the Gross Merchandise Value (GMV) and then compare our results with the results of last clicking method. GMV is a value number used in online retailing and represents the total sales value of goods sold through a specific market within a period.





The ROC curve of our model is showed in Figure <ref>. One can see that the ROC of our model reaches AUC 91%, which is a rather good performance. Particularly, when the false position  reaches 0.65, the true positive is 1.00. It shows the tradeoff between sensitivity and specificity (any increase in sensitivity will be accompanied by a decrease in specificity). The closer the curve is to the left and upper boundaries of the ROC space, the more accurate the test. The closer the curve is to the 45-degree diagonal of the ROC space, the lower the accuracy of the test.

Second, following most previous works in MTA that compare their results with last-clicking method, we also compare our result with the last-clicking model since it is the most popular model in the industry. Many other models are not guaranteed to work very well and most of the model using deep learning directly is not interpretable. After we calculate the weight for each channel and manipulate on the raw weight followed by normalization, we are able to allocate the GMV of each customer journey to each channel.


The total average accumulative attribution for each channel are as followed: Display is 0.017, Paid Search is 0.205, Natural Search is 0.321, Affiliate is 0.143, Social Media is 0.018, Partner Integration is 0.071, Paid Social is 0.034 and Other are 0.014. Note that the sum of the weights of all channels is not equal to 1. After we calculate channel importance for each customer journey, if the weight of that channel in a customer journey is negative, we just set it 0.0 and then normalize all other positive values. We set these normalized values as the actual channel importance in that customer journey. Then we could get a total weight for a channel. We sum up all channels importance of all customer journey and average it based on the number of customer journeys that this channel occurs to get the average accumulative attribution. We set these normalized values to the channel and allocate the GMV to this channel finally. After normalizing all calculated weights, we then use them to allocate the GMV value. 




  
  Channel     Aggregate Weight 

  Display     0.017 

  Paid Search     0.205 

  Natural Search     0.321 

  Affiliate     0.143 

  Social Media     0.018 

  Partner Integration     0.071 

  Partner Integration - Organic     0.0 

  Paid Search - Brand     0.0 

  Unassigned     0.014 

  Exclusion     0.0 

  Paid Social     0.034 

  Others     0.0 

  
  
  









 §.§ Case Analysis


The first step contains data prepossessing and model training. Assuming the customer journey is A_1 → B_1 → A_2 → A_3 → B_2, where A_i is a list of paid search click events, B_i is a list of natural search click events. Based on the features of company id, channel id and time stamp, we embed A as x_A, B as x_B, where each x_i = [v_company_i, v_channel_i, t_i], v_company and v_channel is a one-hot embedding vector, t_i is the time period shifting from t_0. The label of this customer journey label is [0, 0, 0, 0, 1], where 0 means non-converted, 1 means converted. Then based on these three features of the samples and their labels, we train a conversion prediction model. 



The next step is to know how important of the input. Mask matrix is generated to feed masked input to the deepMTA for training. In this case of A_1 → B_1 → A_2 → A_3 → B_2, mask matrix powerset is built first. Then a sample for mask matrix is like maskMatrix_8 = [0, 0, 1, 1, 1]. The generated sample x_new will be x * maskMatrix_8^T. At the same time, the label label_new will be label * maskMatrix_8. Then we put x_new into conversion prediction model and get a predicted labels y_pred. After multiplied by maskMatrix_8, it is compared with y_new. After getting accuracy for this sample, linear regression could be used to calculate the importance of input clicking events. maskMatrix W = accMatrix, where W is the importance of clicking events. The final step is to normalize the weights. 












§ CONCLUSION

We built up a unified architecture of deep learning for multi-touch attribution with interpretation.  It is the first trial in this area. For the consideration of different time intervals, phased-LSTM is used so that the model could catch different time intervals information. After the model is trained well, which means DeepMTA achieves a high accuracy in ROC in conversion prediction, an additive explaination model is involved to generate the multi-touch attributions. These generated attributions for each channel could be well interpreted in a mathematical way, which makes it interpretable.




§ ACKNOWLEDGMENTS

Thanks.




named


