AWS BEDROCK Flashcards
what is aws bedrock?
one of the fastest growing AI services, genAI Foundation Models are used to create new data by training on a wide variety of input data
bedrock makes a copy of the FM you choose, which you then fine-tune with your own data
it’s fully-managed by aws, with a pay-per-use pricing model, unified APIs, with out of the box features like RAG and LLM Agents
what are LLMs?
Large Language Models are designed to generate coherent human-like text, their output is NON-DETERMINISTIC
what are diffusion models?
genAI, create images or data by transforming noise into the desired output (reversing the diffusion proccess)
what are multimodal models?
models that accept various types of inputs AND outputs such as text, images, audio or video
what is amazon titan?
high performing aws foundation model
multimodal choices via a fully-managed API, customizable with your own data, 8k tokens, +100 languages
content creation, classification, education
what is fine-tuning in the aws bedrock?
adapting a copy of a FM with your data, fine-tuning changes the weight of the base FM
data must adhere to a specific format and be stored in aws S3
you must use “provisioned throughput” as the pricing model for a fine-tuned FM as oposed to on-demand pricing for non fine-tuned FMs
what is instructions-based fine tuning?
improving the performance of the FM on domain specific tasks with labeled examples called PROMPT RESPONSE PAIRS
there is also single-turn and multi-turn messaging for chatbots, giving hints into the interaction between a user and an assistant (bot)
what is continued pre-training?
since we know FMs have been trained with unlabelled data, we provide more unlabeled data
only input, no output
what is domain-adaptation fine-tuning?
to make a model an expert in a specific domain, good technique for feeding industry-specific terminology
as more data becomes available the model can be continually trained, only input no output
what is transfer learning?
using pre-trained model to adapt it to a new task, it’s widely used for image classification and for NLP models (chatGPT)
fine-tuning is a specific kind of transfer learning
what are the built-in task types for automatic evaluation in aws bedrock and how does it work?
text summarization
question and answer
text classification
open-ended text generation
you bring your own prompt dataset or use built-in curated datasets, scores are calculared automatically, the generated answers are compared between FM using a genAI model called judge model
what are benchmark datasets?
curated collection of data designed specifically for evaluating the performance of a language model
very quick, very low administrative effort to evaluate your models for potential bias, you can also create your own
there are also human evaluations, which are the same with the benchmark answers and questions but compared by humans
what are the automatic metrics to evaluate a FM?
ROUGE (Recall-Oriented Understudy for Gisting Evaluation): for automatic summarization and language translation systems
ROUGE-N: measures matching n-grams between reference and generated text
ROUGE-L: computes longest common subsequence between reference and generated text
F1 Score for BINARY CLASSIFICATION (spam vs. not spam) of UNBALANCED DATASETS
ACCURACY gor BINARY CLASSIFICATION OF BALANCED DATASETS
BLEU (Bilingual Evaluation Understudy): evaluates the quality of generated text, specially for translation; penalizes too much brevity
BERTScore (Bidirectional Encoder Representations from Transformers): for SEMANTIC SIMILARITY, compares embeddings
Perplexity: how well the model will predict the next token, meaning that if a model is very confident about the next token it will be less perplexed
what is RAG?
Retrieval Augmented Generation allows the FM to reference a data source outside of its training data without being fine-tuned
knowledge bases are built and managed by aws bedrock with a data source (like your S3 bucket), and when a user needs information from there it will be searched (retrieved if you will)
knowledge bases are backed by vector databases, which bedrock populates by creating vector embeddings, which enable the searches
RAG is used when real-time data is needed to be fed into the FM
what are RAG vector databases?
aws opensearch service - built to handle search and analytics workloads
aws aurora - online transaction processing workloads
as well as others like mongodb, redis, pinecone
if you don’t specify it aws is going to create an opensearch service serverless database