Sequence models practice problems

18 problems · 0 solved

Sequence models process data where order matters, such as text, speech and sensor readings. Before transformers, recurrent networks read a sequence one step at a time and carried a hidden state forward, a bit like reading a sentence while keeping a running summary in your head. These ideas still matter for speech, streaming and newer state-space models. In these problems you will run a vanilla RNN, implement one step of an LSTM cell and a GRU cell, pick the last real hidden state of each sequence, build teacher-forcing decoder inputs, compute Bahdanau additive attention, backpropagate through time in a linear RNN, decode a CTC output greedily, compute the CTC loss with the forward algorithm in log space, decode the best HMM path with Viterbi, and compute HMM state posteriors with forward-backward. Start with the Easy problems on the vanilla RNN, teacher forcing and CTC greedy decoding. Then do LSTM, GRU, attention and Viterbi, and finish with backprop through time, CTC loss and forward-backward. Speech and time-based products still use these models, and interviewers use them to test your grasp of recurrence and dynamic programming.

Easy 5

Medium 7

Hard 6

Related topics

All practice problems