Cs224n lecture 19 20 future of nlp and deep learning

Lecture 20 - Future of NLP and Deep Learning

Kevin Clarke- Areas recently taking off

** **

Harnessing Unlabeled Data - **Backtranslation and unsupervised machine translation**

Monolingual text is easier to acquire! Use a large corpus of unlabeled data and use it to help our billingual translation model.

Pre-training: 1. Separately train encoder and decoder as langauge models 2. Then train jointly on billingual data. Super effective.

Problem with pre-retraining: no “interaction” ebtween the two sentences,

Self-Training: label unlabeled data to get noisy training examples. (Not used very common, its a bad idea, but it inspires back-translation).

Screenshot 2020-02-16 at 9.13.14 PM.png

Back-Translation

Screenshot 2020-02-16 at 9.14.32 PM.png

Back-translation helps a lot.Screenshot 2020-02-16 at 9.16.59 PM.png

What if there is no billingual data?

Word to word unsupervised translation

Unsupervised Word Translation using cross-lingual word embeddings - shard embeddings space for both languages. Keep word vectors close to their translations from monolingual corpora.

FIrst run word2vec on monolingual corpora, getting word embeddings X and Y.

Learn an orthogonal (rotation) metric such that WX ~ Y.

Learn W with adversarial training:

Dsicriminator: Predict if an embedding is from Y or it is a transformed embedding Wx originally from X. Train W so the discriminator gets “confused”.

Screenshot 2020-02-16 at 9.21.17 PM.png

Sentence to sentence unsupervised translation

Model: same encoder-decoder model (without attention) used for both languages

Screenshot 2020-02-16 at 9.23.32 PM.png

Now, this model can be used both as a translation model as well as an autoencoder, because the input can be English or French.

** **

Train it on two objectives:

Training Objective 1: De-noising auto encoder

Training Objective 2: Back translation

First translate fr -> en

Then use as a “supervised example” to train “en -> fr”

Screenshot 2020-02-16 at 9.30.12 PM.png

Results

Screenshot 2020-02-16 at 9.30.45 PM.png

** **

**Notes: Attribute transfer: **

You can use the same appraoch above to do attribute transfer, where the attributes now are not English/French but for example, relaxed, annoyed. Data from Twitter.

Screenshot 2020-02-16 at 9.31.37 PM.png

**Notes: **Doesn’t work so well in languages with very different grammars

** **

Notes: Cross-Lingual BERT

Google concatenated a whole bunch of corpora in differnet langauges and then trained one BERT language model using BERT’s maskLM method.

Facebook porposed to combine this MaskedLM objective with translation

Screenshot 2020-02-16 at 9.35.53 PM.png

Leads to very very substantial improvements in unsupervised machine translation.

They took cross-lingual BERT and take it as input to an unsupervised machine translation system, and got the

current SOTA in unsupervised machine translation.

Screenshot 2020-02-16 at 9.36.47 PM.png

Huge Models: GPT-2, **Scaled up pre-training**

Screenshot 2020-02-16 at 9.39.06 PM.png

Screenshot 2020-02-16 at 9.39.33 PM.png

StyleGAN is in-between the size of EMLO and BERT

Screenshot 2020-02-16 at 9.40.01 PM.png

Screenshot 2020-02-16 at 9.40.35 PM.png

Screenshot 2020-02-16 at 9.41.01 PM.png

Data Parallelism - Each GPU has a copy of the model, split the minibatch across these models. So if you have 16 GPUs, each sees a batch size of 32, you can aggregate the gradeints of these 16 GPUs and you effectively get a batch size of 512 - allows you to train models much faster.

Model Parallelism - Models get so big they can’t fit on a single GPU. In this case, you ahve to split up the model across multiple compute units, that’s what’s done for models the size of GPT-2. There are new frameworks such as Mesh-Tensorflow which are basically designed to make this model parallelism easier.

GPT2

Just a really big Transformer ML, trained on 40GB of text (10x larger than what previous langauge models has been trained on), quite a lot of effort going into making sure the dataset is good quality; take webpages form reddit links with high karma.

Screenshot 2020-02-16 at 9.46.12 PM.png

Screenshot 2020-02-16 at 9.46.53 PM.png

Screenshot 2020-02-16 at 9.47.57 PM.png

X-axis is log(model size), Y-axis is accuracy. Dotted lines are existing works on these tasks. (How could it be doing translation?- Appendix 1)

GPT2 is much worse at Question answering - it only gets 4% accuracy. However, look at GPT2 QA results, it seems like GPT2 has learned some world knowledge about the world.

Screenshot 2020-02-16 at 9.51.30 PM.png

Screenshot 2020-02-16 at 9.52.49 PM.pngMaybe 1 Trillion parameter models will be possible in ~10 years.

Social Ramifications of GPT2 (Appendix 2).

What’s next for NLP?

A lot of the current research “trends” are reactions to BERT. What did BERT “solve” and what do we work on next?

Screenshot 2020-02-16 at 10.02.51 PM.png

Screenshot 2020-02-16 at 10.03.53 PM.png

Screenshot 2020-02-16 at 10.04.14 PM.png

Architecture engineering isn’t providing gains for time improvement!

We need harder NLU tasks. BERT has almost solved SQuAD

Screenshot 2020-02-16 at 10.05.01 PM.png

New Datasets:

Screenshot 2020-02-16 at 10.06.36 PM.png** **

Screenshot 2020-02-16 at 10.07.34 PM.png

Screenshot 2020-02-16 at 10.07.49 PM.png

New Areas of NLP

**Multi-Task Learning - **Another fronteir of NLP is getting one model to perform many tasks. GLUE and DecaNLP are recent examples

Multi-task learning yields improvements on top of BERT.

Screenshot 2020-02-16 at 10.09.40 PM.png

BERT is a very large model, a better way to use that model is to get it to do many things at once.

Low-Resource Settings

Models that don’t require lots of compute power (can’t use BERT) - especially for mobile devices.

Low-resource langauges

Low-data settings (few-shot learning).

Interpreting/Understanding Models

Can we get explainations for model predictions?

Can we understand what models like BERT know and why they work so well?

Rapidly growing area in NLP, very important for some applications (e.g. healthcare).

Usually tested using Diagnostic/Probing Classifiers - take a model like BERT and run it through several tasks, each of which test for one particular thing, like “does this model know about syntax, or POS”?

This is done by training another classifier on top of BERT to do, say, POS tagging, but we only backprop into the diagnostic classifier itself (we are treating the output of BERT as a fixed input).

Screenshot 2020-02-16 at 10.13.23 PM.png

Screenshot 2020-02-16 at 10.15.09 PM.png

The different layers of BERT seem to be representing pretty well the differnet layers of lingustic structure. For example, dependency parsing is a medium-level tasks, and it seems like the medium layers of BERT help most with dependency parsing.

Screenshot 2020-02-16 at 10.15.46 PM.png

NLP in Industry

NLP is rapidly growing in industry:

** **

Lecture 19: Bias in AI Bias in AI - Margaret Mitchell GoogleAI

Prototype - there is “exemplar’ features of objects, i.e. “yellow” bananas.

Human reporting bias - huamns report things not in acordance with real world frequencies

Screenshot 2020-02-16 at 8.36.44 PM.png

Screenshot 2020-02-16 at 8.36.57 PM.png

Appendices

Appendix 1:

How can GPT-2 do EN-Fr Translation when it was trained on a giant corpus of English data?

Because in some parts of the English corpus there were bits of French, and quite amazingly it picked up bits and pieces of how to translate into french even though that wasn’t the inded object of the training.

Screenshot 2020-02-16 at 9.49.54 PM.png

Appendix 2:

Debate about should GPT-2 Release their model

Screenshot 2020-02-16 at 9.54.49 PM.png

Appendix 3: NLP in high stakes decision making