Skip to content
Back to full roadmap
topiccore

Long-Context Techniques

Structural tactics against 'lost in the middle' in 1M-token contexts.

3 hours2 resources1 prereqs

Tactics:

  1. Instructions at start AND end (critical rules in two places)
  2. XML / markdown sectioning — wrap each doc in a tag
  3. Short summary on top, detail below
  4. Narrow with "look only at sources: <ids>"
  5. End-anchored sampling — put the most critical info in the final user message

Test: Needle-in-a-haystack benchmark — can the model find a random fact in the context when asked?

Prerequisites

Resources(2)

Long-Context Techniques · Prompt Engineer Roadmap | Şükrü Yusuf Kaya