jeb-rag
收藏资源简介:
JEB-Bench 是一个公开的、用于自适应检索增强生成(RAG)管道的每查询×每配置 (correct?, joules, latency, tokens) 矩阵基准数据集,并附带生成该数据集的测量工具。该数据集旨在填补现有基准(如RAGRouter-Bench和HAKARI-Bench)中缺乏直接测量能量消耗的空白。现有自适应RAG文献通常以检索调用次数、步数、令牌数、延迟或美元成本来衡量效率,但从未直接测量能量。JEB-Bench 通过测量每个查询在不同配置下的实际能量消耗(以毫焦耳计)、正确性、延迟和令牌数,提供了直接的能量核算。数据集包含用于构建 oracle 矩阵的测量数据,包括索引构建能量日志、测量验证结果等。数据规模在10万到100万之间,涉及 NQ、HotpotQA、PopQA、TriviaQA 等数据集。该基准适用于评估自适应RAG方法的能量效率,特别关注两个关键问题:(1)路由器自身的能量消耗未被扣除;(2)索引构建能量未被摊销。修正这两个问题会改变已发表方法的效率排名。数据集使用 GPL 能量测量方法(基于NVML),在 NVIDIA T4 GPU 上运行,并提供了详细的测量方法论、已知限制(如单GPU模型、CPU能量建模等)和引用信息。
JEB-Bench is a public benchmark dataset providing a per-query × per-configuration (correct?, joules, latency, tokens) matrix for adaptive retrieval-augmented generation (RAG) pipelines, along with the measurement tools used to generate it. The dataset aims to fill the gap in existing benchmarks (e.g., RAGRouter-Bench and HAKARI-Bench) that lack direct energy consumption measurements. Existing adaptive RAG literature typically measures efficiency via retrieval calls, steps, tokens, latency, or dollar cost, but never directly measures energy. JEB-Bench provides direct energy accounting by measuring actual energy consumption (in millijoules), correctness, latency, and token count for each query under different configurations. The dataset includes measurement data for constructing oracle matrices, index building energy logs, measurement validation results, etc. The data size ranges from 100k to 1M, covering datasets such as NQ, HotpotQA, PopQA, TriviaQA. This benchmark is suitable for evaluating the energy efficiency of adaptive RAG methods, with particular attention to two key issues: (1) the energy consumption of the router itself is not deducted; (2) index building energy is not amortized. Correcting these two issues changes the efficiency ranking of published methods. The dataset uses the GPL energy measurement method (based on NVML), runs on NVIDIA T4 GPU, and provides detailed measurement methodology, known limitations (e.g., single GPU model, CPU energy modeling), and citation information.
JEB-Bench 数据集概述
基本信息
- 数据集名称: JEB-Bench (Charging the Gate Rent: Measured-Energy Accounting for Adaptive Retrieval-Augmented Generation)
- 许可证: Apache-2.0
- 语言: 英语
- 任务类型: 问答、文本检索
- 数据集规模: 100K < n < 1M
- 配置:
oracle_matrix包含四个数据子集(NQ、HotpotQA、PopQA、TriviaQA),以 Parquet 格式存储
核心内容
这是首个公开的 每查询 × 每配置(正确性、焦耳、延迟、令牌数)矩阵,用于检索增强生成(RAG)管道,并附带产生该矩阵的测量工具。区别于现有基准(按令牌计价或仅关注检索质量),该数据集提供了直接测量的能量消耗数据。
关键动机
该数据集针对自适应 RAG 效率评估中的两个关键盲点:
- 路由能量未被计入:基于草稿的门控机制在做出二元决策时的自身能量消耗未被扣除
- 索引构建能量未被摊销:不同配置的比较忽略了向量索引构建的成本
这两项修正改变了已发表方法的效率排名。
仓库结构
harness/: 冻结的测量代码及版本清单,所有账户运行字节级一致的副本phase0/: 测量验证结果(门控判定、能量读数、校准点、计数器探针、RAPL 探针等)indices/: 索引变体及每次构建的能量日志bench/oracle/: 核心结果——oracle 矩阵(Parquet 格式)logs/: 运行树、检查点、来源追踪registry/: 分片协调事件
测量方法论
| 方面 | 方法 |
|---|---|
| GPU 能量 | 使用 NVML 毫焦耳计数器,运行时经验验证,必要时回退到功率积分 |
| 同步 | 每个测量区域前后均执行 torch.cuda.synchronize() |
| 窗口长度 | 依据每种工作负载经验推导最小稳定窗口,通过批处理或重复达到 |
| 热管理 | 观察并记录温度、时钟、利用率、降频原因,不丢弃高温读数 |
| 热控制 | 随机化执行顺序 + 早-晚漂移统计门控(5% 容差) |
| CPU 能量 | 未直接测量(RAPL 不可访问),采用 TDP 估算并标记为 CPU |
硬件环境
- NVIDIA T4 GPU(Turing 架构)双卡,每卡 16 GB
- 仅支持 fp16,不支持 bf16 或 FlashAttention-2
已知局限
- 仅基于单一 GPU 型号,绝对焦耳数为 T4 特定值;可迁移的是排名和盈亏平衡点
- CPU 能量为建模值而非实测值
- NVML 功率读数可能偏离物理功率计
- Phase 2 跨六个 Kaggle 账户运行,跨账户可比性依赖冻结工具的 SHA-256 断言





