以作者查詢圖書館館藏 、以作者查詢臺灣博碩士 、以作者查詢全國書目 、勘誤回報 、線上人數:103 、訪客IP:3.147.48.240
姓名 成曄 查詢紙本館藏 畢業系所 資訊工程學系 論文名稱 校園知識庫型人工智慧助理 - 基於大語言模型與檢索增強生成
(Campus knowledge AI assistant - Based on Large Language Models with Retrieval-Augmented Generation)相關論文 檔案 [Endnote RIS 格式] [Bibtex 格式] [相關文章] [文章引用] [完整記錄] [館藏目錄] 至系統瀏覽論文 ( 永不開放) 摘要(中) 大語言模型爆發性成長的年代,我們躬逢其盛,人人皆能擁有一位全方位數位秘書的時代已然到來。相比過去任務導向式Task-Oriented Dialogue (TOD)聊天機器人,Large Language Models (LLM)可以有更全方位的對答能力與準確回答的特性。
本篇論文先以自然語言處理的歷史脈絡為切入點,了解其技術演進史,其後初探Transformer模型與Attention機制如何改進突破了過往自然語言處理(Natural Language Processing)技術所遭遇的瓶頸,兼以電腦計算能力的提升與巨量網路數據的容易取得,終究誕生了當今多數主流的許多大語言模型,將NLP領域推升到過去不曾想像過的高度。
本論文首重在開源的Meta Llama 3衍伸的Taide大語言模型,藉助其優異的能力作為我們Campus AI Assistant去實現撰寫文章、文章摘要以及深具特色的台灣地方文化背景知識問答能力等;引入了RAG技術框架,讓Campus AI Assistant能夠快速即時的具備相關校園知識的問答能力,而不需要對LLM進行技術門檻較高的微調作業。
本篇論文研究主要是以On-Premise概念建立自己的Campus AI Assistant,LangChain為開發框架、Ollama為LLM的管理平台,我們也使用開源的ChromaDB作為向量資料庫的儲存,選定taide/Llama3-TAIDE-LX-8B-Chat為我們的LLM,整合RAG框架讓Campus AI Assistant具備對於特定知識的訊息處理流程,並且自行爬蟲取得我們所需要的校園(以中央大學資料為例)相關資料,並進行資料預處理以呈現最佳的RAG檢索效果;最後使用Chainlit的WEB UI呈現我們的論文構想AI Assistant介面。
我們的實驗設計,不論是在撰寫文章、文章摘要、RAG檢索精準度等,均可見我們的論文框架有著顯著可信任的特定領域答題精準度,則證明此架構明確可用。摘要(英) We are witnessing the era of explosive growth in large language models, where everyone can now have a versatile digital assistant. Compared to the task-oriented dialogue (TOD) chatbots of the past, large language models (LLMs) offer more comprehensive conversational abilities and the characteristic of providing accurate responses.
This paper begins with the historical context of natural language processing to understand its technological evolution. It then explores how Transformer models and the Attention mechanism have overcome the limitations faced by previous natural language processing (NLP) technologies. Coupled with advancements in computing power and the easy availability of massive online data, these developments have ultimately led to the creation of many mainstream large language models today, elevating the field of NLP to unprecedented heights.
This paper focuses on the Taide large language model, derived from the open-source Meta Llama 3, leveraging its superior capabilities to implement our Campus AI Assistant for tasks such as article writing, summarization, and providing answers to questions about Taiwan′s local cultural background. By incorporating the RAG (Retrieval-Augmented Generation) framework, the Campus AI Assistant can quickly and efficiently provide relevant campus-related knowledge without the need for technically demanding fine-tuning of the LLM.
This paper primarily focuses on establishing our own Campus AI Assistant using the On-Premises concept. LangChain serves as the development framework, and Ollama is used as the LLM management platform. We also employ the open-source ChromaDB for vector database storage and select taide/Llama3-TAIDE-LX-8B-Chat as our LLM. By integrating the RAG framework, we enable the Campus AI Assistant to handle specific knowledge processing workflows. We also use web scraping to gather relevant campus data (using National Central University as an example) and perform data preprocessing to optimize RAG retrieval performance. Finally, we use Chainlit WEB UI to present our AI Assistant interface as conceived in this paper.
Our experimental design, whether in writing articles, article summaries, or the accuracy of RAG retrieval, clearly demonstrates that our paper framework has significantly trustworthy and domain-specific answer accuracy, thus proving that this framework is definitively usable.關鍵字(中) ★ 大語言模型
★ 檢索增強生辭
★ 提示詞工程
★ 聊天機器人關鍵字(英) ★ LLM
★ RAG
★ Prompt Engineering
★ Chat Bot論文目次 目錄
ABSTRACT ............................................................................................... 2
目錄 ............................................................................................................. 5
圖目錄 ......................................................................................................... 8
表目錄 ....................................................................................................... 11
第一章 緒論 ...................................................................................... 12
1.1 概要...................................................................................................... 12
1.2 研究動機.............................................................................................. 13
1.3 研究目的.............................................................................................. 14
1.4 論文架構.............................................................................................. 15
第二章 背景知識與文獻回顧 .......................................................... 16
2.1. 引言...................................................................................................... 16
2.2. 背景知識.............................................................................................. 16
2.2.1. 自然語言處理Natural Language Processing (NLP) .......................... 16
2.2.2. NLP Evolution Timeline ...................................................................... 16
2.2.3. 2017-2023 NLP技術的蓬勃發展 ....................................................... 18
2.2.4. 神經網路Transformer模型的演進史 ................................................ 19
2.2.5. Transformer vs Llama .......................................................................... 22
2.2.6. Llama 2 的訓練方法 ........................................................................... 24
2.2.7. LLM的能力 ........................................................................................ 24
2.2.8. Retrieval-Augmented Generation (RAG) ............................................ 25
2.2.9. AI Assistant and Chatbot ..................................................................... 27
2.3. 文獻回顧.............................................................................................. 29
2.3.1. 比較基於意圖 (TOD) 和基於LLM的系统 ...................................... 29
2.3.2. 對話系統與Microsoft LUIS ............................................................... 30
2.3.3. 客戶服務聊天機器人.......................................................................... 30
2.3.4. 大語言模型概述.................................................................................. 31
2.3.5. Google Gemeni概述 ........................................................................... 31
2.3.6. ChatGPT的技術應用和限制 .............................................................. 31
2.3.7. Prompt Engineering ............................................................................. 31
2.4. 小結...................................................................................................... 35
6
第三章 系統架構與設計 .................................................................. 39
3.1. 系統架構.............................................................................................. 39
3.2. 系統流程圖.......................................................................................... 47
3.2.1. Campus Knowledge AI Assistant - LLM Capabilities ......................... 48
3.2.2. Campus Knowledge AI Assistant – RAG Q&A .................................. 50
3.2.3. Conversation Recording對話紀錄儲存: .......................................... 57
3.3. 系統實施.............................................................................................. 59
3.3.1. Campus Knowledge AI Assistant - LLM Capabilities ......................... 59
3.3.2. Campus Knowledge AI Assistant - RAG Q&A .................................. 64
3.3.3. 聊天內容記錄...................................................................................... 73
第四章 實驗與討論 .......................................................................... 76
4.1. Scenario A: Different LLM Capabilities Comparison ......................... 78
4.1.1 Experiment 1 – Writing articles ........................................................... 79
4.1.2 Experiment 2 – Writing letters ............................................................. 82
4.1.3 Experiment 3 – Summarization ........................................................... 86
4.1.4 Experiment 4 – Translation .................................................................. 89
4.1.5 Experiment 5 – Taiwan culture ............................................................ 91
4.2. Scenario B: RAG (Retrieval-Augmented Generation) – Different Context Types .......................................................................................................... 94
4.2.6 Experiment 6 – Question Answering Accuracy in PDF Documents . 100
4.2.7 Experiment 7 – Question Answering Accuracy in EXCEL Documents 108
4.2.8 Experiment 8 – Question Answering Accuracy in WORD Documents 111
4.2.9 Experiment 9 – Question Answering Accuracy in TXT Documents . 113
4.3. Scenario C: RAG (Retrieval-Augmented Generation) – Comparison of Accuracy Between Preprocessed Data and Unpreprocessed Data ........................ 118
4.3.10 Experiment 10 – Question Answering Accuracy with Unpreprocessed Data 120
4.3.11 Experiment 11 – Question Answering Accuracy with Preprocessed Data 124
4.4. Supplement Experiment Scenario D: LLM Semantic Understanding Accuracy in RAG ................................................................................................... 130
4.5.12. Experiment 12 – Comparison with Taide and Qwen2 ....................... 132
4.5. Supplement Experiment Scenario E: Text Embedding Model Retrieval Accuracy in RAG ................................................................................................... 153
7
4.6.13. Experiment 13 – Comparison with Mxbai Text Embedding and Acge Text Embedding Model ...................................................................................... 155
4.6. Supplement Experiment Scenario F: Questionnaire Analysis..... 162
4.6.14. Experiment 14 – User experience ...................................................... 163
4.6.15. Experiment 15 – Accuracy ................................................................. 167
4.6.16. Experiment 16 – Satisfaction ............................................................. 170
第五章 結論與未來研究方向 ........................................................ 173
5.1. 結論.................................................................................................... 173
5.2. 研究限制............................................................................................ 174
5.3. 未來研究............................................................................................ 175
參考文獻 ................................................................................................. 176參考文獻 [1] Maxime Appé, “The Evolution of NLP (& How Dataiku Can Help)”, Accessed on: Jun 01, 2024. [Online]. https://blog.dataiku.com/nlp-metamorphosis
[2] Shervin Minaee, Tomas Mikolov, Narjes Nikzad, Meysam Chenaghlu Richard Socher, Xavier Amatriain, Jianfeng Gao, “Large Language Models: A Survey”, Feb. 2024
[3] Aritra Ghosh, “The Story of AI Evolution: Before ML Era to Transformers, GPT-3 and Beyond”, Accessed on: Jun 01, 2024. [Online]. https://www.linkedin.com/pulse/story-ai-evolution-before-ml-era-transformers-gpt-3-beyond-ghosh/
[4] Umar Jamil, “LLaMA explained: KV-Cache, Rotary Positional Embedding, RMS Norm, Grouped Query Attention, SwiGLU”, Accessed on: Jun 01, 2024. [Online]. https://github.com/hkproj/pytorch-llama-notes.
[5] Hugo Touvron, et al. “Llama 2: Open Foundation and Fine-Tuned Chat Models”, Jul. 2023
[6] J. Zhang et al., “Large Language Models: A Survey”, Apr. 2024.
[7] Yunfan Gaoa, Yun Xiongb, Xinyu Gaob, Kangxiang Jiab, Jinliu Panb, Yuxi Bic, Yi Daia, Jiawei Suna, Meng Wangc, and Haofen Wang a,c, “Retrieval-Augmented Generation for Large Language Models: A Survey”, Dec. 2023.
[8] Wenqi Fan et al., “A Survey on RAG Meeting LLMs:Towards Retrieval-Augmented Large Language Models”, Jun. 2024.
[9] Jelisaveta Sapardic, “Chatbot vs. AI Virtual Assistant: What Are the Differences? 2024”, Accessed on: Jun 01, 2024. [Online]. https://www.tidio.com/blog/chatbot-vs-virtual-assistant/
[10] S. KERNAN FREIRE,C. WANG,E. NIFORATOS, “Chatbots in Knowledge-Intensive Contexts: Comparing Intent and LLM-Based Systems”, Feb. 2024.
[11] M. Imtha Shafeeu et al., “Approaching Natural Conversation Chatbots by Interactive Dialogue Modelling & Microsoft LUIS”, pp. 1-6, Dec. 2019.
[12] A. Chaidrata et al., “Intent Matching based Customer Services Chatbot with Natural Language Understanding”, pp. 1-10, Oct. 2021
[13] Google AI, “Gemini: A Family of Highly Capable Multimodal Models”, Apr. 2024.
[14] D. K. Smith et al., “REVIEW Let’s Have a Chat! A Conversation with ChatGPT: Technology, Applications, and Limitations”, vol. 74, no. 1, pp. 102-123, Jun. 2023.
[15] Qingxiu Dong et al., “A Survey on In-context Learning”, Jun. 2023.
177
[16] Yongchao Zhou, Andrei Ioan Muresanu, Ziwen Han, Keiran Paster, Silviu Pitis, Harris Chan, Jimmy Ba, “Large Language Models Are Human-Level Prompt Engineers”, Mar. 2023.
[17] Cheng Li, Jindong Wang, Yixuan Zhang, Kaijie Zhu, Wenxin Hou, Jianxun Lian, Fang Luo, Qiang Yang, Xing Xie, “Large Language Models Understand and Can be Enhanced by Emotional Stimuli”, Nov. 2023.
[18] Sondos Mahmoud Bsharat et al.,“Principled Instructions Are All You Need for Questioning LLaMA-1/2, GPT-3.5/4”, Nov. 2023.
[19] ZIHAO YI et al., “A Survey on Recent Advances in LLM-Based Multi-turn Dialogue Systems”, Feb. 2024.
[20] “Chainlit Overview”, Accessed on: March 10, 2024. [Online]. https://docs.chainlit.io/get-started/overview
[21] “ChromaDB Vector Database: A guide on extending the knowledge of LLM models with RAG”, Accessed on: Mar 10. 2024. [Online]. https://amusatomisin65.medium.com/chromadb-vector-database-a-guide-on-extending-the-knowledge-of-llm-models-with-rag-4dedb26930f8
[22] “LangChain Introduction”, Accessed on: Mar 05. 2024. [Online]. https://python.langchain.com/v0.2/docs/introduction/
[23] “Build a Retrieval Augmented Generation (RAG) App”, Accessed on: Jun 17, 2024. [Online]. https://python.langchain.com/v0.2/docs/tutorials/rag/
[24] “Q&A with RAG”, Accessed on Jul 02, 2024. [Online]. https://python.langchain.com/v0.1/docs/use_cases/question_answering/
[25] Sakil Ansari, “Unleashing the Power of Sentence Transformers: Revolutionising Semantic Search and Sentence Similarity”, Accessed on: Mar 05. 2024. [Online]. https://python.langchain.com/v0.2/docs/introduction/
[26] Lianmin Zheng et al., “Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena”, Dec. 2023.
[27] Charles Koutcheme et al., “Open Source Language Models Can Provide Feedback: Evaluating LLMs’ Ability to Help Students Using GPT-4-As-A-Judge”, May. 2024.
[28] Anna Bavaresco et al., “LLMs instead of Human Judges? A Large Scale Empirical Study across 20 NLP Evaluation Tasks”, Jun. 2024.
[29] Shi-Qi Yan et al., “Corrective Retrieval Augmented Generation”, Feb. 2024.
[30] Akari Asai et al., “Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflection”, Oct. 2023.
[31] Darren Edge et al., “From Local to Global: A Graph RAG Approach to Query-Focused Summarization”, Apr. 2024.指導教授 周立德(Li-Der Chou) 審核日期 2024-8-20 推文 facebook plurk twitter funp google live udn HD myshare reddit netvibes friend youpush delicious baidu 網路書籤 Google bookmarks del.icio.us hemidemi myshare