Python 中的生成式 AI 基礎
一份全面的指南,幫助您理解並實現生成式 AI 與大型語言模型(LLMs)。本課程涵蓋從理論基礎到基於 Python 的實務開發的過渡,包括 GAN、擴散模型、變壓器、微調以及生產環境部署。
課程總覽
📚 內容概要
一本全面介紹生成式人工智慧與大型語言模型(LLM)理解與實作的指南。本課程涵蓋從理論基礎到以 Python 為主的實際開發轉變,包括生成對抗網路(GAN)、擴散模型、變壓器(Transformer)、微調以及生產部署。
透過 Python 掌握現代 LLM 與生成技術的核心原理與實際應用。
作者: Carlos Rodriguez
致謝: 特別感謝作者的妻子 Jill、父母,以及技術審核者 Morgan Boyce、Eric Rui 與 Samira Shaikh(序言作者)。
🎯 學習目標
- 區分傳統(判別式)機器學習架構與生成式 AI 模型之間的差異。
- 辨識生成式 AI 的基礎架構,包含 GAN、擴散模型與變壓器。
- 解釋大型語言模型(LLM)在廣義人工智慧領域中的角色與演進。
- 区分 GAN、擴散模型與變壓器的獨特特性與架構範式。
- 分析每種模型類型的進展與限制,包括模式崩潰或採樣速度等特定問題。
- 實作 Stable Diffusion 流程並使用 CLIP 基於的邏輯值與機率評估生成輸出。
- 追溯自然語言處理(NLP)從早期計數方法與遞迴神經網路(RNN)到現代分佈表示與遷移學習的演進歷程。
- 解釋多頭注意力(MHA)、自我注意力、遮蔽(Masking)與前饋網路(FFN)的技術細節。
- 實作完整的變壓器模型架構,包含資料詞元化、位置編碼以及訓練/推論函數。
- 將原型功能(例如 Google Colab)映射至可生產環境,使用 Docker 與 VS Code。
課程 共 7 课时 · 预计 21.0h
課程
Lesson
This lesson explores the concept of the technological Singularity and the exponential growth of AI, while establishing the fundamental distinction between discriminative models that classify data and generative models that synthesize it. Students will learn to analyze the synergy between compute, data, and algorithmic efficiency, as well as the mathematical foundations of probabilistic modeling in high-dimensional spaces.
This lesson explores the three core pillars of generative AI—GANs, diffusion models, and transformers—by analyzing their unique mathematical strategies and architectural trade-offs. Students will learn to differentiate these models based on their training stability, computational efficiency, and specific applications in multimodal synthesis.
This lesson explores the evolution of Natural Language Processing from sparse, count-based methods like TF-IDF to dense, distributed vector representations and recurrent neural architectures. It examines the limitations of RNNs and LSTMs, such as the vanishing gradient problem and the Seq2Seq bottleneck, while establishing the mathematical foundations of the Transformer architecture and self-attention mechanisms.
AI030: Production Engineering and Responsible AI Deployment (Lesson 4) explores the transition from experimental prototyping in notebooks to robust, scalable production systems. Students will learn to implement CI/CD pipelines, ensure model reliability through automated testing, and integrate fairness monitoring to meet ethical and regulatory standards.
This lesson explores the spectrum of model adaptation, comparing the computational efficiency of In-Context Learning with the specialized performance and stability of Parameter-Efficient Fine-Tuning (PEFT) and full fine-tuning. Students will learn to navigate the trade-offs between hardware constraints and model alignment, with a focus on implementing techniques like LoRA to optimize performance in resource-limited environments.
This lesson explores the necessity of domain adaptation for general-purpose LLMs, focusing on techniques like continued pre-training and fine-tuning to align model knowledge with specialized fields. Students will learn to implement parameter-efficient methods like LoRA and develop evaluation frameworks to ensure linguistic accuracy in high-stakes professional environments.
This lesson explores the paradigm shift from resource-heavy model fine-tuning to efficient prompt-based inference and in-context learning. Students will learn to master advanced prompting techniques, such as persona-based conditioning and Chain-of-Thought, to optimize model performance and maintain factual consistency.