Turning digital data into synthetic DNA means writing bits as strings over the four nucleotides A, C, G, T that a chemical synthesizer can actually build and a sequencer can read back. Arbitrary bit-to-base mapping produces random-looking strings, and randomness is bad for chemistry: skewed GC content shifts melting temperatures and can stop synthesis outright, long runs of one base cause insert/delete errors during sequencing, and strands that fold back on themselves (hairpins) become chemically silent. Today's encoders handle this with fast static lookup tables — but tables can only enforce local rules like run-length limits, while the genuinely global problems (strand-level free energy, cross-hybridization between oligos, batch-level synthesis cost across millions of parallel oligos) are left to slow search or ignored. In a parallel universe, the real-time optimization community solved an analogous problem by unfolding: take an iterative solver, truncate it to a fixed small number of iterations, and turn each iteration into one neural network layer, so a problem that took 100 variable-length iterations finishes in 4 deterministic ones. And a third literature warns exactly what happens if you then try to prune such a network naively: irregular, unstructured zero patterns run slower on dense GPU hardware unless the sparsity is shaped to match it.
This proposal builds a single system at that three-way junction. The core object is an unfolded encoder: a fixed-depth network whose layers are the iterations of a penalty-method optimizer over nucleotide sequences, trained so that every forward pass emits a constraint-compliant oligo in bounded, predictable wall-clock time. Two ingredients make it more than an architecture sketch. First, the layer weights are trained from scratch under 2:4 semi-structured sparsity using the Sparse-Refined Straight-Through Estimator of Learning N: M Fine-grained Structured Sparse Neural Networks From Scratch, so the network runs natively on Ampere-class sparse Tensor Cores — sidestepping the preprocessing trap that disqualifies unstructured kernels like SMaT in per-call settings. Second, the constraint weights are conditioned on measured channel statistics, which turns the field's most divisive empirical dispute — whether to forbid bad sequences or to allow errors and correct them — from a fixed design choice into a per-write decision the encoder makes in real time.
Core Claim
The claim is threefold and testable. First, a projected-gradient optimizer over per-position nucleotide distributions, unrolled into $K \approx 4$–$8$ layers, can jointly enforce local constraints (GC balance, homopolymer limit $h$) and global ones (Nussinov-style free-energy surrogates, synthesis reference cost), at code rates competitive with dedicated static schemes. Second, training those layers under 2:4 N:M sparsity with SR-STE preserves encoding quality — Zhou et al. report ResNet-50 at 2:4 sparsity reaching 77.0% ImageNet top-1 versus 77.3% dense, and 4:8 reaching 77.4%, i.e. near-lossless — while delivering the deterministic $2\times$ hardware speedup, so the wall-clock claim is real rather than a FLOP-counting fiction. Third, when the constraint weights are input-conditioned on error statistics from the actual sequencer in the loop, the encoder should learn the regime map that the constrained-versus-error-correction debate has been arguing about by hand: relax toward pseudo-randomized, error-corrected output on error-tolerant platforms, tighten toward strict constraints when synthesis cost or strand silence dominates.
The last point is grounded in a genuine unresolved tension. Embracing errors is more effective than avoiding them through constrained coding for DNA data storage proves, via capacity models and empirical Twist/Nanopore/Illumina traces, that forbidding codewords costs more Shannon capacity than the errors save — an $m{=}1$ repeat constraint only pays off if the error rate reaches nearly 75%, and their datasets show no significant correlation between run length (up to 6) and insertion rates. But Controlling gene expression with deep generative design of regulatory DNA documents that extreme GC fractions can make physical synthesis fail completely, and DNA codes that avoid secondary structures reports that intra-strand folding can render up to 30% of codewords chemically silent in unconstrained molecular storage — failure modes that no amount of Reed-Solomon coding recovers, because the strand never gets made or never gets read. Both sides are right in different regimes; no existing encoder switches between them based on evidence.
Research Program
The unfolded solver. Represent each candidate oligo position $i$ as a probability vector $p_i \in \Delta^4$ over $\{A,C,G,T\}$. The encoder minimizes a penalized objective
$$ \min_{p}\; D\big(p \,\|\, r\big) \;+\; \lambda_{\mathrm{GC}}\, C_{\mathrm{GC}}(p) \;+\; \lambda_{\mathrm{H}}\, C_{\mathrm{H}}(p) \;+\; \lambda_{\mathrm{FE}}\, C_{\mathrm{FE}}(p) \;+\; \lambda_{\mathrm{syn}}\, C_{\mathrm{syn}}(p), $$
where $r$ is a reference distribution produced by XOR-randomizing the payload (so decodability and error correction behave as in Embracing errors...), $C_{\mathrm{GC}}$ and $C_{\mathrm{H}}$ penalize GC deviation and run-length violations, $C_{\mathrm{FE}}$ is a differentiable surrogate of the Nussinov pairing matrix following DNA codes that avoid secondary structures, and $C_{\mathrm{syn}}$ measures reference-sequence synthesis cost in the sense of Batch Optimization for DNA Synthesis, which exploits the exact duality $\mathrm{cost}_{ACGT}(S) + \mathrm{cost}_{TGCA}(S) = 4n+1$ for homopolymer-free strands. Each unfolded layer is one projected-gradient step: a small learned convolution over the local base context, followed by a learned step size and a projection back onto the simplex. Unfolding follows the recipe validated in Unfolding WMMSE Using Graph Neural Networks for Efficient Power Allocation, where a 4-layer unfolded model matched a 100-iteration solver (sum-rate 83.21 versus 82.94) at roughly 2 ms versus 16 ms per sample — the same truncation-with-learned-hyperparameters principle, transplanted from wireless power allocation to sequence design. After $K$ layers, argmax gives the emitted nucleotide string.
Semi-structured sparse layers. The learned context-to-base matrices in every layer are trained under 2:4 (and 4:8) N:M masks using SR-STE, which suppresses the mask "flickering" that destabilizes sparse-from-scratch training Learning N: M.... This is a deliberate rejection of the alternative route through unstructured sparsity: High Performance Unstructured SpMM Computation Using Tensor Cores shows unstructured sparse matrix multiplication can be made fast on Tensor Cores (up to 125× over cuSPARSE on SuiteSparse matrices, beating dense cuBLAS from 78% sparsity) only via expensive offline Jaccard row-reordering — a cost its own authors flag as a bottleneck for dynamic workloads. An encoder that must re-run per write, with constraint weights changing per channel trace, cannot afford per-call reordering; N:M masks are fixed at training time and cost nothing at inference. The price is a hard 50% sparsity ceiling, which is acceptable here because the encoder's compute is modest and the binding constraint is wall-clock per oligo, not model size.
Adaptive constraint weights. The penalty vector $\lambda = (\lambda_{\mathrm{GC}}, \lambda_{\mathrm{H}}, \lambda_{\mathrm{FE}}, \lambda_{\mathrm{syn}})$ is produced by a small conditioning network from an error-statistics summary of the target platform (substitution/insertion/deletion rates, run-length error correlations in the style of the Weindel et al. traces, plus synthesis-cost parameters). Training pairs each $\lambda$-regime with its appropriate target output, so the same network covers the whole strictness spectrum rather than one operating point. This directly attacks the open problem that Adaptable DNA Storage Coding: An Efficient Framework for Homopolymer Constraint Transitions solves only discretely (transitioning between fixed homopolymer limits $h_1 \to h_2$ via table recomposition): here strictness is a continuous, learned knob, changed in a single forward pass.
Why the real-time framing is not manufactured. High-throughput array synthesis writes millions of oligos in parallel and requires per-pool combinatorial decisions — the batch partitioning and dual-reference selection of Batch Optimization for DNA Synthesis currently solved by static quantile sorting — and High-throughput DNA synthesis for data storage documents the chemical-cycle throughput pressure this creates on the digital compilation side. A fixed-depth, sparse-Tensor-Core encoder is the digital component that can keep pace with that pipeline, and it is also the only way constraint strictness can respond to in-loop evidence within a write session.
Proposed Experiments
Three experimental tracks, all on benchmarks documented in the file. First, code quality: on synthetic i.i.d. data with $h=4$ and GC tolerance 0.05, the yardstick is the 1.988 bits-per-nucleotide achieved by Efficient and low-complexity variable-to-variable length coding for DNA storage against its theoretical 1.990 bpn limit, across strand lengths $L \in \{100, 200, 400, 500, 1000\}$; on the "Jetplane" image (where the same paper reports 3.32 bpn including compression) and on ILSVRC2012 images, the yardstick is DNA-QLC's 2.90 bits/nt net density. Second, biochemical validity: every emitted oligo is checked with the Vienna RNA/DNA package for secondary structure, in the manner DNA codes that avoid secondary structures used to confirm that none of its 49 length-7 shift-property codewords folded; we additionally simulate a 2% error channel and measure post-reconstruction SSIM against DNA-QLC's reported 0.917. Third, wall-clock: end-to-end encoding throughput (oligos/second and bits/second) on an A100 with sparse Tensor Cores, dense-unfolded versus 2:4-unfolded versus static-table encoders, plus an SMaT-style baseline with unstructured pruning to demonstrate the preprocessing penalty empirically. The headline target is ≥1.8× wall-clock over the dense unfolded encoder at ≤0.05 bpn density loss, and match-or-beat static-scheme density in every constraint regime the static schemes can handle at all.
The adaptive-weights track is the scientific core. We train and evaluate under three channel regimes drawn from the empirical datasets in Embracing errors... (Twist, Nanopore, Illumina traces) plus a synthesis-cost-bound regime. Prediction: on the error-tolerant regimes the conditioning network should drive $\lambda_{\mathrm{H}}$ toward zero, reproducing Weindel et al.'s conclusion from data rather than by proof; in the cost-bound and folding-sensitive regimes it should tighten, and the win should show up as higher net density after synthesis cost and lower silent-codeword fraction. If the adaptive encoder never beats the best fixed policy in any regime, the adaptivity claim is falsified and we will report that.
Baselines
The naive reference point is XOR pseudo-randomization followed by standard Reed-Solomon/LDPC error correction with no constrained coding — the scheme Embracing errors... shows is capacity-optimal on current sequencers, and the cheapest thing anyone can do ($O(1)$ per base). It will be run on the identical payload streams (Jetplane, i.i.d. synthetic, ILSVRC2012) with the same ECC overhead accounting, so net bits/nt and post-error SSIM are compared on equal footing. Beating it means higher net density after ECC parity in at least the cost-bound and folding-sensitive regimes; in the pure sequencer-error regimes it may well tie, and we will say so.
The strongest existing end-to-end competitor is DNA-QLC DNA-QLC: an efficient and reliable image encoding scheme for DNA storage, which holds the best documented net density in this literature at 2.90 bits/nt on ILSVRC2012 — 2.4× the DNA Fountain method, 33.3% cheaper to synthesize than Fountain and 11.6% cheaper than Yin-Yang — and SSIM 0.917 at a 2% error rate where Grass and Yin-Yang drop below 0.4. It will be run with its published 3-bit-to-2-base mapping and its QRes-VAE front end on the same images; we beat it if we match or exceed 2.90 bits/nt while adding global-constraint guarantees (Vienna-validated structure avoidance, batch-aware synthesis cost) that DNA-QLC does not provide, at higher encoding throughput. For code-rate-only comparisons on synthetic data, the reference is the V2V encoder of Efficient and low-complexity... (1.988 bpn at $h{=}4$) and Transfer Coding (rate ~0.9825 versus the ~0.9915 limit) Adaptable DNA Storage Coding..., both run at their published constraint settings.
The ablation that isolates the proposal's key hardware ingredient is the same unfolded encoder trained dense versus trained at 2:4 and 4:8 N:M sparsity with SR-STE, at identical depth $K$, identical training data, and identical tuning budget. The companion ablation isolating the algorithmic ingredient is a black-box MLP or GNN encoder of matched parameter count, also 2:4-sparse, trained on the same data — this tests whether unfolding's inductive bias (the projection structure) or merely the sparse hardware is doing the work. For the speed comparison the fair compute setting is a single A100 with the same batch size across all systems; beating the dense unfolded ablation means ≥1.8× wall-clock with no more than 0.05 bpn density loss, and beating the black-box ablation means lower constraint-violation rate at equal density, particularly on strand lengths (500, 1000) unseen in training.
Why not just…?
Why not just XOR-scramble and add error correction? This is the strongest objection, and Embracing errors... gives it real force: their traces show insertion rates uncorrelated with run length up to 6, and a 75% error rate would be needed to justify forbidding $m{=}1$ repeats. But XOR randomization gives only probabilistic comfort: it cannot model thermodynamics, so it does nothing about the up-to-30% chemically silent codewords from secondary folding documented in DNA codes that avoid secondary structures, and it does nothing about the extreme-GC synthesis failure mode in Controlling gene expression.... More importantly, this proposal does not argue against their conclusion — it subsumes it: when the conditioning network sees error statistics where constraints don't pay, it should drive the constraint weights to zero and collapse toward exactly that behavior. The decisive experiment is whether the adaptive encoder beats the best fixed policy across regimes; if XOR+ECC wins everywhere, our result is a clean empirical confirmation of Weindel et al., which is still worth having but not the headline we expect.
Why not just use static lookup tables like DNA-QLC or Transfer Coding? Tables are genuinely fast and near-optimal on what they encode — Transfer Coding reaches rate ~0.9825 of a ~0.9915 limit, with normalized edit distance 0.0173 versus Goldman's ~0.62 — and we adopt XOR-randomized reference sequences partly for that reason. Their limitation is scope, not speed: a 3-bit-to-2-base dictionary enforces run-length and GC rules locally and cannot see a hairpin forming between positions 40 and 90, cannot price a strand against the $(ACGT)^*/(TGCA)^*$ synthesis reference duality of Batch Optimization for DNA Synthesis, and cannot change strictness without a table redesign, whereas Transfer Coding itself needs a recomposition to move between homopolymer limits. The experiments settle this directly: on strands long enough for global folding (checked with Vienna), we measure the violation rate of table encoders versus the unfolded encoder, and we time the strictness switch (one forward pass versus recomposition). If tables match the unfolded encoder on all of these, the proposal's global-constraint motivation collapses and only the adaptation result would remain.
Why not just train a black-box MLP or GNN and prune it to 2:4? If the only goal were wall-clock, this would be a real threat — a sparse MLP is a single forward pass with the same Tensor Core benefit. The unfolding literature gives concrete evidence for why it underdelivers on this problem: Unfolding WMMSE Using Graph Neural Networks... found that architecture embedding the solver's update equations generalized from 20-transceiver-pair training to 10 and 30 pairs without retraining, which pure weight matrices do not; Joint Communications and Sensing Hybrid Beamforming Design via Deep Unfolding shows unfolded projections enforce non-convex physical constraints that black-box networks violate. Our analog is length generalization (train at $L \le 200$, test at $L = 500, 1000$) and hard constraint satisfaction: the unfolded projection guarantees violation rates decay by construction, while a black-box network must learn compliance from penalties. The matched black-box baseline in the ablation exists precisely to test this honestly; if it matches the unfolded encoder on both, we will report that the projection structure is unnecessary and the contribution reduces to "sprinkle N:M sparsity on any encoder," which would still be a finding but a smaller one.
Decisive Checks
The proposal stands or falls on four numbers, all falsifiable. One: the 2:4 unfolded encoder achieves at least 1.8× wall-clock over the dense unfolded encoder on an A100, with density loss at most 0.05 bpn — mirroring the near-lossless pattern SR-STE showed on ImageNet (77.0% versus 77.3% dense). Two: on synthetic i.i.d. data at $h{=}4$, the encoder reaches within 1% of the 1.988 bpn of the V2V encoder, i.e. close to the 1.990 theoretical limit. Three: on ILSVRC2012 images, net density at or above DNA-QLC's 2.90 bits/nt with Vienna-confirmed zero secondary structures and SSIM at or above 0.917 under the 2% error channel. Four — the scientific heart — the adaptively-conditioned encoder beats the best fixed policy (strict constraints, or XOR+ECC, whichever is better per regime) on net density in at least two of the three channel regimes, and never loses by more than the capacity tax of the corresponding fixed choice. If the first three hold and the fourth fails, we have built a faster compliant encoder and learned that constraint strictness is not worth adapting — a result that would itself sharpen the standing debate between Embracing errors... and the constrained-coding line of Efficient and low-complexity... and DNA-QLC.
References
- Learning N: M Fine-grained Structured Sparse Neural Networks From Scratch
- Embracing errors is more effective than avoiding them through constrained coding for DNA data storage
- Controlling gene expression with deep generative design of regulatory DNA
- DNA Codes that Avoid Secondary Structures
- Batch Optimization for DNA Synthesis
- Unfolding WMMSE Using Graph Neural Networks for Efficient Power Allocation
- High Performance Unstructured SpMM Computation Using Tensor Cores
- Adaptable DNA Storage Coding: An Efficient Framework for Homopolymer Constraint Transitions
- High-throughput DNA synthesis for data storage
- Efficient and low-complexity variable-to-variable length coding for DNA storage
- DNA-QLC: an efficient and reliable image encoding scheme for DNA storage
- Joint Communications and Sensing Hybrid Beamforming Design via Deep Unfolding