Blogs / Why Long Sequences Are Hard to Train On

Why Long Sequences Are Hard to Train On

What a Hugging Face post says about why long-sequence training has become essential, which tasks need it and how attention scales.

  • Learning
  • 1 min read

For: Learners who know what a language model is.

Why long sequences matter

Training large language models on long sequences has become essential for building capable AI systems.[1]

Which tasks need them

As models are increasingly used for tasks like document analysis, code understanding, complex reasoning, and RAG workloads, the need to process sequences of hundreds of thousands—or even millions—of tokens has grown dramatically.[1]

Long-sequencetraining is essentialdocument analysis, code,reasoning and RAGHundreds of thousandsof tokensor even millionsAttention scalesquadraticallywith sequence lengthneedsruns into
What makes long sequences a training problem?

How attention scales

The attention mechanism in transformers scales quadratically with sequence length.[1]

Sources

  1. Ulysses Sequence Parallelism (huggingface.co · checked )

More articles