genomic-niah / README.md
loubnabnl's picture
loubnabnl HF Staff
Initial Genome-NIAH release: 4 tasks × 6 ctxs = 24 configs, 12000 rows
f286afe verified
|
raw
history blame
7.22 kB
metadata
license: apache-2.0
task_categories:
  - text-generation
tags:
  - dna
  - long-context
  - retrieval
  - benchmark
  - niah
configs:
  - config_name: niah_4k
    data_files:
      - split: test
        path: data/niah_4k/test-*.parquet
  - config_name: niah_8k
    data_files:
      - split: test
        path: data/niah_8k/test-*.parquet
  - config_name: niah_16k
    data_files:
      - split: test
        path: data/niah_16k/test-*.parquet
  - config_name: niah_32k
    data_files:
      - split: test
        path: data/niah_32k/test-*.parquet
  - config_name: niah_64k
    data_files:
      - split: test
        path: data/niah_64k/test-*.parquet
  - config_name: niah_128k
    data_files:
      - split: test
        path: data/niah_128k/test-*.parquet
  - config_name: niah_neardup_d4_4k
    data_files:
      - split: test
        path: data/niah_neardup_d4_4k/test-*.parquet
  - config_name: niah_neardup_d4_8k
    data_files:
      - split: test
        path: data/niah_neardup_d4_8k/test-*.parquet
  - config_name: niah_neardup_d4_16k
    data_files:
      - split: test
        path: data/niah_neardup_d4_16k/test-*.parquet
  - config_name: niah_neardup_d4_32k
    data_files:
      - split: test
        path: data/niah_neardup_d4_32k/test-*.parquet
  - config_name: niah_neardup_d4_64k
    data_files:
      - split: test
        path: data/niah_neardup_d4_64k/test-*.parquet
  - config_name: niah_neardup_d4_128k
    data_files:
      - split: test
        path: data/niah_neardup_d4_128k/test-*.parquet
  - config_name: niah_neardup_d2_4k
    data_files:
      - split: test
        path: data/niah_neardup_d2_4k/test-*.parquet
  - config_name: niah_neardup_d2_8k
    data_files:
      - split: test
        path: data/niah_neardup_d2_8k/test-*.parquet
  - config_name: niah_neardup_d2_16k
    data_files:
      - split: test
        path: data/niah_neardup_d2_16k/test-*.parquet
  - config_name: niah_neardup_d2_32k
    data_files:
      - split: test
        path: data/niah_neardup_d2_32k/test-*.parquet
  - config_name: niah_neardup_d2_64k
    data_files:
      - split: test
        path: data/niah_neardup_d2_64k/test-*.parquet
  - config_name: niah_neardup_d2_128k
    data_files:
      - split: test
        path: data/niah_neardup_d2_128k/test-*.parquet
  - config_name: niah_neardup_d1_4k
    data_files:
      - split: test
        path: data/niah_neardup_d1_4k/test-*.parquet
  - config_name: niah_neardup_d1_8k
    data_files:
      - split: test
        path: data/niah_neardup_d1_8k/test-*.parquet
  - config_name: niah_neardup_d1_16k
    data_files:
      - split: test
        path: data/niah_neardup_d1_16k/test-*.parquet
  - config_name: niah_neardup_d1_32k
    data_files:
      - split: test
        path: data/niah_neardup_d1_32k/test-*.parquet
  - config_name: niah_neardup_d1_64k
    data_files:
      - split: test
        path: data/niah_neardup_d1_64k/test-*.parquet
  - config_name: niah_neardup_d1_128k
    data_files:
      - split: test
        path: data/niah_neardup_d1_128k/test-*.parquet

Genome-NIAH

A NIAH-style needle-in-a-haystack benchmark for genomic language models, with a DNA-specific near-duplicate distractor extension that's not in RULER.

Tasks

Task What it tests
niah Plain NIAH: insert (KEY, VALUE) at a random depth, query KEY → expect VALUE. The cliff diagnostic.
niah_neardup_d4 NIAH + 8 distractor (KEY', VALUE') pairs where KEY' differs from KEY by 4 bp (83 % key identity).
niah_neardup_d2 Same but Δ = 2 bp (92 % key identity).
niah_neardup_d1 Same but Δ = 1 bp (96 % key identity) — the discrimination test.

Context lengths

Six lengths in 6-mer-tokens (Carbon convention) → bp:

ctx (tokens) ctx (bp) mode
4 k 24 kbp contiguous (single ACGT run from one OG2 record)
8 k 49 kbp contiguous
16 k 98 kbp contiguous
32 k 197 kbp stitched-within-record
64 k 393 kbp stitched
128 k 786 kbp stitched

Why two modes? OpenGenome2 records are pre-chunked at 128 KiB max contiguous ACGT (gaps from N's, soft-masked repeats, and metadata break the sequence). For ctx ≤ 16 k tokens we use single contiguous runs from one OG2 record. For ctx ≥ 32 k tokens we stitch all ACGT runs from a single record together (gaps removed within the same chromosome) — this matches how DNA language models are trained and preserves chromosomal locality.

The haystack_mode column distinguishes "real" (contiguous) from "real_stitched" (stitched).

Subset structure (24 configs total)

Each config = one (task, ctx) pair. Layout matches RULER's HF convention:

data/<task>_<ctx>/test-00000-of-00001.parquet
from datasets import load_dataset
ds = load_dataset("hf-carbon/genome-niah", "niah_16k")        # 500 rows, 5 depths × 100/cell
ds = load_dataset("hf-carbon/genome-niah", "niah_neardup_d1_64k")

Sampling design (per config)

  • n = 500 retrieval rows per (task, ctx) — matches RULER's per-cell scale
  • 5 needle depths (10 / 25 / 50 / 75 / 90 %), 100 rows each
  • Stratified across 4 species (animalia / fungi / plantae / protista) matching Carbon's training distribution; 25 rows per (depth, species)
  • Wilson 95 % CI half-widths: ± 9.8 % per-cell, ± 4.4 % per-(task, ctx)

Source

OpenGenome2 NCBI eukaryotic test + valid splits across all 8 batches: arcinstitute/opengenome2 → midtraining_specific/ncbi_eukaryotic_genomes/. Chromista is dropped (not in Carbon's training mix; also has the worst fragmentation under the [ACGT]+ filter).

Schema

column dtype description
uid string deterministic SHA1 row id
haystack_mode string real (contiguous) or real_stitched
source string animalia / fungi / plantae / protista
context_length_tokens int 6-mer tokens (× 6 = bp)
context_length_bp int length of positive_sequence
depth int needle insertion depth as percentage
condition string retrieval (only — no no_memory in this release)
key, value string random 24 bp DNA strings
negative_value string value with all 24 bp mutated to a different base
prompt string <dna> + haystack with embedded (KEY, VALUE) + trailing KEY
positive_sequence string prompt + value
negative_sequence string prompt + negative_value
target_insert_start_bp / target_insert_end_bp int needle position (niah only)
distractor_keys, distractor_values string comma-separated lists (niah_neardup_* only)

Evaluation metrics

  • gen_exact_match — strict: greedy decode (DNA-token-restricted) matches value char-for-char.
  • ll_correct — lenient: LL(value | prompt) > LL(negative_value | prompt).

Citation

If you use this benchmark, please cite the Carbon DNA model project (Hugging Face).

Built with the build_dna_long_context_retrieval.py / build_dna_lcr_harder.py pipelines in the carbon-long-context repo.