1
CS 589 Lecture 11
Monday 6:30-9:00
Kidde 228
Automated machine learning (cont.)
Parameter Efficient Fine Tuning
In-context Learning
photo: https://www.scubedstudios.com/information-retrieval/
ICL slides are adapted from Stanford CS 224U: https://web.stanford.edu/class/cs224u/slides/cs224u-incontextlearning-2023-handout.pdf
2
Recap: GPT: Left-to-right decoder using the Transformer arch.
3
Improving Language Understanding by Generative Pre-Training. Radford et al. 2018
Lecture 11
4
Hyperparameter optimization
: hyperparameter
: search space for hyperparameter
D_{train}: training dataset
trial #3
FLAML: A Fast Library for Automated Machine Learning & Tuning
FLAML: AutoML vs Tune
FLAML: Tune User-Defined Function
source: https://github.com/microsoft/FLAML/blob/main/flaml/tune/tune.py#L202
CFO: A Cost-Frugal HPO Algorithm [AAAI’21]
source: FLAML KDD 2022 Tutorial Frugal Optimization for Cost-related Hyperparameters. Wu et al. 2021
CFO: A Cost-Frugal HPO Algorithm [AAAI’21]
Repeat the following steps after each move:
1.Uniformly sample a direction from a local unit sphere;
2.Compare;
3.Move (and break) or try the opposite direction;
4.Move (and break) or stay
source: FLAML KDD 2022 Tutorial Frugal Optimization for Cost-related Hyperparameters. Wu et al. 2021
BlendSearch: Combining Local + Global Search [ICLR’22]
source: FLAML KDD 2022 Tutorial ECONOMIC HYPERPARAMETER OPTIMIZATION WITH BLENDED SEARCH STRATEGY. Wang et al. 2022
BlendSearch: Combining Local + Global Search [ICLR’22]
source: FLAML KDD 2022 Tutorial ECONOMIC HYPERPARAMETER OPTIMIZATION WITH BLENDED SEARCH STRATEGY. Wang et al. 2022
HW4: Hyperparameter Tuning for HW3
FLAML: Resources
Lecture 11
16
Paradigm shifts in NLP (2017)
Training -> predict
Pre-training -> fine tuning -> predict
2017
Second paradigm shifts in NLP (2021)
Pre-training -> fine tuning -> predict
Pre-training -> prompting -> predict
Fine-Tuning Has Good Performance, but…
source: https://www.semanticscholar.org/paper/Localizing-Catastrophic-Forgetting-in-Neural-Wiewel-Yang/e5e33640ccf7de93b963da0a4719499d05b84b6b
How to Improve over Fine Tuning?
source: https://www.semanticscholar.org/paper/Localizing-Catastrophic-Forgetting-in-Neural-Wiewel-Yang/e5e33640ccf7de93b963da0a4719499d05b84b6b
Prefix Tuning: Optimizing continuous prompts
Prefix-tuning: optimizing continuous prompts for generation. Li et al. 2020
Prefix-tuning: lightweight fine-tuning
Prefix-tuning: optimizing continuous prompts for generation. Li et al. 2020
Adapter: Parameter-Efficient Transfer Learning for NLP
source: Parameter-Efficient Transfer Learning for NLP. Houlsby et al. 2019
LoRA: LOW-RANK ADAPTATION OF LARGE LANGUAGE MODELS
source: LOW-RANK ADAPTATION OF LARGE LANGUAGE MODELS. Hu et al. 2021
LoRA: LOW-RANK ADAPTATION OF LARGE LANGUAGE MODELS
source: LOW-RANK ADAPTATION OF LARGE LANGUAGE MODELS. Hu et al. 2021
LoRA: LOW-RANK ADAPTATION OF LARGE LANGUAGE MODELS
source: Parameter-efficient fine-tuning of large-scale pre-trained language models. Ding et al. 2022
Resource for Parameter Efficient Fine Tuning
Lecture 11
28
In-context learning
In-Context Learning Ability of LLMs
How does in-context learning work? A framework for understanding the differences from traditional supervised learning. Sang Michael Xie and Sewon Min
Using Prompts to Elicit the Answer
I missed the bus today. I felt so ___________
Mike went to Paris. [Paris] is a [location] entity.
Prompt engineering
Prompt generation
Making pre-trained language models better few-shot learners. Gao et al. 2020
Prompt generation
Making pre-trained language models better few-shot learners. Gao et al. 2020
AutoPrompt: Gradient based prompt generation
AUTOPROMPT: Eliciting Knowledge from Language Models with Automatically Generated Prompts. Shin et al. 2020
AutoPrompt: Gradient based prompt generation
AUTOPROMPT: Eliciting Knowledge from Language Models with Automatically Generated Prompts. Shin et al. 2020
Chain-of-thoughts Prompting
Chain-of-Thought Prompting Elicits Reasoning in Large Language Models. Wei et al. 2022
Chain-of-Thought Prompting Elicits Reasoning in Large Language Models. Wei et al. 2022
Self-Consistency
Self-consistency improves chain of thought reasoning in language models. Wang et al. 2022
Self-Ask
Measuring and Narrowing the Compositionality Gap in Language Models. Press et al. 2023
Self-Ask
Measuring and Narrowing the Compositionality Gap in Language Models. Press et al. 2023
Instruction Fine-Tuning
GPT: The sky is blue. The water is clear.
Instruct-GPT: Write a poem containing seven sentences. ______
Training language models to follow instructions with human feedback. Ouyang et al. 2022
Instruction Fine-Tuning
Training language models to follow instructions with human feedback. Ouyang et al. 2022
Instruction Fine-Tuning
Training language models to follow instructions with human feedback. Ouyang et al. 2022
smaller InstructGPT > larger GPT
Gray bar: truthfulness, color: informativeness and truthfulness
Self Instruct: Aligning LM with Self Generate Instructions
Self-instruct: Aligning language model with self generated instructions. Wang et al. 2022
Self Instruct: Aligning LM with Self Generate Instructions
Self-instruct: Aligning language model with self generated instructions. Wang et al. 2022
Alpaca: A Strong, Replicable Instruction-Following Model
Alpaca: A Strong, Replicable Instruction-Following Model. Taori et al. 2022
Structured Prompting: Scaling Number of Demonstrations
Structured Prompting: Scaling In-Context Learning to 1,000 Examples. Hao et al. 2022
Explanation Improves Few Shot Prompting
Can language models learn from explanations in context?. Lampinen et al. 2022
Explanation Improves Fine-Tuning of LLM
Testing Hate Speech against Policies. Zheng et al. 2023
An Explanation of In-context Learning as Implicit Bayesian Inference
An Explanation of In-context Learning as Implicit Bayesian Inference. Xie et al. 2021
Using Retrieval to Improve ICL
Learning To Retrieve Prompts for In-Context Learning. Rubin et al. 2021
ReAct: Synergizing Reasoning and Acting in Language Models
ReAct: Synergizing Reasoning and Acting in Language Models. ICLR 2023.
ReAct: Synergizing Reasoning and Acting in Language Models
ReAct: Synergizing Reasoning and Acting in Language Models. ICLR 2023.
Summary
56