Podcast
Questions and Answers
What type of similarity is word embedding capable of capturing?
What type of similarity is word embedding capable of capturing?
- Syntactic
- Semantic
- Both semantic and syntactic (correct)
- Neither semantic nor syntactic
What are the basic units of a sentence considered in the context of language models?
What are the basic units of a sentence considered in the context of language models?
- Sentences
- Documents
- Tokens (correct)
- Paragraphs
What is a potential risk associated with LLMs due to their broad knowledge?
What is a potential risk associated with LLMs due to their broad knowledge?
- Over-reliance on data
- Exposure to hazardous and harmful knowledge (correct)
- Inability to process information
- Limited creativity
What is a key characteristic of Reinforcement Learning (RL)?
What is a key characteristic of Reinforcement Learning (RL)?
What does RLHF stand for in the context of aligning LLMs?
What does RLHF stand for in the context of aligning LLMs?
What is a primary function of Reinforcement Learning from Human Feedback (RLHF)?
What is a primary function of Reinforcement Learning from Human Feedback (RLHF)?
What mechanism does the Generative Pretrained Transformer (GPT) architecture adopt to better capture the semantic meaning of text?
What mechanism does the Generative Pretrained Transformer (GPT) architecture adopt to better capture the semantic meaning of text?
What is the primary goal of a generative model when using a masked word?
What is the primary goal of a generative model when using a masked word?
What is a key characteristic of generative language models?
What is a key characteristic of generative language models?
What term is used to describe the phenomenon where LLMs generate unfaithful, fabricated, or nonsensical content?
What term is used to describe the phenomenon where LLMs generate unfaithful, fabricated, or nonsensical content?
What is 'in-context hallucination' in the context of LLMs?
What is 'in-context hallucination' in the context of LLMs?
Which of the following is a common limitation of LLMs regarding their knowledge?
Which of the following is a common limitation of LLMs regarding their knowledge?
What is a common challenge for LLMs when dealing with numbers?
What is a common challenge for LLMs when dealing with numbers?
What is the term for the maximum length of text a model can generate in one run?
What is the term for the maximum length of text a model can generate in one run?
What might occur if the 'Max Tokens' parameter is set too low?
What might occur if the 'Max Tokens' parameter is set too low?
Which parameter in LLMs controls the number of previous conversation messages the model remembers?
Which parameter in LLMs controls the number of previous conversation messages the model remembers?
In LLMs, what is the effect of setting a lower temperature?
In LLMs, what is the effect of setting a lower temperature?
What is the main goal of prompt engineering?
What is the main goal of prompt engineering?
What is the approach where a model is given a few input-output examples to perform a new task?
What is the approach where a model is given a few input-output examples to perform a new task?
What is a key characteristic of 'Zero-shot prompting'?
What is a key characteristic of 'Zero-shot prompting'?
How does Chain-of-Thought (CoT) prompting typically influence the final answer?
How does Chain-of-Thought (CoT) prompting typically influence the final answer?
What technique involves instructing an AI to act as a specific character?
What technique involves instructing an AI to act as a specific character?
What is the primary purpose of Retrieval-Augmented Generation (RAG)?
What is the primary purpose of Retrieval-Augmented Generation (RAG)?
Which of the following is the first step performed by the RAG system when a user asks a question?
Which of the following is the first step performed by the RAG system when a user asks a question?
What is a key benefit of providing reference text when prompting a language model?
What is a key benefit of providing reference text when prompting a language model?
According to the principles of prompt engineering, what should you do with complex tasks?
According to the principles of prompt engineering, what should you do with complex tasks?
What does principle 4 suggest doing?
What does principle 4 suggest doing?
What is word embedding particularly good at capturing?
What is word embedding particularly good at capturing?
What is a potential consequence of LLMs having no active filtering on training data?
What is a potential consequence of LLMs having no active filtering on training data?
Unlike supervised learning, what does reinforcement learning depend on?
Unlike supervised learning, what does reinforcement learning depend on?
What kind of knowledge can LLMs potentially provide that may be considered a concern?
What kind of knowledge can LLMs potentially provide that may be considered a concern?
What aspect of language does the 'self-attention' mechanism in the transformer models help capture?
What aspect of language does the 'self-attention' mechanism in the transformer models help capture?
What may occur if they exist in the training data?
What may occur if they exist in the training data?
What is inaccurate about hallucination?
What is inaccurate about hallucination?
What is tokenization?
What is tokenization?
What might the model be able to predict when using masked words?
What might the model be able to predict when using masked words?
Why is factual information important?
Why is factual information important?
Flashcards
Word Embedding
Word Embedding
Representing words as numerical vectors to capture semantic and syntactic relationships between words.
Tokens
Tokens
Words, character sets, or combinations thereof, serving as basic units in a sentence.
LLM Safety Concerns
LLM Safety Concerns
Concerns regarding possible risks, biases, or misuse arising from LLMs. Often due to un-filtered training data.
RLHF
RLHF
Signup and view all the flashcards
GPT Architecture
GPT Architecture
Signup and view all the flashcards
Self-Attention Mechanism
Self-Attention Mechanism
Signup and view all the flashcards
Hallucination in LLMs
Hallucination in LLMs
Signup and view all the flashcards
In-context hallucination
In-context hallucination
Signup and view all the flashcards
Extrinsic hallucination
Extrinsic hallucination
Signup and view all the flashcards
Knowledge timeliness
Knowledge timeliness
Signup and view all the flashcards
Numbers insensitive
Numbers insensitive
Signup and view all the flashcards
Lack of Common Knowledge
Lack of Common Knowledge
Signup and view all the flashcards
Hyperparameter
Hyperparameter
Signup and view all the flashcards
Max Tokens
Max Tokens
Signup and view all the flashcards
Previous Messages Included
Previous Messages Included
Signup and view all the flashcards
Temperature
Temperature
Signup and view all the flashcards
Prompt Engineering
Prompt Engineering
Signup and view all the flashcards
Query Crafting
Query Crafting
Signup and view all the flashcards
In-Context Learning
In-Context Learning
Signup and view all the flashcards
Zero-shot learning
Zero-shot learning
Signup and view all the flashcards
One-shot learning
One-shot learning
Signup and view all the flashcards
Few-shot learning
Few-shot learning
Signup and view all the flashcards
Chain-of-thought Prompting
Chain-of-thought Prompting
Signup and view all the flashcards
Role play and persona
Role play and persona
Signup and view all the flashcards
Retrieval Augmented Generation
Retrieval Augmented Generation
Signup and view all the flashcards
Clear instructions
Clear instructions
Signup and view all the flashcards
Reference text
Reference text
Signup and view all the flashcards
Split the tasks
Split the tasks
Signup and view all the flashcards
Use external websites
Use external websites
Signup and view all the flashcards
Study Notes
Word Embedding Recap
- Word embedding is a popular way to represent document vocabulary
- Captures semantic and syntactic similarity, as well as the relationship between words
- Numerical representation of words, where similar words have mathematically similar embeddings and dissimilar words have mathematically dissimilar embeddings
- Tokens are the basic units of a sentence; words, character sets, etc
LLM Safety Concerns
- LLMs possess extensive knowledge, both good and bad
- Pretraining lacks human oversight
- Training data not actively filtered
- Lack of censorship can lead to hazardous and harmful knowledge
- Sensitive data may leak if it’s present in the training data
RLHF - Aligning LLMs
- Reinforcement Learning from Human Feedback is a reinforcement learning approach
- Utilizes human input to fine-tune LLMs
- RL is a machine learning area focused on maximizing cumulative rewards in situations through decision-making
- Learning occurs through experience, unlike supervised methods that rely on predefined datasets
- Agents in RL learn in complex environments by performing actions and adjusting based on rewards or penalties
- Can reduce biased and harmful responses from LLMs, though not perfectly
- Safety mechanisms could be bypassed
- LLM developers must update safety policies
GPT Architecture & Self-Attention
- GPT adopts a "self-attention" mechanism
- Helps in capturing the semantic meaning
Generative Language Models
- Generative model guesses the next word in a series
- Model generates the next word as if it didn't exist
- The process is "auto-regressive generation" as it generates the next word based on all the previous ones
- This model can go beyond the knowledge of people
- It can make decisions from a vocabulary of human languages
- It acquires knowledge at an unprecedented rate, learning patterns without labelled data
- The process is not controlled by humans
LLM Limitations - Hallucinations
- Hallucinations in LLMs: generates inaccurate, fabricated, inconsistent, or nonsensical information
- In-context hallucination: LLM misinterprets input, leading to distorted responses
- Extrinsic hallucination: LLM creates false information due to lack of knowledge
LLM Limitations - Knowledge Timeliness
- LLMs' information can be outdated
- LLMs cannot access information or incorporate data after training
LLM Limitations - Numbers
- LLMs have trouble with numerical comparisons
- Numbers inside LLMs are tokenized
Hyperparameters in LLMs
- Max Tokens: Text length the model generates in one run
- Setting max tokens too low may result in incomplete output
- Setting max tokens too high may include unnecessary information
- Previous Messages Included: Number of previous conversation messages the model remembers
- High value may lead to redundant output and faster burning of your tokens
- Low value may cause forgetting important information from past conversations
- Lower temperatures leverage learned patterns
- Produces predictable and reliable outputs
- Higher temperatures encourage exploration, increasing the diversity of outputs
Prompt Engineering: Query Crafting
- Improves output quality
- Phrasing queries and including context
Prompt Engineering: In-Context Learning
- In-Context Learning (ICL) uses input-output examples in the model's context as a preamble for performing a task on an unseen example
- Zero-shot prompting: No example given
- One-shot prompting: One example provided
- Few-shot prompting: Typically 3~6 examples
- Techniques limited by length limits
Prompt Engineering: Chain-of-Thought
- A sequence of short sentences describes the reasoning, eventually leading to the final answer
- CoT prompting is beneficial for complicated reasoning tasks, particularly with large models
Prompt Engineering: Role Play
- "Role play": uses personas and scenarios
- AI is your actor
- Specific scenarios are constructed through pretend roles
- Improves GPT into a high-moral role
Prompt Engineering: RAG
- Retrieval-Augmented Generation (RAG) combines LLMs with external databases
- Ensure generated content is based on factual data when generating text
Prompt Engineering; Retrievel Augmented Generation example
- Question: Who was awarded the 2024 Nobel Prize in Physics and describe their contributions?
- The model must rely on its trained knowledge
- Models trained on data until September 2024 may not know about the October 2024 Nobel Prize in Physics
- Without RAG: The answer is incorrect
- Without RAG: Admission of Ignorance, or knowledge is outdated
- Model RAG: System retrieves relevant documents, searching keywords like "2024 Nobel Prize in Physics winner"
- With RAG: Retrieved information becomes context, replacing pre-trained knowledge to generate response
- With RAG: Output produces researchers and their artificial information
Prompt Engineering Principles
- Principle 1: Clear instructions
- Request brief or expert replies as needed
- Show the required format if the format is important
- **Principle 2: Reference Text"
- Language models can make up responses especially if asked about niche subjects.
- Reference texts can help prevent the models from fabricating information
- Principle 3: Split complex tasks
- Split complex tasks into simpler sub-tasks
- **Principle 4: External Tools"
- Compensate for the weaknesses of the model by feeding it the outputs of other tools.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.