1.1
ML
Structured Data:
- Tabular Data - data stored in spreadsheets, databases, and csv's
- Time Series Data - Data measured with successive points like stocks or sensor readings
Unstructured Data: - Text and image data
Learning Types
- Supervised - trained on labeled data, see if mapping function can predict the output for new unseen data
- Unsupervised - From unlabeled data, goal is to discover inherent relationships and patterns
- Reinforcement - Give a performance score, feedback is given with rewards and penalties
Inferencing
- Batch - Analyzes all data at once - used for data analysis. More accuracy less speed
- Real-time - Used for chatbots, self driving cars.
Deep learning
Inspired bu the structure of the human brain. Uses neural networks which mimic how the brain functions.
Neural Networks
- Contain layers of nodes connected to one another. Contains an input layer, various hidden layers, and then an output layer
- Computer Vision: uses deep learning to interpret images
- Natural Language Processing (NLP): Allows for interaction between computers and human language. (Text classification, sentiment analysis, machine translation, and language generation)
Generative AI
By throwing money and an insane amount of compute and data at ML, we were able to create foundation models (FMs). Instead of making specialized MLs per task, we are able to make a more general model that can perform multiple tasks. These FMs can also become specialized
- Created with unlabeled data as that allows for significantly more input
- These models are pre-trained through self-supervised learning. Created in a way that the "ground truth" can be inferred rather than confirmed by looking at underlying similarities.
- Optimized through techniques: Prompt engineering, retrival augmented generation (RAG), and fine-tuning for specific tasks.
- Evaluation: Performance needs to be measured on how it works against actual tasks
- Deployment: Set it free in an API or chatbot or whatever
- Iteration
Types of FMs - LLMs: Large language models are often transformer based architecture. They use tokens to split up natural language and then create embeddings and vectors. Embeddings are just a number attached to the idea while the vector is like a location in relation to everything else. This allows for similar ideas to be more closely aligned
- Diffusion models: Work off of pure noise or randomness and then become more meaningful.
- Mutlimodal models: Can process and generate multiple modes of data at once. Good for multiple media uses like closed captions and keeping the image and text aligned
- Generative adverarial networks (GANs): involves two neural networks competing against each other. One generates new data and the other tries to assert whether that is real or generated data
- Variational Autoencoders (VAEs): Encodes and decodes data by compressing to smallest possible size then enlarging.
Optimization
Prompt Engineering
- Easiest and lowest cost method.
- Instructions: Provides description on what it should do
- Context: external info to guide model
- input data: input
Fine Tuning - Taking a pre-trained model and adding specific small data-sets to better align to its purpose
- Instruction fine-tuning: Uses examples of what outputs should look like
- Reinforcement learning from human feedback (RLHF): uses human feedback to better align
RAG: - Like a mix of the two. Doesn't change underlying weights, just grabs a better context and then adds that to the prompt
AWS AI/ML Stack
ML Frameworks
- SageMaker - Used to build and train FMs
AI/ML Services - Various services for search, speech, chat, text documentation, and CV
GenAI - SageMaker JumpStart - Most common, easily deployed
- Bedrock - Use AI through an API
- Q and Q develeper