Direct RNA sequence design under codon constraints using expressive tensor-based secondary structure models
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: Genomics Radio. Generated commentary on the latest computational biology and genomics papers.
Ines: We're looking at the paper: "Direct RNA sequence design under codon constraints using expressive tensor-based secondary structure models".
Marcus: The gist Direct RNA sequence design under codon constraints using expressive tensor-based secondary structure models demonstrates a direct and efficient algorithm to sample sequences from a suitable Boltzmann distribution defined…
Ines: First, who's behind it and why it matters.
Title and authors: Ines: So we're looking at this paper today called "Direct RNA sequence design under codon constraints using expressive tensor-based secondary structure models". It looks like they are tackling the problem of designing mRNA sequences that code for a specific protein, but they're doing it by directly sampling from a distribution.
Marcus: Yeah, so instead of just trying to find one best sequence through some kind of optimization that might get stuck in a local minimum, this approach aims to sample sequences directly from what’s called a Boltzmann distribution. It defines this based on both the codon sequence and a detailed secondary structure free energy model, which is pretty comprehensive.
Yuki: For us as geneticists, the implication here is that we can generate an entire ensemble of coding sequences instead of just one candidate. This gives us something statistically principled to look at before we even start experimental work.
Ines: Exactly. The paper focuses on how they use dynamic programming combined with these tensor models to handle both the hard constraints—the actual protein sequence—and the soft constraints, which are often related to secondary structure stability. They use a specific formulation involving tensor trains and traces of matrix products for this, which is pretty advanced stuff.
Marcus: And what's really interesting for me from a data science standpoint is that they aren't just giving us one answer; they show how to compute exact statistical quantities like free energies, base pairing probabilities, and even codon marginals. This means we can get very precise information about the distribution of sequences.
Yuki: That’s important because it lets us calculate things like the expected total number of base pairs in a sampled sequence at thermal equilibrium, which is something you need when you are trying to understand the physical properties of these molecules.
Ines: Right, and they also provide methods for exactly computing the marginal probability of an amino acid being coded by a specific codon, which gives us insight into how often certain genetic codes appear in this generated ensemble.
Marcus: They also show algorithms for sequence sampling itself, which is Algorithm S4 point 1, and they talk about tracking suboptimal sequences using Algorithm S4 point 5, which lets you find combinations that are systematically more stable than what you'd get from just picking things randomly <ref:2604.19718#pg1>.
Title and authors: Yuki: So it’s not just about finding a good sequence; it’s about understanding the whole landscape of possibilities and filtering that landscape based on physical or biological criteria we define.
Ines: And computationally, they state that the complexity is O(n three), but they also show that for many problem sizes, it's actually faster than that theoretical limit, and with GPU acceleration they see speedups up to about one hundred times over serial computation.
Marcus: That’s a big deal for throughput because if we can get this kind of exact sampling done quickly on hardware, it opens up possibilities for designing sequences much faster than current heuristic methods allow.
Yuki: What I wonder is how far this framework extends beyond just secondary structure stability; can we apply these tensor models to other kinds of biological constraints?
Ines: The authors mention that the methodology is extensible, meaning they built a general and extensible framework for sequence design via dynamic programming, and they say it applies to "relatively arbitrary bonusing functions locally built in terms of sequence or secondary structure."
Marcus: That extensibility is key because it means we can incorporate those biologically motivated soft constraints we talked about earlier, not just hard coding constraints for the protein itself. It lets us model things like local base pair preferences directly into the design process.
Yuki: From a population genetics view, if we can generate this ensemble of sequences that are physically stable according to these detailed models, it gives us a much richer set of candidates to see which ones are actually favored by selection in nature.
Ines: So the core idea is using tensor-based free energy models within dynamic programming to create an efficient generator for sequences from a Boltzmann distribution defined by both codon usage and structure. This is what they call direct and efficient sampling.
Marcus: And the exact computation of those base pair probabilities, P psi, which takes O(n three) cost, is what allows us to get those precise statistical metrics we need for validation <ref:2604.19718#pg1>.
Yuki: I think the implication for us is that this moves the problem from just sequence generation to characterizing the statistical properties of that generation process itself.
Ines: So, when we wrap up on this paper, "Direct RNA sequence design under codon constraints using expressive tensor-based secondary structure models" provides a principled way to do codon optimization by directly sampling sequences from a distribution defined by structure and codon constraints.
Title and authors: Marcus: It allows for the exact computation of base pair probabilities and codon frequencies, which gives us tools to understand the statistical landscape of possible RNA designs.
Yuki: And it provides an ensemble, not just a single sequence, which is valuable for seeing how different stable sequences behave in a biological context.
Ines: So it’s an efficient generator for many sequences that we can filter according to experimentalist preferences later on, and they also showed how to compute the marginal probability of amino acids being coded by specific codons in O(n) cost after the initial free energy computation.
Marcus: And they demonstrated that this entire framework can leverage parallel computing resources very effectively, with speedups up to about one hundred times when you use multi-GPU acceleration for those dominant computations <ref:2604.19718#pg2>.
Yuki: It’s a powerful tool for bridging the gap between theoretical structure and the practical design of functional molecules.
Ines: It moves us toward a new paradigm where we can incorporate complex biological objectives directly into the sequence design process using this tensor modeling approach, which is what they call expressive tensor-based secondary structure models.
Marcus: So to wrap up on this paper, "Direct RNA sequence design under codon constraints using expressive tensor-based secondary structure models" shows a direct and efficient algorithm for sampling sequences from a Boltzmann distribution defined by codon sequence and detailed secondary structure free energy model.
Yuki: It gives us an ensemble of coding sequences that we can filter based on our experimental preferences, which is a really useful statistical starting point for biological research.
Ines: And it lets us exactly compute base pair probabilities and codon frequencies, giving us the tools to understand the underlying distribution very precisely.
Marcus: We also see methods for tracking suboptimal combinations using Algorithm S4 point 5, which helps in finding sequences that are systematically more stable than what you would get from uniform sampling or simpler methods <ref:2604.19718#pg1>.
Yuki: It’s a framework that moves beyond just generating sequences to characterizing the statistical properties of those designs, which is a big step for understanding the evolutionary constraints on RNA structure and function.
Ines: That’s it for this discussion on "Direct RNA sequence design under codon constraints using expressive tensor-based secondary structure models".
The paper's summary: Ines: So, to recap, this paper is about using tensor models to design RNA sequences directly, sampling them from a specific distribution that includes both codon usage and secondary structure constraints.
Marcus: Right, it’s not just picking random sequences anymore; they’re building the rules of the game into the sampling process itself.
Ines: They use dynamic programming combined with these tensor models to define a folding function, and then they sample sequences from that distribution—the Boltzmann distribution—which incorporates those structure free energies.
Marcus: That means we get an entire ensemble of coding sequences instead of just one sequence that might be lucky or unlucky by chance.
Ines: Exactly, and the authors focus on how they can exactly compute things like base pair probabilities and codon frequencies over that whole sampled distribution.
Marcus: And those exact counts are what give us a real handle on the underlying statistical landscape of all possible RNA designs.
Ines: It also lets them get the marginal probability of an amino acid being coded by a specific codon, which is useful for seeing how often certain genetic codes show up in their generated set.
Marcus: The computational part is what catches my eye, though; they say the complexity is O(n three), but with GPU acceleration, they’re seeing speedups up to one hundred times over serial computation.
Ines: That’s a big deal for throughput because it means this kind of exact sampling can actually be done fast enough to be useful in real-world design pipelines.
Marcus: So, what does this mean for someone looking at actual biological data? It means we can test hypotheses against a statistically principled set of candidates derived from these models.
Ines: And they also show algorithms, like that minimization algorithm S4 point five that lets you reconstruct suboptimal combinations to find sequences that are systematically more stable than just random guesses.
Marcus: It’s about finding those sequences where the stability isn't accidental but is actually built into the structure according to the model.
Ines: That’s what they are showing—a way to go beyond just stability and use these tensor models to incorporate biologically motivated soft constraints directly into sequence design.
Marcus: This moves us away from just finding a single best sequence and toward characterizing the entire population of stable sequences that fit our criteria.
Ines: So, this paper lays out a framework where you combine dynamic programming with tensor models to generate and analyze RNA sequences under codon constraints in an exact way.
Marcus: And it sets up the foundation for how we can use these exact statistical tools to filter candidates based on experimentalists’ preferences later on.
Ines: It's a method for principled design, and that opens up some new avenues for building functional molecules with better structural control.
Marcus: Next time, we’re going to look at the specific mathematical framework they use—how they build these tensor trains and traces of matrix products to handle those constraints.
The paper's improvements: Ines: So, we’re looking at how these authors are trying to improve their initial design method for this RNA sequence problem by suggesting new approaches and tweaks to their existing framework.
Marcus: They aren't just stopping there with the basic dynamic programming setup; they are building on that using these tensor models in more sophisticated ways.
Ines: They suggest using those tensor trains and traces of matrix products to handle both hard and soft constraints in a more flexible way, which is a big step since it lets you incorporate arbitrary bonuses.
Marcus: So, instead of just having pre-defined stability rules, they’re giving the system the ability to learn or incorporate more complex biological preferences directly into the design process.
Ines: That’s right; it moves them beyond simple constraints and allows for those biologically motivated soft constraints we talked about earlier to be built in.
Marcus: And on top of that, they are developing these new algorithms, like S4 point five, to reconstruct suboptimal combinations, which helps find sequences that are systematically more stable than what you’d get from just picking things randomly.
Ines: That means they can actually find sequences that are better than the uniform sampling or simpler methods suggest.
Marcus: So it’s a way to systematically search for better solutions instead of just hoping random sampling lands on something good.
Ines: And they also focus on improving the way they calculate those marginal probabilities, making sure that computation is as efficient as possible across all the different statistical quantities they need.
Marcus: That efficiency is key because if you want to use this for large cohorts or massive sequence spaces, you need those computations to scale well.
Ines: It seems like the authors are pushing toward a more generalized approach, meaning their framework should work for a broader class of sequence-based objectives than just the initial stability model they tested.
Marcus: And if they can successfully extend this tensor-based method to other types of constraints, it could apply to many different areas in molecular design.
Ines: So, the improvement here is taking their solid foundation and making it more adaptable and powerful by integrating those complex soft constraints and better search strategies.
Marcus: It’s about making the sampling process smarter by giving it more control over what kind of sequences it actually prioritizes finding.
Ines: And they keep emphasizing that this whole structure can be extended, which suggests the method has potential beyond just this specific stability model.
Marcus: So, the takeaway is that they’re building a much more robust and flexible design tool than what was presented in the first version of this work.
Ines: Next up, we’re going to look at how they are actually using these tensor models—specifically, how they formulate those hard and soft constraints using tensor trains—to handle that complexity.
Conclusion: Ines: So we’re wrapping up this discussion on "Direct RNA sequence design under codon constraints using expressive tensor-based secondary structure models."
Marcus: Basically, this paper shows a direct and efficient way to sample stable RNA sequences by defining a distribution that includes both codon usage and detailed structure free energy models.
Ines: It’s about moving past just finding one good sequence to generating an entire ensemble of candidates, which is statistically principled.
Marcus: And they provide tools to exactly compute things like base pair probabilities and codon frequencies over that whole set.
Ines: This lets us get precise stats on the distribution, not just a single guess at what’s possible.
Marcus: The complexity is O of n three, but with GPU acceleration, they’re seeing speedups up to one hundred times over serial computation for these exact computations.
Ines: It really shows how we can leverage hardware to get these kinds of detailed statistical analyses done much faster than before.
Marcus: For someone just listening, it means we can trust the statistical properties of the generated sequences because they’re being computed exactly on a powerful system.
Yuki: From a population genetics viewpoint, having this ensemble means we can really see what kind of genetic variation and structural diversity is possible within the constraints.
Ines: Exactly, and it lets us test hypotheses about evolutionary pressures on RNA structure in a way that’s far more rigorous than just looking at isolated sequences.
Marcus: It changes things for me because I can now use these exact marginal probabilities to figure out if certain codon preferences are statistically significant in the context of a whole distribution.
Yuki: That’s what it supports—it gives us a much richer set of candidates to see which ones might actually be favored by selection across different evolutionary timescales.
Ines: Overall, this paper provides a principled approach to codon optimization using dynamic programming and tensor modeling for structure and constraints.
Marcus: It sets up a new way for computational biologists to generate sequences that aren't just randomly generated, but are designed according to physical and genetic rules simultaneously.
Ines: So yeah, "Direct RNA sequence design under codon constraints using expressive tensor-based secondary structure models" gives us a solid method for generating and analyzing these complex molecules.
Marcus: It’s a framework for designing sequences that are stable according to detailed models while respecting the codon code, with exact statistical checks built in.
Yuki: It’s about understanding the full landscape of possibility rather than just chasing one local optimum sequence.
Ines: And it opens up avenues where we can incorporate more complex biological objectives directly into the design process using this tensor modeling approach.
Marcus: Next time, we’re going to look at the specific math they use—how they build those tensor trains and traces of matrix products to handle those constraints.
Lawrence Berkeley National Laboratory · University of Colorado Boulder · University of California, Berkeley
q-bio.QM
Submitted: 2026-04-21
Updated: 2026-10-19
License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
Importance score: 92/100
The gist: The gist Direct RNA sequence design under codon constraints using expressive tensor-based secondary structure models demonstrates a direct and efficient algorithm to sample sequences from a suitable
Key concepts
- Tensor-based Secondary Structure Models
- These are advanced mathematical tools used to represent the complex folding patterns of RNA. They allow the researchers to model how different parts of the RNA sequence can fold into various secondary structures, providing a highly detailed and accurate way to calculate stability free energy.
- Dynamic Programming with Tensor Constraints
- This methodology combines dynamic programming—a technique for solving complex optimization problems by breaking them into smaller, overlapping subproblems—with tensor representations. This allows the system to simultaneously handle the constraints imposed by the required amino acid sequence and the structural rules of RNA folding.
- Ensemble Sampling from Boltzmann Distribution
- Instead of finding just one optimal sequence, this method samples an entire set (an ensemble) of sequences that are statistically likely under a defined stability model. This provides a principled set for downstream selection based on experimental preferences rather than just a single guess.
- Marginal Probability Computation
- The algorithms allow for the exact calculation of probabilities related to the sampling distribution, such as the likelihood of observing specific base pairs or codons in the final sequence. This is crucial for understanding and controlling the statistical properties of the generated sequences.
Summary
The gist Direct RNA sequence design under codon constraints using expressive tensor-based secondary structure models demonstrates a direct and efficient algorithm to sample sequences from a suitable Boltzmann distribution defined in terms of the codon sequence and a fully detailed secondary structure free energy model, as well as related algorithms for exact computation of statistical quantities such as free energies, base pairing probabilities, and base and codon marginals.
Significance
Computational mRNA sequence design is a vital tool for current research in bioengineering and vaccine design. Existing approaches seek to optimize a stability objective, subject to a constraint enforcing that the RNA sequence codes for a desired protein, but are limited by either inaccurate stability models or heuristic optimization approaches. The work develops an algorithm for sampling stable RNA sequences, maintaining exact sampling while expressing stability in terms of highly accurate tensor-based free energy models. This approach allows for the incorporation of biologically motivated soft constraints in addition to hard coding constraints and enables fast hardware-accelerated computations.
Contributions
The paper develops a framework for sequence optimization purely based on a combination of dynamic programming with tensor-based models of secondary structure and codon constraints. The key demonstrations include:
**- principled and direct stability-based design using dynamic programming with fully detailed secondary structure free energy models. The approach defines an entire ensemble of coding sequences which may be considered for downstream use. The methodology offers an efficient generator of many sequences, which may be chosen or filtered according to arbitrary experimentalist preferences afterwards. (The paper is 2604.19718). **
**- new methods for exactly computing marginal probabilities over our sampling distribution, including base pair probabilities and codon frequencies. The algorithms can leverage any available CPU and GPU resources in parallel for massive computational speedups. **
Methodology
The core of the methodology involves combining dynamic programming with tensor-based models of secondary structure and codon constraints. This is achieved by formulating hard and soft constraints using concepts of tensor trains and traces of matrix products.
The free energy computation involves summing over all RNA sequences, secondary structures, and configurations compatible with the amino acid sequence ψ. This is done by combining the RNA sequence tensor train with the structural tensor diagram to yield a folding function χˆ which generalizes the folding function χ. The final free energy q(ϕ) is computed as TrS[Q0,k χ⊤ k,n(Qk+1,n-1)].
The paper shows how to combine these two tensor approaches by replacing the χ function with a generalized version to accomplish the additional sequence summations in the expanded folding function ˆχ. The final dynamic programming framework can be used to compute qψ exactly and directly sample RNA sequences ϕ from D(ψ) or Dλ(ψ).
Computed Quantities
The algorithms allow for the exact computation of several essential statistics of the sampling distribution D(ψ). These include:
**- the equilibrium base pair probability matrix P ψ (for each i ∈ [n], j ∈ [n]) defined entrywise by p(i · j s ∼ D(ψ)). This matrix can be computed exactly with O(n 3) cost. **
**- the marginal probability of nucleotide ϕi being a given base b (e.g., b = G): pϕi(b) = p(ϕi = b ϕ ∼ D(ψ)) which can be computed exactly with O(n) complexity. **
**- the marginal probability of amino acid ψi being coded by a given codon c (e.g., c = GAU): pψi(c) = pϕ[3i:3i+3) = c ϕ ∼ D(ψ) which can be computed exactly with O(n) complexity. **
Additional Algorithms
The paper develops algorithms for various statistical quantities in Section 2c, each operating in the same or lower computational complexity. These include:
**- Sequence sampling: Algorithm S4.1 computes qψ exactly and directly samples RNA sequences ϕ from D(ψ) and more generally Dλ(ψ). **
**- Equilibrium base pair probabilities: Substitution of χˆ for χ in 15 yields the equilibrium base pair probability matrix, averaged over all RNA sequences, P ψ, cf. **
**- Marginal computation: Problems of marginal computation can be exactly solved after the O(n 3) cost of free energy computation. The marginal codon probability pψi(c) can be computed in O(n) cost for any given i. **
**- Minimization: Algorithm S4.5 solves the minimization problem (2.8) by invoking the evaluation algebra approach of 16. **
Computational Details
The algorithms incur O(n 3) complexity, invoke no approximations, and incur only a roughly ≲ 4× cost prefactor compared to analysis of a fixed RNA sequence. The empirical complexity is often lower than the theoretical O(n 3) for many problem sizes, with GPU acceleration yielding up to ∼100× speedups over serial computation. For example, the cost of computing qψ is within a cost factor of ≈ 4 of analysis for this problem.
Conclusion and Future Directions
The work proposes a principled approach to codon optimization based on dynamic programming, tensor modeling, and statistical sampling. The methodology can apply to relatively arbitrary bonusing functions locally built in terms of sequence or secondary structure. Future work will explore the optimization of conditional structural objectives, such as objectives based on equilibrium base pair probabilities. The approach is expected to lead to a new paradigm for computational sequence design.
Acknowledgments
This work was supported in part by the Applied Mathematics Competitive Portfolios program (M.F. and M.L.), the Luis W. Alvarez Fellowship in Computing Sciences (M.F.), and the Laboratory Directed Research and Development Program of Lawrence Berkeley National Laboratory (M.F. and C.W.). This research used resources of the National Energy Research Scientific Computing Center (NERSC), a Department of Energy User Facility using NERSC award ASCR-ERCAP 0033070. M.L. was also partially supported by a Sloan Research Fellowship.
References
The references listed are [1] A Alexaki, J Kames et al Codon and codon-pair usage tables (CoCoPUTs): Facilitating genetic variation analyses and recombinant gene design J Mol Biol 431:2434–2441, 2019. [5] J R Coleman, D Papamichail et al Virus attenuation by genome-scale changes in codon pair bias Science 320:1784–1787, 2008. [6] A Condon and C Thachuk Efficient codon optimization with motif engineering J of Discrete Algorithms 16:104–112, Oct.
Improvements for AI systems
-
Bold sequence design via tensor-based free energy models: The algorithm can
directly sample sequences from a suitable Boltzmann distribution defined in terms of the codon sequence and a fully detailed secondary structure free energy model,
allowing forprincipled and direct stability-based design using dynamic programming with fully detailed secondary structure free energy models.
-
Exact ensemble sampling for sequence design: Rather than producing a single sequence, the system can define
an entire ensemble of coding sequences which may be considered for downstream use,
providing astatistically principled ensemble
that avoidspathological sequences in favor of those drawn from a statistically principled ensemble.
-
Exact computation of marginal probabilities: The system can provide methods for
exactly computing marginal probabilities over our sampling distribution D(ψ), including base pair probabilities and codon frequencies,
enabling the calculation ofthe expected total number of base pairs in a sampled sequence at thermal equilibrium
and themarginal probability of amino acid ψ being coded by a given codon c.
-
Integration of soft constraints via tensor trains: The framework allows for incorporating
biologically motivated soft constraints in addition to hard coding constraints,
where these are formulated usinga novel tensor train formulation of hard and soft constraints, extensible to a broad class of sequence-based objectives.
-
GPU-accelerated high-throughput design: The algorithms can leverage hardware efficiently, as they
incur just a fixed cost prefactor of ≲ 4× over RNA sequence analysis
and exhibit speedups up to∼100× speedups over serial computation
when utilizing multi-GPU acceleration for the dominant computations. -
Efficient codon frequency matching: A fixed-point iteration algorithm can be used to match desired sampling frequencies, where it
repeatedly compute the output codon or codon pair frequencies of our sampling distributions by summing the exact marginal probabilities over all sequence indices,
allowing for asimple and direct sampling algorithm which approximately matches those frequencies.
-
Suboptimal sequence generation: The system can reconstruct suboptimal combinations of sequences and structures using algorithms like Algorithm S4.5, which allows tracking states where
q ≤ qopt + qgap,
enabling the design of sequences that aresystematically more stable than those produced by uniform sampling or more naïve methods.
Related papers
- A likelihood-based framework for simultaneously learning both noise and growth dynamics using biologically-informed neural networks
- Automated Lesion Segmentation of Stroke MRI Using nnU-Net: A Comprehensive External Validation Across Acute and Chronic Lesions
- Imaging-anchored multiomics in cardiovascular disease: integrating cardiac imaging, bulk, single-cell, and spatial transcriptomics
- Resolving satellite-in situ mismatches in Net Primary Production using high-frequency in situ bio-optical observations in the subpolar Northwest Atlantic
- easyplater: The easy way to generate microplate designs deconvolved from multivariate clinical data
- Essential Workers at Risk: An Agent-Based Model (SAFE-ABM) with Bayesian Uncertainty Quantification