SlowGuess/NAACL_2021_OCR huggingface dataset:
Radford M Neal and Geoffrey E Hinton. 1998. A view of the em algorithm that justifies incremental, sparse, and other variants. In Learning in graphical models, pages 355-368. Springer.
Jianmo Ni, Jiacheng Li, and Julian McAuley. 2019. Justifying recommendations using distantly-labeled reviews and fine-grained aspects. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 188-197.
Meng Qu and Jian Tang. 2019. Probabilistic logic neural networks for reasoning. In Advances in Neural Information Processing Systems, pages 7712-7722.
Sofia Serrano and Noah A Smith. 2019. Is attention interpretable? arXiv preprint arXiv:1906.03731.
Sanjay Subramanian, Ben Bogin, Nitish Gupta, Tomer Wolfson, Sameer Singh, Jonathan Berant, and Matt Gardner. 2020. Obtaining faithful interpretations from compositional neural networks. arXiv preprint arXiv:2005.00724.
Maartje ter Hoeve, Anne Schuth, Daan Odijk, and Maarten de Rijke. 2018. Faithfully explaining rankings in a news recommender system. arXiv preprint arXiv:1805.05447.
Hongwei Wang, Fuzheng Zhang, Jialin Wang, Miao Zhao, Wenjie Li, Xing Xie, and Minyi Guo. 2018. Ripplenet: Propagating user preferences on the knowledge graph for recommender systems. In CIKM, pages 417-426. ACM.
Xiang Wang, Xiangnan He, Yixin Cao, Meng Liu, and Tat-Seng Chua. 2019. Kgat: Knowledge graph attention network for recommendation. In KDD '19.
Jialin Wu and Raymond J Mooney. 2018. Faithful multimodal explanation for visual question answering. arXiv preprint arXiv:1809.02805.
Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. 2020. A comprehensive survey on graph neural networks. IEEE Transactions on Neural Networks and Learning Systems.
Yikun Xian, Zuohui Fu, Qiaoying Huang, Shan Muthukrishnan, and Yongfeng Zhang. 2020a. Neural-symbolic reasoning over knowledge graph for multi-stage explainable recommendation. AAAI DLGMA Workshop.
Yikun Xian, Zuohui Fu, S. Muthukrishnan, Gerard de Melo, and Yongfeng Zhang. 2019. Reinforcement knowledge graph reasoning for explainable recommendation. In SIGIR.
Yikun Xian, Zuohui Fu, Handong Zhao, Yingqiang Ge, Xu Chen, Qiaoying Huang, Shijie Geng, Zhou Qin, Gerard de Melo, S Muthukrishnan, et al. 2020b. Cafe: Coarse-to-fine neural symbolic reasoning for
explainable recommendation. In Proceedings of the 29th ACM International Conference on Information & Knowledge Management, pages 1645-1654.
Wei Zhang, Quan Yuan, Jiawei Han, and Jianyong Wang. 2016. Collaborative multi-level embedding learning from reviews for rating prediction. In *IJ-CAI*.
Yongfeng Zhang and Xu Chen. 2020. Explanable recommendation: A survey and new perspectives. Foundations and Trends in Information Retrieval.
Kangzhi Zhao, Xiting Wang, Yuren Zhang, Li Zhao, Zheng Liu, Chunxiao Xing, and Xing Xie. 2020. Leveraging demonstrations for reinforcement recommendation reasoning over knowledge graphs. In SIGIR.
Wayne Xin Zhao, Gaole He, Hong-Jian Dou, J. Huang, Siqi Ouyang, and Ji-Rong Wen. 2019. Kb4rec: A data set for linking knowledge bases with recommender systems. Data Intelligence, 1:121-136.
A Detail of Rule-Guided Path Reasoning
Our LSTM-based path reasoner  $\phi$  is based on the graph walker in Moon et al. (2019). It takes as input the embedding of the current entity  $e_{t-1}$  and outputs the embeddings of the next relation  $r_t$  and the next entity  $e_t$ , i.e.,  $\mathbf{r}_t, \mathbf{e}_t = \phi(\mathbf{e}_{t-1})$ . In particular, the next relation embedding  $\mathbf{r}_t$  is defined as:
$$
\alpha_ {t} = \sigma \left(W _ {\alpha} \mathbf {e} _ {t - 1} + b _ {\alpha}\right),
$$
$$
\mathbf {r} _ {t} = \sum_ {r \in \mathcal {R}} \alpha_ {t, r} r,
$$
where  $W_{\alpha}, b_{\alpha}$  are parameters and  $\alpha_{t}$  are the attention weights over all relations in the KG. The next entity embedding  $\mathbf{e}_t$  is defined as:
$$
\mathbf {z} _ {t} = \mathbf {e} _ {t - 1} + \mathbf {r} _ {t}
$$
$$
\mathbf {i} _ {t} = \sigma \left(W _ {i} \left[ \mathbf {e} _ {t - 1}; \mathbf {c} _ {t - 1} \right] + b _ {i}\right)
$$
$$
\mathbf {c} _ {t} = \left(1 - \mathbf {i} _ {t}\right) \odot \mathbf {c} _ {t - 1} + \mathbf {i} _ {t} \odot \tanh  \left(W _ {c} [ \mathbf {z} _ {t}; \mathbf {e} _ {t - 1} ] + b _ {c}\right)
$$
$$
\mathbf {o} _ {t} = \sigma \left(W _ {o} [ \mathbf {z} _ {t}, \mathbf {e} _ {t - 1}, \mathbf {c} _ {t} ] + b _ {o}\right)
$$
$$
\mathbf {e} _ {t} = \mathbf {o} _ {t} \odot \tanh  (\mathbf {c} _ {t})
$$
Here,  $[\cdot ]$  denotes concatenation,  $\odot$  is elementwise multiplication,  $i_t$ ,  $o_t$  are vectors passing through corresponding gates, and  $z_{t}$  is the context vector.
During training, for every user and its observed user-item triplets, we sample a set of training paths following the rules, with numbers proportional to the rule weights. The goal is to make the path reasoner  $\phi$  generate paths that are close to the training samples, which can be optimized by the hinge loss.
The inference pipeline using the trained path-reasoning network is described in Alg. 1. Starting with a user  $u$  encoded as  $\mathbf{e}_0 = \mathbf{u}$ , the estimated entity embedding  $\mathbf{e}_t$  and relation embedding  $\mathbf{r}_t$  at the  $t$ -th hop is obtained by the model  $\phi$ . At each hop, for all potential neighbors, we calculate a ranking score based on the dot-product of the neighbor and estimated  $(\mathbf{e}_t, \mathbf{r}_t)$ . After ranking these neighbors based on such scores, we can filter a set of candidate neighbors and invoke a Beam Search to identify a set of paths as well as corresponding items for  $u$ .
In order to guarantee path connectivity, we add reverse relations into the knowledge graph, i.e., if  $(e_h,r,e_t)\in \mathcal{G}$ , then  $(e_t,r^{-1},e_h)\in \mathcal{G}$ . We restrict the length of candidate rules to be 3. We adopt TransE (Bordes et al., 2013) as the KG encoder
$f_{\theta}$ , with the dimensionality of entity and relation embeddings set as 100.
To learn the global rule weights, we first generate the hidden triplet set according to the result of the KG encoder. For each user, the top 50 estimated items with the highest scores predicted by KG encoder are taken as the hidden triplet set  $H^{+}$ . The threshold  $\tau$  is set to 0.5 and the weighting factor  $\alpha$  is set to 0.3 by default. In the path reasoning algorithm, we set the neighboring size  $\beta$  to 10. Other training details can be found in Table 3.
Parameter	Cellphones	Grocery	Automotive
# of epochs	4	2	3
KGE batch size	512	512	512
KGE optimizer	Adam	Adam	Adam
KGE learning rate	1e-4	1e-4	1e-4
NLM learning rate	1e-5	1e-5	1e-5
# of sample node	100	100	100
Table 3: Training detail for three datasets. KGE = KG encoder. NLM = neural logic model.
The statistics of our datasets are shown in Table 4.
Dataset	Cellphones	Grocery	Automotive
#Users	61,254	57,822	95,445
#Items	47,604	40,694	78,557
#Interactions	607,673	709,280	1,122,776
#Entities	169,331	173,369	270,543
#Relations	45	45	73
#Triples	3,117,051	3,742,954	4,580,318
Table 4: Overall statistics of three datasets.