# Diffusion Model as a Base for Cold Item Recommendation
## 3 Cold Item Recommender with a Diffusion Model Base
### Second-Phase Refiner  
The refiner's purpose in the second phase is to reduce the error that may be caused by the lack of user-side information or coarse side information of cold items by adjusting the ground-truth user collaborative embeddings and the generated item collaborative embeddings to predict more accurate user-item interactions. Figure 3 shows the architecture of the refiner (Refiner). The ground-truth user collaborative embeddings \(e_{u}\), generated item collaborative embeddings \(\hat{e}_{i}\), and items' side information \(c_{i}\) are given. With the information provided, the Refiner calculates the recommendation score \(\hat{r}_{ui}\) which is proportional to the probability of interaction between user \(u\) and item \(i\) by calculating Equation (18) with the refined user vector \(\hat{e}_{u}^{+}\) and item vector \(\hat{e}_{i}^{+}\). The Refiner adopts two sub-networks: one for users and one for items. The user-side sub-network that calculates \(\hat{e}_{u}^{+}\) is represented in Equation (19). \[\hat{r}_{ui}=\hat{e}_{u}^{+}\cdot\hat{e}_{i}^{+} \tag{18}\]  
\[\hat{e}_{u}^{+}=W_{U}^{(2)}\times BN(tanh(W_{U}^{(1)}\times e_{u}+b_{U}^{(1)}) )+b_{U}^{(2)} \tag{19}\]  
where \(W_{U}^{(1)},W_{U}^{(2)}\in\mathbb{R}^{d_{cf}\times d_{cf}}\), and \(b_{U}^{(1)},b_{U}^{(2)}\in\mathbb{R}^{d_{cf}}\) represent weights and biases of the first and second layer, respectively. \(BN\) indicates the batch normalization [62]. The item-side sub-network comprises the two layers represented in Equations (20) and (21). \[h_{i}=BN(tanh(W_{I}^{(1)}\times(\tilde{e}_{i}\parallel c_{i})+b_{I}^{(1)})) \tag{20}\]  
\[\hat{e}_{i}^{+}=W_{I}^{(2)}\times(h_{i}\parallel\tilde{e}_{i}\parallel c_{i}) +b_{I}^{(2)} \tag{21}\]  
where \(W_{I}^{(1)}\in\mathbb{R}^{d_{cf}\times(d_{cf}+d_{cond})}\) and \(W_{I}^{(2)}\in\mathbb{R}^{d_{cf}\times(2d_{cf}+d_{cond})}\), and \(b_{I}^{(1)},b_{I}^{(2)}\in\mathbb{R}^{d_{cf}}\) represent weights and biases of the first and second layers, respectively. At the inference time, \(\tilde{e}_{i}\) indicates the predicted collaborative embedding of the cold item calculated by the DM-based generator. We designed each of the two layers as a collaborative embedding refiner, which refines \(\tilde{e}_{i}\) based on the side information \(c_{i}\) and the output of the previous layer as guidelines. **Training:** To train the Refiner, we use the interaction information \(R^{tr}\) that is used to train the base recommender and the ground-truth item collaborative embeddings \(e_{i}\) calculated by the base recommender. For each positive interaction of user \(u\) whose value of \(r_{ui}\in\ R^{tr}\) is one, five negative user-item interactions whose value of \(r_{ui}\in\ R^{tr}\) is zero are sampled. The sets of positive and negative interactions are joined to create the training  
Figure 3: Architecture of the Refiner. dataset \(D^{tr}\). With \(D^{tr}\), the Refiner is trained to minimize the objective function represented in Equation (22). The details of the training procedure are found in Algorithm 3. \[L_{Refiner}=\frac{1}{|D_{tr}|}\Sigma_{ru\in D_{tr}}\parallel r_{ui}-\hat{r}_{ui} \parallel_{2}^{2} \tag{22}\]  
```
0: Dataset \(D_{tr}\), the sets of ground-truth user, item, generated item collaborative embeddings, and items' side information: \(E_{U}\), \(E_{I}\), \(\hat{E}_{I}\), and \(C_{I}\)
0: Trained model parameter \(\theta\)
1: Initialize \(\theta\) with random values
2:while\(\theta\) is not converged do
3: Randomly sample a batch \(D^{\prime}_{tr}\subset D_{tr}\)
4:for all\(r_{ui}\in D^{\prime}_{tr}\)do
5: Extract \(e_{u}\), \(e_{i}\), \(\hat{e}_{i}\), and \(c_{i}\) from \(E_{U}\), \(E_{I}\), \(\hat{E}_{I}\), and \(C_{I}\), respectively
6: Calculate \(\hat{e}^{+}_{u}\) and \(\hat{e}^{+}_{i}\) by using Equations (19)-(21).