liveBook · Manning

Sequence

As explained in LLMs in Production

Sequence data is data whose elements have an ordered position that carries information.

A sequence is an ordered array whose elements carry information through their positions; moving an element can change the whole. section 2.2.7

Language models can process tokens in sequence, using an internal state as new inputs arrive. Recurrent neural networks accept variable-length inputs, but longer sequences can cause gradients to vanish or explode, making training difficult. section 2.2.7

Sentiment across sentence lengths

“I loved the movie last night” and a much longer sentence expressing similar sentiment may receive different positive ratings in an RNN: the shorter sentence can rate higher because of how sequence processing affects the result. section 2.2.7

How LLMs in Production covers it

How deep it goes
Defines ordered arrays and explains variable-length RNN inputs and gradient problems, without detailing their mathematical mechanics.
Examples
Compares two semantically similar movie-review sentences of different lengths for sentiment analysis.
What you can do after
Understand how ordered, variable-length language inputs are processed by RNNs and why long sequences can complicate training.
How it connects
Connects sequences to recurrent neural networks, long short-term memory networks, tokens, gradients, multilayer perceptrons, and Markov chains.

Also explained in

Compare how 22 books explain sequence →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of LLMs in Production. The section links point to the parts of the book it draws on.