context
stringlengths
299k
3.17M
multi_turns
listlengths
2
4
id
int64
0
57
"\n\n With a single drop of ink for a mirror, the Egyptian sorcerer undertakes to reveal to any chan(...TRUNCATED)
[{"answer":"Snowfield","input":"Where does Octavio Amber live for the majority of the novel?","optio(...TRUNCATED)
0
" BOOK I\n\n Arms, and the man I sing, who, forc'd by fate, And haughty Carley's unrelenting hate, E(...TRUNCATED)
[{"answer":"Jaelynn","input":"Who is the queen of Carthage, the city-state where Fernando lands afte(...TRUNCATED)
1
"PART ONE\nChapter 1\nHappy families are all alike; every unhappy family is unhappy in its own way.\(...TRUNCATED)
[{"answer":"Mitya","input":"What is the name of Ladonna and Alain's child?","options":["Mitya","Gris(...TRUNCATED)
2
"\n\n |MRS. Natalie Ernesto lived just where the Avonlea main road dipped down into a little hollow,(...TRUNCATED)
[{"answer":"Avonlea","input":"Where will Ellington begin teaching?","options":["Avonlea","White Sand(...TRUNCATED)
3
" THE towers of Zenith aspired above the morning mist; austere towers of steel and cement and limest(...TRUNCATED)
[{"answer":"Religion is heavily influenced by materialism and competition for social status.","input(...TRUNCATED)
4
"PROLOGUE\na mountain range of rubble \nin which our narrator introduces: himself—the colors—and(...TRUNCATED)
[{"answer":"He'll die and they'll have to get rid of his body","input":"When Tara gets sick, Jonah a(...TRUNCATED)
5
"CHAPTER I\nOn an exceptionally hot evening early in July a young man came out of the garret in whic(...TRUNCATED)
[{"answer":"She wants to invite him to the memorial dinner for her father","input":"What is the main(...TRUNCATED)
6
"\n\n York Katara, handsome, clever, and rich, with a comfortable home and happy disposition, seemed(...TRUNCATED)
[{"answer":"Mr. Martha","input":"What is the name of the man Mr. Katara relies on for medical advice(...TRUNCATED)
7
"I am by birth a Genevese, and my family is one of the most distinguished of that republic. My ances(...TRUNCATED)
[{"answer":"He misunderstands the monster's warning.","input":"Why doesn't Kiran protect his wife, R(...TRUNCATED)
8
"Chapter One \nTO THE red country and part of the gray country of Oklahoma, the last rains came gent(...TRUNCATED)
[{"answer":"Gum","input":"What does Sadhbh Owen give to children?","options":["Pennies","Cracker Jac(...TRUNCATED)
9

SCBench

[Paper] [Code]

SCBench

SCBench (SharedContextBench) is a comprehensive benchmark to evaluate efficient long-context methods in a KV cache-centric perspective, analyzing their performance across the full KV cache lifecycle (generation, compression, retrieval, and loading) in real-world scenarios where context memory (KV cache) is shared and reused across multiple requests.

Dataset

SCBench

SCBench covers 12 diverse tasks that test four key long-context capabilities: string retrieval, semantic retrieval, global information processing, and multi-tasking.

String Retrieval

  • Retr.KV: Tests key-value lookup in large JSON objects with random, incompressible content
  • Retr.Prefix-Suffix: Evaluates finding strings with specific prefix and suffix patterns
  • Retr.MultiHop: Assesses multi-hop variable tracing capabilities in long inputs

Semantic Retrieval

  • Code.RepoQA: Function retrieval from large codebases based on natural language descriptions
  • Language QA: Includes English QA, Chinese QA, and multi-choice questions on long texts
  • Requires semantic understanding on length inputs

Global Information Processing

  • Many-shot ICL: Tests in-context learning with hundreds of examples
  • Math.Find: Statistical tasks on large arrays
  • En.Sum: Summarization of documents
  • Requires global information processing or aggregation

Multi-Tasking

  • Mix.Sum+NIAH: Combines summarization with needle-in-haystack search
  • Mix.RepoQA+KV: Integrates code function retrieval with key-value lookup
  • Requires multi-tasking or multi-step reasoning

Two Shared Context Modes

The benchmark evaluates these tasks across two shared context modes:

  • Multi-turn Mode: Caches context within single sessions
  • Multi-request Mode: Shares context across multiple sessions

Compared to previous long-context benchmarks

SCBench

Our SCBench is the first long-context benchmark that covers single-turn, multi-turn, and multi-request scenarios. In addition, our impelmentation also involves KV cache reuse techniques, thereby providing a more comprehensive analysis on the full KV cache lifecycle of efficient long-context methods.

Results and Findings

SCBench

Our SCBench reveals that the following key insights:

Finding 1: Sub-O(n) Memory is Problematic in Multi-Request/Multi-Turn Decoding

  • Sparse decoding methods with sub-O(n) memory perform well on first queries but lose accuracy in subsequent requests
  • Methods maintaining O(n) memory with sub-O(n²) computation during pre-filling can better approximate full attention accuracy across multiple queries

Finding 2: Task Performance Shows Varying Decline Patterns

  • Sparse KV cache methods excel in tasks requiring global information processing
  • O(n) memory is essential for tasks involving exact match retrieval

Finding 3: Performance vs Compression Rate

  • All methods show performance degradation as compression rates increase
  • Sub-O(n) memory methods exhibit significant drop at 1/4 compression rate
  • Methods like RetrievalAttention and KIVI that maintain O(n) memory with sparse decoding show better resilience at higher compression rates

Finding 4: Issues with Long-Generation Scenarios

  • Attention distribution shifts significantly as generation length and number of rounds increase
  • This out-of-distribution (OOD) issue impacts performance even for O(n) memory methods

Finding 5: Dynamic vs Static Patterns

  • Dynamic sparse patterns generally outperform static patterns

Citation

@article{li2024scbench,
    title={SCBench: A KV cache-centric analysis of long-context methods},
    author={Li, Yucheng and Jiang, Huiqiang and Wu, Qianhui and Luo, Xufang and Ahn, Surin and Zhang, Chengruidong and Abdi, Amir H and Li, Dongsheng and Gao, Jianfeng and Yang, Yuqing and Qiu, Lili},
    journal={arXiv preprint arXiv:2412.},
    year={2024}
}
Downloads last month
86