loubnabnl HF Staff commited on
Commit
960e3f6
·
verified ·
1 Parent(s): 6b42e8e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -6
README.md CHANGED
@@ -108,11 +108,11 @@ configs:
108
  path: data/niah_neardup_d1_128k/test-*.parquet
109
  ---
110
 
111
- # Genome-NIAH
112
 
113
  **A long-context retrieval benchmark for genomic language models.**
114
 
115
- Genome-NIAH measures whether a DNA model actually *uses* its long context. Each example plants a random (KEY, VALUE) DNA pair inside a real-genome haystack and asks the model to recover VALUE given the haystack followed by KEY. Because both KEY and VALUE are uncorrelated with the surrounding sequence, the only way to succeed is to retrieve the planted pair at long range — turning the abstract question "does the model use distal context" into a concrete generative task with a per-example accuracy. This benchmark is inspired from [NIAH](https://github.com/gkamradt/LLMTest_NeedleInAHaystack) and [RULER](https://arxiv.org/abs/2404.06654), popular long context benchmarks for natural language.
116
 
117
  The benchmark provides 4 tasks of varying difficulty, and 24 sub-configurations on a **4 × 6 grid** of task difficulty (plain retrieval and three near-duplicate variants) × context length (from 4k to 128k 6-mer tokens ≈ 24,000 DNA base pairs – 786,000 DNA base pairs). Each sub-configuration contains 500 examples, stratified across five needle depths and four eukaryotic kingdoms.
118
 
@@ -133,10 +133,10 @@ The benchmark provides 4 tasks of varying difficulty, and 24 sub-configurations
133
  from datasets import load_dataset
134
 
135
  # Plain retrieval at 16 k tokens (≈ 98 kbp)
136
- ds = load_dataset("hf-carbon/genome-niah", "niah_16k")
137
 
138
  # Hardest near-duplicate variant (KEY′ differs by 1 bp) at 64 k tokens (≈ 384 kbp)
139
- ds = load_dataset("hf-carbon/genome-niah", "niah_neardup_d1_64k")
140
  ```
141
 
142
  For each example, the `prompt` field already contains the full input to feed the model. The expected response is in `value` (for `gen_exact_match`) or can be discriminated against `negative_value` (for `ll_correct`). See [Evaluation metrics](#evaluation-metrics).
@@ -202,7 +202,7 @@ Each row contains:
202
 
203
  The official evaluation script lives in the Carbon repository. See [`evaluation/genome_niah_eval.py`](https://github.com/huggingface/carbon/tree/main/evaluation#5-genome-niah-long-context-retrieval) for the command-line interface, supported backends, and reproducible run instructions.
204
 
205
- Genome-NIAH supports two metrics, computed per example:
206
 
207
  - **`gen_exact_match` (recommended headline metric).** Greedy decoding with the next-token logit space restricted to DNA tokens. The decoded VALUE must match the ground-truth `value` exactly. This is the strict, fully-generative retrieval accuracy.
208
  - **`ll_correct` (complementary).** The log-likelihood of `positive_sequence` (`prompt + value`) is higher than the log-likelihood of `negative_sequence` (`prompt + negative_value`). This is a softer probe: the model only needs to prefer the correct VALUE over a fully-mutated alternative, not to generate it. Useful for diagnosing whether retrieval failures are decoding failures or attention failures.
@@ -211,7 +211,7 @@ We treat `gen_exact_match` as the task metric. `ll_correct` is informative but e
211
 
212
  ## Reference results (Carbon-3B)
213
 
214
- We report reference Genome-NIAH results on [Carbon-3B](https://huggingface.co/hf-carbon/Carbon-3B) and [Carbon-8B](https://huggingface.co/hf-carbon/Carbon-8B) to illustrate how the benchmark behaves across difficulties and context lengths. We evaluate two inference settings: Carbon until the native boundary **32k context**, and the same model under **YaRN 4×** (up to 64 k tokens, ≈ 384 kbp and 128k/131k=786kbp).
215
 
216
  | Native (32 k) | YaRN 4× (up to 64 k) |
217
  |:---:|:---:|
 
108
  path: data/niah_neardup_d1_128k/test-*.parquet
109
  ---
110
 
111
+ # Genomic-NIAH
112
 
113
  **A long-context retrieval benchmark for genomic language models.**
114
 
115
+ Genomic-NIAH measures whether a DNA model actually *uses* its long context. Each example plants a random (KEY, VALUE) DNA pair inside a real-genome haystack and asks the model to recover VALUE given the haystack followed by KEY. Because both KEY and VALUE are uncorrelated with the surrounding sequence, the only way to succeed is to retrieve the planted pair at long range — turning the abstract question "does the model use distal context" into a concrete generative task with a per-example accuracy. This benchmark is inspired from [NIAH](https://github.com/gkamradt/LLMTest_NeedleInAHaystack) and [RULER](https://arxiv.org/abs/2404.06654), popular long context benchmarks for natural language.
116
 
117
  The benchmark provides 4 tasks of varying difficulty, and 24 sub-configurations on a **4 × 6 grid** of task difficulty (plain retrieval and three near-duplicate variants) × context length (from 4k to 128k 6-mer tokens ≈ 24,000 DNA base pairs – 786,000 DNA base pairs). Each sub-configuration contains 500 examples, stratified across five needle depths and four eukaryotic kingdoms.
118
 
 
133
  from datasets import load_dataset
134
 
135
  # Plain retrieval at 16 k tokens (≈ 98 kbp)
136
+ ds = load_dataset("hf-carbon/genomic-niah", "niah_16k")
137
 
138
  # Hardest near-duplicate variant (KEY′ differs by 1 bp) at 64 k tokens (≈ 384 kbp)
139
+ ds = load_dataset("hf-carbon/genomic-niah", "niah_neardup_d1_64k")
140
  ```
141
 
142
  For each example, the `prompt` field already contains the full input to feed the model. The expected response is in `value` (for `gen_exact_match`) or can be discriminated against `negative_value` (for `ll_correct`). See [Evaluation metrics](#evaluation-metrics).
 
202
 
203
  The official evaluation script lives in the Carbon repository. See [`evaluation/genome_niah_eval.py`](https://github.com/huggingface/carbon/tree/main/evaluation#5-genome-niah-long-context-retrieval) for the command-line interface, supported backends, and reproducible run instructions.
204
 
205
+ Genomic-NIAH supports two metrics, computed per example:
206
 
207
  - **`gen_exact_match` (recommended headline metric).** Greedy decoding with the next-token logit space restricted to DNA tokens. The decoded VALUE must match the ground-truth `value` exactly. This is the strict, fully-generative retrieval accuracy.
208
  - **`ll_correct` (complementary).** The log-likelihood of `positive_sequence` (`prompt + value`) is higher than the log-likelihood of `negative_sequence` (`prompt + negative_value`). This is a softer probe: the model only needs to prefer the correct VALUE over a fully-mutated alternative, not to generate it. Useful for diagnosing whether retrieval failures are decoding failures or attention failures.
 
211
 
212
  ## Reference results (Carbon-3B)
213
 
214
+ We report reference Genomic-NIAH results on [Carbon-3B](https://huggingface.co/hf-carbon/Carbon-3B) and [Carbon-8B](https://huggingface.co/hf-carbon/Carbon-8B) to illustrate how the benchmark behaves across difficulties and context lengths. We evaluate two inference settings: Carbon until the native boundary **32k context**, and the same model under **YaRN 4×** (up to 64 k tokens, ≈ 384 kbp and 128k/131k=786kbp).
215
 
216
  | Native (32 k) | YaRN 4× (up to 64 k) |
217
  |:---:|:---:|