Skip to main content

Three-rung benchmark for evaluating whether RNA/DNA foundation models encode genuine secondary structure or composition shortcuts.

Project description

rna-structure-audit

Three-rung benchmark for evaluating whether RNA/DNA foundation models encode genuine secondary structure or composition shortcuts.

Open Quickstart in Colab Open BYOM Tutorial in Colab

Install

pip install rna-structure-audit

For pre-built adapters (ERNIE-RNA, RiNALMo, RNA-FM, and 7 more):

pip install rna-structure-audit[all-models]

Quick start

from rna_structure_audit.adapters import ERNIERNAAdapter
from rna_structure_audit.evaluate import evaluate

results = evaluate(ERNIERNAAdapter(), device="cuda")
print(results["report"]["grade"])  # A

Pre-built adapters

Adapter Model Params Grade
ERNIERNAAdapter ERNIE-RNA 86M A
RiNALMoAdapter RiNALMo 650M A
SpliceBERTAdapter SpliceBERT 19M D
UTRLMAdapter UTR-LM 1.2M D
RNAFMAdapter RNA-FM 99M D
NTAdapter Nucleotide Transformer v2 56M D
HyenaDNAAdapter HyenaDNA 5.4M D
CaduceusAdapter Caduceus 14M D
EvoAdapter Evo 7B D
DNABERT2Adapter DNABERT-2 117M D

Bring your own model

Write an adapter for your model:

from rna_structure_audit.adapter import ModelAdapter
import torch

class MyModelAdapter(ModelAdapter):
    name = "my-model"
    d_model = 640
    n_layers = 12

    def load(self):
        # Load your model
        ...

    def tokenize(self, sequence: str) -> torch.Tensor:
        # Return input_ids tensor
        ...

    def get_all_layer_embeddings(self, tokens: torch.Tensor) -> list[torch.Tensor]:
        # Return list of (seq_len, d_model) tensors, one per layer
        ...

Then run from the command line:

rna-structure-audit --adapter my_adapter.py --device cuda -o results.json

Or from Python:

from rna_structure_audit.evaluate import evaluate

adapter = MyModelAdapter()
results = evaluate(adapter, device="cuda")
print(results["report"]["grade"])  # A, B, C, or D

See the Bring Your Own Model tutorial for a full walkthrough.

Grading

Grade Meaning
A Partner-specific: encodes which position pairs with which
B Structure-aware beyond composition: survives dinucleotide controls
C Composition-sensitive: stem/loop signal absorbed by nucleotide null
D No detectable structure signal

The three rungs

  1. Mutation sensitivity — Do stems respond differently than loops to complement mutations? Controlled by nucleotide-stratified permutation null.
  2. Dinucleotide null — Of families passing Rung 1, how many survive when the null is stratified by dinucleotide context?
  3. Partner specificity — When position i is mutated, is perturbation at its base-pairing partner j greater than at j's stem-adjacent neighbors? Controlled by within-stem derangement null.

Citation

Tower, E. (2026). A Three-Rung Evaluation of RNA Structure Awareness in Foundation Models.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rna_structure_audit-0.1.0.tar.gz (3.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rna_structure_audit-0.1.0-py3-none-any.whl (46.5 kB view details)

Uploaded Python 3

File details

Details for the file rna_structure_audit-0.1.0.tar.gz.

File metadata

  • Download URL: rna_structure_audit-0.1.0.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rna_structure_audit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6cdabb9be3a85b8675f79e38fe27a4454d6a75998135a5b47b794d0cb8e77e5b
MD5 55654794ef3758b0ca5cb5a90824aee1
BLAKE2b-256 007ba0a46cfe8b7960f2201483b49194ef72bd954b3f1f285172ddaafa5c9d4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rna_structure_audit-0.1.0.tar.gz:

Publisher: publish.yml on elliottower/rna-structure-audit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rna_structure_audit-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rna_structure_audit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c13baa4554a8c243dd34f644c12049871dffe42bcf355e58c3c8474792d70e0
MD5 f022231b2de28215bb89307504c2d005
BLAKE2b-256 a6ea13c6396b4a702ae183234a0bc1e93b1d8447527fe402ad6e71f8bf33304f

See more details on using hashes here.

Provenance

The following attestation bundles were made for rna_structure_audit-0.1.0-py3-none-any.whl:

Publisher: publish.yml on elliottower/rna-structure-audit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page