What is CTC loss and where is it used?
hardAnswer
- Connectionist Temporal Classification (Graves 2006): sums the probability over all valid alignments between an input sequence (frames) and an output sequence (labels) that may be shorter.
- Allows a 'blank' token and repeated labels.
- Used in speech recognition (DeepSpeech), handwriting recognition — anywhere you have variable-length outputs but no per-frame labels.
- Modern speech models often replace CTC with attention-based or CTC+Transducer hybrids.
Check yourself — multiple choice
- Requires frame-level labels
- Sums over all valid alignments (with blanks) between frames and labels — enables label-free per-frame training in speech
- Same as cross-entropy
- Only for classification
CTC: marginalize over alignments → speech/OCR without frame labels.
#losses#rnn
Practise Deep Learning
214 interview questions in this topic.
Related questions
- Why did transformers replace RNNs for sequence modeling?
- When is orthogonal weight initialization useful?
- Why compute softmax + cross-entropy jointly via log-sum-exp?
- How should the output head be designed for a regression task with a strictly positive target?
- How is the output head different for multi-label vs multi-class classification?
- What causes exploding gradients and how do you handle them?