Domain 3: Application of Foundation Models 28% Flashcards

1
Q

What’s the goal with Gen AI?

A

To architect an efficient scalable solution that does not reduce model performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Cost, latency constraints, and required modalities

A

considerations for apps that use FMs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Understanding the requirements for your use case in terms of _____ is important when deciding on AI model.

A

inference speed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Cost

A

find the balance between training time, cost, and model performance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Latency

A

Consider real-time results requirements, inference times

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

_____ is the duration it takes a model to process data and produce a prediction.

A

Inference speed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Modalities

A

specific embedding, multi-model, multilingual, pre-trained (architecture/complexity)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Accuracy, precision, recall, F1 score, root mean squared error or RMSE, mean average precision or MAP, and mean absolute error, MAE.

A

standard metrics to evaluate and compare different models

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

It’s important when you are choosing an appropriate metric or set of metrics to _____ before selecting a model.

A

assess your model’s performance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Framework, language, environment, license, documentation, whether the model has been updated and maintained regularly, known issues or limitations, customization, and explainability.

A

Compatibilities should you consider when using a pre-trained model online

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

flexible, modular, transparent, provide tools or methods to visualize or interpret their inner workings, interpret and explain model outcomes

A

What to look for when considering a pre-trained model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

T/F: Foundation models are not interpretable by design because they are extremely complex.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

_____ attempts to explain the black box nature of FMs, by approximating it locally with a simpler model that is interpretable.

A

Explainability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

T/F: If interpretability is a requirement, then pre-trained foundation models might not be the best choice.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

T/F: Linear regression and decision trees might be better when it comes to explainability.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The complexity of a model is important and can help you uncover intricate patterns within the data, but it can add challenges to _____ and _____.

A

maintenance and interpretability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

T/F: Greater complexity might lead to enhanced performance, but can increase costs.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

T/F: The more complicated the model is, the harder it is to explain the outputs of the model.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

The _____ is where you process new data through the model to make predictions. It is the process of generating an output from an input that you provided to model.

A

inference

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

_____ gives you the ability to run inference in the foundation model you choose.

A

Amazon Bedrock

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

A _____, which is an input, is provided to the model for it to generate a response.

A

prompt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

_____ are a set of values that can be adjusted to limit or influence the model response.

A

inference parameters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What kind of models can you run inference with?

A

base, custom, and provision to test FM responses

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Amazon Bedrock foundation models support the inference parameters of _____ to control randomness and diversity in the response.

A

temperature, Top K, Top P

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What parameters are supported by Bedrock to limit the length of responses

A

response length, penalties, and stop sequences

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

These inputs guide LLMS to generate an appropriate response or output for a given task or instruction.

A

Prompts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

You can integrate additional domain-specific data from these data stores or vector data stores that add to your prompts semantically relevant inputs.

A

retrieval augmented generation, RAG

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

A _____ is a collection of data that is stored as mathematical representations.

A

vector database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

It requires millions of graphic processing units, GPUs, compute hours, terabytes and petabytes of data, trillions of tokens, trial and error, and time; generative AI models learn its capabilities.

A

pre-training

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

_____ add additional capabilities for efficient and fast lookup, and to provide data management, fault tolerance, authentication, access control, and query engine.

A

Vector databases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

_____ enhances language models to retrieve and use external knowledge during the generation process. It is a technique in which the retrieval of information from data sources augments the generation of model responses.

A

RAG

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

RAG combines two components, a _____ component, which searches through a knowledge base and a _____ component, which produces outputs based on the retrieved information.

A

retriever / generator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Why does RAG combine two components?

A

helps the model access up-to-date and domain-specific knowledge beyond their training data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

Prompt is passed into the query encoder, which encodes or embeds the data into the same format as the external data. Then the embedding can be passed to the vector database to search and return similar embeddings that have been through the model. Those embeddings are then attached to my new query and can also be mapped back to their original location. If the vector database finds similar data, then the retriever retrieves that data, the LLM combines or augments the new data or text with the original prompt, then the prompt is sent to the LLM to return a completion.

A

How to use a vector database in the real world

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

How does RAG solve hallucinations?

A

By complimenting generative LLMs with an external knowledge base that is typically built using a vector database, hydrated with vector-coded knowledge articles

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

Amazon OpenSearch Service, Amazon Aurora, Redis, Amazon Neptune, Amazon DocumentDB with MongoDB compatibility, and Amazon RDS with PostgreSQL

A

AWS services that help store embeddings within vector databases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

The _____ delivers low-latency search and aggregations, dashboards, visualization, and dashboarding tools. It also has plugins that provide advanced capabilities such as alerting, fine-grained access control, observability, security monitoring and vector storage and processing. With this service’s vector database capabilities, you can implement semantic search, retrieval of augmented generation, RAG with LLMs, recommendation engines, and search media too.

A

OpenSearch search engine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

With _____ you can securely connect foundation models, FMs, to your company data. It is stored as embeddings in the vector engine for more relevant, context-specific, and accurate responses without continuously re-training the FM. Amazon RDS for PostgreSQL also supports the pgvector extension to store embeddings and perform efficient searches.

A

a fully managed RAG offered by knowledge bases for Amazon Bedrock

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q
  1. A fully managed AI capability from AWS to help you build applications foundation models.
  2. Can automatically break down tasks and generate the required orchestration logic or write custom code, and they can securely connect to your databases through APIs.
  3. They can ingest and structure the data for machine consumption and augment it with contextual details to produce more accurate responses and fulfill requests.
  4. They are an additional piece of software that orchestrates the prompt completion workflows and interactions between the user requests, foundation model, and external data sources or applications.
  5. They automatically call APIs to take actions and invoke knowledge bases to supplement information for these actions.
A

Agents for Amazon Bedrock

40
Q

_____ are a specific set of inputs provided by you the user. They guide LLMs to generate an appropriate response or output for a given task or instruction.

A

Prompts

41
Q

A _____ contains components that you want the LLM to perform such as the task or instruction. You might also need the context of that task or instruction and the input text that you want for the response or output.

A

prompt

42
Q

When you provide a few examples to help the LLM models better perform and calibrate their output to meet your expectations.

A

few-shot prompting

43
Q

A sentiment classification prompt with no examples provided to the prompt.

A

zero-shot prompting

44
Q

Where the actual prompt text is replaced with a continuous embedding backer that is optimized during training. This technique helps the prompt to be fine-tuned for a specific task. At the same time, it keeps the rest of the model parameters frozen, which can be more efficient than full fine-tuning.

A

prompt tuning

45
Q

The practice of crafting and optimizing input prompts. It selects appropriate words, phrases, sentences, punctuation, and separator characters to effectively use LLMs for a wide variety of applications.

A

prompt engineering

46
Q

Classification, question and answer with and without context, summarization, open-ended text generation, code generation, math, and reasoning or logical thinking.

A

common tasks supported by LLMs on Amazon Bedrock

47
Q

This is:
1. The encoded knowledge of language in an LLM.
2. The stored patterns of data that capture relationships and, when prompted, reconstruct language from those patterns.
3. An understanding of patterns that the model can use to generate new outputs.
4. A statistical database.

A

Latent space

48
Q

When you write a prompt for a language model, that prompt is ingested by the model and _____. It returns a pile of statistics that then get assembled as words.

A

refers to its latent space against its database of statistics

49
Q

Designing and refining the input prompts that are fed into the model to guide it towards producing the desired outputs.

A

prompt engineering

50
Q
  1. Be specific and provide clear instructions or specifications for the task at hand. For example, include the desired format, examples, comparison, style, tone, output length, and detailed context.
  2. Include examples of the desired behavior and direction, such as sample texts, data formats, templates, code, graphs, charts, and more.
  3. Experiment and use an iterative process to test prompts and understand how the modifications alter the responses.
  4. Know the strengths and weaknesses of your model.
  5. Balance simplicity and complexity in your prompts to avoid vague, unrelated, or unexpected answers.
  6. Specifically for your prompt engineers, use multiple comments to offer more context without cluttering your prompt.
  7. Add guardrails.
A

prompt engineering techniques

51
Q

Attacks of prompt manipulation with an untrusted input that is created by a user to produce malicious, undesired, or elicit response.

A

prompt injection

52
Q

When an attacker tries to bypass the guardrails that you have established, this is called _____.

A

jailbreaking

53
Q

_____ is an attempt to change or manipulate the original prompt with new instructions.

A

Hijacking

54
Q

_____ is another risk of prompt engineering where harmful instructions are embedded in messages, emails, web pages, and more.

A

Poisoning

55
Q
  1. Use these services to build applications that generate high-quality text for use cases such as content creation summarization, question answering and chatbots.
  2. Offer pre-trained language models that can be customized and controlled through prompt engineering.
  3. They provide APIs and tools for constructing and refining prompts, along with monitoring and analyzing the resulting outputs.
A

Amazon Bedrock and Amazon Titan

56
Q

What are the key elements of training a foundation model?

A

They include pre-training, fine-tuning, and continuous pre-training.

57
Q
A
58
Q

With _____, you train the LLM by using huge amounts of unstructured data with self-supervised learning.

A

pre-training

59
Q

_____ is a process that extends the training of the model to improve the generation of completions for a specific task. It is a supervised learning process and you use a dataset of labeled examples to update the weights of the LLM, it helps to adapt foundation models to your custom datasets and use cases.

A

Fine-tuning

60
Q

_____ happens when the whole fine-tuning process modifies the weights of the original LLM. This can improve the performance of the single task fine-tuning, but it can degrade performance on other tasks.

A

Catastrophic forgetting

61
Q

When you train and tune a foundation model, _____.

A

you load the model parameters and add memory for the optimizer, gradients, forward activations, and temporal memory

62
Q

_____ is a process and set of techniques that freeze or preserve the parameters and weights of the original LLM and fine-tune or train a small number of task-specific adaptor layers and parameters. It reduces the compute and memory that’s needed because it’s fine-tuning a small set of model parameters.

A

Parameter-efficient fine-tuning, PEFT

63
Q

_____ is a popular PEFT technique that also preserves or freezes the original weights of the foundation model and creates new trainable low-rank matrices into each layer of a transformer architecture.

A

Low-rank adaptation or LoRA

64
Q

PEFT and LoRA modify the _____ of your model, but not the representations.

A

weights

65
Q

_____ encode semantic information similar to embeddings.

A

Representations

66
Q

_____ is a fine-tuning process that freezes the base model and learns task-specific interventions on hidden representations.

A

Representation fine-tuning, ReFT

67
Q

The _____ says that concepts are encoded in linear subspaces of representation in a neural network.

A

linear representation hypothesis

68
Q

_____ is an extension of fine-tuning a single task. This requires a lot of data. For this process, the training dataset has examples of inputs and outputs for multiple tasks.

A

Multitask fine-tuning

69
Q

_____ gives you the ability to use the pre-trained foundation models and adapt them to specific tasks by using limited domain-specific data. You can use this to help your model work with domain-specific language such as industry jargon, technical terms, or other specialized data.

A

Domain adaptation fine-tuning

70
Q

_____ provides the capability to fine-tune a large language model, particularly a text generation model, on a domain- specific dataset so you can improve the performance of your model and help it better understand human-like prompts to generate human-like responses.

A

Amazon SageMaker JumpStart

71
Q

During _____, you select prompts from your training dataset and pass them to the LLM to generate completions. Then, compare the distribution of completions, and the training label, to calculate a loss between the two token distributions, which you can use to update your model’s weights so the model’s performance on the task improves.

A

fine-tuning

72
Q

You can define separate evaluation steps to measure your LLM’s performance, by using the _____. You will get the validation accuracy, and after you’ve completed your fine-tuning, you can perform a final performance evaluation by using this, and the last result will give you the test accuracy.

A

holdout validation dataset

73
Q

In machine learning, _____ is the collecting, pre-processing, and organizing of raw data for your model.

A

data preparation

74
Q

If you have low-code data preparation, you can use _____ to create data flows that define your ML data pre-processing.

A

Amazon SageMaker Canvas

75
Q

If you have _____ that needs to scale, you can use open source frameworks such as Apache Spark, Apache Hive, or Presto.

A

data preparation

76
Q

If you need to use structured query language (SQL) in SageMaker Studio for data preparation, you can use _____.

A

Jupyter Lab

77
Q

If you have data preparation for feature discovery and storage, you can use _____ to search, discover, and retrieve features for model training. You can also use it to provide a centralized repository to store feature data in a standardized format.

A

Amazon SageMaker Feature Store

78
Q

You can use _____ to analyze your data and detect potential biases across multiple facets, which can help you detect whether your training data contains imbalanced representations or labeling biases between groups such as gender, race, or age.

A

Amazon SageMaker Clarify

79
Q

If you have data that needs to be labeled, you can use _____ to manage the data labeling workflows for your training datasets.

A

SageMaker Ground Truth

80
Q

T/F: The output of generative AI models is non-deterministic, which makes validation more difficult.

A

True

81
Q
  1. Improve application performance by reducing the size of the LLMs. This action can reduce the inference latency because the smaller size model loads more quickly. However, remember that reducing the size of the model might decrease its performance.
  2. Make a more concise prompt, reducing the size of the retrieved snippets and their number, and reducing generation through inference parameters and prompt.
A

optimization techniques

82
Q

_____ is a set of metrics and a software package. It is used to evaluate automatic summarization tasks and machine translation software in natural language processing. It evaluates how well the input compares to the generated output.

A

Recall Oriented Understudy for Gisting Evaluation, or ROUGE

83
Q

_____ is an algorithm that is used for translation tasks. It evaluates the quality of text which has been machine translated from one natural language to another.

A

Bilingual Evaluation Understudy, or BLEU

84
Q

_____ was created to help the development of models that can generalize across multiple tasks. It is a collection of natural language tasks, such as sentiment analysis and question answering. You can use these tasks to evaluate and compare model performance across a set of language tasks. Then, you can use the benchmark to measure and compare the model performance.

A

GLUE

85
Q

_____ was introduced in 2019 and adds additional tasks, such as multi-sentence reasoning and reading comprehension.

A

SuperGlue

86
Q

_____ evaluates the knowledge and problem-solving capabilities of the model.

A

Massive Multitask Language Understanding, MMLU

87
Q

____ focuses on tasks that are beyond the capabilities of the current language models. It contains tasks such as math, biology, physics, bias, linguistics, reasoning, childhood development, software development, and more.

A

The Beyond the Imitation Game Benchmark, BIG-bench

88
Q

Another benchmark is the _____ which is a benchmark to help improve model transparency. It offers users guidance on which model performs well for a given task. This is a combination of metrics for tasks such as summarization, question and answer, sentiment analysis, and bias detection.

A

Holistic Evaluation of Language Models, HELM

89
Q

You can also use _____ to manually evaluate your model responses. For example, you can use these to compare the responses of SageMaker JumpStart models, and you can also specify responses from models outside AWS.

A

human workers

90
Q

You can use _____ to evaluate large language models, LLMs, and create model evaluation jobs. A model evaluation job helps to evaluate and compare model quality and metrics for text-based foundation models from SageMaker JumpStart.

A

Amazon SageMaker Clarify

91
Q

_____ provides an evaluation module that can automatically compare generated responses and calculate a semantic similarity base score, BERTscore, against a human reference. It is suitable to evaluate faithfulness and hallucinations in text-generation tasks

A

Amazon Bedrock

92
Q

_____ helps with the challenge of internal knowledge of models being outdated. If your model is outdated, then it’ll not know newer information. This helps by providing a context, which helps to avoid hallucinations and improve factuality by grounding responses.

A

RAG

93
Q
  1. Use an orchestration library to configure and manage the passing of user input to the large language model and the return of completions.
  2. RAG helps your model access additional external data at inference times. And the additional external data can help improve the relevance and accuracy of completions.
  3. RAG helps overcome the outdated knowledge issue if your model uses older information.
A

Actions to give you more configurations to connect your LLM to external components and integrate deployment within your application

94
Q
  1. define business goals
  2. determine metrics then measure, monitor, review them
  3. make sure models interact well w/ your other systems (have to interact in real time using APIs and interfaces)
  4. choose the large language models to use with your application and the appropriate infrastructure for your inference needs (remember storage)
  5. consider additional tools/frameworks for LLMs
  6. user interface (like website/rest API) to consume app
A

Primary AI considerations

95
Q

The _____provides the compute, storage, and network to serve and host your LLMs and to host your application components. For this layer, you must ensure that your data is being handled securely across the AI lifecycle for data preparation, training, and inferencing.

A

infrastructure layer