## 3 Materials and Methods
[25; 26; 27], for large data sets, when data arrives at a certain scale will not continue to increase data has obvious improvement in accuracy, thus effectively compress the size of the input data reasonably is one of the ways to reduce the complexity of data; Embedding layer, on the other hand, the processing of greatly increased the running time, this is the major source of time complexity. Slow convergence speed and Embedding layer is the main reason of the parameters of the huge number and input vector is too sparse, this is mainly due to the category of the input feature vectors too much alone after hot coding vector dimensions is too high. Therefore, the processing of Embedding layer can be realized by reducing the vector dimension. However, this method will lose accuracy to some extent, because it will destroy the original data in exchange for a shorter time. Starting from the two aspects mentioned above, we can acquire two processing formulas for gate structure, respectively:  
a. Input data processing  
Assuming that \(s\) for the input data size, \(g_{1}\) for gate structure parameters, its value between 0 and 1, we can acquire the new data size \(s_{new}\) as follows:  
\[s_{new}=\lfloor s\cdot g_{1}\rfloor \tag{9}\]  
Using Equation (9), the input data can be compressed to a customized degree, and the parameter G is the hyperparameter. b. Embedding layer processing  
Assuming that the number of feature dimension of the input vector is n and \(g_{2}\) is a gate structure parameter whose value is between 0 and 1, it has the same meaning as \(g_{1}\) above, so subscripts 1 and 2 are used to distinguish the two variables. The dimension dim of Embedding can be obtained as follows:  
\[dim=\lfloor n\cdot g_{2}\rfloor \tag{10}\]  
Equation (10) can be used to reduce the vector dimension of Embedding layer, and parameter G is a hyperparameter. In general, because of the large adjustable range of parameter G, it is often not necessary to use the above two methods at the same time in practical applications, so a parameter \(\lambda\) is introduced to combine the two formulas:  
\[\lambda s_{new}+(1-\lambda)dim=\lambda\lfloor s\cdot g_{1}\rfloor+(1-\lambda) \lfloor n\cdot g_{2}\rfloor \tag{11}\]  
Figure 1: Main structure of GAFM. Among them, \(\lambda\) takes 1 to realize compressed data, \(\lambda\) takes 0 to realize compressed Embedding. (2) drop  
Drop structure is another structure we proposed to speed up the model. Its starting point is to reduce the complexity of the model, that is, to change the complexity of the model from the perspective of network structure. Specifically, we apply the pruning idea of the neural network to the drop structure. Given a parameter d with a value between 0 and 1, the neural network only keeps the neurons before d and drops the parts after (1-d). It should be noted that the drop structure is not the same as dropout. Dropout only inactivates random neurons and does not change the network structure of the neural network, so it can only prevent overfitting and even prolong the running time. The idea of pruning is to directly cut some neurons to simplify the network structure. The essential difference between Dropout and Drop can be clearly seen in Figure 2. From an implementation perspective, there are two Drop structures in the GAFM model, one after the two fully connected layers, to solve the balance problem when entering large data, assuming that the matrix of fully connected neurons is concat_embeds, the number of neurons input is n, and the value of parameter D is between 0 and 1, then:  
\[\textit{concat\_embeds}_{new}=\textit{concat\_embeds}[:\textit{n\cdot d}] \tag{12}\]  
(3) attention  
The attentional mechanism is a technology that has recently become popular in recommendation systems, and it comes from the most natural human habit of selective attention. The most typical example is when a user is browsing a web page, they will selectively pay attention to certain areas of the page and ignore other areas.