Deciphering RNA Secondary Structure Prediction: A Probabilistic K-Rook Matching Perspective

Cheng Tan, Zhangyang Gao, Stan Z. Li, Chen, Xingran, Wang, Ge, Wu, Lirong, Xia, Jun, Zheng, Jiangbin, Li, Stan Z. · DOI

Abstract

The secondary structure of ribonucleic acid (RNA) is more stable and accessible in the cell than its tertiary structure, making it essential for functional prediction. Although deep learning has shown promising results in this field, current methods suffer from poor generalization and high complexity. In this work, we reformulate the RNA secondary structure prediction as a K-Rook problem, thereby simplifying the prediction process into probabilistic matching within a finite solution space. Building on this innovative perspective, we introduce RFold, a simple yet effective method that learns to predict the most matching K-Rook solution from the given sequence. RFold employs a bi-dimensional optimization strategy that decomposes the probabilistic matching problem into row-wise and column-wise components to reduce the matching complexity, simplifying the solving process while guaranteeing the validity of the output. Extensive experiments demonstrate that RFold achieves competitive performance and about eight times faster inference efficiency than the state-of-the-art approaches.

Introduction

Predicting how an RNA molecule folds—its secondary structure—is a cornerstone of bioinformatics. RNA is not merely a passive messenger; its biological function is largely dictated by its shape. Predicting the secondary structure, which consists of the pattern of base pairs (A-U, G-C, G-U), is essential for understanding cellular processes, diseases, and designing new therapeutic interventions.

Historically, two main approaches have dominated the field:

  1. Energy-based methods: These utilize dynamic programming to identify the lowest-energy state. While physically grounded, they are computationally slow and often struggle to predict complex, non-nested structures known as pseudoknots.
  2. Deep Learning (DL) methods: These treat the problem as a 2D prediction task, similar to image segmentation. While faster, they often ignore fundamental biological constraints, such as the rule that a single nucleotide can pair with at most one other partner.
RNA structures can be simple (nested) or complex (non-nested/pseudoknots). Traditional methods often fail on the latter.

The K-Rook Perspective

The core innovation of RFold is the reformulation of RNA base-pairing as a K-Rook problem. In this mathematical framework, an RNA sequence of length $L$ is represented as an $L \times L$ matrix (a contact map). Placing a "Rook" at position $(i, j)$ indicates that nucleotide $i$ is paired with nucleotide $j$.

To ensure biological validity, the structure must satisfy the constraint that no two Rooks can share the same row or column—mirroring the non-attacking condition of Rooks on a chessboard. This perspective simplifies the prediction process into a probabilistic matching task within a finite, well-defined solution space.

The graph and matrix representation of RNA secondary structure. The matrix (contact map) illustrates the potential for a K-Rook matching approach.

The RFold Architecture

RFold implements this K-Rook perspective through a specialized deep learning pipeline designed for both accuracy and efficiency. The architecture consists of:

  • Seq2map Attention: A module that transforms the 1D RNA sequence into a 2D attention map, capturing potential long-range interactions.
  • U-Net Backbone: A standard refinement network that processes the 2D map to improve feature representation.
  • Bi-dimensional Optimization: This is the critical step that ensures validity. Instead of solving a complex global matching problem, RFold decomposes it into row-wise and column-wise components. By applying a Softmax function across both dimensions, the model naturally converges on a valid K-Rook solution, guaranteeing that each base has at most one partner.

Results and Discussion

RFold was evaluated against several rigorous benchmarks, including RNAStralign, ArchiveII, and bpRNA. The results demonstrate a significant leap in both performance and efficiency:

  • Superior Accuracy: On the RNAStralign test set, RFold achieved an F1 score of 0.977, significantly outperforming previous state-of-the-art models like UFold (0.915).
  • Inference Efficiency: RFold is approximately 8x faster than UFold and 16x faster than MXfold2, taking only 0.02 seconds to fold a sequence.
  • Guaranteed Validity: Unlike many DL models that produce invalid structures up to 50% of the time, RFold achieves a 100% validity rate due to its constrained optimization design.
  • Handling Pseudoknots: The model excels at predicting complex structures, reaching an F1 score of 0.982 on sequences containing pseudoknots, a task where traditional energy-based methods often fail.

Conclusion

RFold introduces a paradigm shift in RNA secondary structure prediction by framing it as a K-Rook matching problem. By combining deep learning with combinatorial constraints, it provides a solution that is biologically valid, highly accurate, and computationally efficient. Future work will explore balancing the precision-recall trade-off and extending this framework to 3D tertiary structure prediction.

Summary updated

BibTeX
@inproceedings{tan2024deciphering,
  author = {Cheng Tan and Zhangyang Gao and Stan Z. Li and Chen, Xingran and Wang, Ge and Wu, Lirong and Xia, Jun and Zheng, Jiangbin and Li, Stan Z.},
  title = {{Deciphering RNA Secondary Structure Prediction: A Probabilistic K-Rook Matching Perspective}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=Ada9Z68nvb},
}
Figure