《Research Triangle AI:大語言模型入門(25頁).pdf》由會員分享,可在線閱讀,更多相關《Research Triangle AI:大語言模型入門(25頁).pdf(25頁珍藏版)》請在三個皮匠報告上搜索。
1、大語言模型入門Getting Started with Large Language ModelsA Beginners Guide and Live DemoPresented by Yi LiResearch Triangle AI2024-09-21議程概述 Agenda引言與自我介紹 Introduction理解大語言模型 Understanding LLM實際應用 Practical Applications演示:在Google Colab上部署Llama 3.1Demo:Deploying Llama 3.1 on Google Colab倫理考量與LLM的未來 Ethical C
2、onsiderations and Future of LLMs總結與問答 Summary and Q&A啥是大語言模型 What is Large Language Model(LLM)大語言模型(Large Language Model,LLM)通過大量文本數據訓練的一種人工智能模型專門用于理解、生成和處理自然語言訓練數據LLM輸入中國的首都是?輸出中國的首都是北京如何理解大語言模型 大規模大量參數的AI模型大量文本數據訓練Common Crawl網絡爬蟲公開數據集WebText2 Reddit論壇網頁文本Books1,Books2互聯網書籍語料庫Wikipedia 維基百科知識庫GPT4
3、(not official)1.8T parameters 120 layers 13T tokens如何理解大語言模型大規模大量參數的AI模型大量文本數據訓練 語言基于自然語言處理(Nature Language Processing/NLP)能夠理解、生成和處理人類語言如何理解大語言模型大規模大量參數的AI模型大量文本數據訓練語言基于自然語言處理(Nature Language Processing/NLP)能夠理解、生成和處理人類語言 模型模擬語言規則和模式的數學框架訓練的模型可以預測語言中的下一個詞或者句子LLM的簡史與演變早期發展早期的NLP主要依賴于規則系統和基本的統計模型神經網絡
4、的引入極大地改變了NLP領域LLM的崛起:Attention is all you need(2017)2022年11月30日 ChatGPT發布常見的大語言模型OpenAI ChatGPT/o1Google GeminiMeta LlamaAnthropic ClaudeMistral Mistral/Mixtral百度 文心一言阿里云 通義千問華為 盤古騰訊 混元科大訊飛 星火零一萬物 Yi 大模型是如何煉成的 How LLM is TrainedStep 1:Pre-training(unsupervised)Base LLM 文字接龍機Step 2:Supervised Fine-tu
5、ning(SFT)Instruct LLM 初級客服Step 3:Reinforcement Learning from Human Feedback(RLHF)Chat LLM 專業顧問大語言模型如何工作中國的首都是LLM北京TokenizationEmbeddingAttentionFeed ForwardOutput文字轉成 token理解 語義/位置考慮 上(下)文綜合思考輸出Transformer反復思考RAG/PAL/ReAct借助外部數據/工具中國的首都是人要是行,干一行,行一行。一行行,行行行;要是不行,干一行,不行一行。一行不行,行行不行。大語言模型和AI/ChatGPT的關
6、系LLM 是基礎技術 ChatGPT是LLM技術的一種應用實現實際應用 Practical Applications內容生成 Content Generation知識庫問答 Knowledge Base Answering文本分類 Text Classification情感分析 Sentiment Analysis搜索 Search計算機安全 Cybersecurity為什么要部署自己的大語言模型數據隱私和安全 Data Privacy and Security無需依賴互聯網連接 Independence from Internet Connectivity降低運營成本 Reduced Ope
7、rational Costs更高的模型靈活性與控制 Greater Flexibility and Control部署需求Google Colab Runtime(GPU type)Ollama server/daemonCommand Line(CLI)Python LibraryGUIgradioGoogle Colab(google account)可用 free tier,with usage limits基于 Jupyter NotebookLLaMA 3.1開源大模型(by Meta)2024年4月發布多種模型95%的訓練數據是英文OllamaLLM 管理平臺開源部署步驟環境設置打
8、開Google Colab選擇有GPU的runtime安裝Ollama下載并運行Llama 3.1模型與模型交互Google Colab Runtime(GPU type)Ollama server/daemonCommand Line(CLI)Python LibraryGUIgradio演示:在演示:在Google Colab上部署上部署Llama 3.1Demo:Deploying Llama 3.1 on Google ColabColab Notebook 鏈接下一步硬件條件允許可以嘗試 本地部署與ngrok結合 隨時訪問自己的大模型Fine tune 擁有了解自己的大模型API 調
9、用,與其它應用結合Google Colab Runtime(GPU type)Ollama server/daemonCommand Line(CLI)Python LibraryGUIgradioGUI in remoteGPT4AllLM StudioOpen-WebUIngrokLLM的未來趨勢模型規模與計算能力的提升多模態模型的發展邏輯推理 openai o1(self replay RL)自主模型(autonomous models)更高效的微調與個性化及深入與人類的協作減少模型偏見與提高模型透明度倫理與法規的發展倫理考量數據隱私 Ethical and Privacy Concer
10、ns誤導信息與虛假內容 Misinformation and False Content偏見與歧視 Biases and Fairness Problems對工作崗位的影響 Jobs/Society Impact責任歸屬與道德困境 Accountability and Ethical Dilemmas環境問題 Energy Consumption and Carbon Footprints總結LLM 的基礎知識Llama 3.1 在 Google Colab 上的部署過程LLM 的倫理問題和未來趨勢深入了解學習Large language models,explained with a min
11、imum of math and jargonThe Practical Guides for Large Language ModelsHugging Face-NLP CourseDeepLearning.ai參考資料Introduction to Large Language ModelsLLM Training-A Simple 3-Step Guide You Wont Find Anywhere Else!Run Llama 3.1 8B with Ollama on Free Google ColabAI大語言模型科普課圖片來源LLM與AI關系/LLM如何煉成的https:/ 各行應用 https:/ https:/arxiv.org/pdf/2005.14165v4GPT4 https:/the-