--- license: cc-by-4.0 pretty_name: GeneAnnotationBench task_categories: - question-answering - multiple-choice language: - en size_categories: - 1K Choose the best answer: A) regulation of translation in response to endoplasmic reticulum stress B) copper ion transport C) dTMP salvage D) negative regulation of adenylate cyclase-activating adrenergic receptor signaling pathway E) positive regulation of natural killer cell chemotaxis F) mitochondrial tRNA wobble position uridine thiolation G) fast-twitch skeletal muscle fiber contraction H) regulation of transcription by RNA polymerase II I) nuclear polyadenylation-dependent rRNA catabolic process J) protein K33-linked deubiquitination Answer with a single letter. ``` ## Evaluation ### Load a Pinned Revision Install `datasets`, copy the immutable commit SHA from the Hub's **Files and versions** page, and pin it as `REVISION`: ```python from datasets import load_dataset REVISION = "" test = load_dataset( "nvidia/GeneAnnotationBench", split="test", revision=REVISION, ) ``` ### Model-Input Contract Only `prompt_template` and `dna_sequence` are model inputs. Fields named `answer_*` and `*_provenance` are labels or provenance and **must never be appended to, rendered into, or otherwise exposed through the evaluation prompt**. Provenance supports traceability and post-inference analysis only; it may reveal the answer directly or indirectly. Every template contains exactly one ``. DNA-native models should retain that placeholder in the text prompt and pass the sequence through their DNA modality. Text-only baselines should replace the placeholder with the uppercase `ACGTN` sequence. ```python row = test[0] assert row["prompt_template"].count("") == 1 # DNA-native model prompt = row["prompt_template"] dna = row["dna_sequence"] # prediction = model.generate(prompt=prompt, dna_sequence=dna) # Text-only baseline text_prompt = row["prompt_template"].replace( "", row["dna_sequence"] ) # prediction = model.generate(text_prompt) # Never add row["answer_indices"], other answer_* fields, or *_provenance fields. ``` Models should return one option letter for `single_choice` questions and a comma-separated set of option letters for `multi_select` questions. ### Final-answer format and optional reasoning For a boxed-answer evaluation protocol, replace only the final plain-letter instruction in `prompt_template` with: ```text Respond with exactly one final answer in \boxed{...}, containing the option letter or letters. For multiple letters, use alphabetical order separated by comma and space, for example \boxed{A, F}. ``` Preserve the question, choices, their order, DNA placeholder and gold `answer_indices`. This instruction does not require a visible reasoning trace. It works with models that hide reasoning or return it separately as `reasoning_content`. Score only the final answer in the assistant `content`; never concatenate a separate reasoning field into the answer being scored. For a native model returning an inline trace, separate that trace from its final answer before applying the same answer parser. ```python import re def parse_boxed_answer(final_answer): """Parse final answer content independently of reasoning availability.""" match = re.fullmatch(r"\s*\\boxed\{([A-J](?:, [A-J])*)\}\s*", final_answer) if match is None: return [] letters = match.group(1).split(", ") if letters != sorted(set(letters)): return [] return ["ABCDEFGHIJ".index(letter) for letter in letters] ``` Use the same single-choice exact match and localization option-set micro-F1 under this protocol. Report the prompt version, answer parser, token budget and malformed-answer rate. Keep historical plain-letter scores identified as such; their answer protocol differs. The relaxed scoring implementation below accepts explicit answers accompanied by explanations. Never concatenate separate reasoning into scored content. Trace-envelope checks, such as the native Lightning newline and closing-tag contract, belong to training diagnostics and GRPO formatting rewards. Report these separately from benchmark answer scores. Missing, hidden or separately returned reasoning must not invalidate an otherwise correct benchmark answer. This documentation does not modify the frozen `test.parquet` or its SHA-256. ### Scoring: relaxed explicit-answer extraction The current relaxed scorer accepts explanatory assistant text when it contains an explicit, unambiguous answer. It uses only the final assistant `content` and presented choices; separate thinking, reasoning summaries, gold labels and provenance are never inputs to answer extraction. This is deterministic parsing, not an LLM judge or semantic answer matching. The parser first retains answers accepted by the original strict parser. If that fails, it tries consistent boxed selections, answer-labelled lines, then an explicit leading, bolded or terminal selection. Full choice text is accepted only when it matches exactly one presented choice, ignoring case, presentation markup and a trailing period. It does not harvest option letters from prose or accept a copied choice list as an answer. At the selected extraction priority, conflicting selections, duplicates, alternatives such as “A or C”, and multiple letters for a single-choice question score as an empty prediction. Examples: | Assistant content | Question type | Parsed selection | | --- | --- | --- | | `Final answer: C. Because A and B are distractors.` | single choice | C | | `**C) siRNA processing**` | single choice | C | | `Answer: A and C — both compartments.` | multi-select | A, C | | `Analysis mentions A and B.` followed by `The answer is C.` | single choice | C | | `Answer: A or C` | either | empty | | `Answer: A, A` | either | empty | | `Answer: A, C` | single choice | empty | | `Answer: A` followed by `Answer: C` | either | empty | For the six single-choice aspects, report exact-match accuracy. For localization, aggregate true positives, false positives and false negatives across questions and report option-set micro-F1, `2 TP / (2 TP + FP + FN)`. The headline score is **the unweighted mean of these seven aspect metrics**, not pooled question accuracy. An empty selection is incorrect for single-choice questions and adds all gold localization options to false negatives. The API completion status must be normalized to `finish_reason="stop"` for a completed answer. Any other status, including token-limit termination, scores as empty even if an early answer appears in the response. Missing responses make a run incomplete; do not silently omit them or report a partial run as a complete benchmark. Transport failures may be retried with the same policy; completed or length-capped answers are not resampled to improve the score. The implementation below is the current campaign parser and scoring policy. It supports both the full test split and a published reviewed panel, provided all seven aspects are represented. Select the 350-question panel by the IDs in `subsets/350.json`; it contains 50 questions per aspect. Use the subset files from the same pinned Hub commit as the Parquet; replacement IDs differ from earlier reviewed panels. ```python import re from collections import Counter def final_options(content: str, multi_select: bool) -> set[str]: """Parse one boxed final answer or an answer-only A–J list, never reasoning. Extra boxes, malformed lists, duplicate options and missing answers score as empty predictions. A single-choice response containing multiple options also scores empty. Parsing is fixed independently of gold labels. """ boxes = re.findall(r'\\boxed\{([^{}]*)\}', content) if len(boxes) > 1: return set() answer = boxes[0] if boxes else content.strip() if not re.fullmatch(r'\s*[A-J](?:\s*,\s*[A-J])*\s*', answer): return set() letters = [value.strip() for value in answer.split(',')] if len(set(letters)) != len(letters) or (not multi_select and len(letters) != 1): return set() return set(letters) def plain(text): """Remove presentation markup while retaining option letters and prose.""" return re.sub(r'[*`]', '', text).strip().lstrip('#').strip() def selection(text, multi_select): """Read an explicit initial letter list without harvesting prose letters. Accept commas, semicolons, slashes, ampersands and 'and'. Reject alternatives expressed with 'or', duplicate letters and multiple single-choice selections. The suffix may contain the answer text or an explanation. """ text = plain(text) match = re.match(r'^\(?([A-J])\b((?:\s*(?:,|;|/|&|\band\b)\s*[A-J]\b)*)', text) if not match: return None suffix = text[match.end():] if re.match(r'^\s*(?:or\b|(?:,|;|/|&)\s*(?:or\b|[A-J]\b))', suffix): return None # A letter must be separated from prose; an initial 'A protein ...' is not # an answer selection. Parentheses, punctuation or a line break are explicit. if suffix and not re.match(r'^\s*(?:[().,:;\-–—]|$)', suffix): return None letters = [match.group(1), *re.findall(r'\b[A-J]\b', match.group(2))] if len(set(letters)) != len(letters) or (not multi_select and len(letters) != 1): return None return set(letters) def explicit_answer(content, multi_select, choices, original_parser): """Return a selection plus extraction evidence, or leave ambiguity ungraded. Priority is original valid answer, consistent boxes, explicit answer-labelled lines, then a leading selection. Named-choice matching requires a complete choice text and uniqueness. Copied choice lists are not treated as selections. """ original = original_parser(content, multi_select) if original: return original, 'original_valid' boxes = re.findall(r'\\boxed\{([^{}]*)\}', content) if boxes: selected = [selection(box, multi_select) for box in boxes] if all(selected) and len({tuple(sorted(s)) for s in selected}) == 1: return selected[0], 'explicit_box' return set(), 'ambiguous_or_invalid_box' raw_lines = [line.strip() for line in content.splitlines() if plain(line)] lines = [plain(line) for line in raw_lines] if not lines: return set(), 'empty' labelled = [] for index, line in enumerate(lines): if re.fullmatch(r'(?:final\s+|correct\s+)?answer\s*[:=]?', line, re.I): if index+1 < len(lines): labelled.append(lines[index+1]) continue match = re.match(r'^(?:(?:therefore|thus|so)[,:]?\s*)?(?:the\s+)?(?:final\s+|correct\s+)?answer(?:\s+is)?\s*[:=\-]?\s+(.+)$', line, re.I) if not match: match = re.match(r'^(?:final\s+|correct\s+)?answer\s*[:=]\s*(.+)$', line, re.I) if match: labelled.append(match.group(1)) candidates = labelled or [lines[0]] if not labelled and selection(lines[0], multi_select) is None: # A separately bolded answer line is an explicit selection even when it # follows an analysis paragraph. Multiple different selections conflict. bold_selections = [line for raw, line in zip(raw_lines, lines) if raw.startswith('**') and selection(line, multi_select)] if bold_selections: candidates = bold_selections elif selection(lines[-1], multi_select): # Some models put an unformatted final selection after explanatory # paragraphs. A terminal selection must not merely end a choice list. option_lines = [line for line in lines if re.match(r'^[A-J][).]\s', line)] if len(option_lines) <= 1 or (re.match(r'^[A-J][).]\s*Correct\b', lines[-1], re.I) and all(re.match(r'^[A-J][).]\s*Incorrect\b', line, re.I) for line in option_lines[:-1])): candidates = [lines[-1]] parsed = [] for candidate in candidates: result = selection(candidate, multi_select) if result is None: named = [chr(65+i) for i, choice in enumerate(choices) if plain(candidate).casefold().rstrip('.') == plain(choice).casefold().rstrip('.')] result = set(named) if len(named) == 1 else None parsed.append(result) if not all(parsed) or len({tuple(sorted(s)) for s in parsed}) != 1: return set(), 'unresolved_or_conflicting_answer' if not labelled and candidates == [lines[0]] and sum(bool(re.match(r'^[A-J][).]\s', line)) for line in lines) > 1: return set(), 'unselected_choice_list' return parsed[0], 'labelled_answer' if labelled else 'leading_answer' def score(rows, predictions): """Score every row by ID using explicit answers and completed responses. predictions[id] must contain content and a normalized finish_reason. Missing IDs raise KeyError rather than disappearing from the denominator. """ counts, correct = Counter(), Counter() tp = fp = fn = invalid = nonstop = 0 extraction = [] for row in rows: prediction = predictions[row["id"]] selected, rule = explicit_answer( prediction["content"], row["aspect"] == "localization", row["choices"], final_options, ) if prediction["finish_reason"] != "stop": selected, rule = set(), "nonstop_excluded" nonstop += 1 gold = set(row["answer_letters"]) aspect = row["aspect"] counts[aspect] += 1 invalid += not selected if aspect == "localization": tp += len(selected & gold) fp += len(selected - gold) fn += len(gold - selected) else: correct[aspect] += selected == gold extraction.append({"id": row["id"], "selected": sorted(selected), "rule": rule}) expected = {"biological_process", "domains", "family", "function", "localization", "molecular_activity", "pathways"} if set(counts) != expected: raise ValueError("All seven aspects are required for comparison") metrics = {aspect: correct[aspect] / counts[aspect] for aspect in sorted(expected - {"localization"})} metrics["localization"] = 2 * tp / (2 * tp + fp + fn) return { "metrics": metrics, "mean_seven_aspects": sum(metrics.values()) / 7, "counts": dict(counts), "invalid_answers": invalid, "length_or_other_nonstop_answers": nonstop, "extraction": extraction, } ``` Fix the parser before evaluation and use it identically for every model. Record the dataset revision, selected subset, complete prompt, output ceiling, reasoning settings, provider/model identity, finish-status normalization, parser version, and invalid/capped counts. Keep historical strict scores labelled separately; relaxed scoring changes answer extraction, not the underlying metric or labels. Parser source SHA-256 (the `plain`, `selection`, and `explicit_answer` module): `fbbf35373d71a8f67df5458fb10b2370e9ba3e589eec2adcec3c86cd4a98351a`. ## References - [Gene Ontology](https://geneontology.org/) - [UniProt](https://www.uniprot.org/) - [InterPro](https://www.ebi.ac.uk/interpro/) and [Pfam](https://www.ebi.ac.uk/interpro/entry/pfam/) - [Reactome](https://reactome.org/) - [NCBI Datasets](https://www.ncbi.nlm.nih.gov/datasets/) ## Ethical Considerations NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. Developers should work with their internal developer teams to ensure this dataset meets requirements for the relevant industry and use case and addresses unforeseen product misuse. GeneAnnotationBench evaluates computational predictions from genomic sequence. Its annotations may be incomplete, uncertain, or context-dependent, and benchmark performance does not establish biological mechanism, clinical validity, or safety. Users should account for organism and source coverage, possible annotation bias, and the risk of overgeneralizing from a fixed multiple-choice benchmark. Please report quality, risk, security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).