Chapter 4 - AI Flashcards

1
Q

What is a narrow ML Model

A

Designed for specific tasks using custom-collected and
labeled datasets.

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

What is a foundation model in ML

A

pretrained for general purposes, i.e.: not one
specific purpose, adaptable to a variety of specific tasks.

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

Advantages of Narrow ML Models

A

Tailored to specific tasks, potentially offering higher precision for particular applications.
Greater control over the model development process, allowing for customized adjustments and integration of safety measures (guardrails).

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

Challenges with Narrow ML Models

A

High cost of data collection, labeling, and computation during training.
Potentially limited by the quality and quantity of available training data.

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

Advantages of Foundation Models

A

Can reduce the amount of human labor and time required for model development.
Offer a flexible base that can be fine-tuned for accuracy improvements across diverse tasks.
Economical in terms of reuse and scalability, especially when shared within an organization or accessed via API

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

Challenges of FMs:

A

Training effort infeasible for many organizations
Potentially high cost / compute requirements for inference (i.e. runtime use)

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

What is a key factor in deciding between Narrow ML and FMs

A

Cost is a key factor in deciding between Narrow ML models and FMs.

▪ Development cost – similar for system, lower for using existing FMs
▪ Maintenance cost – depends on customization / model size
▪ Operation costs – typically higher for FMs

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

Techniques for Customizing FMs

A

▪ Prompt Engineering
▪ Retrieval-Augmented Generation (RAG)
▪ Fine-Tuning
▪ Distilling

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

What is Distilling?

A

Simplifying and compressing the model to enhance efficiency while retaining performance, useful for deployment on resource-constrained environments.

▪ Distillation is used to create a smaller “student” model that mimics the behavior of a larger, more complex “teacher” foundation model.
▪ Goal: the resulting student model is (close to) as good as the teacher model in some areas of interest, but more efficient.

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

What are Distilling Techniques?

A

▪ Knowledge Distillation - Combines data loss (encouraging the student to learn directly from training data) with distillation loss (guiding the student to replicate the teacher’s outputs on a separate dataset).
+ Aims to transfer the comprehensive knowledge from the teacher model to the student model effectively.

▪ Attention Distillation - Focuses on transferring attention mechanisms from the teacher to the student model.
+ Helps the student model to identify and concentrate on the most relevant parts of the input data, enhancing task-specific performance.

▪ Parameter Sharing - Involves sharing layers or parameters from the teacher model with the student model.
+ Reduces the learning burden on the student model by utilizing pre-trained components of the teacher model

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

What are the Advantages of Distillation

A

▪ Produces models that are lighter and faster, suitable for deployment in environments with resource constraints.
▪ Retains a significant level of the teacher model’s performance, making it ideal for applications requiring both efficiency and effectiveness.
▪ Enables the distilled model to operate independently of the large FM, enhancing scalability and deployment flexibility.

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

How does a Fine-Tuning work?

A

Adjusting the model’s parameters on a specific dataset to improve performance for particular tasks.

▪ It allows organizations to leverage the powerful capabilities of FMs while addressing specific needs with minimal additional investment.
▪ It enhances the model’s utility in specialized fields, providing outputs that are both accurate and contextually appropriate.

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

What are 2 Techniques for Fine-Tuning

A

▪ Full Fine-Tuning - Involves retraining all parameters of the FM, allowing comprehensive learning from the domain-specific dataset.
+ Challenges include high computational costs and extensive training time, especially for large models like GPT-3 or GPT-4.

▪ Parameter-Efficient Fine-Tuning - Focuses on modifying only a subset of the model’s parameters, significantly reducing resource requirements.
+ Utilizes adapter modules or low-rank adaptation layers that target specific layers within the FM, preserving the original model’s structure.

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

How does Retrieval-Augmented Generation (RAG) work?

A

Enhancing the FM’s responses by dynamically incorporating external knowledge or data during the generation process.

▪ Data Retrieval - Utilizes vector databases like Pinecone and Milvus to store and retrieve organizational or personal data as vector embeddings.
▪ Prompt Augmentation - Retrieves relevant external information based on the initial prompt and uses this data to enrich the prompt before it is input into the FM.

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

What are the benefits of Retrieval-Augmented Generation (RAG)

A

▪ Improved Accuracy and Relevance - By accessing vast and specific external information, RAG significantly enhances the model’s output quality.
▪ Dynamic Content Updates - Keeps the model up-to-date with the latest information, ensuring the responses are current and reflective of the most recent data.
▪ Enhanced Customization - Allows for tailored responses based on the specific information needs of the organization or the query context.

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

How does Prompt Engineering work?

A

Crafting specific prompts or input sequences that guide the FM towards producing desired outputs.

It allows users and developers to manipulate model outputs creatively and strategically by adding meaning to words like microservice or agile, ensuring that the model aligns with specific task requirements.

17
Q

What does a static Prompt Engineering mean?

A

Development teams create and maintain a consistent “system prompt” that sets the context and tone for all interactions.
▪ Example: A system prompt instructs the FM to adopt a professional and concise tone when assisting knowledge workers in the IT industry

18
Q

What are the Dynamic Prompt Engineering Techniques?

A

▪ Incorporating Contextual Adjustment - Modifies the prompt to align with the current user interaction, ensuring that the FM has the most pertinent information for generating responses.
▪ Iterative Refinement - Involves querying the FM multiple times with variations of the initial prompt,
using the responses to refine the prompt until the desired accuracy and coherence are achieved.
▪ Progressive Prompting - Gradually introduces more information through a series of prompts that build
on each other, leading to more detailed and nuanced responses from the FM.
▪ Few-Shot Learning - Provides the FM with a few examples within the prompt to quickly adapt and generate appropriate responses for similar tasks, enhancing learning efficiency.
▪ Adaptive Learning - Similar to few-shot learning but includes dynamic adjustment of examples based on the FM’s performance, continuously refining the learning process to improve response quality over time.

19
Q

What are challenges in Dynamic Prompt Engineering?

A

▪ Dynamic prompt engineering requires careful implementation to avoid misrepresentations or inaccuracies, as demonstrated by instances like Google Gemini’s portrayal of historical events.
▪ Sufficient resources and rigorous feedback mechanisms to mitigate potential negative outcomes.

20
Q

What are sophisticated Prompt Patterns?

A

▪ Self-Consistency - Enhances reliability by querying the FM multiple times with similar prompts, selecting the most consistent response as the final answer.
▪ Chain of Thought - Facilitates complex reasoning by decomposing tasks into manageable steps, allowing the FM to process and address each component sequentially.
▪ Tree of Thought - Extends the chain of thought by employing a tree structure to explore multiple reasoning pathways simultaneously. Includes mechanisms to assess the effectiveness of each path, deciding whether to proceed or explore alternative branches.

21
Q

What are Guardrails, what’s their goal?

A

▪ Guardrails are designed to monitor and control the inputs and outputs of: foundation models, users, RAG, external tools
▪ Goal is to meet specific requirements, including
function, accuracy. aspects needed due to policy (AI Act, etc.), standards and laws.

22
Q

What are the 5 Types of Guardrails?

A

▪ Input guardrails are applied to the inputs received from users, and their possible effects include refusing or modifying user prompts.
▪ Output guardrails focus on the output generated by the foundation model, and may modify the output of the foundation model or prevent certain outputs from
being returned to the user.
▪ RAG guardrails are used to ensure the retrieved data is appropriate, either by validating or modifying the retrieved data where needed.
▪ Execution guardrails ensure that the called tools or models do not have any known vulnerabilities and the actions only run on the intended target environment and do not have negative side-effects.
▪ Intermediate guardrails can be used to assert that each intermediate step meets the necessary criteria.

23
Q

What is Maturity of FMs in Organizations?

A

Easiest to Hardest:
1. Prompt Engineering
2. RAG
3. Fine-Tuning/distilling
4. Own FM

24
Q

What makes FhGenie so good?

A

It is a FM by Frauenhofer that is capable of working with restricted data (but not highly confidential) based on OpenAI GPT models.

25
Q

What is Limited Grounding?

A

FMs focus on identifying statistical patterns within data sequences, not grounded in facts or authoritative knowledge. They identify correlations but lack an underlying causal model or a world model. This can lead to significant
inaccuracies in their outputs.

26
Q

What are Hallucinations?

A

Without grounding, FMs lack the ability to evaluate the confidence and truthfulness of their outputs while having a tendency to provide an answer by making one up—often termed “hallucinations.” The term “hallucination” has
been critiqued for anthropomorphizing AI, suggesting false perception.

27
Q

What are the steps in Model Development

A
  1. Data Managment
  2. Feature Engineering
  3. Dividing the data
  4. Generating Model
28
Q

What does it mean to divide the data?

A

Split data into 3 main sets:
Training set 60% - 80%
Validation 10 - 20%
Test 10 - 20%
sets cannot overlap

29
Q

How to evaluate a Model?

A

▪ Models are initially tested in isolation and then re-tested when integrated into the broader system
▪ Quality Attributes: Describe non-functional requirements such as system reliability, maintainability, and efficiency.
▪ Risk Assessment: Identifies potential immediate harms and evaluates the likelihood and impact of adverse events.
▪ Impact Assessment
▪ Analyzes the broader, long-term effects of AI systems on individuals, communities, and societal aspects. Includes evaluations across economic, social, and environmental dimensions.