SlideShare una empresa de Scribd logo
1 de 24
Descargar para leer sin conexión
Distilling Relation Embeddings from Pre-trained
Language Models
Asahi Ushio
Jose Camacho-Collados
Steven Schockaert
https://github.com/asahi417/relbert
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Language Model Understanding
2
Syntactic Knowledge
- Probing embedding: Hewitt 2019, Tenney 2019
- Probing attention weight: Clark 2020
Factual Knowledge a.k.a Language Model as a Commonsense KB
- Petroni 2019, Kassner 2020, Jiang 2020, etc
Relational Knowledge a.k.a Language Model as a Lexical Relation Reasoner
- LM fine-tuning on relation classification: Bouraoui 2019
- Vanilla LM evaluation: Ushio 2021
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Language Model Understanding
3
Syntactic Knowledge
- Probing embedding: Hewitt 2019, Tenney 2019
- Probing attention weight: Clark 2020
Factual Knowledge a.k.a Language Model as a Commonsense KB
- Petroni 2019, Kassner 2020, Jiang 2020, etc
Relational Knowledge a.k.a Language Model as a Lexical Relation Reasoner
- LM fine-tuning on relation classification: Bouraoui 2019
- Vanilla LM evaluation: Ushio 2021
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Language Model Understanding
4
Syntactic Knowledge
- Probing embedding: Hewitt 2019, Tenney 2019
- Probing attention weight: Clark 2020
Factual Knowledge a.k.a Language Model as a Commonsense KB
- Petroni 2019, Kassner 2020, Jiang 2020, etc
Relational Knowledge a.k.a Language Model as a Lexical Relation Reasoner
- LM fine-tuning on relation classification: Bouraoui 2019
- Vanilla LM evaluation: Ushio 2021
Can we distil relational knowledge as relation embedding?
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Relation Embedding
Word Embedding Mikolov (2013)
Pair2Vec Joshi (2019)
Relative Camacho-Collados (2019)
5
King
Queen
Woman
Man
Word Embedding
RelBERT
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Prompt Generation
Custom Template, AutoPrompt (Shin 2020), P-tuning (Liu 2021)
LM embedding
Averaging over the context
Relation Embedding from LM
7
(h, t)
Word pair
Sentence
(tokens)
Prompt
Generation
Contextual
embeddings
Fixed-length
embedding
LM
encoding
x
Averaging
s1
s2
s3
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Prompt Generation
Custom Template, AutoPrompt (Shin 2020), P-tuning (Liu 2021)
LM embedding
Averaging over the context
Relation Embedding from LM
8
(h, t)
Word pair
Sentence
(tokens)
Prompt
Generation
Contextual
embeddings
Fixed-length
embedding
LM
encoding
x
Averaging
s1
s2
s3
1. Today, I finally discovered the relation between camera and
photographer : camera is the <mask> of photographer
2. Today, I finally discovered the relation between camera and
photographer : photographer is camera’s <mask>
3. Today, I finally discovered the relation between camera and
photographer : <mask>
4. I wasn’t aware of this relationship, but I just read in the
encyclopedia that camera is the <mask> of photographer
5. I wasn’t aware of this relationship, but I just read in the
encyclopedia that photographer is camera’s <mask>
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Given a triple: anchor “sunscreen::sunburn”, positive “vaccine::malaria”, and
negative “dog::cat”, we want the embeddings of the anchor and the posirive close but
far from the negative.
Loss function: Triplet loss and classification loss following SBERT (Reimers 2019).
Fine-tuning on Triples
9
vaccine::malaria
sunscreen::sunburn
dog::cat
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
We create the dataset from SemEval 2012 Task 2.
Dataset
10
Class Inclusion
Parent Relation
Child
Relation
Taxonomic
Functional
(h1,t1), ... , (hk,tk)
Positive
(h1,t1), ... , (hk,tk)
Negative
:
Triplet
( xa, xp, xn )
:
:
( xa,1, xp,1, xn,1 )
( xa,2, xp,2, xn,2 )
:
( xa,m, xp,m, xn,m ) [(xa,m, xp,m, xa,1), ..., (xa,m, xp,m, xp,m-1)]
Original batch:
m samples
Augmented batch:
2m(m-1) samples
[(xa,1, xp,1, xa,2 ), ..., (xa,1, xp,1, xp,m)]
EXPERIMENTS
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Experiment: Analogy
12
Setup
- Cosine similarity in between embeddings.
- No training.
- Accuracy as the metric.
- No validation.
Sample from SAT analogy dataset. Data statistics.
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Experiment: Analogy
13
SotA in 4 / 5 datasets 🎉
Better than tuned methods on dev set 🤗
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Experiment: Classification
14
Setup
- Supervised Task
- LMs are frozen
- macro/micro F1
- Tuned on dev
Data statistics.
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
SotA in 4 / 5 datasets in
macro F1 score 🎉
SotA in 3 / 5 datasets in
micro F1 score 🎉
Experiment:
Classification
15
ANALYSIS
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Relation Memorarization
17
Does RelBERT just memorize the relations in the
training set… ?
Experiment: Train RelBERT without hypernymy.
Result: No significant decrease in hyperbyny
prediction.
→ RelBERT does not rely on the memorization!
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Fine-tuning? Other LMs?
18
Train RelBERT on BERT, ALBERT in addition to
RoBERTa.
→ RoBERTa is the best.
Vanilla RoBERTa (no fine-tuning).
→ Fine-tuning (distillation) is necessary.
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Conclusion
19
● We propose RelBERT, a framework to achieve relation embedding model based on
pretrained LM.
● RelBERT distil the LM’s relational knowledge and realize a high quality relation
embedding.
● Experimental results show that RelBERT embedding outperform existing
baselines, establishing SotA in analogy and relation classification.
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Release of RelBERT Library
20
We release python package relbert (install via pip install relbert) along with
model checkpoints on the huggingface modelhub.
Please check our project page https://github.com/asahi417/relbert !!
from relbert import RelBERT
model = RelBERT( 'asahi417/relbert-roberta-large' )
# the vector has (1024,)
v_tokyo_japan = model.get_embedding([ 'Tokyo', 'Japan'])
🌳Thank you!🌳
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Comparing to Word Embeddings
22
FastText is still better than RelBERT in Google
Analogy Question.
Breakdown per relation types shows that FastText is
better in the morphological relation, while very poor
in the lexical relation.
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Nearest Neighbours
23
Distilling Relation Embeddings from Pre-trained Language Models
Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados
Fine-tuning on Triples
Given a triple of the anchor (eg. “sunscreen”), the positive (eg. “sunburn”), and
the negative (eg. “evil”), the triplet loss is defined as
and the classification loss is defined as
where is a learnable weight. The loss functions are inspired by SBERT (Reimers 2019).
24

Más contenido relacionado

Último

Call Girls Ahmedabad +917728919243 call me Independent Escort Service
Call Girls Ahmedabad +917728919243 call me Independent Escort ServiceCall Girls Ahmedabad +917728919243 call me Independent Escort Service
Call Girls Ahmedabad +917728919243 call me Independent Escort Serviceshivanisharma5244
 
development of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusdevelopment of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusNazaninKarimi6
 
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...Silpa
 
pumpkin fruit fly, water melon fruit fly, cucumber fruit fly
pumpkin fruit fly, water melon fruit fly, cucumber fruit flypumpkin fruit fly, water melon fruit fly, cucumber fruit fly
pumpkin fruit fly, water melon fruit fly, cucumber fruit flyPRADYUMMAURYA1
 
Thyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate ProfessorThyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate Professormuralinath2
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learninglevieagacer
 
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...chandars293
 
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLKochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLkantirani197
 
The Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptxThe Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptxseri bangash
 
Human & Veterinary Respiratory Physilogy_DR.E.Muralinath_Associate Professor....
Human & Veterinary Respiratory Physilogy_DR.E.Muralinath_Associate Professor....Human & Veterinary Respiratory Physilogy_DR.E.Muralinath_Associate Professor....
Human & Veterinary Respiratory Physilogy_DR.E.Muralinath_Associate Professor....muralinath2
 
chemical bonding Essentials of Physical Chemistry2.pdf
chemical bonding Essentials of Physical Chemistry2.pdfchemical bonding Essentials of Physical Chemistry2.pdf
chemical bonding Essentials of Physical Chemistry2.pdfTukamushabaBismark
 
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 60009654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000Sapana Sha
 
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPirithiRaju
 
PSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptxPSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptxSuji236384
 
Bacterial Identification and Classifications
Bacterial Identification and ClassificationsBacterial Identification and Classifications
Bacterial Identification and ClassificationsAreesha Ahmad
 
GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)Areesha Ahmad
 
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verifiedConnaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bSérgio Sacani
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsSérgio Sacani
 

Último (20)

Call Girls Ahmedabad +917728919243 call me Independent Escort Service
Call Girls Ahmedabad +917728919243 call me Independent Escort ServiceCall Girls Ahmedabad +917728919243 call me Independent Escort Service
Call Girls Ahmedabad +917728919243 call me Independent Escort Service
 
development of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusdevelopment of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virus
 
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
 
pumpkin fruit fly, water melon fruit fly, cucumber fruit fly
pumpkin fruit fly, water melon fruit fly, cucumber fruit flypumpkin fruit fly, water melon fruit fly, cucumber fruit fly
pumpkin fruit fly, water melon fruit fly, cucumber fruit fly
 
Thyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate ProfessorThyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate Professor
 
Module for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learningModule for Grade 9 for Asynchronous/Distance learning
Module for Grade 9 for Asynchronous/Distance learning
 
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
 
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLKochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
 
Site Acceptance Test .
Site Acceptance Test                    .Site Acceptance Test                    .
Site Acceptance Test .
 
The Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptxThe Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptx
 
Human & Veterinary Respiratory Physilogy_DR.E.Muralinath_Associate Professor....
Human & Veterinary Respiratory Physilogy_DR.E.Muralinath_Associate Professor....Human & Veterinary Respiratory Physilogy_DR.E.Muralinath_Associate Professor....
Human & Veterinary Respiratory Physilogy_DR.E.Muralinath_Associate Professor....
 
chemical bonding Essentials of Physical Chemistry2.pdf
chemical bonding Essentials of Physical Chemistry2.pdfchemical bonding Essentials of Physical Chemistry2.pdf
chemical bonding Essentials of Physical Chemistry2.pdf
 
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 60009654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
 
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
 
PSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptxPSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptx
 
Bacterial Identification and Classifications
Bacterial Identification and ClassificationsBacterial Identification and Classifications
Bacterial Identification and Classifications
 
GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)
 
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verifiedConnaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

2021-11, EMNLP, Distilling Relation Embeddings from Pre-trained Language Models

  • 1. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio Jose Camacho-Collados Steven Schockaert https://github.com/asahi417/relbert
  • 2. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Language Model Understanding 2 Syntactic Knowledge - Probing embedding: Hewitt 2019, Tenney 2019 - Probing attention weight: Clark 2020 Factual Knowledge a.k.a Language Model as a Commonsense KB - Petroni 2019, Kassner 2020, Jiang 2020, etc Relational Knowledge a.k.a Language Model as a Lexical Relation Reasoner - LM fine-tuning on relation classification: Bouraoui 2019 - Vanilla LM evaluation: Ushio 2021
  • 3. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Language Model Understanding 3 Syntactic Knowledge - Probing embedding: Hewitt 2019, Tenney 2019 - Probing attention weight: Clark 2020 Factual Knowledge a.k.a Language Model as a Commonsense KB - Petroni 2019, Kassner 2020, Jiang 2020, etc Relational Knowledge a.k.a Language Model as a Lexical Relation Reasoner - LM fine-tuning on relation classification: Bouraoui 2019 - Vanilla LM evaluation: Ushio 2021
  • 4. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Language Model Understanding 4 Syntactic Knowledge - Probing embedding: Hewitt 2019, Tenney 2019 - Probing attention weight: Clark 2020 Factual Knowledge a.k.a Language Model as a Commonsense KB - Petroni 2019, Kassner 2020, Jiang 2020, etc Relational Knowledge a.k.a Language Model as a Lexical Relation Reasoner - LM fine-tuning on relation classification: Bouraoui 2019 - Vanilla LM evaluation: Ushio 2021 Can we distil relational knowledge as relation embedding?
  • 5. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Relation Embedding Word Embedding Mikolov (2013) Pair2Vec Joshi (2019) Relative Camacho-Collados (2019) 5 King Queen Woman Man Word Embedding
  • 7. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Prompt Generation Custom Template, AutoPrompt (Shin 2020), P-tuning (Liu 2021) LM embedding Averaging over the context Relation Embedding from LM 7 (h, t) Word pair Sentence (tokens) Prompt Generation Contextual embeddings Fixed-length embedding LM encoding x Averaging s1 s2 s3
  • 8. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Prompt Generation Custom Template, AutoPrompt (Shin 2020), P-tuning (Liu 2021) LM embedding Averaging over the context Relation Embedding from LM 8 (h, t) Word pair Sentence (tokens) Prompt Generation Contextual embeddings Fixed-length embedding LM encoding x Averaging s1 s2 s3 1. Today, I finally discovered the relation between camera and photographer : camera is the <mask> of photographer 2. Today, I finally discovered the relation between camera and photographer : photographer is camera’s <mask> 3. Today, I finally discovered the relation between camera and photographer : <mask> 4. I wasn’t aware of this relationship, but I just read in the encyclopedia that camera is the <mask> of photographer 5. I wasn’t aware of this relationship, but I just read in the encyclopedia that photographer is camera’s <mask>
  • 9. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Given a triple: anchor “sunscreen::sunburn”, positive “vaccine::malaria”, and negative “dog::cat”, we want the embeddings of the anchor and the posirive close but far from the negative. Loss function: Triplet loss and classification loss following SBERT (Reimers 2019). Fine-tuning on Triples 9 vaccine::malaria sunscreen::sunburn dog::cat
  • 10. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados We create the dataset from SemEval 2012 Task 2. Dataset 10 Class Inclusion Parent Relation Child Relation Taxonomic Functional (h1,t1), ... , (hk,tk) Positive (h1,t1), ... , (hk,tk) Negative : Triplet ( xa, xp, xn ) : : ( xa,1, xp,1, xn,1 ) ( xa,2, xp,2, xn,2 ) : ( xa,m, xp,m, xn,m ) [(xa,m, xp,m, xa,1), ..., (xa,m, xp,m, xp,m-1)] Original batch: m samples Augmented batch: 2m(m-1) samples [(xa,1, xp,1, xa,2 ), ..., (xa,1, xp,1, xp,m)]
  • 12. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Experiment: Analogy 12 Setup - Cosine similarity in between embeddings. - No training. - Accuracy as the metric. - No validation. Sample from SAT analogy dataset. Data statistics.
  • 13. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Experiment: Analogy 13 SotA in 4 / 5 datasets 🎉 Better than tuned methods on dev set 🤗
  • 14. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Experiment: Classification 14 Setup - Supervised Task - LMs are frozen - macro/micro F1 - Tuned on dev Data statistics.
  • 15. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados SotA in 4 / 5 datasets in macro F1 score 🎉 SotA in 3 / 5 datasets in micro F1 score 🎉 Experiment: Classification 15
  • 17. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Relation Memorarization 17 Does RelBERT just memorize the relations in the training set… ? Experiment: Train RelBERT without hypernymy. Result: No significant decrease in hyperbyny prediction. → RelBERT does not rely on the memorization!
  • 18. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Fine-tuning? Other LMs? 18 Train RelBERT on BERT, ALBERT in addition to RoBERTa. → RoBERTa is the best. Vanilla RoBERTa (no fine-tuning). → Fine-tuning (distillation) is necessary.
  • 19. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Conclusion 19 ● We propose RelBERT, a framework to achieve relation embedding model based on pretrained LM. ● RelBERT distil the LM’s relational knowledge and realize a high quality relation embedding. ● Experimental results show that RelBERT embedding outperform existing baselines, establishing SotA in analogy and relation classification.
  • 20. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Release of RelBERT Library 20 We release python package relbert (install via pip install relbert) along with model checkpoints on the huggingface modelhub. Please check our project page https://github.com/asahi417/relbert !! from relbert import RelBERT model = RelBERT( 'asahi417/relbert-roberta-large' ) # the vector has (1024,) v_tokyo_japan = model.get_embedding([ 'Tokyo', 'Japan'])
  • 22. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Comparing to Word Embeddings 22 FastText is still better than RelBERT in Google Analogy Question. Breakdown per relation types shows that FastText is better in the morphological relation, while very poor in the lexical relation.
  • 23. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Nearest Neighbours 23
  • 24. Distilling Relation Embeddings from Pre-trained Language Models Asahi Ushio, Steven Schockaert, and Jose Camacho-Collados Fine-tuning on Triples Given a triple of the anchor (eg. “sunscreen”), the positive (eg. “sunburn”), and the negative (eg. “evil”), the triplet loss is defined as and the classification loss is defined as where is a learnable weight. The loss functions are inspired by SBERT (Reimers 2019). 24