## 3 The ASLM Architecture
### Main Idea  
Consider the following example of a user shopping scenario: On May 15 th, [PERSON] purchased a printer and a smartphone. On July 10 th, when the ink cartridge ran out, he wanted another to replace it. At that point in time, he would have been happy to see an ad for any ink cartridge and would have bought another brand if the system had recommended it. Also, since [PERSON] was in the purchasing process, he might also have been attracted to a cross-well recommendation of a phone-protector case. However, he would have been much less interested, in July, about recommendations for another brand-new printer or smartphone.  
In the ASLM model, there are two layers: the Long-term Preference Layer and the Attention-based Short-term Intent Layer. Our model is illustrated in Figure 2, where two mutually exclusive methods are shown in one figure to conserve space: (a) ASLM-AP, and (b) ASLM-LHS. In other words, only one method is used separately at a time, and has no connection between each other. The two ASLM models only differ by how they feed information to the Attention-based Short-term Intent Layer, either using average pooling (ASLM-AP) or the last hidden state (ASLM-LHS). Based on the experiment results discussed in Section 5, researchers can feel free to use either of these two models since their performances are at the same level.  
Figure 2: ASLM architecture. Two mutually exclusive methods are shown: (**a**) ASLM-AP, and (**b**) ASLM-LHS. Only one method is used at a time.  
The task of the Long-term Preference Layer is to supply knowledge of the user's long-term preference to the Attention-based Short-term Intent Layer before the short-term intent layer investigates the current session at the beginning. The task of the Attention-based Short-term Intent Layer is to produce recommendations by taking the user's long-term preference into consideration when the short-term layer is processing the sequence of items in the current session to extract his short-term intent.  
We discuss the work flow of these two layers in detail in Section 3.3. Particularly, the Attention-based Short-term Intent Layer's procedure of capturing the characteristics of each step in the user behavior is thoroughly discussed at the part of decoder in Section 3.3.2. Our model is proposed according to the following characteristics of user preference. (1) User preference changes at different time steps. (2) Within one time step, the user may have another intent on a different category of items, which has a different impact on the future interaction of items. (3) Since there are different preferences across users, the importance of the same item may differ, which results in different influences on the prediction of the next item for different individuals. The main idea of our approach is to:  
1. use the GRU (Gated Recurrent Unit) [13] in the Long-term Preference Layer to process a user's recent sessions, i.e., a user's long-term preference, which is similar to the Inter-session RNN in [7].
2. enhance the recommendations by employing an augmented attention-based encoder-decoder in a structured framework named Attention-based Short-term Intent Layer. We use the encoder to process the events within a session, i.e., a user's short-term intent, and make the decoder receive the user's long-term preference representation \(P_{L}^{u}\) from the user's history session representations as its initial hidden state. As a result, the model enables the Attention-based Short-term Intent Layer to combine both the user's long-term preference and short-term intent in the attention process. Eventually, for ASLM-LHS, the decoder stores its output state in session representations for the Long-term Preference Layer to update the states for future recommendation. For ASLM-AP, we put the average of current session's embedded vector representations of the items into session representations.