RNAmin-RLVR

Testing whether RLVR's structural recipe transfers to a domain with effectively zero pretraining overlap.

Ryan Clark · April 2026

TL;DR

I trained Qwen3-4B-Instruct with GRPO to design RNA sequences that fold into target dot-bracket structures, using ViennaRNA as a fast verifier. In-domain, mean structural match climbed 72.9% → 92.7% (perfect-solve rate 30% → 52% as the binary check). Cross-domain, the same checkpoint degraded GPQA Diamond by −4.1pp, the opposite sign of what a matched BoolMin-RLVR run produced (+3.5). The algorithm, base model, and training budget are matched to the BoolMin run; the task is the only variable. The choice of task seems to matter more than the existence of a verifier. n=1 seed per condition; see caveats.

BenchmarkBaseRNA-trainedBoolMin-trained
GPQA Diamond48.0%43.9% (−4.1)51.5% (+3.5)
MATH-50091.0%91.2% (+0.2)90.4% (−0.6)
IFEval (strict)84.5%83.0% (−1.5)84.1% (−0.4)
IFEval (loose)87.8%87.1% (−0.7)87.2% (−0.6)

Matched-pair zero-shot evaluation. Same base model (Qwen3-4B-Instruct-2507), same algorithm (GRPO via Tinker), same hyperparameters, matched training budget (~150 / ~250 steps; ~$11–15 each). Only the training task varies. n=1 seed per condition.

The question

RLVR (reinforcement learning with verifiable rewards) has worked best when the verifier is fast and the task is far from contaminated pretraining data. The existing literature (math reasoning, classical NP problems, code unit tests) mostly clusters in one neighborhood of "discrete CS-flavored problems." I wanted to test whether that neighborhood is driving reasoning transfer effects or whether other domains could produce similar cross-domain transfer.

RNA inverse folding is unusually well-suited as a test:

If RLVR produces meaningful in-domain learning on RNA inverse folding, that's a signal that task structure (inverse design + fast verifier) matters more than task content (math, code, biology). If it doesn't, that's evidence the existing successes lean heavily on domain-specific pretraining priors.

Task design

The model receives a target secondary structure in dot-bracket notation and must output an RNA sequence whose minimum-free-energy fold matches it:

Target:   ..(((..(((....)))..(((...)))..)))..
Output:   SEQUENCE = GCUAACGUAUGCAACGUAAGCUUACGGUACCUGCC

Verification folds the output with ViennaRNA at the default temperature and computes a position-by-position match against the target structure. The reward function is layered to give useful gradient on the typical rollout, where most early outputs fold into something unrelated:

Reward tierConditionValue
Format bonusParseable output extracted0.05
Stepping-stoneCorrect length + valid A/U/G/C alphabet0.15
Partial match≥80% positional match (threshold)match_frac × 0.9
Perfect matchExact structural match1.0 + stability bonus (≤0.1)

The 80% positional-match threshold is deliberate: RNA folding is cooperative, so a sequence whose fold matches at 60% of positions isn't "60% correct"; it's essentially random and a different molecule. The stepping-stone reward for length-and-alphabet correctness was essential: without it, ~75% of early rollouts scored 0 and offered no gradient signal.

Difficulty tiers and data

TierLengthMax depthTypical structure
Easy20–35 nt1–2Single hairpin or simple stem-loop
Medium35–60 nt2–32–3 stem-loops, possible internal loops
Hard60–100 nt3–4Multi-branch loops, long-range pairing
Expert100–150 nt4+Multiple folded domains (eval only)

Structures are generated on-the-fly by a recursive descent grammar that enforces the biological constraints that matter for foldability: minimum hairpin loop size of 3 nucleotides, minimum stem length of 3 base pairs, balanced parentheses. The evaluation set is two fixed benchmarks: an in-house 400-instance suite (100 per tier through hard) and a 100-instance subset of community Eterna puzzles.

Training setup

Results

Evaluated on a 100-instance held-out test set drawn from RNA-Eval:

MetricBase (Qwen3-4B-Instruct)After RLVRΔ
Perfect solve rate30%52%+22 pp
Sequence validity rate56%57%+1 pp
Parseable rate92%98%+6 pp
Mean structural match72.9%92.7%+19.8 pp
Mean reward0.6080.845+0.237
Two-panel chart showing the RNA-RLVR training trajectory across 150 cumulative steps. Left panel: mean reward climbs from about 0.55 at step 0 to roughly 0.8 by step 80 and plateaus around 0.78. Right panel: in-domain perfect-fold rate climbs from about 0.2 to roughly 0.4 with high step-to-step variance. A dotted vertical line marks step 50 where training resumed from the trial checkpoint.
150-step in-domain trajectory composed from the trial (steps 0–49) and trial_100 (steps 50–149) logs. Light traces are per-step values; bold lines are 10-step rolling averages. Mean reward climbs cleanly; the perfect-fold rate is noisier per-step (cooperative folding is high-variance), but the rolling average shows the climb that ends at the 52% figure on the held-out eval set.

A few observations from these numbers:

Cross-domain evaluation

The motivating question (does RLVR on a maximally out-of-distribution domain transfer to general reasoning?) needs the trained checkpoint to be evaluated on standard benchmarks. The same 150-step RNA-trained checkpoint was run zero-shot against the suite I use for the matched BoolMin-RLVR experiment:

BenchmarkBaseRNA-trainedΔ
MATH-50091.0%91.2%+0.2 (flat)
GPQA Diamond48.0%43.9%−4.1
IFEval (strict)84.5%83.0%−1.5
IFEval (loose)87.8%87.1%−0.7

Graduate-level science reasoning degrades by 4.1 points; instruction-following degrades modestly; math is flat. This is the opposite sign of what the parallel BoolMin-RLVR run produced on the same base model with the same algorithm (BoolMin: GPQA +3.5). Two RLVR runs, both with strong in-domain learning, both with fast verifiers, opposite transfer signs.

Reading the cross-domain result. RLVR's structural properties (fast verifier, exploration, partial reward) don't automatically produce reasoning transfer. The choice of task domain interacts with what the model generalizes to. Boolean logic seems to share something with GPQA-style reasoning (constraint satisfaction, compositional structure) that RNA secondary-structure design doesn't. Whether that's about task content or about what the model spends rollouts doing is the next experiment to run; see the BoolMin writeup for that thread.

Reading the result

I'd separate what this run contributes by confidence.

The strong claim, well-supported by the data: RLVR works on a domain with effectively zero pretraining overlap. In-domain learning is substantial (+22pp perfect solve, +19.8pp mean match) over a 150-step, ~$11 training budget. The reward design (layered stepping-stone → threshold → exact) and the format-robust verifier are reusable patterns for any inverse-design task where most rollouts miss the target.

The weaker, more interesting claim, supported by the comparison with BoolMin: task choice drives reasoning transfer. With model, algorithm, and training budget held constant, one task transfers positively to graduate-level science reasoning and the other transfers negatively. Whichever direction the field eventually lands on, "find any task with a fast verifier" is too coarse a recipe.

Reusable methodological pieces from this run:

  1. The layered reward design. A binary reward on perfect-fold would have produced near-zero gradient through the early phase of training; the stepping-stone tier (length + alphabet) and the threshold-based partial credit (≥80% match) keep the signal informative without rewarding noise. I'd expect this layout to generalize to any inverse-design task where most candidates miss completely.
  2. The output-format robustness in the verifier. The parser handles three output formats (echo-back, contiguous, and a regex fallback for the longest A/U/G/C stretch). This sounds boring but matters: it cleanly separates "the model didn't learn the task" from "the model produced a sequence in a format the verifier didn't recognize," and it kept early-training rollouts from being penalized for format quirks.

Caveats and scope

Next experiments

  1. Disentangle task content from task structure. The BoolMin/RNA contrast is the most scientifically interesting finding here, and it's currently a comparison of two specific tasks. A shuffled-truth-table control on BoolMin (verifier accepts anything matching the output format) tests whether the algorithm or the task is doing the work. If GPQA still moves on the shuffled control, the structure was the active ingredient; if it doesn't, task content was. Either result is informative.
  2. Multi-seed replication of the cross-domain numbers. The −4.1 on GPQA is a single-seed point estimate on a 198-instance benchmark. Sampling noise at 50% accuracy gives a standard error around ±3.5pp, so one additional seed at the 150-step checkpoint would tell us whether the negative transfer is robust or whether it sits inside the noise floor.
  3. Full curriculum execution. The 3,500-step main run with the 3-phase curriculum is configured but only the 150-step easy-tier pilot has run. Whether hard-tier exposure changes either the in-domain ceiling or the cross-domain sign is open.
  4. Validity-rate reward shaping. Sequence-validity rate didn't move from 56% to 57%; the model still fails to produce a valid candidate ~43% of the time. A 2×2 ablation on stepping-stone weight × threshold strictness would identify whether reward shaping or training scale is the bottleneck.
  5. Comparison to a domain-specific RNA design model. ViennaRNA's RNAinverse and modern tools like RNAiFold provide a strong baseline; the gap (or overlap) is informative for whether this LLM is doing something a specialized solver couldn't.

Code & resources