跳到主要內容

簡易檢索 / 詳目顯示

研究生: 陳鴻文
Chen, Hung-Wen
論文名稱: 利用合成文本提升電影推薦系統的效能:RAG框架的實證分析
Enhancing Movie Recommendation Systems with Synthetic Texts: An Empirical Study Using the RAG Framework
指導教授: 蔡炎龍
Tsai, Yen-Lung
口試委員: 陳天進
張宜武
學位類別: 碩士
Master
系所名稱: 理學院 - 應用數學系
Department of Mathematical Sciences
論文出版年: 2025
畢業學年度: 113
語文別: 英文
論文頁數: 42
中文關鍵詞: 檢索增強生成大型語言模型電影推薦系統合成文本語意檢索生成
外文關鍵詞: Movie recommendation system, Synthetic text, Semantic retrieval generation
相關次數: 點閱:275下載:0
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 本研究旨在開發一套能夠理解使用者口語化觀影偏好並以同樣自然語言回應建議的電影推薦系統。鑑於大型語言模型(LLM)在根據網路資料上訓練時所產生的不穩定性或幻覺等問題,本文引入檢索增強生成(Retrieval-Augmented Generation, RAG)機制以提升推薦內容的準確性與穩定性。首先,RAG 透過向量檢索自有電影資料庫,確保所擷取之上下文資訊正確無誤;接著,將檢索結果與使用者查詢一併輸入 LLM,藉由大規模語言模型生成語義豐富且具語境連貫性的推薦建議,兼顧正確性與對話自然度。
    系統同時整合外部電影資料庫,透過 RAG 即時加入新上映電影,以提升推薦準確度;並將結構化資料轉換為非結構化文本,在統一框架中結合向量檢索與生成模型進行處理。此外,我們設計實驗生成並評估 LLM 產生的合成文本,以增強電影概述的敘事深度、連貫性與說服力。為克服中文資料較少之問題,模型透過使用英文資料,產出英文以及中文兩種推薦,以驗證在英文資料基礎上之中文推薦的可行性以及準確性,。最後,本框架結合 LLM 的語意理解能力與 RAG 的精確檢索機制,能從自由描述的查詢中自動推斷使用者偏好,並提供個性化建議,為未來對話式推薦系統之研究與應用提供實務可行之實證。


    This study proposes a movie recommendation system that interprets users’ colloquial viewing preferences and responds with natural-language suggestions. To address the instability and hallucination issues common in large language models (LLMs) trained on heterogeneous data, we adopt a Retrieval-Augmented Generation (RAG) framework. The system first retrieves relevant context from a self-constructed movie database via vector search, then combines the results with user queries to generate coherent and factually grounded recommendations.
    To enhance relevance, external movie databases are integrated, enabling dynamic updates with newly released films. Structured metadata is converted into unstructured text, allowing both retrieval and generation to operate within a unified text-based pipeline. We further evaluate the LLM’s ability to generate synthetic overviews with improved narrative quality. To mitigate the lack of Chinese-language data, English resources are leveraged to generate recommendations in both English and Chinese, demonstrating cross-lingual transferability. By combining the semantic understanding of LLMs with RAG’s precision, the system infers user intent from free-form input and delivers personalized, context-aware suggestions, providing a robust foundation for future conversational recommender systems.

    致謝 ii
    中文摘要 iii
    Abstract iv
    Contents v
    List of Figures vii
    1 Introduction 1
    2 Related Work 3
    2.1 2.2 2.3 Traditional Recommendation Systems 3
    Large Language Models in Recommendation 4
    Retrieval-Augmented Generation (RAG) 4
    3 Large Language Model (LLM) 5
    3.1 Transformer 6
    3.2 Attention 7
    3.2.1 Scaled Dot-Product Attention 8
    3.2.2 Multi-Head Attention 9
    3.3 Positional Encoding 9
    3.4 Encoder and Decoder 10
    3.5 Residual Blocks 11
    3.6 Normalization 14
    4 Retrieval-Augmented Generation(RAG) 16
    4.1 Retrieval 16
    4.2 Generator 17
    4.3 RAG Model 17
    5 Experiments 19
    5.1 Data Preparation 19
    5.1.1 Data Sources 19
    5.1.2 Data Cleaning 26
    5.1.3 Synthetic Text Augmentation 26
    5.1.4 Vectorization and Index Construction 26
    5.2 Model Overview 27
    5.2.1 Embedding Model 27
    5.2.2 Generation Model 27
    5.2.3 Tools and Frameworks: LangChain & FAISS 28
    5.3 Methodological Process 28
    5.3.1 Experimental Objectives 28
    5.3.2 Process Overview 28
    5.3.3 Process Details 29
    5.4 Results & Discussion 30
    5.4.1 Narrative Richness and Contextual Guidance 30
    5.4.2 Diversity of Recommendation Outcomes 32
    5.4.3 Diversity of Recommendation Outcomes 34
    6 Conclusion 38
    Bibliography 40

    [1] Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer normalization. In Proceedings of the NIPS 2016 Deep Learning Symposium, 2016.
    [2] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Proceedings of the International Conference on Learning Representations (ICLR), 2015.
    [3] Y. Bengio, P. Simard, and P. Frasconi. Learning long-term dependencies with gradient descent is difficult. IEEE Transactions on Neural Networks, 5(2):157–166, 1994.
    [4] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few- shot learners. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 1877–1901. Curran Associates, Inc., 2020.
    [5] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Jill Burstein, Christy Doran, and Thamar Solorio, editors, Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. 40
    [6] Shijie Geng, Shuchang Liu, Zuohui Fu, Yingqiang Ge, and Yongfeng Zhang.
    Recommendation as language processing (rlp): A unified pretrain, personalized prompt & predict paradigm (p5). In Proceedings of the 16th ACM Conference on Recommender Systems (RecSys’ 22), pages 299–315, 2022.
    [7] Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang.
    Realm: Retrieval-augmented language model pre-training. In Proceedings of the 37th International Conference on Machine Learning (ICML), volume 119 of PMLR, pages 3929–3938, 2020.
    [8] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR ’16, pages 770–778. IEEE, June 2016.
    [9] Sepp Hochreiter, Yoshua Bengio, Paolo Frasconi, and Jürgen Schmidhuber. Gradient flow in recurrent nets: The difficulty of learning long-term dependencies. In John F. Kolen and Stefan C. Kremer, editors, A Field Guide to Dynamical Recurrent Neural Networks, pages 237–243. IEEE Press, Piscataway, NJ, 2001.
    [10] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the 32nd International Conference on Machine Learning (ICML), volume 37 of JMLR: Workshop and Conference Proceedings, pages 448–456, 2015.
    [11] Yehuda Koren, Robert Bell, and Chris Volinsky. Matrix factorization techniques for recommender systems. Computer, 42(8):30–37, Aug 2009.
    [12] Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel, and Douwe Kiela. Retrieval-augmented generation for knowledge-intensive nlp tasks. In Advances in Neural Information Processing Systems, Vol. 33, pages 9459–9474, 2020.
    [13] Pasquale Lops, Marco De Gemmis, and Giovanni Semeraro. Content-based recommender systems: State of the art and trends. In Francesco Ricci, Lior Rokach, and Bracha Shapira, editors, Recommender Systems Handbook, pages 73–105. Springer US, 2011. 41
    [14] Michael J. Pazzani and Daniel Billsus. Content-based recommendation systems. In Peter Brusilovsky, Alfred Kobsa, and Wolfgang Nejdl, editors, The Adaptive Web: Methods and Strategies of Web Personalization, pages 325–341. Springer Berlin Heidelberg, 2007.
    [15] Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 464–468, New Orleans, Louisiana, 2018. Association for Computational Linguistics.
    [16] Jianlin Su, Yu Lu, Shengfeng Pan, Ahmed Murtadha, Bo Wen, and Yunfeng Liu. Roformer: Enhanced transformer with rotary position embedding. Neurocomputing, 568:127063, 2023.
    [17] Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In Zoubin Ghahramani, Max Welling, Corinna Cortes, Neil D. Lawrence, and Kilian Q. Weinberger, editors, Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pages 3104–3112, 2014.
    [18] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems 30, pages 5998–6008, 2017.
    [19] Lingzhi Wang, Huang Hu, Lei Sha, Can Xu, Kam-Fai Wong, and Daxin Jiang. Recindial: A unified framework for conversational recommendation with pretrained language models. In Proceedings of the 16th ACM Conference on Recommender Systems (RecSys’ 22), pages 299–307, 2022.
    [20] Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, Ed H. Chi, Tatsunori Hashimoto, Oriol Vinyals, Percy Liang, Jeff Dean, and William Fedus. Emergent abilities of large language models. Transactions on Machine Learning Research, 2022-1:1– 48, 2022.

    無法下載圖示 全文公開日期 2030/07/08
    QR CODE
    :::