five

krzonkalla/kamradt-paul-graham-niah-128k-3p5m

收藏
Hugging Face2026-04-30 更新2026-05-03 收录
下载链接:
https://hf-mirror.com/datasets/krzonkalla/kamradt-paul-graham-niah-128k-3p5m
下载链接
链接失效反馈
官方服务:
资源简介:
--- license: mit language: - en task_categories: - question-answering pretty_name: Kamradt-style Paul Graham Long-Context Needle-in-a-Haystack configs: - config_name: default data_files: - split: test path: data/test.jsonl.gz --- # Kamradt-style Paul Graham Long-Context Needle-in-a-Haystack This dataset contains long-context retrieval prompts inspired by Greg Kamradt's Needle-in-a-Haystack setup. ## What makes this Kamradt-style - The haystack is built from the original PaulGrahamEssays directory in gkamradt/LLMTest_NeedleInAHaystack. - A short needle fact is inserted into the haystack. - The needle is inserted at document depths from 0% to 100%. - The insertion point is moved backward to a sentence boundary by searching for the previous period token. - Context lengths are swept across several sizes. ## Structure - Context lengths: [128000, 256000, 512000, 1000000, 2000000, 3500000] - Needle depths: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100] - Number of examples: 66 - Tokenizer used for construction: cl100k_base - Final context length buffer: 200 - Expected answer for every example: RIO_NIAH_PASSCODE_2026 - Base Paul Graham corpus tokens: 149194 - Corpus repeats needed for max context: 25 ## Important note The original Paul Graham essay corpus is much smaller than 3.5M tokens, so this dataset repeats the Paul Graham corpus for the largest contexts. This preserves the original Kamradt haystack source, but it does mean the 512k, 1M, 2M, and 3.5M examples contain repeated essay text. ## Grading A response is correct if it contains this substring: RIO_NIAH_PASSCODE_2026 ## Fields - id: unique example id - benchmark: benchmark name - haystack_source: source corpus - tokenizer: tokenizer used for construction - context_length: requested Kamradt-style context length - final_context_length_buffer: reserved buffer, matching the Kamradt idea - depth_percent: intended needle depth - estimated_context_tokens: estimated context tokens from construction - measured_context_tokens: exact measured context tokens for smaller rows, null for larger rows - measured_prompt_tokens: exact measured prompt tokens for smaller rows, null for larger rows - approximate_needle_start_token_in_context: approximate token index where the needle starts - approximate_needle_end_token_in_context: approximate token index where the needle ends - needle_text: inserted hidden fact - question: retrieval question - expected_answer: fixed answer - answer_check_substring: substring for simple grading - grading_rule: grading description - prompt_sha256: SHA-256 hash of the full prompt - prompt: full prompt to send to the model

This dataset contains long-context retrieval prompts inspired by Greg Kamradts Needle-in-a-Haystack setup. The haystack is built from the original PaulGrahamEssays directory, with a short needle fact inserted at various document depths from 0% to 100%. The insertion point is adjusted to a sentence boundary by searching for the previous period token. Context lengths are varied across several sizes. The dataset structure includes different context lengths, needle depths, and a total of 66 examples. Note that the original Paul Graham essay corpus is much smaller than 3.5M tokens, so the corpus is repeated for the largest contexts. A response is correct if it contains the substring RIO_NIAH_PASSCODE_2026. The dataset includes fields such as unique ID, benchmark name, haystack source, tokenizer, context length, depth percent, needle text, question, expected answer, and more.
提供机构:
krzonkalla
搜集汇总
数据集介绍
main_image_url
构建方式
该数据集基于Greg Kamradt的“大海捞针”(Needle-in-a-Haystack)范式构建,旨在评估长上下文语言模型的信息检索能力。其“干草堆”源自gkamradt/LLMTest_NeedleInAHaystack仓库中的Paul Graham散文语料库,将一段简短且固定的“针”(秘密口令RIO_NIAH_PASSCODE_2026)插入其中。插入位置依据文档深度百分比(0%至100%)进行系统调控,并通过回溯至前一个句号边界以对齐自然语句。上下文长度跨越六个量级:128k、256k、512k、1M、2M及3.5M个token,使用cl100k_base分词器进行切分。由于原始语料仅约15万token,最大上下文长度的样本需重复拼接散文内容。最终数据集包含66个测试样例,每个样例保留了预期的token索引与精确的提示文本。
特点
本数据集的核心特点在于其系统化的长上下文评估设计。通过遍历六个上下文长度与十一个插入深度,构建了一个涵盖66个测试点的精细矩阵,能够全面揭示模型在不同信息密度下的检索瓶颈。固定答案的设计确保了评分的客观性与一致性——仅需检测输出是否包含子串“RIO_NIAH_PASSCODE_2026”即可判定正误。每个样本提供了详尽的元数据字段,包括预估与实测的token数量、针的起止位置、完整提示文本及其SHA-256哈希值,极大便利了实验复现与深度分析。值得注意的是,对于512k及以上的超长上下文,语料的重复性使得数据集重点转向测试模型对重复模式的抗干扰能力。
使用方法
使用时,可直接从数据集的“default”配置中加载JSONL格式的测试集。每个样本包含完整的“prompt”字段,研究人员应将其直接输入待评估的语言模型,并收集模型生成的全部输出。评判标准简洁明确:若输出中包含子串“RIO_NIAH_PASSCODE_2026”,则视为检索成功。通过与元数据中的“depth_percent”和“context_length”字段进行交叉分析,可绘制模型在上下文长度与信息深度二维空间内的性能热力图,从而系统性地识别模型在长上下文场景下的局部与全局注意力缺陷。此数据集特别适用于对比不同架构(如Transformer与状态空间模型)或不同位置编码方案(如RoPE与ALiBi)在极端长序列上的表现差异。
背景与挑战
背景概述
该数据集名为Kamradt-style Paul Graham Long-Context Needle-in-a-Haystack,由研究人员基于Greg Kamradt的经典“干草堆里找针”评测范式构建,旨在评估长上下文语言模型在超长文本中检索微小信息的能力。创建于大型语言模型上下文窗口飞速扩展的时期,核心研究机构与个人聚焦于模型在128k至3.5M token范围内的信息定位精度。该数据集以Paul Graham的散文集为背景语料,通过在不同深度插入固定“针”(隐藏事实)并提问,系统性地测试模型对极长序列的注意力与记忆能力。作为长上下文评测的标杆之一,它推动了模型在文档理解、信息抽取等领域的性能量化,为研究者提供了评估长序列处理稳健性的重要工具。
当前挑战
数据集所解决的领域挑战在于,长上下文处理已成为大语言模型的关键瓶颈,模型常在超长文本中丢失早期信息或难以精准定位局部细节。该数据集通过模拟“干草堆里找针”场景,直击模型在极端长度(如3.5M token)下信息检索失败的问题。构建过程中面临的主要挑战包括:原始Paul Graham语料仅149k token,为达到百万级上下文长度必须重复语料,导致后段文本包含大量重复内容,可能干扰模型的真实检索表现;同时,插入点需精确迁移至句边界以保持语义自然,且需在0%至100%深度覆盖全范围,这对自动化构建流程的容错性与一致性提出了严格要求。
常用场景
经典使用场景
在长上下文语言模型的评估领域,Kamradt风格的“大海捞针”(Needle-in-a-Haystack)测试已成为衡量模型长距离信息检索能力的标杆。该数据集巧妙地将一条短小的“针”事实嵌入到Paul Graham散文构成的“干草堆”中,通过系统改变上下文长度(从128k到惊人的3.5M tokens)和“针”的插入深度(0%至100%),构建了一个极具挑战性的检索任务。模型需在浩瀚且重复的文本中精确定位并提取那条被隐藏的特定信息,从而检验其是否真正具备了有效的长程上下文利用能力,而非仅仅是在统计上占据优势。这一设置精准地模拟了现实世界中处理海量文档或超长对话时所需的精准信息召回场景。
衍生相关工作
作为长上下文评估的基石,该数据集催生了一系列经典的相关工作。其核心范式被广泛借鉴于诸如“Long-Haystack”、“Multi-Needle Haystack”等扩展评测中,后者将单针检索升级为多针排序或动态信息追踪,进一步增加了任务复杂度。许多研究团队基于此数据集的框架,系统对比了包括RWKV、Mamba、Hyena等非Transformer架构及各种高效注意力Transformer(如Longformer、BigBird)在超长上下文上的表现,揭示了不同模型在信息召回率随长度增加的衰减模式。更重要的是,该数据集的理念被集成进标准的模型能力测试套件(如HELM、L-Eval),成为新模型发布时的事实性基准。此外,其“干草堆”构建策略也启发了主动遗忘与检索增强训练方法的设计,推动了对重复文本鲁棒性的系统性研究。
数据集最近研究
最新研究方向
该数据集聚焦于长上下文语言模型的检索能力评估,采用经典的“大海捞针”范式,将特定事实嵌入至变长文本中,系统性地测试模型在极端上下文长度(高达350万token)下的信息定位与提取能力。这一研究方向与当前大模型向超长序列处理演进的趋势紧密相连——随着GPT-4、Claude等模型窗口不断扩展,验证其是否真正具备长程依赖理解与精准检索能力成为关键。数据集通过控制上下文长度、插入深度等变量,揭示模型在信息淹没环境下的表现瓶颈,为优化注意力机制、改进位置编码及开发更高效的长上下文推理策略提供了实证基础,对推动可信任、高精度长文本AI系统的发展具有重要价值。
以上内容由遇见数据集搜集并总结生成
二维码
社区交流群
二维码
科研交流群
商业服务