BACF: Bayesian Attentional Collaborative Filtering
Abstract
1. Introduction
2. Related Works
2.1. Latent Factor Model for Collaborative Filtering
2.2. Implicit Feedback Data
2.3. One-Class Collaborative Filtering
2.4. Bayesian Attention Module
3. Proposed Method
4. Experiment
4.1. Dataset
4.2. Experiment Settings
5. Results
5.1. Performance Comparison Across Deterministic Models
5.2. Effect of Bayesian Attention Module
5.3. Importance of Prior Information Based on Data Sparsity and Preference Ambiguity
5.4. Configuring Variational Distribution Based on Interaction Sparsity and Ambiguity
5.5. Complexity Analysis
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Lerche, L. Using Implicit Feedback for Recommender Systems: Characteristics, Applications, and Challenges. Ph.D. Thesis, TU Dortmund University, Dortmund, Germany, 2016. [Google Scholar]
- Rendle, S.; Freudenthaler, C.; Gantner, Z.; Schmidt-Thieme, L. BPR: Bayesian Personalized Ranking from Implicit Feedback. In Proceedings of the Twenty-Fifth Conference on Uncertainty in Artificial Intelligence (UAI’09), Montreal, QC, Canada, 18–21 June 2009; pp. 452–461. [Google Scholar]
- Hu, Y.; Koren, Y.; Volinsky, C. Collaborative Filtering for Implicit Feedback Datasets. In Proceedings of the 2008 Eighth IEEE International Conference on Data Mining (ICDM 2008), Pisa, Italy, 15–19 December 2008; pp. 263–272. [Google Scholar]
- Liang, D.; Charlin, L.; McInerney, J.; Blei, D.M. Modeling User Exposure in Recommendation. In Proceedings of the 25th International Conference on World Wide Web (WWW 2016), Montreal, QC, Canada, 11–15 April 2016; pp. 951–961. [Google Scholar]
- He, X.; He, Z.; Song, J.; Liu, Z.; Jiang, Y.-G.; Chua, T.-S. NAIS: Neural Attentive Item Similarity Model for Recommendation. IEEE Trans. Knowl. Data Eng. 2018, 30, 2354–2366. [Google Scholar] [CrossRef]
- Cui, C.; Qin, J.; Ren, Q. Deep collaborative recommendation algorithm based on attention mechanism. Appl. Sci. 2022, 12, 10594. [Google Scholar] [CrossRef]
- Salakhutdinov, R.; Mnih, A. Bayesian probabilistic matrix factorization using Markov chain Monte Carlo. In Proceedings of the 25th International Conference on Machine Learning, Hensinki, Finland, 5–9 July 2008; pp. 880–887. [Google Scholar]
- Liang, D.; Krishnan, R.G.; Hoffman, M.D.; Jebara, T. Variational autoencoders for collaborative filtering. In Proceedings of the 2018 World Wide Web Conference, Lyon, France, 23–27 April 2018; pp. 689–698. [Google Scholar]
- Forouzandeh, S.; Berahmand, K.; Rostami, M.; Aminzadeh, A.; Oussalah, M. UIFRS-HAN: User interests-aware food recommender system based on the heterogeneous attention network. Eng. Appl. Artif. Intell. 2024, 135, 108766. [Google Scholar] [CrossRef]
- Forouzandeh, S.; DW, P.M.; Jalili, M. DistillHGNN: A Knowledge Distillation Approach for High-Speed Hypergraph Neural Networks. In Proceedings of the 13th International Conference on Learning Representations, Singapore, 24–28 April 2025. [Google Scholar]
- Ahmadian, S.; Berahmand, K.; Rostami, M.; Forouzandeh, S.; Moradi, P.; Jalili, M. Recommender Systems based on Non-negative Matrix Factorization: A Survey. IEEE Trans. Artif. Intell. 2025, 1, 1–21. [Google Scholar] [CrossRef]
- He, X.; Liao, L.; Zhang, H.; Nie, L.; Hu, X.; Chua, T.S. Neural Collaborative Filtering. In Proceedings of the 26th International Conference on World Wide Web (WWW ’17), Perth, Australia, 3–7 April 2017; pp. 173–182. [Google Scholar]
- Deng, Z.-H.; Huang, L.; Wang, C.-D.; Lai, J.-H.; Yu, P.S. DeepCF: A Unified Framework of Representation Learning and Matching Function Learning in Recommender System. In Proceedings of the AAAI Conference on Artificial Intelligence (AAAI-19), Honolulu, HI, USA, 27 January–1 February 2019; pp. 61–68. [Google Scholar]
- Luong, M.-T.; Pham, H.; Manning, C.D. Effective Approaches to Attention-based Neural Machine Translation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing (EMNLP 2015), Lisbon, Portugal, 17–21 September 2015. [Google Scholar]
- Bahdanau, D.; Cho, K.; Bengio, Y. Neural Machine Translation by Jointly Learning to Align and Translate. In Proceedings of the 3rd International Conference on Learning Representations (ICLR 2015), San Diego, CA, USA, 7–9 May 2015. [Google Scholar]
- Fan, X.; Zhang, S.; Chen, B.; Zhou, M. Bayesian Attention Modules. In Proceedings of the Advances in Neural Information Processing Systems 33 (NeurIPS 2020), Vancouver, BC, Canada, 6–12 December 2020; pp. 16362–16376. [Google Scholar]
- Deng, Y.; Kim, Y.; Chiu, J.; Guo, D.; Rush, A.M. Latent Alignment and Variational Attention. In Proceedings of the 32nd Conference on Neural Information Processing Systems (NeurIPS 2018), Montreal, QC, Canada, 2–8 December 2018; pp. 9735–9747. [Google Scholar]
- Shankar, S.; Sarawagi, S. Posterior Attention Models for Sequence to Sequence Learning. In Proceedings of the International Conference on Learning Representations (ICLR 2019), New Orleans, LA, USA, 6–9 May 2019. [Google Scholar]
- Lawson, D.; Chiu, C.-C.; Tucker, G.; Raffel, C.; Swersky, K.; Jaitly, N. Learning Hard Alignments with Variational Inference. In Proceedings of the 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Calgary, AB, Canada, 15–20 April 2018; pp. 5799–5803. [Google Scholar]
- He, G.; Zhao, D.; Ding, L. Dual-embedding based Neural Collaborative Filtering for Recommender Systems. arXiv 2021, arXiv:2102.02549. [Google Scholar] [CrossRef]
- Harper, F.M.; Konstan, J.A. The MovieLens Datasets: History and Context. ACM Trans. Interact. Intell. Syst. 2015, 5, 1–19. [Google Scholar] [CrossRef]
- Last.fm Website. Available online: http://www.lastfm.com (accessed on 1 March 2025).
- HatRec 2011|GroupLens Website. Available online: https://grouplens.org/datasets/hetrec-2011/ (accessed on 1 March 2025).
- Ni, J.; Li, J.; McAuley, J. 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), Hong Kong, China, 3–7 November 2019. [Google Scholar]
- Amazon Review Data. Available online: https://cseweb.ucsd.edu/~jmcauley/datasets/amazon_v2/ (accessed on 23 March 2025).
- He, R.; McAuley, J. Ups and Downs: Modeling the Visual Evolution of Fashion Trends with One-Class Collaborative Filtering. In Proceedings of the 25th International World Wide Web Conference (WWW 2016), Montreal, QC, Canada, 11–15 April 2016; pp. 507–517. [Google Scholar]
- Amazon Product Data. Available online: https://cseweb.ucsd.edu/~jmcauley/datasets/amazon/links.html (accessed on 23 March 2025).
Feature | MovieLens | Last.FM | A-Beauty | A-Music |
---|---|---|---|---|
# of users | 610 | 1892 | 3819 | 5541 |
# of items | 9724 | 17,632 | 1581 | 3568 |
# of interactions | 100,836 | 92,834 | 34,278 | 64,706 |
density | 0.0170 | 0.0027 | 0.0056 | 0.0032 |
Hyperparameter | Value |
---|---|
Train:Valid:Test | 8:1:1 |
Embedding dimension | 32 |
Loss function | BPR |
# of layers | 4 |
Optimizer | Adam |
Learning rate | 0.0001 |
Negative sampling ratio | 1:1 (train, valid), 1:99 (test, leave-one-out) |
Batch size | 256 |
Weight Decay | 0.001 |
Dataset | Metric | NCF | DeepCF | DNCF | BACF | |||
---|---|---|---|---|---|---|---|---|
MLP | NeuMF | ml | CFNet | DMLP | DNMF | |||
Movie Lens | HR@5 | 0.8311 | 0.8049 | 0.8000 | 0.8311 | 0.8049 | 0.8344 | 0.8934 |
HR@10 | 0.9131 | 0.9016 | 0.9163 | 0.9327 | 0.9295 | 0.9229 | 0.9508 | |
NDCG@5 | 0.4170 | 0.3882 | 0.3988 | 0.4461 | 0.4066 | 0.4450 | 0.4900 | |
NDCG@10 | 0.4297 | 0.4051 | 0.4241 | 0.4681 | 0.4348 | 0.4650 | 0.4989 | |
Last FM | HR@5 | 0.7057 | 0.7244 | 0.8981 | 0.8971 | 0.7985 | 0.8224 | 0.9035 |
HR@10 | 0.8176 | 0.8422 | 0.9514 | 0.9461 | 0.9035 | 0.9115 | 0.9434 | |
NDCG@5 | 0.2682 | 0.2678 | 0.4160 | 0.4137 | 0.3394 | 0.3670 | 0.4544 | |
NDCG@10 | 0.3288 | 0.3308 | 0.4982 | 0.4970 | 0.4131 | 0.4402 | 0.5292 | |
A-Beauty | HR@5 | 0.3409 | 0.3546 | 0.4885 | 0.4845 | 0.4138 | 0.3948 | 0.5393 |
HR@10 | 0.4165 | 0.4094 | 0.5781 | 0.5618 | 0.5057 | 0.4840 | 0.6183 | |
NDCG@5 | 0.2408 | 0.2734 | 0.4161 | 0.4115 | 0.3391 | 0.3241 | 0.4452 | |
NDCG@10 | 0.2627 | 0.2896 | 0.4442 | 0.4351 | 0.3670 | 0.3512 | 0.4701 | |
A-Music | HR@5 | 0.2359 | 0.4104 | 0.5022 | 0.5027 | 0.4281 | 0.4383 | 0.5785 |
HR@10 | 0.3677 | 0.5594 | 0.6638 | 0.6695 | 0.5929 | 0.6031 | 0.7267 | |
NDCG@5 | 0.1423 | 0.2562 | 0.3141 | 0.3175 | 0.2673 | 0.2729 | 0.3883 | |
NDCG@10 | 0.1814 | 0.3040 | 0.3676 | 0.3736 | 0.3196 | 0.3257 | 0.4393 |
Dataset | Metric | NCF | DeepCF | DNCF | BACF | |||
---|---|---|---|---|---|---|---|---|
MLP | NeuMF | ml | CFNet | DMLP | DNMF | |||
Movie Lens | HR@5 | 0.8344 | 0.7983 | 0.8344 | 0.8327 | 0.8213 | 0.8262 | 0.8934 |
HR@10 | 0.9327 | 0.9245 | 0.9426 | 0.9278 | 0.9311 | 0.9229 | 0.9508 | |
NDCG@5 | 0.4086 | 0.4016 | 0.4300 | 0.4371 | 0.4239 | 0.4243 | 0.4900 | |
NDCG@10 | 0.4298 | 0.4249 | 0.4538 | 0.4555 | 0.4551 | 0.4463 | 0.4989 | |
Last FM | HR@5 | 0.7787 | 0.8496 | 0.9019 | 0.8949 | 0.8795 | 0.9029 | 0.9035 |
HR@10 | 0.8646 | 0.9253 | 0.9568 | 0.9530 | 0.9429 | 0.9482 | 0.9434 | |
NDCG@5 | 0.3346 | 0.3869 | 0.4337 | 0.4220 | 0.4093 | 0.4413 | 0.4544 | |
NDCG@10 | 0.4017 | 0.4664 | 0.5146 | 0.5048 | 0.4910 | 0.5159 | 0.5292 | |
A-Beauty | HR@5 | 0.3484 | 0.4598 | 0.4916 | 0.5008 | 0.4297 | 0.4399 | 0.5393 |
HR@10 | 0.4138 | 0.5309 | 0.5759 | 0.5825 | 0.5097 | 0.5185 | 0.6183 | |
NDCG@5 | 0.2473 | 0.3972 | 0.4084 | 0.4214 | 0.3550 | 0.3596 | 0.4452 | |
NDCG@10 | 0.2658 | 0.4185 | 0.4346 | 0.4465 | 0.3791 | 0.3840 | 0.4701 | |
A-Music | HR@5 | 0.4552 | 0.4348 | 0.5221 | 0.5318 | 0.4878 | 0.4863 | 0.5785 |
HR@10 | 0.6151 | 0.6034 | 0.6817 | 0.6867 | 0.6377 | 0.6506 | 0.7267 | |
NDCG@5 | 0.2858 | 0.2731 | 0.3316 | 0.3401 | 0.3026 | 0.3046 | 0.3883 | |
NDCG@10 | 0.3369 | 0.3269 | 0.3841 | 0.3908 | 0.3519 | 0.3573 | 0.4393 |
Dataset | Metric | DACR | Attentive-CF | BACF |
---|---|---|---|---|
Movie Lens | HR@5 | 0.8262 | 0.8524 | 0.8934 |
HR@10 | 0.9278 | 0.9426 | 0.9508 | |
NDCG@5 | 0.4501 | 0.4553 | 0.4900 | |
NDCG@10 | 0.4657 | 0.4672 | 0.4989 | |
Last FM | HR@5 | 0.8155 | 0.8699 | 0.9035 |
HR@10 | 0.8949 | 0.9232 | 0.9434 | |
NDCG@5 | 0.3515 | 0.4279 | 0.4544 | |
NDCG@10 | 0.4216 | 0.5033 | 0.5292 | |
A-Beauty | HR@5 | 0.4200 | 0.5128 | 0.5393 |
HR@10 | 0.5145 | 0.5812 | 0.6183 | |
NDCG@5 | 0.3408 | 0.4338 | 0.4452 | |
NDCG@10 | 0.3694 | 0.4551 | 0.4701 | |
A-Music | HR@5 | 0.4656 | 0.5233 | 0.5785 |
HR@10 | 0.6215 | 0.6792 | 0.7267 | |
NDCG@5 | 0.2947 | 0.3346 | 0.3883 | |
NDCG@10 | 0.3447 | 0.3862 | 0.4393 |
Dataset | Metric | 0.01 | 0.10 | 0.20 | 0.30 | ||||
---|---|---|---|---|---|---|---|---|---|
10.0 | 1.0 | 10.0 | 1.0 | 10.0 | 1.0 | 10.0 | 1.0 | ||
MovieLens | HR@5 | 0.6540 | 0.8098 | 0.6918 | 0.8491 | 0.7016 | 0.8475 | 0.6918 | 0.8196 |
HR@10 | 0.8655 | 0.9213 | 0.8704 | 0.9278 | 0.8606 | 0.9426 | 0.8508 | 0.9278 | |
NDCG@5 | 0.2423 | 0.4152 | 0.2767 | 0.4288 | 0.2816 | 0.4274 | 0.2769 | 0.3852 | |
NDCG@10 | 0.2808 | 0.4395 | 0.3045 | 0.4560 | 0.3090 | 0.4506 | 0.3036 | 0.4151 | |
Last.FM | HR@5 | 0.7078 | 0.8821 | 0.7057 | 0.8710 | 0.7094 | 0.8752 | 0.7089 | 0.8869 |
HR@10 | 0.8342 | 0.9296 | 0.8363 | 0.9243 | 0.8336 | 0.9323 | 0.8358 | 0.9418 | |
NDCG@5 | 0.2535 | 0.4150 | 0.2652 | 0.4132 | 0.2703 | 0.4239 | 0.2531 | 0.4131 | |
NDCG@10 | 0.3215 | 0.4938 | 0.3299 | 0.4915 | 0.3352 | 0.5006 | 0.3233 | 0.4935 | |
A-Beauty | HR@5 | 0.3431 | 0.4651 | 0.3484 | 0.5136 | 0.3551 | 0.5114 | 0.3405 | 0.5295 |
HR@10 | 0.4103 | 0.5463 | 0.4160 | 0.6046 | 0.4134 | 0.6077 | 0.4147 | 0.6219 | |
NDCG@5 | 0.2626 | 0.3998 | 0.2371 | 0.4295 | 0.2551 | 0.4278 | 0.2346 | 0.4328 | |
NDCG@10 | 0.2819 | 0.4246 | 0.2576 | 0.4579 | 0.2719 | 0.4578 | 0.2560 | 0.4617 | |
A-Music | HR@5 | 0.2406 | 0.5099 | 0.2419 | 0.5790 | 0.2406 | 0.5997 | 0.2473 | 0.5954 |
HR@10 | 0.3612 | 0.6670 | 0.3791 | 0.7260 | 0.3707 | 0.7456 | 0.3779 | 0.7498 | |
NDCG@5 | 0.1407 | 0.3222 | 0.1426 | 0.3844 | 0.1417 | 0.4022 | 0.1442 | 0.4032 | |
NDCG@10 | 0.1761 | 0.3741 | 0.1824 | 0.4338 | 0.1796 | 0.4510 | 0.1830 | 0.4561 |
Dataset | Metric | 0.01 | 0.05 | 0.10 | 0.15 | 0.20 | 0.25 | 0.3 |
---|---|---|---|---|---|---|---|---|
MovieLens | HR@5 | 0.8147 | 0.8377 | 0.8196 | 0.8393 | 0.7950 | 0.8344 | 0.8278 |
HR@10 | 0.9098 | 0.9327 | 0.9311 | 0.9393 | 0.9098 | 0.9229 | 0.9229 | |
NDCG@5 | 0.3997 | 0.4355 | 0.3956 | 0.4414 | 0.3888 | 0.4047 | 0.4080 | |
NDCG@10 | 0.4237 | 0.4508 | 0.4197 | 0.4590 | 0.4146 | 0.4252 | 0.4293 | |
Last.FM | HR@5 | 0.8795 | 0.8710 | 0.8742 | 0.8848 | 0.8832 | 0.8869 | 0.8773 |
HR@10 | 0.9291 | 0.9301 | 0.9291 | 0.9323 | 0.9339 | 0.9365 | 0.9381 | |
NDCG@5 | 0.4149 | 0.4147 | 0.4156 | 0.4265 | 0.4194 | 0.4265 | 0.4191 | |
NDCG@10 | 0.4906 | 0.4943 | 0.4916 | 0.5049 | 0.4970 | 0.5053 | 0.4956 | |
A-Beauty | HR@5 | 0.4885 | 0.5145 | 0.4986 | 0.5247 | 0.5309 | 0.5371 | 0.5344 |
HR@10 | 0.5702 | 0.5967 | 0.5817 | 0.6130 | 0.6148 | 0.6298 | 0.6157 | |
NDCG@5 | 0.4109 | 0.4354 | 0.4191 | 0.4337 | 0.4418 | 0.4451 | 0.4382 | |
NDCG@10 | 0.4361 | 0.4616 | 0.4453 | 0.4612 | 0.4676 | 0.4732 | 0.4648 | |
A-Music | HR@5 | 0.4992 | 0.5266 | 0.5626 | 0.6089 | 0.6024 | 0.5954 | 0.6156 |
HR@10 | 0.6683 | 0.6944 | 0.7163 | 0.7496 | 0.7456 | 0.7473 | 0.7560 | |
NDCG@5 | 0.3220 | 0.3396 | 0.3677 | 0.4088 | 0.4091 | 0.4012 | 0.4131 | |
NDCG@10 | 0.3773 | 0.3951 | 0.4198 | 0.4573 | 0.4574 | 0.4529 | 0.4609 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Wang, J.; Lee, J. BACF: Bayesian Attentional Collaborative Filtering. Appl. Sci. 2025, 15, 10402. https://doi.org/10.3390/app151910402
Wang J, Lee J. BACF: Bayesian Attentional Collaborative Filtering. Applied Sciences. 2025; 15(19):10402. https://doi.org/10.3390/app151910402
Chicago/Turabian StyleWang, Jaejun, and Jehyuk Lee. 2025. "BACF: Bayesian Attentional Collaborative Filtering" Applied Sciences 15, no. 19: 10402. https://doi.org/10.3390/app151910402
APA StyleWang, J., & Lee, J. (2025). BACF: Bayesian Attentional Collaborative Filtering. Applied Sciences, 15(19), 10402. https://doi.org/10.3390/app151910402