SDE & MLE Prep

Long Context

Q: How do models handle very long inputs, and what breaks?

Techniques: RoPE scaling / position interpolation, training on long sequences, efficient attention (FlashAttention, sliding window + global tokens), KV-cache compression, ring/sequence parallelism. Failure modes: "lost in the middle" (information in the middle is used less), cost growing with length, distractors reducing accuracy. Mitigations: RAG to select relevant chunks, put key instructions at the start/end, summarize or structure long inputs, evaluate with needle-in-a-haystack and realistic multi-hop tasks.