Applied Generative AI for Beginners: Practical Knowledge on Diffusion Models, ChatGPT, and Other LLMs [1 ed.] 1484299930, 9781484299937, 9781484299944

This book provides a deep dive into the world of generative AI, covering everything from the basics of neural networks t

166 98

English Pages xvi, 212 Year 2023

Report DMCA / Copyright

DOWNLOAD FILE

Applied Generative AI for Beginners: Practical Knowledge on Diffusion Models, ChatGPT, and Other LLMs [1 ed.]
 1484299930, 9781484299937, 9781484299944

  • Commentary
  • Publisher ePUB | Published: 22 November 2023

Table of contents :
Table of Contents
About the Authors
About the Technical Reviewer
Introduction
Chapter 1: Introduction to Generative AI
So, What Is Generative AI?
Components of AI
Domains of Generative AI
Text Generation
Image Generation
Audio Generation
Video Generation
Generating Images
Generating Text
Generative AI: Current Players and Their Models
Generative AI Applications
Conclusion
Chapter 2: Evolution of Neural Networks to Large Language Models
Natural Language Processing
Tokenization
N-grams
Language Representation and Embeddings
Word2Vec
GloVe (Global Vectors for Word Representation)
Probabilistic Models
Neural Network–Based Language Models
Recurrent Neural Networks (RNNs)
Long Short-Term Memory (LSTM)
Gated Recurrent Unit (GRU)
Encoder-Decoder Networks
Sequence-to-Sequence Models
Encoder
Decoder
Attention Mechanism
Training Sequence-to-Sequence Models
Challenges of Sequence-to-Sequence Models
Transformer
Large Language Models (LLMs)
Conclusion
Chapter 3: LLMs and Transformers
The Power of Language Models
Transformer Architecture
Motivation for Transformer
Architecture
Encoder-Decoder Architecture
Encoder
Decoder
Attention
Inputs
Calculating Attention Scores
Calculating Attention Weights
Weighted Sum
Scaled Dot-Product Attention
Input and Matrices
Dot Product and Scaling
Softmax and Attention Weights
Matrix Formulation and Efficiency
Multi-Head Attention
Input and Linear Projections
Multiple Attention Heads
Scaled Dot-Product Attention per Head
Concatenation and Linear Projection
Model’s Flexibility
Position-wise Feed-Forward Networks
Position Encoding
Interpretation
Advantages and Limitations of Transformer Architecture
Advantages
Limitations
Conclusion
Chapter 4: The ChatGPT Architecture: An In-Depth Exploration of OpenAI’s Conversational Language Model
The Evolution of GPT Models
The Transformer Architecture: A Recap
Architecture of ChatGPT
Pre-training and Fine-Tuning in ChatGPT
Pre-training: Learning Language Patterns
Fine-Tuning: Adapting to Specific Tasks
Continuous Learning and Iterative Improvement
Contextual Embeddings in ChatGPT
Response Generation in ChatGPT
Handling Biases and Ethical Considerations
Addressing Biases in Language Models
OpenAI’s Efforts to Mitigate Biases
Strengths and Limitations
Strengths of ChatGPT
Limitations of ChatGPT
Conclusion
Chapter 5: Google Bard and Beyond
The Transformer Architecture
Elevating Transformer: The Genius of Google Bard
Google Bard’s Text and Code Fusion
Self-Supervised Learning
Strengths and Weaknesses of Google Bard
Strengths
Weaknesses
Difference Between ChatGPT and Google Bard
Claude 2
Key Features of Claude 2
Comparing Claude 2 to Other AI Chatbots
The Human-Centered Design Philosophy of Claude
Exploring Claude’s AI Conversation Proficiencies
Constitutional AI
Claude 2 vs. GPT 3.5
Other Large Language Models
Falcon AI
LLaMa 2
Dolly 2
Conclusion
Chapter 6: Implement LLMs Using Sklearn
Install Scikit-LLM and Setup
Obtain an OpenAI API Key
Zero-Shot GPTClassifier
What If You Find Yourself Without Labeled Data?
Multilabel Zero-Shot Text Classification
Implementation
What If You Find Yourself Without Labeled Data?
Implementation
Text Vectorization
Implementation
Text Summarization
Implementation
Conclusion
Chapter 7: LLMs for Enterprise and LLMOps
Private Generalized LLM API
Design Strategy to Enable LLMs for Enterprise: In-Context Learning
Data Preprocessing/Embedding
Prompt Construction/Retrieval
Fine-Tuning
Technology Stack
Gen AI/LLM Testbed
Data Sources
Data Processing
Leveraging Embeddings for Enterprise LLMs
Vector Databases: Accelerating Enterprise LLMs with Semantic Search
LLM APIs: Empowering Enterprise Language Capabilities
LLMOps
What Is LLMOps?
Why LLMOps?
What Is an LLMOps Platform?
Technology Components LLMOps
Monitoring Generative AI Models
Proprietary Generative AI Models
Open Source Models with Permissive Licenses
Playground for Model Selection
Evaluation Metrics
Validating LLM Outputs
Challenges Faced When Deploying LLMs
Implementation
Using the OpenAI API with Python
Using the OpenAI API with Python
Prerequisites
Installation
Initializing the Environment and Setting API Key
Test the Environment
Data Preparation: Loading PDF Data
Embeddings and VectorDB Using LangChain and Chroma
Utilizing OpenAI API
Leveraging Azure OpenAI Service
Conclusion
Chapter 8: Diffusion Model and Generative AI for Images
Variational Autoencoders (VAEs)
Generative Adversarial Networks (GANs)
Diffusion Models
Types of Diffusion Models
Architecture
The Technology Behind DALL-E 2
Top Part: CLIP Training Process
Bottom Part: Text-to-Image Generation Process
The Technology Behind Stable Diffusion
Latent Diffusion Model (LDM)
Benefits and Significance
The Technology Behind Midjourney
Generative Adversarial Networks (GANs)
Text-to-Image Synthesis with GANs
Conditional GANs
Training Process
Loss Functions and Optimization
Attention Mechanisms
Data Augmentation and Preprocessing
Benefits and Applications
Comparison Between DALL-E 2, Stable Diffusion, and Midjourney
Applications
Conclusion
Chapter 9: ChatGPT Use Cases
Business and Customer Service
Content Creation and Marketing
Software Development and Tech Support
Data Entry and Analysis
Healthcare and Medical Information
Market Research and Analysis
Creative Writing and Storytelling
Education and Learning
Legal and Compliance
HR and Recruitment
Personal Assistant and Productivity
Examples
Conclusion
Index

Polecaj historie