Variable length, order matters, long-range dependencies
An image is a fixed-size grid. A sentence is a variable-length sequence where the meaning depends on word order ("dog bites man" ≠ "man bites dog"). Audio is a long sequence at high sampling rates. Code is a structured sequence. Each token's meaning depends on tokens far away — sometimes the relevant context is hundreds of tokens back.
Three core challenges: variable length (no fixed input shape), order sensitivity (permuting tokens changes meaning), long-range dependencies (token N may depend on token N-1000).
The sequence task shapes
- Sequence classification (sentiment, intent) — one label for a whole sequence.
- Sequence labeling (NER, POS) — one label per token.
- Sequence-to-sequence (translation, summarization) — output sequence given input sequence.
- Causal language modeling (GPT) — predict the next token given all previous tokens.
What you'd need from an ideal sequence model
Constant-time per-token inference, true long-range memory, parallelizable training, and reasonable parameter efficiency. No single architecture has all four. RNNs gave constant per-token cost but bad long-range memory; transformers gave great long-range memory and parallel training at the cost of quadratic attention.