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.
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
- Mutation sensitivity — Do stems respond differently than loops to complement mutations? Controlled by nucleotide-stratified permutation null.
- Dinucleotide null — Of families passing Rung 1, how many survive when the null is stratified by dinucleotide context?
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cdabb9be3a85b8675f79e38fe27a4454d6a75998135a5b47b794d0cb8e77e5b
|
|
| MD5 |
55654794ef3758b0ca5cb5a90824aee1
|
|
| BLAKE2b-256 |
007ba0a46cfe8b7960f2201483b49194ef72bd954b3f1f285172ddaafa5c9d4d
|
Provenance
The following attestation bundles were made for rna_structure_audit-0.1.0.tar.gz:
Publisher:
publish.yml on elliottower/rna-structure-audit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rna_structure_audit-0.1.0.tar.gz -
Subject digest:
6cdabb9be3a85b8675f79e38fe27a4454d6a75998135a5b47b794d0cb8e77e5b - Sigstore transparency entry: 2195010326
- Sigstore integration time:
-
Permalink:
elliottower/rna-structure-audit@8d939d33b4429cd0dbb5dd08be2ba22b40d17a96 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/elliottower
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8d939d33b4429cd0dbb5dd08be2ba22b40d17a96 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rna_structure_audit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rna_structure_audit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 46.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c13baa4554a8c243dd34f644c12049871dffe42bcf355e58c3c8474792d70e0
|
|
| MD5 |
f022231b2de28215bb89307504c2d005
|
|
| BLAKE2b-256 |
a6ea13c6396b4a702ae183234a0bc1e93b1d8447527fe402ad6e71f8bf33304f
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rna_structure_audit-0.1.0-py3-none-any.whl -
Subject digest:
1c13baa4554a8c243dd34f644c12049871dffe42bcf355e58c3c8474792d70e0 - Sigstore transparency entry: 2195010329
- Sigstore integration time:
-
Permalink:
elliottower/rna-structure-audit@8d939d33b4429cd0dbb5dd08be2ba22b40d17a96 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/elliottower
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8d939d33b4429cd0dbb5dd08be2ba22b40d17a96 -
Trigger Event:
release
-
Statement type: