Professional Documents
Culture Documents
Beeker: RNN: Sequence To Sequence
Beeker: RNN: Sequence To Sequence
Pawan Goyal
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 1 / 43
What we have seen?
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 2 / 43
What we have seen?
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 2 / 43
What is machine translation?
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 3 / 43
Sequence-to-sequence architecture
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 4 / 43
Sequence-to-sequence architecture
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 4 / 43
Sequence-to-sequence architecture
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 4 / 43
ai÷:m}•¥¥¥÷µ÷⇐s
Target :
Yu -
.
Ym
-
•
French roca
{ de•d← a
-491*7--4 sees
9
adf.wi.ir
pry
lying
-
he
-
-
7-
→
ho→n
-
-
iii. rid
.
tu"
Mud
Teacher
m an <
|YI→
Encoder Foray
Decodes
*
) I'm not teeth
find -
G- - End Tsahy
/ 7 of
asgmax step
poor
.
the
freely actual olp from
tnepser .
step ,
Sequence-to-sequence architecture
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 4 / 43
Sequence to Sequence Models for Machine Translation
time
test -
Never thing
TIherFoz1 testing
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 5 / 43
Sequence to sequence is versatile
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 6 / 43
Neural Machine Translation (NMT)
plyn.be?---.. . -.-.--
An example of a Conditional Language Model
Language Model because the decoder is predicting the next word of the
target sentence y
Conditional because the predictions are also conditioned on the
sentence x
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 7 / 43
Training an NMT system
a
÷÷
-
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 8 / 43
Greedy decoding
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 10 / 43
Exhaustive search decoding
ao →
-
!!
-53 optimal
☒
nose
year
Olr 'T →Lavoe
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 11 / 43
Beam search decoding
Core Idea
On each step of the decoder, keep track of the k most probable partial
translations (hypotheses)
k is the beam size (in practice around 5 to 10)
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 12 / 43
Beam search decoding
Core Idea
On each step of the decoder, keep track of the k most probable partial
translations (hypotheses)
k is the beam size (in practice around 5 to 10)
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 12 / 43
Beam search decoding: example
Beam size = k =2. Blue numbers = d
-
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 13 / 43
Beam search decoding: example
Beam size = k =2. Blue numbers =
score(y1 , . . . , yt ) = Âti=1 logPLM (yi |y1 , . . . , yi 1 , x)
Greedy)
¥75k
✓
9
Es
-
✓
É¥-
< START
?
IIe
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 14 / 43
Beam search decoding: example
Beam size = k =2. Blue numbers =
score(y1 , . . . , yt ) = Âti=1 logPLM (yi |y1 , . . . , yi 1 , x)
É
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 15 / 43
Beam search decoding: example
Beam size = k =2. Blue numbers =
score(y1 , . . . , yt ) = Âti=1 logPLM (yi |y1 , . . . , yi 1 , x)
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 16 / 43
Beam search decoding: example
Beam size = k =2. Blue numbers =
score(y1 , . . . , yt ) = Âti=1 logPLM (yi |y1 , . . . , yi 1 , x)
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 17 / 43
Beam search decoding: example
Beam size = k =2. Blue numbers =
score(y1 , . . . , yt ) = Âti=1 logPLM (yi |y1 , . . . , yi 1 , x)
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 18 / 43
Beam search decoding: example
Beam size = k =2. Blue numbers =
score(y1 , . . . , yt ) = Âti=1 logPLM (yi |y1 , . . . , yi 1 , x)
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 19 / 43
Beam search decoding: example
Beam size = k =2. Blue numbers =
score(y1 , . . . , yt ) = Âti=1 logPLM (yi |y1 , . . . , yi 1 , x)
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 20 / 43
Beam search decoding: example
Beam size = k =2. Blue numbers =
score(y1 , . . . , yt ) = Âti=1 logPLM (yi |y1 , . . . , yi 1 , x)
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 21 / 43
Beam search decoding: example
Beam size = k =2. Blue numbers =
score(y1 , . . . , yt ) = Âti=1 logPLM (yi |y1 , . . . , yi 1 , x)
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 22 / 43
Beam search decoding: example
Beam size = k =2. Blue numbers =
score(y1 , . . . , yt ) = Âti=1 logPLM (yi |y1 , . . . , yi 1 , x) T
a-
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 23 / 43
Beam search decoding: example
Beam size = k =2. Blue numbers =
score(y1 , . . . , yt ) = Âti=1 logPLM (yi |y1 , . . . , yi 1 , x)
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 24 / 43
Beam search decoding: example
Beam size = k =2. Blue numbers = greedy decodes
score(y1 , . . . , yt ) = Âti=1 logPLM (yi |y1 , . . . , yi 1 , x)
NS .
beam -
Search
deady
forty
drums
tests
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 25 / 43
Beam Search Decoding: Stopping Criterion
In greedy decoding,
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 26 / 43
Beam Search Decoding: Stopping Criterion
-
- - -
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 26 / 43
Beam Search Decoding: Stopping Criterion
times hold
-
In beam search decoding, a
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 26 / 43
Beam Search Decoding: Stopping Criterion
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 26 / 43
Beam Search Decoding: Stopping Criterion
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 26 / 43
Beam Search Decoding: Stopping Criterion
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 26 / 43
Beam Search Decoding: Stopping Criterion
{wytose
I We have at least n completed hypotheses (some pre-defined cutoff)
be #
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 26 / 43
Beam search decoding: finishing up
z
{÷ ✗
w
' we < END ]
Wg Wu SEND>
length Ñ" .
"
normal rzlgpc )
6
would not be preferred
longer sentences
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 27 / 43
Beam search decoding: finishing up
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 27 / 43
Beam search decoding: finishing up
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 27 / 43
Beam search decoding: finishing up
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 27 / 43
Beam search decoding: finishing up
Pawan Goyal (IIT Kharagpur) RNN: Sequence to Sequence Feb 15th, 2022 27 / 43
Alternative for solving NLP problems .
Neural
%↳ representation greedy
vs
÷' beans-
Deco@fseoscnprr.R
"
,
-
'
- deady
Rtr "
Laban generate
t
labels
{ pnetrain.by
-
see .
LS -1ms )
*return } ' ] RAN ( GRUS ,
2? Fasteners
CT -1 4:30 -
5:30 PI ( 22nd Feb)
Tne_
[Muodle ,
sigmrtollwze -1J
has been covered
Syllabus :
Whatever
Austins
AeY÷
:-.
sample
"" "
T÷÷→⇐÷ /
"
9-
RNNk⇐%
• * Hh →
app texts #
BERT} manhtst-o-rusfn-s.es