Bias-aware video recommendation system history bias mitigation method
By generating diffused sample pairs and calculating the difference in activation values of biased neurons, and using a biased attention mask to suppress the output of biased neurons, the problem of historical bias in recommendation systems is solved, achieving low-complexity dynamic bias mitigation and improving the fairness and user experience of video recommendation systems.
Patent Information
- Application Number
- CN202211325574.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-27
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2042-10-27
AI Technical Summary
Existing recommendation systems suffer from high computational complexity and an inability to effectively remove historical biases when dealing with dynamic historical biases, especially in video recommendation systems, resulting in poor user experience and difficulty in achieving long-term fairness.
By generating diffused sample pairs, calculating the difference in activation values at each layer, identifying biased neurons, and using a biased attention mask to suppress the activation output of biased neurons, the biased attention is dynamically updated to alleviate historical bias.
It effectively reduces computational complexity, and dynamically updating biased attention can offset the influence of biased neurons, thereby improving the fairness and user experience of video recommendation systems.
Smart Images

Figure CN115661445B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of machine learning, and particularly relates to a video recommendation system history bias mitigation method based on bias attention. BACKGROUND
[0002] With the development of information globalization, the amount of information available on the network far exceeds the individual's information needs and processing capacity, which is called information overload. Recommendation systems, as an important tool to alleviate the challenge of information overload, are widely used in people's daily life (e.g., video recommendation, news recommendation, career recommendation, and medical recommendation, etc.). In the recommendation of video recommendation and news recommendation, the recommendation system pushes the video or news that the user likes according to the user's historical browsing records and personal information of the user, and the best item for one user may be different from that for another user, wherein the user's historical browsing records include the click rate, duration, comments, ratings, etc. of the browsed video, and the user's information includes gender, age, occupation, education, income, etc. Popular video websites such as Netflix, YouTube and bilibili recommend videos that different users like through recommendation systems, thereby obtaining a large number of users and traffic, and then monetizing these traffic to achieve profits. However, Beutel and Chen et al. showed that as a highly data-driven application, recommendation systems may have various biases, and a recommendation system with bias is not only unethical, but also harms the long-term interests of the recommendation system itself.
[0003] The bias in the recommendation system mainly comes from model bias and data bias. The historical bias of the recommendation system training accumulates, and the online recommendation system is updated irregularly. When the merchant collects a certain amount of new data, the old data is jointly trained to fine-tune the parameters of the model, causing model bias. In the process of collecting user data by the merchant, there may be some biased data. These data may not show bias in a single collection process. However, when these data are mixed with historical data, the mutual coupling between the data may cause new data bias, thereby causing the trained recommendation system to have biased behavior.
[0004] With the recommendation system affecting more and more people in life, its fairness is becoming more and more important. The previous recommendation system fairness methods are all for static or single recommendation fairness, and the protected items are fixed, without considering the dynamic characteristics: some attributes of the popularity of items may change over time and with the participation of users. For example, a once popular product may no longer be popular, etc., so a recommendation system that can guarantee long-term fairness is needed.
[0005] For bias mitigation of data, all data needs to be processed. However, as described above, merchants will continuously accumulate new user data and mix old data, and data bias may not be found in a single test. When new data is mixed with old data, the coupling between data forms new data bias. Therefore, after adding new data each time, mass user data needs to be debiased, and the time complexity increases with the continuous accumulation of user data. For bias mitigation of models, existing model bias mitigation methods can only be debiased specifically after the model produces biased behavior, which belongs to a posteriori debiasing. For a video recommendation system scenario where hundreds of millions of users use every day, once biased, it will cause very poor user experience, which is fatal to the promotion of the merchant's system. Therefore, a bias mitigation method that can perform a priori debiasing is needed. In addition, existing debiasing methods only consider bias mitigation in a single scenario, which belongs to a static debiasing method and does not consider the cumulative effect of historical bias, and cannot handle dynamic bias behavior. SUMMARY
[0006] In order to solve the problem of historical bias contained in the recommendation system, the application proposes a historical bias mitigation method based on bias attention, mainly aiming at video recommendation in the recommendation system.
[0007] In order to solve the problem of historical bias existing in the video recommendation system, the application designs a historical bias mitigation method for the video recommendation system based on bias attention, that is, for the output of a certain layer of the model, the corresponding bias neuron is found, the attention mask is calculated, the mask is added to the output as the input of the next layer, thereby improving the fairness of the video recommendation system.
[0008] To achieve the above-mentioned application purposes, the application provides the following technical solutions:
[0009] The video recommendation historical bias mitigation method based on bias attention of the application comprises the following steps:
[0010] (1) Data preprocessing. Obtain the sensitive attribute of the video recommendation system data, flip the sensitive attribute value of the video recommendation system data, then combine the original data sensitive attribute sample and the flipped sensitive attribute sample to generate a sensitive attribute original sample pair. On the basis of the original sample pair, add different size perturbations to the attribute values other than the sensitive attribute to obtain perturbation sample pairs near the original sample pair, and finally combine the original sample pair and the perturbation sample pair in proportion to obtain diffusion sample pairs;
[0011] (2) Find bias neurons. Input the diffusion sample pairs generated in step (1) into the model, calculate the average value of the activation value difference of each layer, and find the bias neurons according to the difference average value size;
[0012] (2-1) Calculate the average of the activation value difference;
[0013] Each layer of neuron activation value:
[0014] z = wx + b (1)
[0015] Where z is the neuron activation value, w refers to the weight of the neurons in this layer, x refers to the input features, and b is the bias of the neurons in this layer;
[0016] The average value Z of the activation value difference of the diffusion sample pair D is calculated as follows:
[0017]
[0018] Where m+1 is the sum of the proportion of the original sample pair W and the perturbed sample pair V, is the average value of the activation value difference of the original sample pair W, is the average value of the activation value difference of the perturbed sample pair V, |z i -z i | is the flipped neuron activation value difference value in the original sample pair W of the sensitive attribute, |z j -z j | is the flipped neuron activation value difference value in the perturbed sample pair V of the sensitive attribute;
[0019] (2-2) Sort the average value Z of the activation value difference from large to small, optimize the sampling based on the regularization sampling of the activation value difference average, sort the sampled values in descending order, find the TOPk neurons, and mark them as biased neurons;
[0020] Regularization adaptive sampling step initial value;
[0021]
[0022] Where fl is the floor function, sum is the total number of all neuron activation value difference averages in each layer, and k is the number of neurons to be taken from the neuron activation value difference averages in this layer.
[0023] Regularization adaptive sampling step, after taking out a neuron activation value difference average each time, regularize one neuron activation value difference average from the raw array containing sum neuron activation value difference averages to the new array, until all values are taken out;
[0024] new[j] = raw[i] (4)
[0025] s j+1 = s j -step (5)
[0026]
[0027] wherein, j refers to the position of the element in the new array of regular sampling, j = 0 and j < k, j = j + 1 after each calculation, i refers to the position of the element in the raw array, the initial value of each calculation is i = step - 1, i = i + step after each calculation, ro refers to the rounding function, and the initial value of s is the total number sum of the mean of the activation value difference of each layer of neurons.
[0028] The values sampled by the adaptive algorithm based on regular sampling are sorted in descending order, and the TOPk neurons are found from the sorted results, which are marked as bias neurons, wherein the value of k is preferably 2% of the total number of neurons.
[0029] (3) Calculate the bias mask. Normalize the average of the activation value difference of the bias neurons in step (2), and assign the value to the element in the corresponding position of the zero vector, then take the average in the channel direction to obtain the bias mask;
[0030] (3-1) Establish an empty vector with the same output feature size as the corresponding bias neuron layer, and assign the value of 0 to each element in the empty vector to obtain a zero vector;
[0031] (3-2) Normalize the average of the activation value difference of the bias neurons in step (2), and then assign the normalized value to the element in the corresponding position of the zero vector to obtain a new vector containing the bias neuron element;
[0032] (3-3) Take the average of the vector containing the bias neuron element in (3-2) in the channel direction to obtain a bias mask with a size of 1*H'*W'.
[0033] (4) Calculate the bias attention mask. Perform reshape and matrix transformation operations on the bias mask obtained in step (3) to obtain the bias attention mask;
[0034] (4-1) Perform reshape operation on the bias mask to obtain a matrix B with a size of 1*s1, wherein s1 = H'*W', and then transpose the matrix B to obtain a matrix B T , matrix multiplication obtains B T B, the size is s1*s1, then calculate the average of each column in the matrix B T B according to the column to obtain a matrix C' with a size of 1*s1;
[0035] (4-2) Calculate the bias attention mask;
[0036] MaskAtt = 1 - C (7)
[0037] Wherein, the size of MaskAtt is 1*H'*W', and C refers to a vector with a size of 1*H'*W'.
[0038] (5) Output adds bias attention mask. Superimpose the bias attention mask to the output of the layer and input to the next layer;
[0039] output new =output raw +MaskAtt (8)
[0040] Wherein, the output new of the layer after adding the bias attention mask MaskAtt is referred to as the original layer output result without bias attention mask MaskAtt. raw
[0041] (6) Repeat steps (2), (3), (4) and (5) for each layer until all layers are processed by bias removal operation, and the output layer ends.
[0042] The technical concept of the application is: based on the bias attention of the video recommendation system history bias mitigation method, first, the sensitive attributes of the data are flipped to obtain the original sample pair of the data sensitive attributes, then the other attributes of the original sample pair except the sensitive attributes are added to obtain the perturbed sample pair, the original sample pair and the perturbed sample pair are combined in proportion to obtain the diffusion sample pair, and input into the model to obtain the average value of the activation value difference of each layer, find the TOPk bias neurons, then normalize the average value of the activation value difference of the bias neurons, calculate the bias mask, and finally calculate the attention mask through matrix transformation of the bias mask, and as superimposed to the output of the layer next layer input, to the output layer end.
[0043] The beneficial effects of the application mainly manifest in: the diffusion sample pair can more reliably find the bias neuron than the ordinary sample pair; the finding of the bias neuron and the calculation of the bias attention are irrelevant to the historical data, so the high computational complexity problem caused by massive data is avoided; the bias attention suppresses the activation output of the bias neuron without changing the normal neuron activation value, which can effectively offset the bias behavior caused by the bias neuron; the bias neuron is dynamically updated by data, and the bias attention is also personalized according to data, which can effectively handle the historical bias problem. BRIEF DESCRIPTION OF DRAWINGS
[0044] Figure 1 is the flowchart of the method of the application;
[0045] Figure 2 is the structure block diagram of the video recommendation recall model of the application;
[0046] Figure 3 This is a block diagram of the video recommendation and ranking model structure of the present invention;
[0047] Figure 4 This is a schematic diagram of the mask used in this invention. Detailed Implementation
[0048] The present invention will now be further described with reference to the accompanying drawings.
[0049] Reference Figure 1 A network video recommendation method applying the bias attention-based historical bias mitigation method of the present invention includes the following steps:
[0050] (1) Data Preprocessing. Acquire data for video recommendation systems. Commonly used video recommendation system datasets include MovieLens and Netflix. This embodiment uses the MovieLens-1M dataset as an example, where 1M indicates that the dataset contains 1 million rating data points. Define the input user features x∈X={x1,x2,...,x...} in the MovieLens-1M dataset. n}, the user's corresponding label y∈Y={y1,y2,...,y n}, the user's sensitive attribute a∈A={a1,a2,...,a k}, where A is the user's sensitive attribute set, and k is the type of sensitive attribute, such as gender, age, and job title. The sensitive attribute values of the video recommendation system data are flipped to obtain a'. Finally, the original sensitive attribute samples and the flipped sensitive attribute samples are combined to generate the original sample pair W of the sensitive attributes. To more reliably find biased neurons, this invention proposes the concept of diffused sample pairs. Based on the original sample pair, perturbations of different sizes r∈R={r1,r2,...,r k}, obtain the perturbation sample pairs V near the original sample pair, and finally combine the original sample pair and the perturbation sample pair in a ratio of m:1 to obtain the diffusion sample pair D;
[0051] (2) Locating bias neurons. The data-sensitive attribute diffusion sample pairs D generated in step (1) are input into the video recommendation system model. This invention uses the YouTube video recommendation system model as the target for historical bias mitigation. It is divided into a recall model and a ranking model. The recall model uses Weighted Logistic Regression as the output layer, represented by weighted RL in the figure. The ranking model uses the softmax function as the output layer. The model structure is as follows: Figure 2 and Figure 3, the average value of the activation value difference of each layer in the calculation model is calculated, and the TOPk biased neurons are found by sorting according to the size of the average value of the activation value difference.
[0052] (2-1) Calculate the average value of the activation value difference;
[0053] The activation value of each layer of neurons:
[0054] z = wx + b (1)
[0055] Where z is the neuron activation value, w refers to the weight of the neuron in this layer, x refers to the input feature, and b is the bias of the neuron in this layer.
[0056] The average value Z of the activation value difference of the diffusion sample pair D is calculated as follows:
[0057]
[0058] Where m+1 is the sum of the proportion of the original sample pair W and the perturbed sample pair V, is the average value of the activation value difference of the original sample pair W, is the average value of the activation value difference of the perturbed sample pair V, |z i -z i | is the flipped neuron activation value difference value in the sensitive attribute original sample pair W, |z j -z j | is the flipped neuron activation value difference value in the sensitive attribute perturbed sample pair V.
[0059] (2-2) Sort the average value Z of the activation value difference from large to small, and the present application optimizes sampling based on the regularization sampling adaptive algorithm of the average value of the activation value difference, sorts the sampled values in descending order, finds the TOPk neurons, and marks them as biased neurons;
[0060] Regularization adaptive sampling step initial value;
[0061]
[0062] Where fl is the floor function, sum is the total number of all neuron activation value difference averages in each layer, and k is the number of neuron activation value difference averages to be taken from the neuron activation value difference averages in this layer.
[0063] Regularization adaptive sampling step, after taking out a neuron activation value difference average each time, regularize a neuron activation value difference average from the raw array containing sum neuron activation value difference averages to the new array, until all values are taken out;
[0064] new[j] = raw[i] (4)
[0065] s j+1 =s j -step (5)
[0066]
[0067] wherein j refers to the position of the element in the new array of regular sampling, j = 0 and j < k, j = j + 1 after each calculation, i refers to the position of the element in the raw array, i = step - 1 as the initial value for each calculation, i = i + step after each calculation, ro refers to the rounding function, and the initial value of s is the total number sum of the mean of the activation value difference of each layer of neurons.
[0068] The values sampled by the adaptive algorithm based on regular sampling are sorted in descending order, and the TOPk neurons are found from the sorted results, which are marked as biased neurons, wherein the value of k is preferably 2% of the total number of neurons.
[0069] (3) Calculate the bias mask. The mask schematic is shown in Figure 4 The mean of the activation value difference of the biased neurons in step (2) is normalized, and the value is assigned to the element in the corresponding position of the zero vector, and then the mean value is taken in the channel direction to calculate the bias mask.
[0070] (3-1) Establish an empty vector, which has the same output feature size as the corresponding biased neuron layer, i.e. the size is c'*H'*W', wherein c' refers to the channel number of the output feature, H' refers to the length of the output feature, and W' refers to the width of the output feature, and each element in the empty vector is assigned a value of 0 to obtain a zero vector;
[0071] (3-2) The mean of the activation value difference of the biased neurons in step (2) is normalized to (0, 1) by the sigmoid function, wherein The normalized value is assigned to the element in the corresponding position of the zero vector of the biased neuron to obtain a new vector containing the elements of the biased neuron;
[0072] (3-3) The vector containing the elements of the biased neuron in (3-2) is averaged in the channel direction, and after the averaging is completed, the vector is transformed from the size of c'*H'*W' to the size of 1*H'*W' to obtain the bias mask.
[0073] (4) Calculate the bias attention mask. The bias mask obtained in step (3) is reshaped to obtain an excessive matrix, and then the bias attention mask is calculated through matrix transformation operation;
[0074] (4-1) Perform a reshape operation on the bias mask to obtain a matrix B of size 1*s1, where s1 = H'*W'. Then transpose matrix B to obtain matrix B'. T The matrix multiplication of size s1*1 yields B. T B, with size s1*s1, then perform matrix B... T B performs a matrix transformation, that is, calculates the mean of each column in the matrix column by column, to obtain matrix C' with a size of 1*s1;
[0075] (4-2) Reshape matrix C' to obtain vector C with size 1*H'*W', and calculate the bias attention mask;
[0076] MaskAtt=1-C (7)
[0077] Here, MaskAtt has a size of 1*H'*W', and C refers to a vector with a size of 1*H'*W'.
[0078] (5) Add a bias attention mask (MaskAtt). To alleviate the historical bias problem in video recommendation systems, this invention uses a bias attention method to overlay a bias attention mask onto the output of this layer and input it into the next layer, thereby mitigating historical bias.
[0079] output new =output raw +MaskAtt (8)
[0080] Where, output new This refers to the layer output obtained after adding the biased attention mask MaskAtt. raw This is the original layer output of MaskAtt without bias, which contains bias.
[0081] (6) Repeat steps (2), (3), (4), and (5) for each layer until all layers containing biased neurons have completed the bias mitigation operation, ending at the output layer. At this point, the historical bias mitigation method for video recommendation systems is complete. By obtaining diffused sample pairs of sensitive attributes from the video recommendation system data, biased neurons are found by sorting them according to the average size of the activation value differences. Then, bias masks and bias attention masks are calculated. Finally, the bias attention mask is superimposed on the output of this layer and input to the next layer, ending at the output layer, thus achieving bias mitigation for historical bias in video recommendation systems.
[0082] (7) The method of this invention is applied to mitigate historical bias in the YouTube online video recommendation system, and the model is as follows: Figure 2 and Figure 3As shown, the trained model is obtained using data stored on the website. The method of this invention first preprocesses the data input to the video recommendation system, flipping the values of sensitive attributes (e.g., gender, age). Then, the original data's sensitive attribute samples and the flipped sensitive attribute samples are combined to obtain original sample pairs. Based on these original sample pairs, perturbations of different magnitudes are added to the attribute values other than the sensitive attributes to obtain perturbation sample pairs near the original sample pairs. Finally, the original sample pairs and perturbation sample pairs are combined in an m:1 ratio to obtain diffusion sample pairs. The diffusion sample pairs are input into the model, and the average difference in activation values of the i-th layer is calculated according to step (2-1), where... Figure 2 It contains a total of 3 ReLU layers and 1 softmax layer. Figure 3 The algorithm consists of three ReLU layers and one weighted RL layer. The top k biased neurons are identified by sampling and sorting the average difference of the calculated activation values in step (2-2). Then, for each biased neuron, the i-th layer bias mask and the i-th layer attention bias mask are calculated sequentially according to steps (3) and (4). Following step (5), the bias attention mask is superimposed on the output of the i-th layer and input to the next layer. Finally, following step (6), all layers are traversed until the output layer is reached. This process mitigates historical bias in this embodiment.
Claims
1. A method for mitigating historical bias in video recommendations based on biased attention, comprising the following steps: (1) Data preprocessing; (2) Finding biased neurons; (3) Calculating a bias mask; (4) Calculating a biased attention mask; (5) Outputting and adding the biased attention mask; (6) Repeat steps (2), (3), (4), and (5) for each layer until all layers have been debiased and the output layer is reached; (1) Specifically includes: obtaining the sensitive attributes of the video recommendation system data, flipping the sensitive attribute values of the video recommendation system data, and then combining the original sensitive attribute samples of the raw data and the flipped sensitive attribute samples to generate original sample pairs of sensitive attributes; adding different magnitudes of perturbations to the other attribute values except the sensitive attributes based on the original sample pairs to obtain perturbed sample pairs near the original sample pairs, and finally combining the original sample pairs and the perturbed sample pairs in proportion to obtain diffused sample pairs; ((2) Specifically includes: inputting the diffused sample pairs generated in step (1) into the model, calculating the average value of the activation value differences for each layer, and sorting according to the magnitude of the difference mean to find the biased neurons; (2-1) Calculating the average value of the activation value differences; Activation values of neurons in each layer: z = wx + b (1) where z is the neuron activation value, w is the weight of the neurons in this layer, x is the input feature, and b is the bias of the neurons in this layer; The formula for calculating the average value Z of the activation value differences of the diffused sample pair D: Where m+1 refers to the sum of the proportions of the original sample pair W and the perturbation sample pair V. This refers to averaging the differences in W activation values between the original samples. This refers to averaging the differences in activation values of perturbed samples with respect to V, |z i -z i '| refers to the difference in activation values of neurons in W after flipping, where |z' is the original sample with the sensitive attribute. j -z j '| refers to the difference in activation values of neurons in V after flipping, based on samples with sensitive attribute perturbations; (2-2) Sort the average value Z of the activation value differences from largest to smallest, optimize the sampling for the adaptive algorithm based on regularized sampling for the average value of the activation value differences, sort the sampled values in descending order, find the TOPk neurons, and mark them as biased neurons; Initial value of the regularized adaptive sampling step size; where fl is the floor function, sum is the total number of the average values of the activation value differences of all neurons in each layer, and k is the number to be taken from the average values of the activation value differences of the neurons in this layer; Regularized adaptive sampling step size. After taking out the average value of the activation value difference of one neuron each time, a neuron activation value difference mean is sampled regularly from the raw array containing sum neuron activation value difference means into the new array until all values are taken out; new[j] = raw[i] (4) s j+1 =s j -step (5) where j is the position of the element in the regularly sampled new array, j = 0 and j < k, j = j + 1 after each calculation, i is the position of the element in the raw array, the initial value is i = step - 1 each time, i = i + step after each calculation, ro is the rounding function, and the initial value of s is the total number sum of the average values of the activation value differences of the neurons in each layer; Sort the values sampled by the adaptive algorithm based on regularized sampling in descending order, find the TOPk neurons from the sorted results, and mark them as biased neurons, where the value of k is 2% of the total number of neurons; Step (3) specifically includes: normalizing the average value of the difference in activation values of biased neurons in step (2), assigning the value to the element at the corresponding position in the zero vector, taking the average value according to the channel direction, and calculating the bias mask; (3-1) Create an empty vector with the same size as the output feature of the corresponding biased neuron layer, and assign 0 to each element in the empty vector to obtain a zero vector; (3-2) Normalize the average value of the difference in activation values of biased neurons in step (2), and then assign the normalized value to the element corresponding to the position of the biased neuron in the zero vector to obtain a new vector containing the elements of the biased neuron. (3-3) Take the average value of the vector containing biased neuron elements in step (3-2) according to the channel direction to obtain a biased mask with size 1*H'*W'; Step (4) specifically includes: reshaping and matrix transformation operations on the bias mask obtained in step (3) to calculate the bias attention mask; (4-1) Perform a reshape operation on the bias mask to obtain a matrix B of size 1*s1, where s1 = H'*W'. Then transpose matrix B to obtain matrix B'. T Matrix multiplication yields B T B, with size s1*s1, then perform matrix B... T B calculates the mean of each column in the matrix, resulting in matrix C' with a size of 1*s1; (4-2) Calculate the biased attention mask; MaskAtt=1-C (7) Here, MaskAtt has a size of 1*H'*W', and C refers to a vector with a size of 1*H'*W'; Step (5) specifically includes: overlaying the bias attention mask onto the output of this layer and inputting it into the next layer; output new =output raw +MaskAtt (8) Where, output new This refers to the layer output obtained after adding the biased attention mask MaskAtt. raw This is the original layer output of MaskAtt without bias, which contains bias.