Next Article in Journal
Topology-Oblivious Random-Walk Key Relaying in Quantum Key Distribution Networks
Previous Article in Journal
Shannon Entropy and Beyond: An Information-Theoretic Framework for Randomness Pre-Screening
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A DNA-Local, Constraint-Aware Dual-Head Transformer for Pseudorandom Stream Generation

by
Alev Kaya
1,2,* and
İbrahim Türkoğlu
2
1
Software Engineering Graduate Program, Graduate School of Natural and Applied Sciences, Firat University, 23119 Elazig, Türkiye
2
Department of Software Engineering, Faculty of Technology, Firat University, 23119 Elazig, Türkiye
*
Author to whom correspondence should be addressed.
Entropy 2026, 28(6), 694; https://doi.org/10.3390/e28060694
Submission received: 7 April 2026 / Revised: 6 June 2026 / Accepted: 9 June 2026 / Published: 16 June 2026
(This article belongs to the Section Information Theory, Probability and Statistics)

Abstract

Pseudorandom number generators (PRNGs) used in deoxyribonucleic acid (DNA)-oriented computational workflows often generate outputs in the bit domain and then map them to DNA symbols. This indirect strategy may treat DNA-specific constraints, including GC balance, homopolymer limits, and short-range sequence dependencies, as separate from generation. This study proposes a constraint-aware, dual-head decoder-only Transformer framework for DNA-local PRNG generation directly in the adenine/cytosine/guanine/thymine (A/C/G/T) alphabet. The model generates the next DNA base and derives the bitstream through dynamic selection among eight equivalent DNA-to-bit coding rules. The framework was evaluated under R1 based on real genomic data, R1-ext as independent validation, R2 based on synthetic data, and R3 without training or reference data. For each setting, 10 independent runs were performed, each producing a 500,000-base DNA sequence and a 1,000,000-bit stream. Bit-level evaluation used NIST SP 800-22, SP 800-90B-inspired min-entropy/health indicators, and ENT, while DNA-level evaluation used GC balance, homopolymer control, and symbolic structural metrics. The reported NIST tests satisfied the acceptance criterion, t-tuple min-entropy lower bounds ranged from 0.9955 to 0.9964 bit/bit, and core DNA-compatibility constraints were preserved. Multi-stream and exact-match k-mer leakage analyses indicated no systematic bit-level dependence or direct long-fragment copying. Overall, the framework supports reproducible DNA-local PRNG generation and multilayer validation.

1. Introduction

Randomness is a fundamental component of modern computational systems used in data processing, modeling, simulation, security, and privacy-oriented applications [1,2]. This requirement becomes more specific in deoxyribonucleic acid (DNA)-based computing and biomolecular workflows. In processes such as DNA synthesis, sequencing, indexing, error modeling, data storage, and biomolecular design, it is not sufficient for sequences to appear statistically random. They must also satisfy structural and process-related constraints of DNA [3,4]. In particular, guanine/cytosine (GC) balance, homopolymer length, short-range dependencies, local motif enrichment, and k-mer distribution can directly affect the synthesizability, sequenceability, and downstream analytical reliability of DNA-based outputs [3,4,5,6].
Many pseudorandom number generators (PRNGs) used in DNA-oriented applications first generate outputs in the bit domain and then convert these outputs into the adenine/C/G/thymine (A/C/G/T) base alphabet [5,6]. Although this bit-first strategy is practical and widely used, it does not treat DNA-specific structural properties as an intrinsic part of the generation process. A bitstream that appears statistically acceptable at the bit level may produce GC imbalance, long homopolymer runs, or local motif accumulation after being mapped to the DNA alphabet. Moreover, the transition to DNA is often implemented as a fixed mapping step after generation. This makes it difficult to manage DNA-level structural compatibility and bit-level statistical randomness within the same generation cycle. The use of a single fixed DNA-to-bit mapping rule may also introduce secondary regularities in the bitstream. Therefore, a PRNG core designed for DNA-based workflows should generate directly in the DNA alphabet, account for DNA-specific constraints during generation, and derive the bitstream in a traceable manner.
In recent years, learning-based PRNG designs, hybrid systems involving DNA coding, and Transformer-based generative models have attracted increasing attention in this field [7,8,9,10,11,12,13]. However, many existing studies still rely on bit-domain generation or treat the transition to DNA representation as a post hoc coding layer [5,6]. Data-set dependence also remains an important limitation in learning-based methods. When models are trained on large data sets or on data sets with specific distributional properties, it is not always clear whether the observed output quality originates from the model architecture or from patterns transferred from the training data. This issue is more pronounced for DNA sequences, because genomic sequences contain natural regularities at the levels of species, genomic region, motif composition, and local dependency. Therefore, a DNA-local PRNG approach should be evaluated not only under data-supported conditions, but also under conditions in which no training data are used.
These trends in the current literature limit the joint treatment of DNA-specific structural compatibility and bit-level statistical randomness within the same generation core. In addition, the successful performance of a model trained only on data does not demonstrate that the method has a data-independent generation capacity. There is therefore a need for an integrated PRNG design that operates directly in the DNA alphabet, manages DNA-specific constraints during generation, derives the bitstream through dynamic rule selection, and compares data-supported and data-independent conditions under the same architectural core.
In response to this need, this study proposes a DNA-local, constraint-aware, dual-head Transformer-based PRNG core. The proposed structure generates outputs directly in the A/C/G/T alphabet and simultaneously derives the corresponding bitstream. The first output head produces the probability distribution for the next DNA base, whereas the second output head models the selection behavior among eight equivalent DNA-to-bit coding rules. During generation, the GC ratio, maximum homopolymer length, short-range dependency, and local n-gram behavior are regulated at the sampling level. Thus, DNA sequence generation, DNA-to-bit conversion, and structural constraint management are not treated as disconnected sequential steps. Instead, they are handled as interacting components of the same generation pipeline.
The aim of this study is not to train a large-scale language model or to reproduce a specific genomic data set. Rather, the aim is to develop a computationally traceable PRNG core that can operate with lightweight calibration and generate structurally compatible outputs for DNA-based production workflows. For this reason, a limited sub-corpus and a single-epoch training scheme are used in data-supported regimes, while generation-time constraints guide model outputs according to DNA-specific structural criteria. More importantly, this study also defines a reference-free generation regime in which no training data are used. This no-reference/no-training regime provides a critical control condition for evaluating whether the proposed core depends only on learned genomic patterns.
The proposed method is examined under three main regimes. The R1 regime represents the data-supported setting trained on real genomic DNA [14]. The R2 regime represents the controlled setting trained on approximately uniform synthetic DNA [15]. The R3 regime represents the reference-free setting that operates without any training data. This three-regime design aims to separate the effect of data from the architectural structure and the constraint-aware sampling mechanism. In addition, external validation on an independent genome is performed to reduce dependence on a single real genomic source. This additional analysis is used to assess more clearly whether the method behaves as a data-dependent generator tied to a specific genomic source.
This study does not propose a cryptosystem and does not claim to provide a formal proof of cryptographic security. Accordingly, the evaluation is not based on an attack model, key security, or provable security claims. Instead, it focuses on statistical randomness, DNA-specific structural compatibility, data dependence, generation reproducibility, and consistency across regimes. Passing National Institute of Standards and Technology (NIST)-based tests alone should not be interpreted as proof of cryptographic security [16,17,18,19]. Nevertheless, when tests such as NIST Special Publication (SP) 800-22, NIST SP 800-90B, and ENT are used together with DNA-specific metrics, they provide a meaningful initial validation layer for assessing the statistical quality of PRNG outputs [16,17,18,19,20,21]. Therefore, this study evaluates bit-level tests jointly with DNA-level measures such as GC balance, homopolymer profile, k-mer distribution, short-range dependency, rule-usage behavior, and multi-stream independence [3,4,5,6]. The main contributions of this study are summarized as follows:
  • A dual-head Transformer-based PRNG architecture is proposed for direct output generation in the DNA alphabet.
  • GC balance, homopolymer limitation, short-range dependency control, and local motif behavior are treated as components of a constraint-aware sampling mechanism operating during generation, rather than as post-generation corrections.
  • Data-supported and data-independent generation conditions are compared under the same architectural core through the R1, R2, and R3 regimes. In particular, the R3 no-reference/no-training regime enables the assessment of data-set dependence and generation behavior without training data.
  • The bitstream is derived through dynamic selection among eight equivalent DNA-to-bit coding rules, rather than through a single fixed mapping rule.
  • Statistical randomness tests and DNA-specific structural measures are jointly evaluated within an integrated validation protocol.
  • Independent genomic validation, summary statistics across independent runs, and additional analyses of component contributions are used to assess reproducibility and consistency across regimes more explicitly.
The findings show that the proposed method can produce acceptable bit-level statistical randomness behavior under different data regimes. They also show that the generated DNA outputs remain traceable with respect to GC balance, homopolymer control, local motif distribution, and short-range dependency. The remainder of this paper is organized as follows. Section 2 summarizes related work and the research gap. Section 3 describes the proposed architecture and generation-time constraint mechanisms. Section 4 presents the experimental design and results. Section 5 discusses the findings, limitations, and security scope. Finally, Section 6 concludes the study and outlines future research directions.

2. Related Work and Research Gap

The literature on randomness generation compatible with DNA-based processes can be considered along three main lines within the scope of this study: learning-based PRNG approaches, hybrid systems involving DNA coding or encryption steps, and Transformer-based PRNG studies. This section reviews these research lines together to position the proposed DNA-local and constraint-aware PRNG core within the literature. The evaluation focuses particularly on the output space, whether DNA-specific constraints are handled during generation, the DNA-to-bit conversion strategy, the availability of a reference-free generation setting, and the scope of the validation protocol.
Learning-based PRNG studies have mainly developed along deep learning and reinforcement learning directions. Architectures such as recurrent neural networks (RNNs), long short-term memory (LSTM) networks, convolutional neural networks (CNNs), generative adversarial networks (GANs), and Wasserstein GANs with gradient penalty (WGAN-GP) have been used to generate binary outputs by learning distributional patterns from training data [22,23,24,25,26,27,28]. LSTM-based approaches have reported successful NIST SP 800-22 results from deterministic seeds. GAN- and WGAN-GP-based designs have aimed to generate statistically strong bitstreams under different training strategies [22,24,26,27,28]. Reinforcement learning (RL)-based approaches have also treated randomness generation as a sequential decision-making problem and evaluated LSTM- or agent-based generation structures [25,29,30]. These studies are valuable because they demonstrate the potential use of learning-based models in PRNG design. However, from the perspective of DNA-based processes, most of these approaches operate directly in the bit domain. They do not treat DNA-specific measures, such as GC balance, homopolymer limit, short-range dependencies, and local motif behavior, as embedded components of the generation process [3,4,5,6]. In addition, the dependence of many methods on training data, long optimization procedures, or high computational cost may introduce further limitations in terms of data dependence and reproducibility [22,23,24,25,26,27,28,29,30,31,32,33].
Hybrid systems involving DNA coding constitute a broad literature, particularly in image encryption, key generation, and multilayer security mechanisms [31,34,35,36,37,38]. In these studies, DNA bases are generally not used as the primary output space in which randomness is directly generated. Instead, they are used as an intermediate layer in which binary data are symbolically represented or transformed during encryption. Hybrid structures that combine dynamic DNA coding schemes, multi-rule DNA mappings, chaotic maps, and deep learning components have made important contributions in terms of encryption diversity, key variability, and implementation flexibility [12,13,31,34,35,36,37,38]. However, the main objective of these studies is generally not to develop an independent, DNA-local PRNG core that manages constraints during generation. Therefore, although the DNA coding and encryption-oriented literature is functional within its own application domain, it does not fully address the need for an independent and constraint-aware randomness generation core that can be directly integrated into DNA-based processes.
Transformer-based PRNG studies represent a more recent research direction in this field. Recent studies have shown that decoder-only Transformer architectures can learn the output behavior of classical PRNG families and model certain algorithmic regularities [8,11]. For example, Transformer-based approaches have been used to model the output patterns of classical generators such as the linear congruential generator (LCG) and Mersenne Twister, to evaluate bit-level randomness test performance, and to represent certain structural regularities [8]. Similarly, findings related to modular generalization and residue number system (RNS)-based interpretability indicate that Transformer architectures can capture specific algorithmic patterns [11]. Nevertheless, existing Transformer-based PRNG studies remain largely limited to the bit domain. Direct generation in the A/C/G/T alphabet, GC balance and homopolymer control during generation, regulation of short-range DNA dependencies, and dynamic DNA-to-bit rule selection are not the main focus of these studies. Moreover, this research line does not compare regimes with and without training data under the same DNA-local PRNG core.
Taken together, the existing literature provides important contributions to PRNG design, DNA coding, hybrid encryption, and Transformer-based modeling. However, for DNA-based workflows, limited attention has been given to a PRNG framework that directly generates in the DNA alphabet, manages DNA-specific constraints during generation, derives the bitstream through dynamic DNA-to-bit rule selection, and compares data-supported and data-independent conditions under the same core. Studies that combine general-purpose randomness tests and DNA-specific structural measures within the same validation protocol are also limited. This study addresses this gap through a dual-head Transformer-based, DNA-local, and constraint-aware PRNG core. The main differences between representative studies and the proposed method are summarized in Table 1. A broader comparison and additional reporting dimensions are provided in Appendix A, Table A1.
Table 1 shows that the difference of the proposed method does not arise from a single component. Rather, it results from the joint treatment of DNA-local generation, constraint management during generation, dynamic DNA-to-bit rule selection, a reference-free generation setting, and an integrated validation protocol.

3. Materials and Methods

3.1. Overview of the Proposed Method

The proposed framework is designed as a constraint-aware and reproducible PRNG core that generates outputs directly in the A/C/G/T alphabet for DNA-based workflows. Unlike conventional bit-first approaches, generation is performed in the DNA domain, and the corresponding bitstream is derived within the same processing pipeline. For this purpose, the proposed computational core is based on a dual-head decoder-only Transformer architecture. The first output head generates the probability distribution for the next DNA base, whereas the second output head models the selection behavior among eight equivalent DNA-to-bit coding rules. Thus, DNA sequence generation, rule selection, and bitstream derivation are treated as interacting components of the same generation process. The general framework shown in Figure 1 evaluates the same architectural core under three complementary generation regimes.
The R1 regime represents the data-supported setting trained on real genomic DNA. The R2 regime represents the controlled setting trained on approximately uniform synthetic DNA. The R3 regime represents the reference-free setting that operates without any training data. This structure makes it possible to examine the effect of different data conditions on generation behavior. In particular, the R3 regime provides a control setting for evaluating the model behavior independently of learned distributions. An additional external validation setting is also included in the same pipeline to assess dependence on a single real genomic source more explicitly.
The general workflow consists of four main phases. First, the data regime and initial conditions are defined. Second, the RoPE-based dual-head decoder-only Transformer core produces base-head and rule-head outputs. Third, constraint-aware sampling regulates GC balance, homopolymer limits, local k-mer behavior, and short-range dependency during generation. Finally, the DNA keystream, selected rule trace, corresponding bitstream, and evaluation outputs are obtained together. At the end of this process, the DNA sequence, the selected rule trace, and the corresponding bitstream are produced together. Therefore, the proposed method is not only a generator of bit-level randomness. It is also an integrated generation core that manages DNA-level structural compatibility in a traceable manner.
To ensure reproducibility, all regimes use a seed-controlled and traceable execution protocol. Data selection, initial context construction, base sampling, and rule selection are governed by the same randomness-control logic. In the default configuration, no external cryptographically secure pseudorandom number generator (CSPRNG), extractor, or key-derivation function is used. This choice ensures that the reported bit-level and DNA-level statistics directly reflect the behavior of the proposed Transformer core and the constraint-aware sampling mechanism. The generated DNA sequences, bitstreams, rule traces, and run metadata are stored as separate outputs to support the reproducibility and traceability of the experiments.

3.2. Data Regimes and Generation Modes

The proposed DNA-local PRNG framework was evaluated under three generation regimes to examine how the same architectural core behaves under different data conditions. The R1 regime represents the data-supported setting trained on real genomic DNA. The R2 regime represents the controlled setting trained on approximately uniform synthetic DNA. The R3 regime represents the reference-free setting that operates without any external training data. This design aims to separate the observed output behavior from the effects of training data, model architecture, and generation-time constraint-aware sampling. In all regimes, the same decoder-only Transformer core and the same output generation pipeline are preserved. The main differences between regimes are the data source and the relationship of the model to training.
In the R1 regime, the complete genome of Escherichia coli strain K-12 substrain MG1655 was used as the real genomic source [14]. FASTA headers were removed, non-A/C/G/T symbols were cleaned, and the first 1,000,000 bases of the cleaned sequence were used as the source pool. In each independent run, the source pool was divided into non-overlapping 1000-base blocks. From these blocks, 25 blocks were selected using a run_seed-controlled random sampling procedure, resulting in a 25,000-base sub-corpus for each run. The selected blocks were used only within the corresponding run and did not overlap with the sub-corpora of other runs. The resulting sub-corpus was divided into 20,000 bases for training and 5000 bases for validation. In addition, an independent genomic validation setting, R1-ext, was generated using the complete genome of Bacillus subtilis subsp. subtilis strain 168 [39]. This setting was not treated as a new main regime, but as an external validation extension of R1 on an independent genomic source. The same cleaning procedure, source-pool length, non-overlapping block sampling scheme, training/validation split, and production pipeline were preserved. This additional setting was used to assess more clearly whether the method depends on a single real genomic source.
In the R2 regime, the same experimental structure as R1 was preserved. However, instead of a real genomic source, approximately uniform synthetic DNA was used [15]. The synthetic source pool consisted of a 1,000,000-base DNA sequence generated in Python by uniform sampling over the A/C/G/T alphabet. As in R1, each run selected 25 non-overlapping 1000-base blocks, forming a 25,000-base sub-corpus. This sub-corpus was then split into 20,000 bases for training and 5000 bases for validation. The use of the same data size and the same experimental settings in R1 and R2 enabled comparison between effects arising from real genomic patterns and the generation behavior observed under an approximately uniform distribution.
The R3 regime was defined as a reference-free generation setting designed to remove the effect of training data. In this regime, the model parameters were not optimized on any genomic or synthetic training corpus. Generation was initialized with a uniform initial context over the A/C/G/T alphabet and continued using the same autoregressive production pipeline. Therefore, R3 is not a third trained model variant. Instead, it is a data-independent comparison setting used to evaluate generation behavior after removing the influence of learned distributions.
In all regimes, output generation was carried out through the same basic pipeline. The generation process started from an initial sequence with a fixed context length. At each step, the model produced a probability distribution for the next DNA base and a separate distribution for DNA-to-bit rule selection. The selected DNA base was appended to the sequence, and the corresponding two-bit output was derived using the selected rule. In each run, a 500,000-base DNA sequence and an approximately 1 Mbit bitstream were obtained. The DNA sequence, bitstream, rule trace, and run metadata were stored as separate files. This structure supports reproducibility and makes each output component traceable. In the training regimes, the open non-overlapping block-based sampling design was used to prevent overlap within the sub-corpus. The independent genomic validation setting provides an additional control under the same pipeline to assess dependence on a single data source. The general workflow applied under R1–R3 is summarized in Algorithm 1.
Algorithm 1. Proposed DNA-local PRNG generation workflow under R1, R1-ext, R2, and R3
Input: Generation regime ∈ {R1, R1-ext, R2, R3}, context length W, target generation length L, runseed, model configuration, and sampling parameters.
Output: Generated DNA sequence X, rule trace R, and corresponding bitstream Y.
  • Select the generation regime: R1, R1-ext, R2, or R3.
  • If the regime is R1, R1-ext, or R2:
    • Prepare the relevant source pool: real genomic DNA for R1, independent genomic DNA for R1-ext, and approximately uniform synthetic DNA for R2.
    • Select non-overlapping 1000-base blocks from the source pool under run_seed control.
    • Construct a 25,000-base sub-corpus.
    • Split the sub-corpus into training and validation partitions.
    • Calibrate the MiniGPTDualHead model on the relevant sub-corpus.
  • If the regime is R3:
    • Do not use training data.
    • Construct a uniform initial context.
  • Set the initial context as X; initialize the rule trace R and bitstream Y as empty sequences.
  • For t = 1, …, L:
    • Compute the base-head and rule-head outputs.
    • Select the next DNA base using constraint-aware sampling.
    • Select the DNA-to-bit rule.
    • Append the selected base to X.
    • Append the selected rule to R.
    • Derive the two-bit output from the selected base and rule, and append it to Y.
  • Return the generated DNA sequence, rule trace, and bitstream, excluding the initial context.

3.3. Dual-Head Decoder-Only Transformer Architecture

The proposed DNA-local PRNG core is based on a lightweight decoder-only Transformer architecture designed for autoregressive sequence generation [7]. This choice follows from the nature of the problem. The task is not a source-to-target transformation, but a one-directional DNA sequence generation problem conditioned on past context. Therefore, the encoder block and cross-attention layers used in classical encoder–decoder Transformer architectures are not employed in this study. The proposed core uses causal self-attention over the previous context and produces probability distributions for both the next DNA base and the DNA-to-bit rule selection. The general structure of the proposed dual-head decoder-only Transformer core is shown in Figure 2.
The model processes a sliding DNA context, applies Rotary Positional Embedding (RoPE)-based causal self-attention, and produces two output distributions: the base-head distribution for the next DNA base and the rule-head distribution for DNA-to-bit rule selection. DNA-specific structural constraints are not embedded directly into the learned weights of the Transformer core. Instead, they are managed through the constraint-aware sampling layer applied during generation. This design provides a simpler core focused on DNA sequence generation while also limiting computational cost. The proposed model consists of three Transformer blocks, four attention heads, a 128-dimensional embedding space, and a 128-base sliding context window. The expansion ratio in the feed-forward layer is set to 4d_model. To reduce latency and memory cost during long-sequence generation, a key–value (KV) cache is used. The architecture used in this study is not a direct copy of the original Transformer model [7]. It is a lightweight core restructured for DNA-local generation and transition to the bit domain. The main architectural differences between the original Transformer and the proposed DNA-PRNG core are summarized in Table 2. A more detailed comparison is provided in Appendix A, Table A2.
The input vocabulary is restricted to the DNA alphabet. This alphabet consists of four bases :   Σ = A , C , G , T , Σ = 4 . Each base b t Σ is represented as a separate token identity and mapped to a learnable embedding space. Let W denote the context-window length. At time step t, the input sequence is defined as: s t = b t W + 1 , , b t . The initial representation matrix is given in Equation (1):
H ( 0 ) = E m b e d b t W + 1 , , E m b e d b t R W × d m o d e l .
Positional information is not used as a simple vector directly added to the embedding vectors. Instead, relative positional structure is represented by applying RoPE to the query and key vectors in the attention layer. This choice is appropriate for autoregressive generation and sliding-window operation, because it allows relative positional relationships to be modeled more naturally. Each Transformer block consists of a residual multi-head self-attention (MHSA) module with pre-layer normalization (pre-LayerNorm) and a feed-forward network (FFN) with Gaussian Error Linear Unit (GELU) activation. For block l, the transformations are defined in Equations (2)–(4):
X ( l ) = L N ( H ( l 1 ) ) ,
H ~ ( ı ) = H ( l 1 ) + M H S A l ( X l )
H ( l ) = H ~ ( ı ) + F F N l L N H ~ ı ,     l = 1 , , L ,
In the multi-head self-attention layer, the query, key, and value projections are computed as: Q = X W Q ,   K = X W K ,   V = X W V . RoPE is then applied to the query and key vectors as shown in Equation (5):
Q ~ = R o P E Q ,         K ~ = R o P E K .
The scaled dot-product attention under a causal mask is then computed as shown in Equation (6):
A t t e n t i o n Q , K , V = s o f t m a x Q ~ K ~ d h + M c a u s a l V .
Here d h = d m o d e l / h = 32 and M c a u s a l   denotes the causal attention mask that suppresses access to future positions. The feed-forward subnetwork is defined by Equation (7):
F F N z = W 2 G E L U W 1 z + b 1 + b 2
The distinguishing architectural feature of the proposed core is its dual-head structure. The final hidden representation is directed to two separate output heads. Let the final representation vector be: z t R d m o d e l . The logits produced by the base head and rule head are given in Equation (8):
o t b a s e = z t W b a s e R 4 ,     o t r u l e = z t W r u l e R 8 .
The corresponding probability distributions are obtained through the softmax transformation in Equation (9):
p t b = s o f t m a x o t b a s e b   ,     q t r = s o f t m a x o t r u l e r .
Here, the base head produces the probability distribution for the next DNA base. The rule head models the selection behavior over the eight equivalent DNA-to-bit coding rules used to derive the bitstream from the generated DNA sequence. Thus, the proposed architecture operates not only as a DNA sequence generator, but also as a joint generation structure that links the DNA and bit domains. This design also helps limit secondary regularities that may arise from using a single fixed conversion rule. An important architectural point is that DNA-specific structural constraints are not directly embedded into the learned network weights. Instead, GC balance, homopolymer control, short-range dependency suppression, and local n-gram regulation are applied through the constraint-aware sampling layer operating on the probabilities produced by the Transformer core. In other words, the Transformer core is responsible for probability generation, while the sampling layer transforms these probabilities into DNA sequences that are structurally more compatible with DNA-specific requirements. DNA-specific controls are applied at generation time, and the corresponding sampling terms are described in detail in Section 3.5.

3.4. Learning Objective and Regime-Specific Training Strategy

In the proposed DNA-local PRNG framework, the learning step is applied only in data-supported generation settings. The R1 and R1-ext regimes are calibrated on real genomic DNA, whereas the R2 regime is calibrated on approximately uniform synthetic DNA. In contrast, the model is not optimized on any training corpus in the R3 regime. R3 is therefore treated as a data-independent reference setting in which the effect of learned distributional information is removed. For this reason, the learning objective defined in this section applies only to R1, R1-ext, and R2. No training loss or convergence curve is defined for R3.
In the R1, R1-ext, and R2 regimes, the learning objective has two main goals. The first is to calibrate the base-head output to model the next DNA base. The second is to guide the rule-head output toward balanced selection behavior over the eight equivalent DNA-to-bit coding rules, without collapsing to a single rule. Following the operation order in the code-level implementation, the base-head cross-entropy loss is first computed. Then, the soft target distribution for the rule head is constructed using the base probabilities produced by the base head and the DNA-to-bit rule matrix. Finally, the rule-head soft-target cross-entropy loss and the uniformity Kullback–Leibler (KL) regularization term are computed. The total training objective is defined as the weighted sum of these three components. Let the four-class probability distribution produced by the base head at time step   t be denoted by p t ( · ) . The base-head loss is given in Equation (10):
L b a s e =   1 T t = 1 T log p t ( b t + 1   | b t )
The soft-target cross-entropy loss for the rule head is defined in Equation (11):
L r u l e =   1 T t = 1 T r R y t ~ r   log q t r
To prevent the rule-head distribution from collapsing to a small subset of the eight rules, a uniformity regularization term is used. This term is given in Equation (12):
L u n i f =   1 T t = 1 T D K L ( q t U 8 )
The total training objective is given in Equation (13):
L = L b a s e +   λ r u l e L r u l e +   β u n i f L u n i f
Here, T denotes the total number of autoregressive time steps included in the loss computation. The set R = { 0 , 1 , , 7 } denotes the eight DNA-to-bit coding rules. The term p t .   is the next-base probability distribution produced by the base head. The term q t is the probability distribution over the eight rules produced by the rule head. The soft target distribution y t ~ is constructed using the base-head probabilities and the DNA-to-bit rule matrix. The term U 8 denotes the uniform distribution over the rule set. The coefficients λ r u l e and β u n i f control the relative contributions of the soft-target rule loss and the uniformity regularization term to the total loss.
The soft target distribution y t ~ is constructed by considering the expected 0/1 balance of the two-bit outputs under the eight DNA-to-bit rules. This structure does not force the rule head to predict a single fixed rule. Instead, it assigns higher weights to rules that are expected to support more balanced bit-level output. The additional uniformity regularization term limits the collapse of the rule-head distribution to a narrow subset of rules. Together, the soft-target rule loss and the uniformity regularization aim to increase diversity in rule usage during bitstream derivation and to reduce secondary regularities that may arise from using a single fixed DNA-to-bit conversion rule.
Training in the R1, R1-ext, and R2 regimes was performed for a single epoch using the A d a m W optimization algorithm. The batch size was set to 256, the learning rate to 3 × 10−4, and the weight decay to 0.01. The rule-head regularization coefficients were set as λ r u l e = 0.2 and β u n i f = 0.2 and the soft-target temperature was set as τ r u l e = 0.25 . In each trained regime, the model was calibrated on the training sub-corpus, and the validation bits-per-base value was monitored on a separate validation sub-corpus. This separation allows direct fit to the training data and validation behavior to be evaluated separately.
In this study, the training stage is used as a limited calibration step for data-supported regimes, rather than as a long-term convergence optimization process. Therefore, for R1, R1-ext, and R2, convergence is not interpreted through multi-epoch training curves. Instead, it is evaluated together with the validation bits-per-base value monitored on the separate validation sub-corpus, variability across independent runs, and the R1-ext external validation results. The risk of overfitting and memorization is also assessed using the single-epoch training design, the separate validation sub-corpus, and the exact-match k-mer leakage control against the reference or training corpora. In the R3 regime, no training or optimization step is performed. Therefore, training convergence and overfitting are not defined for this regime.
Although the network weights are optimized on data in the R1, R1-ext, and R2 regimes, DNA-specific structural controls such as GC balance, homopolymer limit, short-range dependency suppression, and local n-gram regulation are not embedded directly into the loss function. These constraints are managed through the constraint-aware sampling mechanism applied at generation time. This separation makes it possible to evaluate more clearly the learning capacity of the architectural core and the effect of the constraint-aware generation strategy.
The R3 regime is a data-independent generation setting defined to exclude the effect of training data. In this regime, the model parameters are not optimized on any genomic or synthetic training corpus. Generation starts from a uniform initial context and proceeds through the same autoregressive generation pipeline. Therefore, R3 is not treated as a third trained model variant. Instead, it is used as a comparative reference setting that removes the influence of learned distributions. Since no optimization step is applied, training loss, validation bits-per-base, and training convergence are not reported for R3. This setting is used to evaluate how the architectural core and the constraint-aware sampling layer behave without training data.
Reproducibility across all regimes is ensured through a single seed-controlled randomness logic. In trained regimes, this logic controls source sub-corpus selection, initial context construction, and generation steps. In R3, it controls the uniform initial context and the entire generation process. In the default configuration, no external CSPRNG, extractor, or key-derivation function is used. This choice ensures that the reported results originate from the joint behavior of the proposed dual-head decoder-only Transformer core and the constraint-aware sampling layer, rather than from an external post-processing module.

3.5. Constraint-Aware DNA Sampling

In the proposed framework, the Transformer core produces a probability distribution for the next DNA base at each autoregressive step. A constraint-aware sampling layer before direct sampling from this distribution manages DNA-specific structural compatibility. Thus, GC balance, homopolymer control, short-range dependency suppression, and local n-gram regulation are not treated as post hoc corrections applied after sequence generation. Instead, they are handled as in-process mechanisms that reshape the sampling distribution at each generation step. This design functionally separates the probability-generation capacity of the learned Transformer core from the sampling layer that enforces DNA-compatible output generation. As defined in Section 3.3, at time step t, the base head produces a raw logit vector over the four DNA bases. Let this vector be denoted by: o t b a s e R 4 . Instead of sampling directly from these logits, an initial temperature-scaled base distribution is first obtained as: p t 0 b = s o f t m a x o t b a s e b τ ,   b Σ . The constraint-adjusted logit vector is then defined in Equation (14):
z t ~ b = log p t 0 b + δ t G C b + δ t l a g b + δ t n g b + m t H P b ,     b Σ
Here, p t 0 b denotes the initial base probability obtained from the base-head logits after temperature scaling. The parameter τ is the temperature used to construct this initial distribution. The term δ t G C b denotes the soft correction for GC balance. The term δ t l a g b denotes the short-range dependency suppression term. The term δ t n g b denotes the local n-gram regulation term. The term m t H P b denotes the mask used for enforcing the homopolymer limit. In this study, n-gram regulation is implemented through low-order bigram and 3-mer smoothing components. It aims to limit excessive concentration of local transitions or short motifs. GC balancing is applied as a soft steering term according to the target base distribution corresponding to the desired GC ratio. Let the target GC ratio be: ρ = 0.5 . The target base distribution is defined as: π A = π T = 1 ρ 2 ,   π C = π G = ρ 2 . During generation, the remaining quota or deviation from the target distribution is considered. The GC-guided logit correction for candidate base b is given in Equation (15):
δ t G C b = α t log m a x ( ε ,     π ^ t ( b ) ) m a x ( ε ,     π b )
Here, π ^ t ( b ) denotes the remaining target proportion or soft balancing ratio for base b at the relevant generation step. The term π b denotes the target base proportion, and ε   is a small positive constant used for numerical stability. The coefficient α t controls the strength of the GC-balancing effect as generation progresses. This term does not apply GC control as a hard post hoc correction. Instead, it acts as a guiding preference embedded into the sampling distribution.
Homopolymer control is not treated as a soft preference. It is handled as a hard feasibility condition. Let r t denote the current consecutive repeat length of the same base at the end of the prefix, and let H m a x denote the maximum allowed homopolymer length. The homopolymer mask is defined in Equation (16):
m t H P b = , i f   b = b t   a n d   r t H m a x   0 , o t h e r w i s e .
In this study, H m a x = 5 . Thus, candidate bases that would exceed the allowed homopolymer limit are directly removed from the sampling support. This mechanism prevents the formation of long single-base repeats during generation and limits homopolymer structures that may increase error risk in synthesis or sequencing workflows. Short-range dependency suppression is applied to reduce the tendency of the same base to become locally dominant in consecutive or nearby transitions. The general lag-1 correction is given in Equation (17):
δ t l a g b = α l a g log 1 η l a g 1 b = b t
Here, η l a g is the suppression coefficient for repeated selection of the same base, and α l a g denotes the relative strength of this correction. This term helps prevent the same base from becoming excessively dominant in one-step local transitions. Local n-gram regulation is applied according to the observed counts of low-order motifs that the candidate base would form with the current prefix. The general n-gram correction term is given in Equation (18):
δ t n g b = α n g log c t g b + 1 E t + 1
Here, g b denotes the bigram or 3-mer motif that candidate base   b would form with the current prefix. The term c t g b is the number of times this motif has been observed so far in the generated prefix. The term E t denotes the expected average count for the corresponding n-gram space. The coefficient α n g controls the strength of the correction. This term softly suppresses excessive concentration of local motifs and contributes to a more balanced short-motif distribution. After all correction terms are combined, the final sampling distribution is obtained by normalized exponentiation, as shown in Equation (19):
p t ~ b = e x p ( z t ~ b ) b Σ e x p ( z t ~ b )
The next DNA base is then sampled from this distribution: b t + 1 ~   C a t e g o r i c a l ( p t ~ ) . When necessary, the support set can also be restricted by top-k pruning. However, in the default configuration, the main decision mechanism is based on the probability distribution reshaped directly by constraint-adjusted logits. In this respect, the proposed sampling strategy differs from post-generation repair approaches that modify the completed sequence afterward. DNA-specific compatibility is managed at the probability-distribution level during every generation step. The general constraint-aware sampling workflow is summarized in Algorithm 2.
Algorithm 2. Constraint-aware sampling
Input: Base-head logits o t b a s e , current prefix, temperature τ, GC target, homopolymer limit, lag-1 parameters, and n-gram parameters.
Output: Selected next DNA base b t + 1 .
1. 
Obtain the temperature-scaled initial base distribution p t 0 from the base-head logits.
2. 
Compute the GC correction term according to deviation from the GC target.
3 
Compute the lag-1 correction term according to short-range transition dominance.
4. 
Compute the n-gram correction term according to local n-gram concentration.
5. 
Mask candidate bases that would exceed the homopolymer limit.
6. 
Combine all correction terms to construct the constraint-adjusted logit vector.
7. 
If necessary, restrict the support set using top-k pruning.
8. 
Normalize the constraint-adjusted logits with temperature to obtain the final sampling distribution.
9. 
Sample the next DNA base from the final distribution.
10. 
Append the selected base to the DNA output sequence.
11. 
Store the updated state for the next generation step.
The constraint-aware sampling layer is applied according to the same basic principle in R1, R1-ext, R2, and R3. Therefore, the observed differences among regimes do not originate from different constraint definitions. Instead, they arise from how the base-head probabilities are formed under real-data, synthetic-data, or data-independent initial conditions. In other words, this layer acts as a common regulatory wrapper across all regimes and helps separate the effect of the data source from the effect of the sampling mechanism. While the Transformer core produces probabilities, the constraint-aware sampling layer transforms these probabilities into DNA-compatible generation behavior. Dynamic DNA-to-bit rule selection and bitstream derivation are defined separately in the following section and are treated as monitored output components in the evaluation protocol.

3.6. DNA-to-Bit Mapping and Construction of Output Streams

The proposed framework is not designed only as a structure that generates DNA sequences. A second objective is to combine DNA-local generation with a randomness output that can be used in the bit domain within the same processing pipeline. Therefore, the DNA base obtained from the constraint-aware sampling layer defined in Section 3.5 is converted into a binary output at each generation step through dynamic DNA-to-bit rule selection. In this way, the output is obtained not only as a DNA sequence, but also as a traceable bitstream that does not depend on a single fixed mapping rule. As defined in Section 3.3, the model operates with eight equivalent DNA-to-bit coding rules. This rule set is denoted by R and is given in Table 3. Each rule defines a different mapping between the four bases in the DNA alphabet and two-bit outputs. Accordingly, for each r R , the conversion function is defined as: ϕ r : Σ 0 , 1 2 . Since the same DNA base may correspond to different two-bit outputs under different rules, the behavior of the resulting bitstream depends not only on the generated DNA sequence, but also on the selected rule sequence.
During generation, rule selection is performed adaptively using the constraint-adjusted base distribution obtained in Section 3.5 and the DNA-to-bit rule matrix. For each rule, the expected two-bit output balance is computed, and rules that are closer to the 0/1 balance are assigned higher selection probabilities. At time step t, the adaptive rule-selection distribution used during generation is defined in Equation (20):
E t r , j = b Σ p ~ t b M r b , j ,             j 1 , 2 s t r u l e r = 1 E t r , 1 0.5 + E t r , 2 0.5 2 π t r u l e r = s o f t m a x s t r u l e r τ r u l e ,             r R
Here, M r b , j denotes the value of base b at bit position j under rule r . The term E t r , j denotes the expected bit value produced by the corresponding rule under the current base distribution. The score s t r u l e r indicates how close the rule is to a balanced two-bit output, and π t r u l e r denotes the adaptive rule-selection distribution used during generation. In implementation, this basic balance score can be supported, when necessary, by a mild diversity term that reduces concentration of recently used rules. However, the main selection principle is to preserve the expected two-bit 0/1 balance under the current base distribution. The selected rule rtr_trt is applied to the DNA base sampled at the same generation step. The corresponding two-bit output is obtained as shown in Equation (21):
y t = ϕ r t b t + 1 0 , 1 2
Accordingly, the final DNA output and the corresponding bitstream are defined as: X = { b 1 , b 2 , , b N } and Y = y 1 y 2 y N . Here, the operator ∥ denotes concatenation of consecutive two-bit blocks. Since each base is converted into a two-bit output, a DNA sequence of length N produces a bitstream of length 2 N . For example, a 500,000-base DNA output corresponds to an approximately 1,000,000-bit stream.
The main purpose of dynamic rule selection is to prevent the bit-domain behavior from becoming overly dependent on a single fixed DNA-to-bit mapping rule. If one conversion rule is fixed throughout the entire generation process, local concentration of some base patterns may induce secondary regularities in the bitstream. In contrast, adaptive selection among eight equivalent rules supports a more balanced and diverse bit-level output behavior. Therefore, rule selection is not treated as a simple auxiliary labeling step, but as an active component that regulates diversity during the transition from the DNA domain to the bit domain.
In the R1, R1-ext, and R2 regimes, the rule head is calibrated using the soft-target loss and uniformity regularization described in Section 3.4. However, in the default generation pipeline, rule selection is performed through the adaptive selection mechanism computed from the final base distribution and the rule matrix. In the R3 regime, because model parameters are not trained, rule selection is carried out without the influence of learned distributional information. It is instead performed under data-independent initial conditions and the same adaptive generation principle. Thus, the bitstream obtained in R3 reflects the joint behavior of the architectural core, the constraint-aware sampling layer, and the adaptive DNA-to-bit mapping mechanism, rather than a rule behavior learned from training data.
In the proposed framework, the DNA sequence, the corresponding bitstream, and the selected rule trace are stored as separate outputs for each generation run. This structure enables the DNA output, bitstream behavior, and rule-usage pattern to be examined together within the same run. It also supports comparison of rule usage across regimes, analysis of distributional effects in the bit domain, and experimental reproducibility. In the default configuration, the bitstream is derived directly from the proposed DNA-local generation pipeline. No external extractor, key-derivation function, or additional post-processing layer is used. This choice ensures that the reported bit-level statistics originate from the joint production behavior of the dual-head decoder-only Transformer core, the constraint-aware sampling layer, and the adaptive DNA-to-bit rule-selection mechanism.

4. Results

4.1. Evaluation Setup and Reproducibility Summary

The proposed DNA-local Transformer-based PRNG framework was evaluated under the R1, R2, and R3 generation regimes to compare the behavior of the same architectural core under different data and training conditions. In addition, to examine whether the method depends on a single real genomic source, the R1 protocol was applied to an independent genomic data source as the R1-ext external validation setting. R1-ext is not a new main generation regime, but an external validation extension of R1 on independent genomic data.
For each setting, 10 independent generation runs were performed. In each run, a 500,000-base DNA sequence and the corresponding 1,000,000-bit stream were generated. The same architectural core, autoregressive generation pipeline, constraint-aware sampling mechanism, and adaptive DNA-to-bit rule-selection strategy were preserved across all settings. In R1, R1-ext, and R2, the model was calibrated under the corresponding data condition. In R3, no training or optimization step was applied.
To support reproducibility, sub-corpus selection, initial context construction, base sampling, and rule selection were controlled through a single PyTorch-based random generator. Generator initialized with the run-specific run_seed. The seed values, generated DNA sequences, bitstreams, rule traces, and run metadata were recorded. Computational measurements, including wall-clock time, CPU time, and memory usage, were collected under CPU-only conditions to ensure comparability across regimes. The experiments were conducted on Windows 11 Pro 64-bit, an Intel Core i7-10750H processor, 16 GB random-access memory (RAM), and Python 3.12.3. The main software packages used in the implementation were NumPy version 1.24.4, SciPy version 1.12.0, PyTorch version 2.0.0+cpu, and Biopython version 1.83. GPT-5.5 was used for language editing, limited text refinement, and visual/figure refinement. The run parameters and output-file access information are provided in the detailed reproducibility description and the Data Availability Statement. All generation scripts, run parameters, run_seed values, generated DNA sequences, bitstreams, rule traces, metadata files, and run-level evaluation outputs were also shared in the GitHub repository. This structure supports independent inspection of the reported results and regime-specific outputs.
The results were not reported from a single representative run. Instead, they were summarized across 10 independent runs. Where applicable, the result tables include the mean ± sample standard deviation (SD), 95% confidence interval (CI), observed minimum–maximum range, and the number of successful runs. For individual sequence-test results within NIST SP 800-22, the threshold was set to p ≥ 0.01. Results across multiple runs were evaluated together with pass counts and distributional summaries. Bit-level statistical randomness, DNA-specific structural compatibility, rule-usage behavior, multi-stream independence, robustness, component contributions, computational cost, and theoretical complexity are presented in the following subsections.

4.2. Bit-Level Randomness Evaluation

4.2.1. NIST SP 800-22 Tests

The bitstreams derived from the proposed DNA-local PRNG framework were evaluated using the NIST SP 800-22 test suite at the significance level of α = 0.01 [16,17]. For each of the R1, R1-ext, R2, and R3 settings, 10 independent bitstreams were analyzed, and each stream was generated with a length of 1,000,000 bits. The tests were applied to the binary outputs obtained from the generated DNA sequences through adaptive DNA-to-bit rule selection.
Table 4 presents, for the 15 main tests, the mean ± sample SD, Student-t-based 95% CI, observed minimum–maximum range, and pass count of the p-values obtained from 10 independent streams. The mean p-values and CIs are reported as descriptive statistics. The pass decision was determined separately for each stream using the criterion p ≥ 0.01. Therefore, no superiority ranking among settings was made based on the magnitude of mean p-values.
For tests that produce multiple p-values, the same reporting rule was applied across all settings to construct a compact summary table. Table 4 reports the M = 1000 result for the Block Frequency test, the selected 000000001 template for the Non-overlapping Template test, the second p-value for the Serial test, the backward direction for the Cumulative Sums test, the +4 state for the Random Excursions test, and the +9 state for the Random Excursions Variant test. More detailed reporting information, test parameters, stream-level results, and all sub-results for tests with multiple outputs are provided in Appendix C, Table A4.
As shown in Table 4, all representative p-values reported for R1, R1-ext, R2, and R3 satisfied the p ≥ 0.01 criterion, and a 10/10 pass count was obtained for the reported output of each test. The absence of any reported failure in the R1-ext setting indicates that the proposed generation pipeline preserved acceptable bit-level statistical behavior under an independent real genomic data source. Similarly, the R3 setting, which does not include any training or optimization step, also passed the reported tests. This suggests that the observed bit-level behavior is not solely attributable to patterns learned from training data.
Because this evaluation is limited to 10 independent streams, the results should not be interpreted as a substitute for the second-level p-value uniformity or pass-rate analysis of NIST SP 800-22, which requires larger sample sets. Instead, the findings are interpreted as stream-level pass results and descriptive statistical summaries. Overall, these results indicate that the bitstreams generated without an external post-processing layer satisfy the NIST SP 800-22 stream-level pass criterion reported in Table 4. However, these results alone should not be regarded as a formal proof of cryptographic security.

4.2.2. SP 800-90B-Inspired Min-Entropy, Independent and Identically Distributed (IID)-Related Indicators, and Health-Test Evaluation

The statistical properties of the bitstreams generated by the proposed DNA-local PRNG framework were further evaluated using SP 800-90B-inspired lower-bound min-entropy estimators, IID-related indicators, and online health-test measures [18,19]. This analysis was included because an evaluation based only on bit balance or a single entropy measure may remain limited. Such measures may not fully capture dominance of the most likely output or short-range dependencies. Min-entropy estimators examine output unpredictability from a conservative lower-bound perspective. Using complementary estimators also reduces dependence on a single modeling assumption. For each of the R1, R1-ext, R2, and R3 settings, 10 independent 1 Mbit bitstreams were analyzed under the same evaluation protocol.
The evaluation used the most common value (MCV), t-tuple, and first-order Markov min-entropy estimators. In addition, collision-based H2 and compression-based auxiliary lower-bound indicators were reported for comparison. To examine bit balance and low-order dependence, the 1-bit proportion p(1), Monobit and Runs p-values, and first-order mutual information were reported. Time-local anomalies were evaluated using the Repetition Count Test (RCT) and Adaptive Proportion Test (APT). Table 5 presents the mean ± sample SD and Student-t-based 95% CIs calculated from 10 independent streams. Stream-level detailed results are provided in Appendix D, Table A5.
As shown in Table 5, p(1) values remained close to 0.5 in all settings. According to the more conservative t-tuple estimator, regime-averaged min-entropy lower bounds ranged from 0.9955 to 0.9964 bit/bit. The MCV and first-order Markov estimators produced values close to 1 bit/bit. The collision- and compression-based auxiliary lower-bound indicators were also consistent with this overall pattern. The R1-ext setting showed a descriptive profile similar to R1. This indicates that no clear descriptive degradation was observed when the generation pipeline was evaluated under an independent real genomic source. The R3 setting, despite having no training or optimization step, produced min-entropy values at a similar magnitude to the trained settings. This suggests that the observed lower-bound unpredictability behavior is not solely attributable to patterns learned from training data.
The IID-related indicators support the same interpretation. In the stream-level results reported in Appendix D, the Monobit and Runs p-values remained above the 0.01 threshold for all streams. First-order mutual information values were on the order of 10−7–10−6 bit. The maximum RCT run lengths remained clearly below the predefined 40-bit threshold, and all RCT and APT checks were within the acceptance ranges. The APT worst-window p-values were reported as descriptive indicators of local fluctuations and were not interpreted as standalone failure decisions.
Overall, these findings show that the bitstreams generated under the four settings exhibited high lower-bound min-entropy, weak first-order dependence, and acceptable health-test behavior. However, the results were not used to establish a statistical superiority ranking among regimes. They were interpreted as descriptive reliability indicators. In addition, this evaluation should not be regarded as formal SP 800-90B entropy certification, complete IID validation, or a formal proof of cryptographic security.

4.2.3. ENT Tests

The bitstreams generated from the proposed DNA-local PRNG framework were also evaluated using the ENT-style statistical measures implemented in Python in the manuscript [20,21]. This analysis was conducted to examine the classical statistical properties and information density of the bitstreams from a complementary perspective. ENT reports byte-level summary measures, including entropy per byte, the chi-square statistic, arithmetic mean, Monte Carlo π estimate, and serial correlation coefficient between consecutive bytes. Therefore, ENT results were not interpreted as a replacement for the NIST SP 800-22 or SP 800-90B-inspired evaluations. Instead, they were treated as a complementary and descriptive assessment of the classical statistical behavior of the bitstreams. For each of the R1, R1-ext, R2, and R3 settings, 10 independent 1 Mbit bitstreams were analyzed under the same ENT evaluation protocol. Table 6 presents the mean ± sample SD and Student-t-based 95% CIs calculated for each setting. Stream-level detailed ENT results are provided in Appendix E, Table A6.
As shown in Table 6, the entropy values remained at approximately 7.9985 bits/byte across all settings and were close to the theoretical upper limit of 8 bits/byte. The arithmetic mean values clustered around the expected central value of 127.5, and the 95% CIs of all four settings included this value. These findings indicate that no clear byte-level imbalance or information-density loss was observed in the analyzed bitstreams.
The regime-averaged chi-square statistics were close to the expected 255 degrees of freedom for 256 possible byte values. However, no formal pass decision was made based only on the magnitude of the chi-square statistic. This measure was used descriptively to compare frequency-distribution behavior across regimes. The mean Monte Carlo π estimates remained close to the true value of π, and all 95% CIs included this value. Similarly, the serial correlation coefficients showed small positive or negative values close to zero, and the CIs of all four settings included zero. These results provide complementary evidence that no clear linear dependence was observed between consecutive bytes.
The R1-ext setting showed an ENT profile similar to R1. This indicates that no clear descriptive degradation was observed under an independent real genomic data source. The R3 setting, despite having no training or optimization step, produced ENT results at a similar level to the trained settings. This suggests that the observed ENT profile is not solely attributable to patterns learned from training data.
Overall, the ENT results show that the bitstreams generated under all four settings exhibited high information density, byte distributions close to expected central values, and negligible serial correlation. However, these results were not used to establish a statistical superiority ranking among regimes and should not be interpreted as a standalone formal proof of cryptographic security.

4.3. DNA-Specific Structural and Multi-Stream Evaluation

4.3.1. DNA-Specific Metrics

The structural compatibility of the proposed DNA-local PRNG framework was evaluated using DNA-channel-specific metrics in addition to bit-level randomness tests. For this purpose, the 10 independent 500,000-base DNA streams generated under each of the R1, R1-ext, R2, and R3 settings were analyzed in terms of GC ratio, maximum homopolymer length, normalized Lempel–Ziv (LZ) complexity, 3-mer distribution behavior, reverse-complement (RC) symmetry, block entropy, bit-level p(1), and zlib compression ratio. Thus, the evaluation covered not only the classical randomness properties of the derived bitstreams, but also structural features that may be relevant for DNA-based representation and potential synthesis/sequencing workflows. Table 7 presents the mean ± sample SD and Student-t-based 95% CIs calculated from 10 independent streams for each setting. Stream-level detailed metric results are provided in Appendix F, Table A7.
As shown in Table 7, the GC ratio remained close to the target value of 0.5 in all settings, and the maximum homopolymer length did not exceed the design limit of 5 in any independent stream. These results indicate that the GC-balancing and homopolymer-control mechanisms defined in the constraint-aware sampling layer were preserved over long DNA streams. The same constraints were also maintained in the R1-ext setting, suggesting that this behavior was retained under an independent real genomic source.
The block entropy results show that H(1)–H(6) values remained close to their corresponding theoretical upper bounds across all settings. This supports the interpretation that the generated DNA sequences exhibited high symbolic diversity over the four-symbol alphabet. Normalized LZ complexity values were also high in all settings. These values were approximately 0.986 in R2 and R3, whereas R1 and R1-ext showed slightly lower but still high complexity profiles. This difference suggests that synthetic or reference-free generation settings may exhibit a more isotropic symbolic profile, while real-data-related settings may partially retain short-range source-dependent structural traces.
The very small 3-mer p-values indicate that local 3-mer distributions cannot be fully explained by an equiprobable and memoryless four-symbol source. However, the aim of the proposed framework is not to make all k-mer distributions completely uniform. Rather, it aims to generate controlled and reproducible sequences under DNA-compatibility constraints. Therefore, the 3-mer findings were not interpreted as standalone failure indicators. They were treated as descriptive indicators of local motif and transition structures.
The RC-symmetry results also reveal regime-dependent structural differences. The R2 and especially R3 settings showed more balanced RC-symmetry p-value profiles than R1 and R1-ext. In the real-data-related R1 and R1-ext settings, smaller p-values were observed at the k = 2 and k = 3 levels. This suggests that short-range RC-related structural traces were not fully suppressed in real-data-related generation, but were reflected in the generation pipeline in a controlled manner. This observation supports the interpretation that the method is not merely an abstract randomness generator. Rather, it provides a production architecture that makes the interaction between the data source and constraint-aware sampling visible at the DNA level.
The bit-level p(1) values remained close to 0.5 in all settings. The zlib compression ratios were also approximately 0.1498 across all four settings and did not show a clear regime-level separation. This metric was interpreted as an auxiliary compressibility indicator that is sensitive to output representation and local repeat structure. It was not used as a direct measure of superiority or failure. Overall, the DNA-specific metrics show that the proposed generation pipeline preserved core DNA-compatibility targets, including GC balance and the homopolymer limit. At the same time, it was able to reflect regime-dependent local structural traces in a controlled manner. These results provide supporting evidence for structural compatibility and generation behavior, but they should not be interpreted as a formal proof of cryptographic security.

4.3.2. Multi-Stream Independence and Leakage Controls

To evaluate whether the proposed DNA-local PRNG framework behaves independently not only at the single-stream level but also across different generation runs, two complementary analyses were performed. First, in the data-supported settings, an exact-match k-mer-based leakage control was applied to examine whether the generated DNA streams directly copied long fragments from the corresponding reference or training corpora. Second, all pairwise comparisons were performed among the 10 independent streams generated with different run_seed values in each regime. The Hamming ratio was calculated in the bit domain, and the mismatch ratio was calculated in the DNA domain.
The leakage analysis was applied to the R1, R1-ext, and R2 settings, because these settings are associated with real genomic, independent real genomic, and synthetic reference/training corpora, respectively. In each setting, a 1,000,000-base reference or source DNA sequence was compared with 10 independently generated 500,000-base DNA streams. For k = 32, 48, and 64, the direct k-mer matching control showed no long k-mer overlap with the reference or training corpus in R1, R1-ext, or R2. The R3 setting was not included in this analysis because it does not use any external training or reference corpus. Table 8 summarizes the exact-match k-mer leakage control results.
For multi-stream independence analysis, all pairwise stream combinations were formed from the 10 independent streams in each regime:   10 2 = 45 . Thus, 45 stream pairs were evaluated for each regime. In the bit domain, the expected Hamming ratio for two independent and balanced bitstreams was defined as:   p 0 = 0.5 . In the DNA domain, the expected mismatch ratio under a four-symbol uniform and independent source was defined as: p 0 = 1 b Σ P b 2 = 0.75 . In this framework, Hamming ratios close to 0.5 support independence between bitstreams, whereas mismatch ratios close to 0.75 are consistent with four-symbol uniform-independent behavior in the DNA domain. Table 9 presents the pooled Hamming and mismatch results calculated over 45 stream pairs for each regime.
As shown in Table 9, the pooled Hamming ratios in the bit domain remained very close to the theoretical expectation of 0.5 in all regimes. The p-values were 0.643, 0.864, 0.292, and 0.471 for R1, R1-ext, R2, and R3, respectively. No significant deviation from the 0.5 expectation was observed in the bit domain. This result supports the absence of systematic inter-stream dependence among bitstreams generated with different seed values.
The DNA-domain results showed a more differentiated pattern. The pooled mismatch ratios in R2 and R3 were 0.749915 and 0.750116, respectively, and were consistent with the theoretical expectation of 0.75. In contrast, the mismatch ratios in R1 and R1-ext were 0.732184 and 0.740847, respectively, and deviated significantly from 0.75. This indicates that, although bit-domain independence was preserved, real-data-related settings partially retained structural traces associated with base distribution and short-range organization in the DNA domain. This result should not be interpreted as a failure. Rather, it is a descriptive finding that makes the DNA-level effect of the data source visible.
To evaluate whether the rule-selection behavior collapsed to a single DNA-to-bit mapping rule, normalized rule entropy was calculated from the usage distribution of the eight rules in each run. Under ideal balanced usage, this value approaches 1. The normalized rule entropy values for R1, R1-ext, R2, and R3 were 0.9999965 ± 0.0000015, 0.9999961 ± 0.0000011, 0.9999960 ± 0.0000016, and 0.9999977 ± 0.0000011, respectively. The mean dominant-rule ratio remained approximately within the range of 0.1256–0.1258 across all settings. These results show that adaptive DNA-to-bit rule selection did not collapse to a single rule and that the bitstream did not become overly dependent on a fixed mapping rule. Rule entropy is not interpreted as a cryptographic security proof. It is used as a descriptive indicator supporting the interpretability of rule-selection behavior. A detailed rule-usage summary is provided in Appendix G, Table A8, and run-level rule traces and raw outputs are shared in the GitHub repository for reproducibility.
Overall, the leakage and multi-stream independence analyses indicate that the proposed method did not show evidence of direct long-fragment reproduction from reference or training sequences. In the DNA domain, especially in the real-data-related R1 and R1-ext settings, source-sensitive structural traces were partially preserved. This suggests that the method is not merely an abstract bitstream generator. Instead, it provides a generation architecture that reflects the interaction among DNA-local production, data regime, and constraint-aware sampling. Nevertheless, these analyses provide supporting evidence only for inter-stream independence and direct long-fragment copying control. They do not replace broader attack models or formal security proofs.

4.3.3. Component-Level Sensitivity and Failure-Oriented Stress Control

A limited component-sensitivity and failure-oriented stress control was conducted to evaluate the functional contribution of the generation-time components in the proposed R3 generation pipeline. This analysis was not designed as a full ablation study. Instead, it aimed to examine how DNA-level and bit-level behavior changes when key generation components are removed or restricted. Because R3 does not involve any training data or optimization step, this control was performed under the R3 setting. Thus, the observed changes could be linked more directly to generation-time components related to sampling, constraint management, and DNA-to-bit rule selection rather than to training dynamics.
Four stress variants were evaluated: the fixed-rule variant, in which a single fixed DNA-to-bit rule was used; the no-homopolymer-mask variant, in which the homopolymer mask was removed; the no-lag1-suppression variant, in which lag-1 suppression was disabled; and the no-constraint variant, in which GC balancing, the homopolymer mask, and lag-1 suppression were jointly disabled. Each variant was run with three independent seed values. In each run, a 500,000-base DNA sequence and the corresponding 1,000,000-bit stream were generated. The summary evaluation was based on GC ratio, maximum homopolymer length, bit-level proportion of ones, Monobit behavior, and normalized rule entropy. Table 10 presents the comparative summary of the evaluated methods and highlights the main distinctions of the proposed approach. Run-level detailed results are provided in Appendix H, Table A9 and Table A10.
The fixed-rule variant clearly demonstrated the effect of dynamic DNA-to-bit rule selection on bit-level balance. In this variant, the GC ratio remained within the target range, the maximum homopolymer length did not exceed the predefined limit, and DNA symbol entropy remained high. In contrast, the bit p(1) value systematically deviated from 0.5, and the Monobit p-values remained far below the acceptable range. This finding shows that DNA-level structural compatibility alone does not guarantee bit-level balance. Therefore, dynamic rule selection should be regarded not merely as an additional coding preference, but as a functional component that supports the balance of the corresponding bitstream.
The no-homopolymer-mask variant showed the opposite behavior. In this variant, bit p(1), Monobit behavior, and rule-usage balance were largely preserved. However, the maximum homopolymer length increased to the range of 16–20 across the three independent runs. Similarly, in the no-constraint variant, the maximum homopolymer length increased to the range of 19–23, and a limited decrease in DNA symbol entropy was observed. These findings indicate that an output that appears balanced at the bit level may still be structurally unsuitable at the DNA level. Therefore, the homopolymer mask and the in-generation constraint layer are necessary functional components for DNA-local generation.
In the no-lag1-suppression variant, no clear degradation was observed in terms of GC balance, homopolymer limit, bit p(1), or rule entropy. This suggests that lag-1 suppression does not have as dominant an effect on the primary DNA-compatibility metrics as the homopolymer mask or the general constraint layer. However, this does not imply that lag-1 control is unnecessary. Rather, it indicates that lag-1 suppression should be interpreted as a supporting regulatory component that may be more relevant for detailed analyses of short-range dependencies and local motif behavior.
Overall, this limited stress control shows that the components in the proposed generation pipeline contribute functionally at different levels. Dynamic DNA-to-bit rule selection supports the preservation of bit-level balance, whereas the homopolymer mask and the in-generation constraint layer play a decisive role in preserving DNA-level structural compatibility. This analysis should not be interpreted as a formal security proof or a full ablation study. Nevertheless, by showing failure-like behavior when specific components are removed, it experimentally supports the design rationale of the proposed DNA-local PRNG core.

4.4. Performance and Computational Complexity Analysis

4.4.1. Empirical Performance Analysis

The operational behavior of the proposed DNA-local PRNG core was evaluated over 10 independent streams under the R1, R1-ext, R2, and R3 settings. In each run, a 500,000-base DNA sequence was generated, and the corresponding 1,000,000-bit stream was obtained. The performance evaluation used four main measures: wall-clock execution time, cumulative central processing unit (CPU) time, additional memory usage relative to the initial state, and generation efficiency. Efficiency was calculated as the ratio of the number of generated DNA bases to the total execution time and was reported in bases/minute.
To support comparability, all measurements were obtained under CPU-only execution conditions in the same hardware and software environment. For R1, R1-ext, and R2, the reported total time and CPU load represent the combined cost of the single-epoch training stage and the subsequent generation stage. In contrast, because the R3 setting does not include any training or optimization stage, only the generation process was measured. Therefore, the results should not be interpreted as a comparison of pure inference speed alone. They represent the total operational cost of each regime under its own experimental definition. Table 11 presents the mean ± sample SD and Student-t-based 95% CIs calculated over 10 independent runs for each regime. Run-level detailed performance records are provided in Appendix B, Table A3.
As shown in Table 11, the mean execution times ranged from 26.34 to 31.37 min across regimes. The R3 setting, which does not include a training stage, showed the shortest total execution time. In the training-supported regimes, the total times reflect the combined effect of training and generation. The higher mean execution time observed for R1-ext compared with R1 and R2 indicates the additional operational cost of training-supported generation under an independent real genomic source. The CPU-time results showed a similar pattern. The mean CPU time was approximately 157.16 min for R3, compared with 167.84 min for R1, 180.37 min for R2, and 186.29 min for R1-ext. These results indicate that the training-supported settings required higher CPU load. Nevertheless, all regimes operated within the same order of magnitude in terms of operational cost. Additional memory usage remained approximately 16–17 MB for R1 and R2. The corresponding values were 23.50 MB for R1-ext and 31.73 MB for R3. The higher memory usage in R3 suggests that the generation-only execution profile may differ from the training-supported settings in terms of memory behavior. However, the observed increase was limited and did not reach a level that would prevent execution under CPU-only conditions. Generation efficiency was highest in R3, reaching approximately 19,002 bases/minute. The mean efficiencies for R1, R2, and R1-ext were approximately 17,823, 16,585, and 15,953 bases/minute, respectively. This difference is consistent with the absence of training cost in R3. Although the training-supported settings showed lower efficiency, their total time, CPU load, and memory usage remained within practical execution limits.
Overall, the performance results indicate that the proposed DNA-local PRNG framework provides an applicable time–resource balance under the R1, R1-ext, R2, and R3 settings. R3 achieved shorter execution time and higher generation efficiency, whereas R1, R1-ext, and R2 showed acceptable CPU-only execution profiles despite the additional cost of the training stage. These findings support that the method can operate at the experimental scale with a feasible computational cost, in addition to satisfying the statistical and DNA-specific evaluation criteria.

4.4.2. Theoretical Computational Complexity

The theoretical computational cost of the proposed decoder-only Transformer-based DNA-local PRNG core was analyzed separately for the generation and training stages. The generation complexity applies to all R1, R1-ext, R2, and R3 settings, because all regimes use the same basic autoregressive generation core. Training complexity was evaluated only for the data-supported R1, R1-ext, and R2 settings. Since R3 does not include any training or optimization stage, only generation cost was considered for this regime.
In the analysis, the model is assumed to be a decoder-only Transformer core with L layers, h attention heads, and embedding dimension d . The context-window length is denoted by W , the generated sequence length by G , the batch size by B , and the total number of training tokens by P . In the configuration used in this study, L = 3 ,   h = 4 ,   d = 128 ,   and   W = 128 . The four-class base head and the eight-class rule head are treated as low-order output operations that do not change the dominant asymptotic terms. During generation, the use of a KV cache and a fixed-length sliding window avoids recomputing the entire past sequence for each new token. Therefore, the dominant cost for each new token consists of attention computation over the window and the feed-forward projection. The first W tokens introduce a one-time initialization cost. Accordingly, the total generation time can be expressed as Equation (22):
T g e n = Θ L W 2 d + W d 2 +   Θ G L W d + d 2
The first term in Equation (22) represents the initialization of the starting context window. The second term represents the main generation stage of length G . In the typical case where G W , and L ,   W , and d are fixed, the generation cost grows approximately linearly with the output length G . This property demonstrates the main scalability advantage of the sliding-window and KV-cache design when generating long DNA sequences and the corresponding bitstreams. Generation memory mainly consists of model parameters and KV-cache components. Therefore, generation memory can be approximated as Equation (23):
M e m g e n = Θ L d 2 + Θ B L W d
Here, the first term represents model parameters, whereas the second term represents the KV-cache cost determined by batch size, number of layers, window length, and embedding dimension. When a fixed window length is used, generation memory does not grow with the total output length G . Instead, it is mainly determined by L ,   W ,   d ,   and   B . This keeps memory requirements controlled during long-stream generation. During training, attention is computed over the full window at each training step. Therefore, the single-step cost is higher than the per-token generation cost. For a single training step, the dominant forward-pass cost is given in Equation (24):
T s t e p = Θ B L W 2 d + W d 2 ,
For single-epoch training, the approximate number of steps is: ( N s t e p )   P B W . Thus, the total training time can be expressed as Equation (25):
T t r a i n = Θ L P W d + d 2 .
Although Equation (25) shows that the training cost increases with the total number of training tokens   P , context-window length W , embedding dimension d , and number of layers L . Optimization methods such as A d a m W may introduce additional overhead through parameter updates and optimizer-state memory. However, they do not change the dominant time-order term. This explains why the R1, R1-ext, and R2 settings showed higher CPU time than R3 in the empirical results. Training memory consists of model parameters, optimizer states, and activations. Let κ   denote the relative contribution of optimizer-state memory compared with parameter memory. Training memory can be approximated as Equation (26):
M e m t r a i n = Θ ( ( 1 + κ ) L d 2 ) + Θ ( B L ( W d + h W 2 ) )   c l a s s i c a l   a t t e n t i o n   i m p l e m e n t a t i o n Θ ( B L W d )   S D P A c o m p a t i b l e   a t t e n t i o n   i m p l e m e n t a t i o n
In a classical attention implementation, storing attention weights explicitly may introduce an additional activation-memory term of order h W 2 . In Scaled Dot-Product Attention (SDPA)-compatible implementations, this burden is reduced, and practical memory behavior is more closely associated with the B L W d term. Nevertheless, training memory remains higher than generation memory because activations must be stored for backpropagation.
In this study, the 500,000-base DNA output and the corresponding 1,000,000-bit stream length were selected as the main experimental scale because they are sufficient for bit-level randomness tests and DNA-specific structural evaluation. Longer DNA and bitstreams can be generated using the same pipeline. However, the primary aim of this study was to characterize the proposed core under standard randomness tests, DNA-specific metrics, and reproducible multi-run settings. Owing to the fixed context window and KV-cache mechanism, the generation cost is expected to scale approximately linearly with output length when model size and window length are fixed. Therefore, larger-scale experiments can be addressed in future work without changing the basic design of the method.
Overall, the theoretical analysis shows that the proposed core scales approximately linearly with output length during generation, while generation memory depends on the model and window dimensions rather than the total generated length. The training stage is more costly because of full-window attention computation and activation memory. Nevertheless, the lightweight configuration used in this study provides a controlled balance between methodological adequacy and computational feasibility. These results are consistent with the empirical performance findings reported in Section 4.4.1 and support the computational applicability of the proposed DNA-local PRNG core for long-stream generation.

5. Discussion

When the findings of this study are considered together with selected machine-learning-based PRNG literature, the proposed DNA-local Transformer-based framework differs in several important respects. As summarized in Table 12, Transformer-based [8], LSTM-based [22,25], GAN/WGAN-based [26], and reinforcement-learning-based [30] studies generally focus on bit-domain generation, and their evaluations are often based on a limited number of statistical tests. In contrast, the outputs generated in this study were evaluated not only using NIST SP 800-22, but also through SP 800-90B-inspired min-entropy and health indicators, ENT statistics, DNA-specific structural metrics, multi-stream independence, exact-match leakage controls, empirical performance, and theoretical complexity. This multilayer protocol was not used to claim formal cryptographic security. Rather, it was used to characterize the statistical, structural, and operational behavior of the proposed generator more transparently.
One of the main distinctions of the proposed method is that generation is not first performed in the bit domain and then converted into DNA symbols. Instead, generation is carried out directly in the A/C/G/T alphabet, while GC balance, homopolymer limitation, short-range dependency suppression, and local n-gram behavior are managed during generation [3,4,5,6]. The results show that this choice is not only methodological, but also operationally meaningful. The GC ratio remained close to the target value, the maximum homopolymer length did not exceed the predefined limit, and a controlled structural profile was preserved over long 500,000-base DNA streams. Therefore, the proposed method should not be interpreted merely as a bitstream generator with an added DNA representation layer. It should instead be regarded as a DNA-local generation architecture in which production constraints directly shape sequence formation.
The transition from the DNA domain to the bit domain was also handled differently from fixed-mapping approaches. In the proposed framework, the bitstream is derived not through a single fixed DNA-to-bit conversion rule, but through dynamic selection among eight equivalent coding rules. This design aims to reduce secondary regularities that may arise when a single mapping rule is used throughout the entire sequence. The consistency of the NIST SP 800-22, SP 800-90B-inspired, and ENT results suggests that dynamic rule selection may contribute to bit-domain behavior. However, this interpretation should be treated cautiously. It is not a security proof or a standalone ablation result, but an interpretation supported by the experimental findings.
Another important finding is that the effect of the data regime becomes visible in the DNA domain. Evaluating R1, R2, and R3 under a common protocol made it possible to examine how the observed behavior relates to real-data, synthetic-data, and reference-free generation conditions. In the bit domain, all regimes showed strong statistical profiles and multi-stream independence. In the DNA domain, however, the regimes exhibited more distinguishable structural properties. The significant deviation of the pooled mismatch ratio from the theoretical expectation of 0.75 in R1 and R1-ext suggests that short-range DNA-structural traces are partially preserved in real-data-related generation. This should not be interpreted as a failure. Rather, it is a descriptive finding that makes the DNA-level effect of the data source visible. By contrast, R2 and especially R3 showed more isotropic DNA-level behavior.
The leakage analysis complements this interpretation. In the trained or reference-associated settings, no exact-match long k-mer overlap was observed between the generated DNA streams and the corresponding reference/training corpus for k = 32, 48, and 64. This finding indicates that, under the tested criteria, long reference fragments were not directly copied. However, the absence of exact-match hits should not be interpreted as formal proof that all possible forms of memorization are absent. As indicated by the DNA-specific structural metrics, local structural traces related to the data regime can still be reflected in the generation pipeline in a controlled manner, even without direct copying.
The empirical performance and theoretical complexity findings also support the applicability of the method. As expected, R1, R1-ext, and R2 required higher total execution time and CPU load because they included a training stage. In contrast, R3 consisted only of the generation stage and therefore achieved shorter execution time and higher generation efficiency. Nevertheless, the computational costs of all regimes remained within the same order of magnitude. The theoretical analysis is consistent with this observation. Because of KV-cache and sliding-window operation, generation cost scales approximately linearly with output length, while generation memory depends mainly on the model and window dimensions rather than the total generated length. This indicates that the proposed DNA-local PRNG core provides a computationally feasible profile at the evaluated experimental scale.
The proposed framework may be useful in several DNA-oriented computational workflows where randomness must be considered together with sequence-level structural constraints. Potential application areas include in silico DNA sequence design, DNA data storage and indexing, generation of structurally constrained synthetic DNA streams for benchmarking, and simulation of DNA-based processing pipelines. Because the generator operates directly in the A/C/G/T alphabet, it can produce candidate sequences while monitoring GC balance, homopolymer length, local motif behavior, and the corresponding bitstream within the same pipeline. This feature may be particularly useful when DNA-compatible random or pseudorandom sequences are required before downstream synthesis, sequencing, storage, or computational evaluation. However, the proposed framework should not be interpreted as a replacement for conventional CSPRNGs or as a formally secure cryptographic primitive; its practical relevance lies primarily in DNA-local, constraint-aware, and reproducible stream generation.
Several limitations of this study should also be stated clearly. First, although the reported findings provide supporting evidence in terms of statistical behavior, structural compatibility, leakage control, and performance, they do not constitute formal CSPRNG-level security proof. Attack models such as state recovery, chosen-seed attacks, internal-state inference, and long-horizon predictability remain outside the scope of this work. Second, the proposed architecture was not directly compared with classical software PRNGs under identical experimental conditions. Therefore, this study does not claim to replace general-purpose PRNGs. Third, although the 1 Mbit bitstream and 500,000-base DNA-stream scale provide a meaningful experimental evaluation, larger-scale experiments under different hardware conditions could further strengthen the conclusions.
In addition, this study did not perform a separate robustness analysis under random base substitutions, noisy variants, or systematically corrupted input sub-corpora. This is because the focus of the study was not to test model robustness under noisy data, but to characterize the statistical, structural, and operational behavior of a constraint-aware and reproducible PRNG core that operates directly in the DNA alphabet. Nevertheless, systematic stress tests under low- and moderate-level base substitutions, motif disruption, or regional composition shifts would be important for future work to assess data-source sensitivity and generation stability in greater detail. Finally, the real-data-related regimes were evaluated using a limited number of genomic sources. Therefore, DNA-level structural effects should be interpreted as source-dependent experimental findings rather than as a complete characterization across all genomic distributions.
Overall, this study positions the Transformer architecture not merely as a general-purpose generator operating on bit sequences, but as a DNA-local PRNG core capable of sampling directly in the DNA alphabet under explicit generation-time constraints. Evaluating the same architectural core under real-data, synthetic-data, and reference-free generation conditions within a common protocol shows that the method provides a multidimensional and analyzable framework that is not tied to a single data regime. When considered together with the selected literature and the findings reported in this study, the proposed approach addresses a meaningful gap in machine-learning-based PRNG research in terms of DNA-local randomness generation, in-generation structural constraint control, and multilayer validation.

6. Conclusions

This study presented a constraint-aware, reproducible, Transformer-based DNA-local PRNG framework for DNA-oriented random sequence generation. Unlike approaches that first generate outputs in the bit domain and then map them to DNA symbols, the proposed method performs generation directly in the A/C/G/T alphabet. This structure allows GC balance, homopolymer limits, and short-range sequence regularities to be managed during generation, while the corresponding bitstream is derived through dynamic selection among eight equivalent DNA-to-bit coding rules. The proposed core was evaluated under a common validation protocol across R1 associated with real genomic data, R1-ext based on an independent real genomic source, R2 associated with synthetic data, and R3 without training or reference data. For each setting, 10 independent generation runs were performed, and the results were reported with mean, sample standard deviation, 95% confidence intervals, and stream-level details. Bit-level evaluations using NIST SP 800-22, SP 800-90B-inspired min-entropy and health indicators, and ENT showed a stable statistical profile. DNA-specific analyses showed that the GC ratio remained close to the target value, the homopolymer limit was preserved, and the generated sequences exhibited high symbolic diversity. Multi-stream independence and exact-match k-mer leakage controls did not indicate systematic bit-level dependence under different seed values or direct long-fragment copying from reference/training corpora. The performance and theoretical complexity analyses showed that the proposed framework provides an applicable time–resource balance at the experimental scale. The training-free R3 setting achieved shorter execution time and higher generation efficiency, whereas R1, R1-ext, and R2 exhibited acceptable CPU-only execution profiles despite the additional training cost. The theoretical analysis further supported that, with KV-cache and a fixed-length sliding window, generation cost scales approximately linearly with output length. Nevertheless, this study does not provide a formal CSPRNG-level cryptographic security proof. Attack models such as state recovery, chosen-seed attacks, internal-state inference, and long-horizon predictability remain outside the scope of this work. Future studies should examine longer streams, more diverse genomic sources, different model and window configurations, fixed-rule ablations, separate removal of constraint components, and explicit attack models. Overall, the findings indicate that the proposed method addresses a meaningful gap in machine-learning-based PRNG research through DNA-local generation, in-generation constraint control, dynamic DNA-to-bit mapping, and multilayer validation.

7. Patents

The work reported in this manuscript has resulted in a national patent application titled “Eğitim Gerektirmeyen, Biyolojik Kısıt Farkındalıklı Transformer Tabanlı DNA Sözde Rastgele Dizi Üretimi ve Kodlama” (Training-Free, Biological Constraint-Aware Transformer-Based DNA Pseudorandom Sequence Generation and Encoding). The invention has been officially categorized as a “Service Invention” and approved for filing by the Fırat University Executive Board (Decision No: 2025-2026/17.43, dated 11 March 2026). The application process is currently being managed by the Fırat Technology Transfer Office.

Author Contributions

Conceptualization, A.K. and İ.T.; methodology, A.K. and İ.T.; software, A.K.; validation, A.K.; formal analysis, A.K. and İ.T.; investigation, A.K.; data curation, A.K.; writing—original draft preparation, A.K.; writing—review and editing, A.K. and İ.T.; visualization, A.K.; supervision, İ.T.; funding acquisition, İ.T. All authors have read and agreed to the published version of the manuscript.

Funding

The APC was funded by the Scientific and Technological Research Council of Türkiye (TÜBİTAK) under Project Number 123E386.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The code and reproducibility materials supporting the findings of this study are publicly available in the GitHub repository dna-local-prng-entropy (https://github.com/alevkaya-byte/dna-local-prng-entropy, accessed on 6 April 2026). Publicly available materials include the main generation scripts, recorded run seeds, and the generated DNA outputs, corresponding bitstreams, metadata files, and rule-trace files for the independent streams reported under all three regimes. The public-source genomic input used in the real-data regime is described in the manuscript.

Acknowledgments

This work was derived from the doctoral dissertation of the first author, entitled “Artificial Intelligence-Based Novel Approaches to Enhance the Performance of Genomic Encryption Methods”. During the preparation of this manuscript, the authors used ChatGPT (OpenAI, GPT-5.5 Thinking; accessed on 8 June 2026) for language editing, limited text refinement, and visual/figure refinement. The authors carefully reviewed and edited all outputs and take full responsibility for the content of this publication.

Conflicts of Interest

The authors declare no conflicts of interest. The funder had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

Abbreviations

The following abbreviations are used in this manuscript:
PRNGPseudorandom Number Generator
DNADeoxyribonucleic Acid
NISTNational Institute of Standards and Technology
ENTThe Pseudorandom Number Sequence Test Program
GCGuanine–Cytosine
RCReverse Complement
KVKey–Value
SDPAScaled Dot-Product Attention
CSPRNGCryptographically Secure Pseudorandom Number Generator
KDFKey-Derivation Function

Appendix A

Table A1. Extended inventory of representative PRNG and DNA-coding approaches.
Table A1. Extended inventory of representative PRNG and DNA-coding approaches.
Ref.FamilyMethod/ApproachOutput SpaceTraining/
Input
Constraint HandlingDynamic DNA → Bit MappingValidation ScopeReproducibility/Note
[3]DNA coding/
codec
DNA-Aeon
(arithmetic coding)
Bit → DNA; dynamicNo training; codec designCodebook-basedDNA constraint compatibilityNot a PRNG; no in-generation constraints
[4]DNA coding/
codec
Explorer
(De Bruijn graph)
Bit → DNA; dynamicNo training for Explorer; optional trained Codeformer decoderGraph-guided / in-generationDNA constraint compatibilityNot a PRNG; no in-generation constraints
[5]DNA codingDual-rule rotational coding with chaotic GC controlBit → DNA; dynamicNo training; chaotic mapRule-based / chaotic GC controlPartial (2 rules)Bioinformatics comparisonNot a PRNG; no in-generation constraints
[6]Evaluation/modelDNA storage
digital twin
Storage modelDNA error/bias metricsDoes not propose a PRNG/codec
[8]Transformer PRNGDecoder-only; LCG/MT
simulation with CoT
Bit; dynamicSynthetic PRNG sequences; supervisedNIST SP 800-22 (most tests); MT predictionLimited seed/protocol reporting; not DNA-native
[11]Transformer PRNGDecoder-only; learning LCG
regularities
Bit; dynamicLCG sequences; variety of moduliPrediction/generalization experimentsLimited seed/protocol reporting; not DNA-native
[12]DNA codingDynamic DNA coding (image)Bit → DNA; dynamicTrained/chaotic componentsPostPresentNIST; application metricsNot a PRNG; no in-generation constraints
[13]DNA codingEight-base DNA permutation/diffusionBit → DNA; dynamicChaotic parametersPostVariableEntropy, etc.; limitedFixed/narrow rule sets; no unified protocol
[34]DNA key (GA)DNA key strengthening with GADNA; dynamicExternal random DNA generatorPostFrequency; gap; fitnessNo NIST/90B; dependent on external RNG
[22]DL-PRNGLSTM + SHA-2Bit; staticDigits of π + seedNo additional constraintsNIST SP 800-22Seed reproducible; no DNA
[24]DL-PRNGGAN (Dense/Conv1D)Bit; dynamic256-bit seed; frameworkNIST SP 800-22Seed reproducible; limited security analysis
[25]RL-PRNGPPO-trained LSTM (POMDP)Bit; dynamicRandom seed (N = 2/5/10)NIST SP 800-22Open source; reproducible
[26]DL-PRNGGA-optimized GAN (recursive)Bit; dynamic256-bit seed; GA optimizationNIST; GM/T; Hamming; BCRExtensive reports; GPU/GA cost
[27]DL-PRNGPredictive-GAN (seed + counter)Bit; dynamicCounter + seedNIST SP 800-22 (repeated)Generation without dataset; no DNA
[28]DL-PRNGWGAN-GP (end-to-end; ONNX)Bit; dynamicBased on MT outputsNIST SP 800-22 (multiple repetitions)Platform-independent; no DNA
[31]DNA + Chaos + CNNPre-trained CNN + chaos + DNA codingBit → DNA; dynamicCNN (ImageNet) + imagesPostVariableNIST; entropyData/training-dependent; no in-generation constraints
[29]RL-PRNGRL agent + LSTM + CNNBit; dynamicInitial vector; no external dataNIST; correlationLimited security and hardware reporting
[30]RL-PRNGUDRL (upside-down RL)Bit; dynamic128-bit seed; no dataNIST; entropy; PNB; HammingNo dataset required; hardware/time metrics limited
This workTransformer PRNGDual-head decoder-only TransformerDNA → Bit; dynamicReal DNA/synthetic DNA/no-refIn-generationPresentNIST SP 800-22 + SP 800-90B + DNA-specific metricsSeeded and traceable; DNA-native unified protocol
Table A2. Extended architectural comparison between the original Transformer and the proposed DNA-PRNG core.
Table A2. Extended architectural comparison between the original Transformer and the proposed DNA-PRNG core.
Component/
Feature
Original Transformer (2017) [7]Rationale for UseProposed PRNG CoreRationale for Use
PurposeMachine translation (seq2seq translation, enc + dec)Convert a source sentence into a target languageDNA-native dual-head PRNG with dynamic DNA-to-bit rule mappingArchitecture repurposed for autoregressive DNA generation and rule-guided bitstream derivation
ArchitectureEncoder + decoder (6 + 6)Encoder extracts semantics from input; decoder generates outputDecoder-only, 3 blocksCross-attention is unnecessary; reduces parameters and latency
Positional
encoding
Fixed sinusoidal (sin/cos)Sequence order injected externallyRoPE (Q, K)Compatible with autoregressive generation, sliding window, and KV-cache
Multi-Head
Attention (MHA)
8 heads (base), 16 heads (big)Multiple attention views4 headsGood compute/performance trade-off for a 4-symbol output space
( d m o d e l )512 (base), 1024 (big)High capacity for language tasks128Lightweight configuration for trained and no-ref regimes
Feed-Forward Network (FFN)/ActivationTwo-layer MLP, (=2048), ReLUIncreases representational powerTwo-layer MLP, GELUStable lightweight training and generation
Number of layers6 encoder + 6 decoderDeep structure for complex sequence patterns3 blocksSufficient under the reported regimes while keeping the core lightweight
Normalization/ResidualLayerNorm + residual connectionsStabilizes learningPre-LN + residualMatches implementation and supports stable forward passes
Dropout0.1–0.3Prevents overfitting0.1 in the trained model; 0.0 in the no-ref model; inactive at inferenceConsistent with trained/no-ref code paths
Decoder maskingMandatory (future mask)Enables autoregressive generationCausal SDPA (is_causal = True)Prevents access to future positions
KV-cache/WindowKV-cache + sliding window ( b l o c k s i z e = 128)Reduces latency and memory cost during long generation
Input representationWords (token IDs)Vectorized via embeddingsDNA token IDs (A/C/G/T → 0–3)Supports DNA-local autoregressive modeling
Training data (regimes)Large parallel corpusParameter optimization for translationR1: real DNA; R2: synthetic DNA; R3: no-refR1/R2 trained; R3 generated without training data
Optimization (R1/R2)Adam/AdamWWidely adopted optimizersAdamW, lr = 3 × 10−4, wd = 0.01, batch = 256, epoch = 1Lightweight training configuration
Output headsSingle vocabulary headPredicts next tokenDual heads: base-head (4), rule-head (8)Joint next-base prediction and dynamic rule distribution modeling
Channel constraintsNot required for language tasksGC ≈ 0.5, homopolymer ≤ 5, lag-1 damping; trained code additionally uses bigram/trimer smoothingSupports DNA-compatible generation behavior

Appendix B

Table A3. Flow-level core performance summary for R1, R1-ext, R2 and R3 excluding I/O and downstream analysis.
Table A3. Flow-level core performance summary for R1, R1-ext, R2 and R3 excluding I/O and downstream analysis.
Regime Flow IDRun_SeedTime (min)CPU Time (min)ΔRAM (MB)Efficiency (Bases/min)Most-Used Rule
R1Run1377757683765828881327.578164.91917.0318,130.1R1
Run2299653220691923942627.013161.59414.2318,509.7R2
Run3901523704661722223828.513170.42220.1317,535.9R4
Run4675108307959591413729.050173.59813.0017,211.6R7
Run5660509901697413077628.595170.79712.5617,485.8R3
Run6290144980258183181228.605171.09213.2617,479.2R4
Run7814888892936662301327.330163.51621.9918,295.1R8
Run8434335877737087300128.786171.95514.6417,369.8R3
Run9257537548669553017128.069167.90014.3817,813.1R8
Run10812264473501864710427.181162.60821.6618,395.4R7
R1-extRun1762599988905455965930.733182.59924.9616,268.9R5
Run231457349824333262031.283185.66431.9415,983.1R2
Run376473314688114334831.283185.94413.9915,983.3R1
Run425189897615147551231.613187.13213.7215,816.4R4
Run5749823114198083900429.772177.35314.5816,794.1R6
Run6373889100214603387631.005184.40727.8016,126.6R6
Run7294120086364554554630.617182.15332.4116,330.7R6
Run8260721231819990759032.442192.74219.1915,412.0R7
Run9287594496923276097332.347191.88226.3815,457.4R5
Run10606721817550337737132.562193.05329.9815,355.3R0
R2Run1265934131811287518230.615183.13020.8416,332.0R6
Run2324616830173500597730.436182.10513.9116,428.1R3
Run3639146341569305777530.294181.22013.6216,504.9R6
Run454202121861488125730.115180.14319.2716,603.2R2
Run5336547596287339561930.046179.76521.9116,641.1R3
Run6194949374377467069030.129180.22020.2316,595.3R1
Run7323858291158438662730.118180.18420.7316,601.2R4
Run8376549461141618170830.075179.95513.4516,624.9R8
Run9182724806471535105329.776178.15611.0116,792.2R6
Run10715601921039498321929.888178.86214.6216,729.1R1
R3Run1868797082104273988125.888154.56031.6519,313.6R7
Run2271786091597675197827.841165.04233.3817,959.2R5
Run3416866331530367017425.641152.98931.0619,499.7R2
Run4189946752339761147726.027155.13432.5419,211.1R5
Run566971900732832496926.290156.85331.6819,018.8R7
Run6607808584295312223625.601152.97930.1619,530.2R5
Run7850652086452515064625.401151.83831.4219,684.5R7
Run8774404849585762752026.937160.90930.7518,561.9R2
Run92872821638692665227.455164.12131.9118,211.4R6
Run10234375274216488194926.280157.13832.7519,026.0R5

Appendix C

Table A4. R1, R1-EXT, R2 and R3 NIST SP 800-22 p-values for 10 independent runs.
Table A4. R1, R1-EXT, R2 and R3 NIST SP 800-22 p-values for 10 independent runs.
RegimeTest/FlowRun1Run2Run3Run4Run5Run6Run7Run8Run9Run10
R1T1 Monobit0.5741160.9473780.9728770.1719390.9410100.9808530.1141070.4914530.2695930.413357
T2 Block Frequency *0.6695430.1775560.9765220.8199860.9157930.0890080.3458310.8557910.2204930.532428
T3 Runs0.9821960.2652770.2792520.8011440.9760630.5878180.8301600.6216400.8940200.224240
T4 Longest Run0.4126830.7175640.9914860.9979630.8478730.2160290.0609610.5739090.1334370.672628
T5 Rank0.2722680.5291200.8985600.1522310.4418330.3658760.6564610.4876100.8510330.347866
T6 DFT0.1276790.5029250.3934230.6137590.8328390.7620200.1925470.6267110.1925470.056296
T7 Non-overlapping Template *0.0957130.6914270.9904900.2833910.4495210.8823170.2651650.2462890.4330150.491737
T8 Overlapping Template0.7600160.3917470.4552950.9020040.8394790.0940000.7809320.3013220.9254620.580660
T9 Universal0.2942710.7266370.5032370.0987130.0471890.7730770.2439260.4396910.3085800.924031
T10 Linear Complexity0.4340300.1200950.5185550.2066270.6345340.1497570.3209400.7681360.4732760.958357
T11 Serial *0.0683680.8022270.0321450.2658200.9070150.5465420.5116020.6899680.4900830.344284
T12 Approximate Entropy0.3480510.4787360.8758910.9088120.7520680.0152600.9509420.6900760.6860520.602374
T13 Cumulative Sums (Backward)0.9640880.5347940.9116520.3076990.8766400.7765530.1342010.5613610.3259750.191824
T14 Random Excursions * 0.9406050.0870990.8361600.3270660.5644180.3582560.4424300.8145010.2630740.460295
T15 Random Excursions Variant *0.6181120.6488840.8499510.8400360.5028430.0731600.8729320.5536940.7969870.967530
R1-EXTT1 Monobit0.8760330.2992700.0234510.9187570.4653900.2278170.1763750.6774100.1929160.893403
T2 Block Frequency *0.6888660.5183670.3152150.4053100.2735530.7931530.4359420.3505400.4028320.421235
T3 Runs0.1725750.9147270.7301940.3997940.0185460.1853210.8711700.1922930.0853770.964890
T4 Longest Run0.7012220.9048680.9905110.1126400.8407670.7732680.4665270.5358850.8812140.842003
T5 Rank0.4008570.9348820.1226630.8137680.9119070.2480560.9886090.5070210.9767580.498481
T6 DFT0.0223140.6863810.3127690.7690240.0119240.7830870.4684800.9487820.9487820.479815
T7 Non-overlapping Template *0.4839350.0814190.9876100.4726130.2735940.9496830.4191820.1439440.6826960.584531
T8 Overlapping Template0.9043260.2789280.2547280.4748960.4872610.5383310.6843710.4732330.9048030.593225
T9 Universal0.2630260.0646270.8338990.2009440.7370010.1260800.9767290.2059220.5443050.770810
T10 Linear Complexity0.3906490.9327940.9114300.0932540.4350550.0547200.7715360.6403240.9753770.641268
T11 Serial *0.0104750.2444750.0837040.6837240.2351860.7946450.8811260.9517550.3491470.484959
T12 Approximate Entropy0.9029370.8722480.5725560.6964650.9856750.3412780.7761600.2710600.6438750.908190
T13 Cumulative Sums (Backward)0.6485340.0294560.0365500.7280230.4697160.2277520.2143570.7719290.1962540.913034
T14 Random Excursions * 0.5259690.0653700.0127320.8920200.3341340.9346510.0512100.0211770.7231670.302438
T15 Random Excursions Variant *0.2723040.9297630.2276100.4617140.4171110.2442140.5145980.0715890.3394180.822266
R2T1 Monobit0.8461760.9984040.0226080.3441490.3340440.0472560.6058540.8072310.3702530.221708
T2 Block Frequency *0.9612220.7340240.7615500.3288850.6539730.8876300.6948110.9321470.5433680.894749
T3 Runs0.1459360.2534540.8280530.4563350.5425680.4202780.3608570.9840910.8016620.590926
T4 Longest Run0.4549390.0271100.8513610.6214840.5745230.0942180.9663060.1463810.2147360.580577
T5 Rank0.9711630.4732300.6091440.3127490.3001300.1354800.8626000.4352000.8824490.480366
T6 DFT0.0574910.9123150.3733940.0706380.1166010.9487820.9341780.3783410.3883560.013919
T7 Non-overlapping Template *0.5332610.5303000.6488130.5925120.8263560.6475080.2990970.3185560.9444110.342988
T8 Overlapping Template0.0543710.7925260.0610940.8452110.7212460.9857530.6830120.2380790.0179920.229354
T9 Universal0.3056570.2760970.0402130.9234090.3367580.1983780.5324900.5198680.4070020.176780
T10 Linear Complexity0.6181590.1882540.1608390.6046750.2336680.5106750.8961510.5327040.4493260.183131
T11 Serial *0.0593990.6755360.6641560.6268230.7240780.9671830.1449860.0972460.8668500.087061
T12 Approximate Entropy0.1121630.2300170.4202500.3021750.8923720.4245800.5182280.3773510.1312360.297065
T13 Cumulative Sums (Backward)0.9878440.8661930.0238740.6347200.4295520.0805340.4581050.9343810.5458490.428818
T14 Random Excursions * 0.6311320.9371940.8685880.5154500.3289420.7842650.8540950.4263710.0771110.199304
T15 Random Excursions Variant *0.2063470.4869630.1469030.2873500.9160100.1442440.1596940.7736380.1068270.991227
R3T1 Monobit0.9266980.4377490.8744570.5405380.1915530.8321070.5247760.2316970.8587230.578211
T2 Block Frequency *0.8612600.9041030.6278790.9902530.3142130.3917050.1111550.9500250.4744250.360097
T3 Runs0.8603010.8692570.9171890.9907240.9949780.7809780.0688210.4560110.2670130.689384
T4 Longest Run0.6046060.6324270.0348110.0515200.2222930.7875220.1378090.8711830.5636630.520913
T5 Rank0.2339860.2024300.7722870.2628330.7686700.9193910.7720870.8774920.4952040.919391
T6 DFT0.8328390.9780370.7273060.4088630.7901450.7901450.3636210.5882170.5326200.215403
T7 Non-overlapping Template *0.2065480.9909230.8181750.9294750.8119830.5032670.7287260.6491690.4792380.010210
T8 Overlapping Template0.5985090.9990100.4372660.2362320.5079100.1554610.7630750.8421450.0681210.026088
T9 Universal0.9183520.0583000.6512300.3953610.8711720.5896990.9048840.3353210.1942100.624306
T10 Linear Complexity0.7689220.5607210.0172170.5400990.4566820.8468630.4308510.6128100.9667050.462924
T11 Serial *0.4841660.3448150.4322450.5896280.8765290.7213370.6097390.7011610.3372680.345081
T12 Approximate Entropy0.4084520.7950130.5273410.6571710.9089660.9723340.1213130.6708520.5668610.708757
T13 Cumulative Sums (Backward)0.9431180.2708590.9864780.8913490.2130520.5040490.7158080.3501030.7719290.373520
T14 Random Excursions * 0.4691410.8351470.0372760.1427820.6104500.4904430.9290870.2719920.9392070.741596
T15 Random Excursions Variant *0.7433470.3835740.0843010.9333950.2575870.6574910.7924080.8535590.9360420.266002
* For tests with multiple parameter-dependent or multiple p-value outputs, the reported value corresponds to the predefined compact-summary rule: M = 1000 for Block Frequency, template 000000001 for Non-overlapping Template, the second p-value for Serial, the backward direction for Cumulative Sums, the +4 state for Random Excursions, and the +9 state for Random Excursions Variant.

Appendix D

Table A5. R1, R1-EXT, R2 and R3 SP 800-90B-inspired entropy, IID, and health-test results.
Table A5. R1, R1-EXT, R2 and R3 SP 800-90B-inspired entropy, IID, and health-test results.
RegimeTestRun1Run2Run3Run4Run5Run6Run7Run8Run9Run10
R1Entropy testsp(1)0.5002810.5000330.4999830.5006830.5000370.4999880.5007900.4996560.4994480.500409
H_MCV (bit/bit)0.9991890.9999050.9999510.9980310.9998930.9999650.9977220.9990080.9984080.998820
H_min (t-tuple, bit/bit)0.9970470.9966370.9961210.9968490.9957580.9963640.9966980.9957280.9965570.996470
H_Markov(1) (bit/bit)0.9991880.9983950.9984410.9980290.9998920.9992200.9977210.9990070.9984070.998246
H_Collision H2 (bit/bit)1.0000001.0000001.0000000.9999971.0000001.0000000.9999960.9999990.9999980.999999
H_Compression LB (zlib, bit/bit)1.0000001.0000001.0000001.0000001.0000001.0000001.0000001.0000001.0000001.000000
IID and health testsMonobit p0.5741160.9473780.9728770.1719390.9410100.9808530.1141070.4914530.2695930.413357
Runs p0.9821960.2652770.2792520.8011440.9760630.5878180.8301600.6216400.8940200.224240
I ( X t ;   X t 1 ) [bits]0.0000000.0000010.0000010.0000000.0000000.0000000.0000000.0000000.0000000.000001
RCT max run (threshold ≤ 40)20 (PASS)21 (PASS)19 (PASS)19 (PASS)20 (PASS)18 (PASS)27 (PASS)22 (PASS)21 (PASS)20 (PASS)
APT worst window (index, k/512, p-value)#1137; k = 291/512; p = 0.00226; PASS#1338; k = 293/512; p = 0.00123; PASS#1598; k = 298/512; p = 0.000237; PASS#683; k = 217/512; p = 0.000652; PASS#1115; k = 297/512; p = 0.000335; PASS#446; k = 301/512; p = 8.06 × 10−5; PASS#35; k = 208/512; p = 2.55 × 10−5; PASS#170; k = 292/512; p = 0.00168; PASS#616; k = 219/512; p = 0.00123; PASS#1049; k = 215/512; p = 0.000335; PASS
R1-extEntropy testsp(1)0.5000780.5005190.5011330.4999490.5003650.5006030.5006760.5002080.5006510.500067
H_MCV (bit/bit)0.9997750.9985030.9967350.9998530.9989470.9982610.9980510.9994000.9981230.999807
H_min (t-tuple, bit/bit)0.9942810.9952900.9957130.9952750.9941310.9968130.9966820.9952300.9952000.996849
H_Markov(1) (bit/bit)0.9980320.9985020.9967330.9987840.9966100.9980880.9980490.9981190.9975180.999805
H_Collision H2 (bit/bit)1.0000000.9999980.9999931.0000000.9999990.9999980.9999971.0000000.9999981.000000
H_Compression LB (zlib, bit/bit)1.0000001.0000001.0000001.0000001.0000001.0000001.0000001.0000001.0000001.000000
IID and health testsMonobit p0.8760330.2992700.0234510.9187570.4653900.2278170.1763750.6774100.1929160.893403
Runs p0.1725750.9147270.7301940.3997940.0185460.1853210.8711700.1922930.0853770.964890
I ( X t ;   X t 1 ) [bits]0.0000010.0000000.0000000.0000010.0000040.0000010.0000000.0000010.0000020.000000
RCT max run (threshold ≤ 40)21 (PASS)18 (PASS)20 (PASS)23 (PASS)19 (PASS)20 (PASS)17 (PASS)19 (PASS)21 (PASS)19 (PASS)
APT worst window (index, k/512, p-value)#656; k = 291/512; p = 0.00226; PASS#1346; k = 296/512; p = 0.000469; PASS#348; k = 301/512; p = 8.06× 10−5; PASS#1776; k = 215/512; p = 0.000335; PASS#1859; k = 215/512; p = 0.000335; PASS#711; k = 308/512; p = 4.95 × 10−6; PASS#461; k = 218/512; p = 0.0009; PASS#1843; k = 209/512; p = 3.78 × 10−5; PASS#1073; k = 303/512; p = 3.78 × 10−5; PASS#554; k = 215/512; p = 0.000335; PASS
R2Entropy testsp(1)0.4999030.5000010.5011400.4995270.5004830.5009920.5002580.5001220.5004480.500611
H_MCV (bit/bit)0.9997200.9999970.9967140.9986360.9986070.9971410.9992560.9996480.9987080.998238
H_min (t-tuple, bit/bit)0.9945220.9961210.9956830.9966820.9976860.9959700.9949280.9951540.9949580.996000
H_Markov(1) (bit/bit)0.9979050.9983550.9967130.9986380.9986090.9971420.9986810.9996470.9987070.998237
H_Collision H2 (bit/bit)1.0000001.0000000.9999930.9999990.9999990.9999941.0000001.0000000.9999990.999998
H_Compression LB (zlib, bit/bit)1.0000001.0000001.0000001.0000001.0000001.0000001.0000001.0000001.0000001.000000
IID and health testsMonobit p0.8461760.9984040.0226080.3441490.3340440.0472560.6058540.8072310.3702530.221708
Runs p0.1459360.2534540.8280530.4563350.5425680.4202780.3608570.9840910.8016620.590926
I ( X t ;   X t 1 ) [bits]0.0000020.0000010.0000000.0000000.0000000.0000000.0000010.0000000.0000000.000000
RCT max run (threshold ≤ 40)22 (PASS)21 (PASS)19 (PASS)19 (PASS)20 (PASS)20 (PASS)19 (PASS)20 (PASS)21 (PASS)23 (PASS)
APT worst window (index, k/512, p-value)#497; k = 215/512; p = 0.000335; PASS#1210; k = 212/512; p = 0.000116; PASS#625; k = 220/512; p = 0.00168; PASS#532; k = 295/512; p = 0.000652; PASS#1421; k = 292/512; p = 0.00168; PASS#1304; k = 215/512; p = 0.000335; PASS#517; k = 306/512; p = 1.14 × 10−5; PASS#970; k = 218/512; p = 0.0009; PASS#1818; k = 296/512; p = 0.000469; PASS#1660; k = 302/512; p = 5.54 × 10−5; PASS
R3Entropy testsp(1)0.5000460.5003880.5000790.5003060.4993470.5001060.4996820.4994020.4999110.500278
H_MCV (bit/bit)0.9998670.9988810.9997720.9991170.9981170.9996940.9990830.9982760.9997430.999198
H_min (t-tuple, bit/bit)0.9961670.9968190.9961670.9963940.9947320.9972750.9949280.9948530.9940710.995350
H_Markov(1) (bit/bit)0.9997450.9988790.9997740.9991190.9981160.9996000.9973760.9982750.9983980.999197
H_Collision H2 (bit/bit)1.0000000.9999991.0000000.9999990.9999981.0000000.9999990.9999981.0000001.000000
H_Compression LB (zlib, bit/bit)1.0000001.0000001.0000001.0000001.0000001.0000001.0000001.0000001.0000001.000000
IID and health testsMonobit p0.9266980.4377490.8744570.5405380.1915530.8321070.5247760.2316970.8587230.578211
Runs p0.8603010.8692570.9171890.9907240.9949780.7809780.06882050.4560110.2670130.689384
I ( X t ;   X t 1 ) [bits]0.0000000.0000000.0000000.0000000.0000000.0000000.0000020.0000000.0000010.000000
RCT max run (threshold ≤ 40)27 (PASS)20 (PASS)21 (PASS)20 (PASS)18 (PASS)20 (PASS)18 (PASS)18 (PASS)20 (PASS)23 (PASS)
APT worst window (index, k/512, p-value)#955; k = 295/512; p = 0.000652; PASS#1579; k = 299/512; p = 0.000167; PASS#218; k = 217/512; p = 0.000652; PASS#1431; k = 294/512; p = 0.0009; PASS#1186; k = 299/512; p = 0.000167; PASS#1145; k = 214/512; p = 0.000237; PASS#132; k = 199/512; p = 5.34 × 10−7; PASS#1567; k = 292/512; p = 0.00168; PASS#944; k = 295/512; p = 0.000652; PASS#1437; k = 297/512; p = 0.000335; PASS
Note: All RCT and APT checks remained within the acceptance range.

Appendix E

Table A6. R1, R1-ext, R2 and R3 ENT test statistics.
Table A6. R1, R1-ext, R2 and R3 ENT test statistics.
RegimeMetricRun1Run2Run3Run4Run5Run6Run7Run8Run9Run10
R1Entropy (bits per byte)7.9985037.9984537.9985497.9985797.9982727.9986307.9985647.9987267.9986947.998462
Chi-square statistic259.457268.001250.949245.637298.516238.362248.352221.413227.188265.781
Arithmetic mean (ideal: 127.5)127.7228127.8182127.3822127.8139127.3011127.4006127.6763127.3662127.3714127.7491
Monte Carlo π estimate3.142273.123203.144193.143813.156103.148163.138433.149703.143303.13997
Serial correlation coefficient0.0033290.0008910.002626−0.000355−0.0002890.0033260.0011380.002030−0.0031790.005526
R1-extEntropy (bits per byte)7.9985907.9985987.9983717.9985777.9985827.9983587.9984017.9984577.9986367.998595
Chi-square statistic244.420243.204280.629246.136244.629284.418277.278267.788235.991243.245
Arithmetic mean (ideal: 127.5)127.2646127.8210127.8679127.2059127.5383127.8565127.8331127.9599127.7023127.3961
Monte Carlo π estimate3.144063.125633.137023.152133.130113.123463.133063.130503.146243.14650
Serial correlation coefficient0.002862−0.000997−0.001591−0.0010280.0022110.004837−0.0019100.0000660.0041420.001290
R2Entropy (bits per byte)7.9985087.9987207.9984717.9986297.9986787.9985707.9985337.9981717.9984347.998508
Chi-square statistic257.548221.982264.466237.760229.502247.664254.283317.313270.696258.367
Arithmetic mean (ideal: 127.5)127.4776127.4215127.7040127.7753127.9032127.5479127.6526127.4350127.3099127.7128
Monte Carlo π estimate3.141763.142663.153413.134593.134853.145863.129603.143043.135873.13600
Serial correlation coefficient0.000318−0.0038430.001363−0.0024660.0048510.002446−0.001540−0.000417−0.004635−0.000639
R3Entropy (bits per byte)7.9986087.9985927.9986237.9985507.9985907.9986177.9987147.9983757.9983057.998483
Chi-square statistic241.025243.761239.222250.929244.240239.820222.429281.698293.556263.016
Arithmetic mean (ideal: 127.5)127.2902127.4808127.4596127.7191127.6245127.7010127.3118127.3744127.4543127.5737
Monte Carlo π estimate3.142403.132033.144453.126143.144453.141893.149703.155203.124353.13459
Serial correlation coefficient−0.0028130.002570−0.0013460.003443−0.0059730.002933−0.0004710.000145−0.001226−0.002661

Appendix F

Table A7. DNA-specific metrics for scenario R1, R1-ext, R2 and R3 (10 independent 500k-base DNA streams).
Table A7. DNA-specific metrics for scenario R1, R1-ext, R2 and R3 (10 independent 500k-base DNA streams).
Regime MetricRun1Run2Run3Run4Run5Run6Run7Run8Run9Run10
R1GC ratio0.50000.49940.49990.49950.49990.49990.49990.49960.50000.4997
Homopolymer max5555555555
Normalized LZ complexity0.96520.96590.96320.96840.97350.96760.96950.95530.97470.9611
3-mer p-value ( χ 2 )0.00.00.00.00.00.00.00.00.00.0
RC-symmetry p ((k = 1))0.99960.63350.99640.60370.98710.98870.98570.83950.99660.8526
RC-symmetry p ((k = 2))3.91 × 10−823.83 × 10−745.19 × 10−161.40 × 10−1221.07 × 10−1181.26 × 10−351.20 × 10−31.28 × 10−1411.31 × 10−854.54 × 10−35
RC-symmetry p ((k = 3))2.48 × 10−1659.21 × 10−2273.96 × 10−331.39 × 10−2957.15 × 10−2454.18 × 10−1001.80 × 10−170.01.21 × 10−2136.01 × 10−114
(H(1))2.00002.00002.00002.00002.00002.00002.00002.00002.00002.0000
(H(2))3.98513.98603.98553.98923.98733.98453.98743.98143.98763.9842
(H(3))5.96435.96675.96315.97385.97215.96415.97015.95135.97325.9599
(H(4))7.93617.94167.93167.95297.95437.93797.94737.90887.95637.9267
(H(5))9.89979.90989.89099.92549.93219.90499.91819.85479.93589.8841
(H(6))11.849211.864311.835311.883911.900711.859511.877511.782411.906711.8265
Bit p(1)0.50030.50000.50000.50070.50000.50000.50080.49970.49940.5004
zlib ratio0.14990.14990.14970.14970.14980.14980.15000.14990.14990.1498
R1-extGC ratio0.49950.49960.49950.49890.49950.49930.49890.49960.49910.4994
Homopolymer max5555555555
Normalized LZ complexity0.97440.97350.97230.96810.97600.97330.97000.97520.97060.9751
3-mer p-value ( χ 2 )0.00.00.00.00.00.00.00.00.00.0
RC-symmetry p ((k = 1))0.54450.69210.56860.07780.65040.29600.06760.59030.14110.3629
RC-symmetry p ((k = 2))1.77 × 10−321.89 × 10−845.60 × 10−522.56 × 10−1022.35 × 10−482.54 × 10−84.81 × 10−551.73 × 10−811.61 × 10−1041.60 × 10−3
RC-symmetry p ((k = 3))5.60 × 10−864.04 × 10−2548.60 × 10−1282.20 × 10−2901.66 × 10−1573.59 × 10−685.24 × 10−2141.27 × 10−1883.23 × 10−2814.29 × 10−50
(H(1))2.00002.00002.00002.00002.00002.00002.00002.00002.00002.0000
(H(2))3.98693.98633.98363.98383.98993.98623.98663.98583.98793.9876
(H(3))5.97285.97105.96585.96575.97875.97135.97135.97105.97405.9745
(H(4))7.95707.95347.94607.94527.96587.95477.95387.95517.95797.9602
(H(5))9.93879.93269.92319.92039.95059.93529.93269.93719.93809.9435
(H(6))11.911711.902811.891211.882811.926811.906411.899211.911411.907011.9178
Bit p(1)0.50010.50050.50110.49990.50040.50060.50070.50020.50070.5001
zlib ratio0.14990.14990.14980.14980.14990.14980.14990.14980.14970.1499
R2GC ratio0.50010.50000.50000.49990.50000.50000.49990.50000.50000.5000
Homopolymer max5555555555
Normalized LZ complexity0.98550.98570.98650.98580.98700.98620.98630.98680.98660.9865
3-mer p-value ( χ 2 )8.20 × 10−1001.65 × 10−295.23 × 10−191.60 × 10−72.33 × 10−283.66 × 10−1165.67 × 10−321.83 × 10−372.14 × 10−661.46 × 10−48
RC-symmetry p ((k = 1))0.98311.00000.99800.99161.00000.99470.98721.00000.99990.9972
RC-symmetry p ((k = 2))8.19 × 10−120.01380.00182.28 × 10−41.06 × 10−103.20 × 10−190.40879.90 × 10−51.19 × 10−251.30 × 10−6
RC-symmetry p ((k = 3))5.19 × 10−200.00856.90 × 10−41.73 × 10−61.24 × 10−166.93 × 10−330.14671.62 × 10−63.23 × 10−451.92 × 10−9
(H(1))2.00002.00002.00002.00002.00002.00002.00002.00002.00002.0000
(H(2))3.99953.99983.99993.99993.99983.99953.99983.99983.99973.9997
(H(3))5.99905.99965.99975.99985.99965.99895.99965.99955.99935.9994
(H(4))7.99847.99917.99937.99947.99917.99817.99917.99917.99877.9989
(H(5))9.99689.99779.99799.99819.99779.99649.99779.99769.99729.9974
(H(6))11.990711.991811.992011.992111.991711.990111.991911.991911.991511.9913
Bit p(1)0.49990.50000.50110.49950.50050.50100.50030.50010.50040.5006
zlib ratio0.14990.14980.14990.14990.14990.14980.14980.14980.14980.1498
R3GC ratio0.50000.50000.50000.50000.50000.50000.50000.50000.50000.5000
Homopolymer max5555555555
Normalized LZ complexity0.98590.98670.98710.98660.98650.98610.98640.98640.98570.9865
3-mer p-value ( χ 2 )1.37 × 10−93.96 × 10−182.29 × 10−132.71 × 10−155.53 × 10−161.70 × 10−158.41 × 10−156.38 × 10−255.48 × 10−141.20 × 10−23
RC-symmetry p ((k = 1))1.00001.00001.00001.00001.00001.00001.00001.00001.00001.0000
RC-symmetry p ((k = 2))0.98560.88600.99940.99860.80750.99980.99980.99990.99940.9586
RC-symmetry p ((k = 3))0.99970.98120.92560.99260.95420.98570.44140.65290.96160.5748
(H(1))2.00002.00002.00002.00002.00002.00002.00002.00002.00002.0000
(H(2))3.99993.99993.99993.99993.99993.99993.99993.99993.99993.9999
(H(3))5.99985.99975.99975.99975.99975.99975.99975.99965.99975.9996
(H(4))7.99947.99927.99947.99937.99937.99937.99937.99927.99947.9992
(H(5))9.99819.99799.99809.99799.99819.99799.99809.99779.99809.9979
(H(6))11.992511.992311.992411.992211.992411.992111.992411.992011.992511.9925
Bit p(1)0.50000.50040.50010.50030.49930.50010.49970.49940.49990.5003
zlib ratio0.14980.14990.14990.14980.14980.14990.14980.14980.14990.1498

Appendix G

Table A8. Summary of normalized rule entropy and dominant-rule ratio for the eight DNA-to-bit coding rules under the R1, R1-ext, R2, and R3 settings.
Table A8. Summary of normalized rule entropy and dominant-rule ratio for the eight DNA-to-bit coding rules under the R1, R1-ext, R2, and R3 settings.
RegimeNormalized Rule Entropy, Mean ± SDMean Dominant-Rule RatioInterpretation
R10.9999965 ± 0.00000150.1257Rule selection did not collapse to a single rule
R1-ext0.9999961 ± 0.00000110.1258Rule usage remained balanced under the independent genomic source
R20.9999960 ± 0.00000160.1258Rule usage remained balanced under the synthetic-data setting
R30.9999977 ± 0.00000110.1256Balanced rule usage was maintained without training
Note: Values were computed from the usage counts of the eight DNA-to-bit coding rules recorded across 10 independent runs for each setting. A normalized rule entropy close to 1 indicates balanced rule usage. The dominant-rule ratio denotes the proportion of the most frequently selected rule in each run. Run-level rule traces and raw outputs are provided in the GitHub repository for reproducibility.

Appendix H

Table A9. Run-level results for the R3 component-sensitivity and failure-oriented stress control.
Table A9. Run-level results for the R3 component-sensitivity and failure-oriented stress control.
VariantSeedGC
Ratio
DNA Entropy (bits/base)Max HomopolymerBit p(1)Monobit p-ValueNormalized Rule EntropyDominant Rule Ratio
fixed-rule86879708210427398810.4998681.99921950.4914905.84 × 10−650.00000001.000000
fixed-rule27178609159767519780.4986121.99904350.4897725.31 × 10−930.00000001.000000
fixed-rule41686633153036701740.4966481.99915250.4901023.22 × 10−870.00000001.000000
no-homopolymer-mask86879708210427398810.4937841.998620200.5000570.90920.99999640.125958
no-homopolymer-mask27178609159767519780.4929661.998405160.4999720.95530.99999930.125396
no-homopolymer-mask41686633153036701740.4919181.998283180.4997140.56730.99999880.125538
no-lag1-suppression86879708210427398810.4984241.99921650.5000210.96600.99999630.125972
no-lag1-suppression27178609159767519780.4974581.99905350.5000250.96010.99999940.125350
no-lag1-suppression41686633153036701740.4967181.99904750.4999110.85870.99999870.125520
no-constraint86879708210427398810.4907981.992620190.5002690.59060.99999790.125418
no-constraint27178609159767519780.4885001.992336230.5006110.22170.99999720.125792
no-constraint41686633153036701740.4887961.992115200.4998050.69680.99999890.125310
Table A10. Summary statistics for the R3 stress variants.
Table A10. Summary statistics for the R3 stress variants.
VariantGC Ratio, Mean ± SDDNA Entropy, Mean ± SDMax Homopolymer, Mean ± SDBit p(1), Mean ± SDMonobit p-Value, Mean ± SDNormalized Rule Entropy, Mean ± SDDominant Rule Ratio, Mean ± SD
fixed-rule0.498376 ± 0.0016231.999138 ± 0.0000895.00 ± 0.000.490455 ± 0.0009121.95 × 10−65 ± 3.37 × 10−650.0000000 ± 0.00000001.000000 ± 0.000000
no-homopolymer-mask0.492889 ± 0.0009351.998436 ± 0.00017118.00 ± 2.000.499914 ± 0.0001790.8106 ± 0.21200.9999982 ± 0.00000160.125631 ± 0.000292
no-lag1-suppression0.497533 ± 0.0008551.999105 ± 0.0000965.00 ± 0.000.499986 ± 0.0000650.9283 ± 0.06050.9999981 ± 0.00000160.125614 ± 0.000321
no-constraint0.489365 ± 0.0012501.992357 ± 0.00025420.67 ± 2.080.500228 ± 0.0004050.5030 ± 0.24930.9999980 ± 0.00000090.125507 ± 0.000253

References

  1. Wills, A.G.; Schön, T.B. Sequential Monte Carlo: A unified review. Annu. Rev. Control Robot. Auton. Syst. 2023, 6, 159–182. [Google Scholar] [CrossRef]
  2. Pan, K.; Ong, Y.S.; Gong, M.; Li, H.; Qin, A.K.; Gao, Y. Differential privacy in deep learning: A literature survey. Neurocomputing 2024, 589, 127663. [Google Scholar] [CrossRef]
  3. Welzel, M.; Schwarz, P.M.; Löchel, H.F.; Kabdullayeva, T.; Clemens, S.; Becker, A.; Freisleben, B.; Heider, D. DNA-Aeon provides flexible arithmetic coding for constraint adherence and error correction in DNA storage. Nat. Commun. 2023, 14, 628. [Google Scholar] [CrossRef] [PubMed]
  4. Dou, C.; Yang, Y.; Zhu, F.; Li, B.; Duan, Y. Explorer: Efficient DNA coding by De Bruijn graph toward arbitrary local and global biochemical constraints. Brief. Bioinform. 2024, 25, bbae363. [Google Scholar] [CrossRef] [PubMed]
  5. Zhang, X.; Qi, B.; Niu, Y. A dual-rule encoding DNA storage system using chaotic mapping to control GC content. Bioinformatics 2024, 40, btae113. [Google Scholar] [CrossRef] [PubMed]
  6. Gimpel, A.L.; Stark, W.J.; Heckel, R.; Grass, R.N. A digital twin for DNA data storage based on comprehensive quantification of errors and biases. Nat. Commun. 2023, 14, 6026. [Google Scholar] [CrossRef] [PubMed]
  7. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.; Polosukhin, I. Attention is all you need. In Advances in Neural Information Processing Systems; Curran Associates, Inc.: Red Hook, NY, USA, 2017; Volume 30. [Google Scholar]
  8. Li, R.; Zeng, L. Transformers in pseudo-random number generation: A dual perspective on theory and practice. arXiv 2025, arXiv:2508.01134. [Google Scholar] [CrossRef]
  9. Han, K.; Xiao, A.; Wu, E.; Guo, J.; Xu, C.; Wang, Y. Transformer in transformer. In Advances in Neural Information Processing Systems; Curran Associates, Inc.: Red Hook, NY, USA, 2021; Volume 34, pp. 15908–15919. [Google Scholar] [CrossRef]
  10. Jiang, J.; Ke, L.; Chen, L.; Dou, B.; Zhu, Y.; Liu, J.; Zhang, B.; Zhou, T.; Wei, G.-W. Transformer technology in molecular science. WIREs Comput. Mol. Sci. 2024, 14, e1725. [Google Scholar] [CrossRef] [PubMed]
  11. Tao, T.; Doshi, D.; Kalra, D.S.; He, T.; Barkeshli, M. (How) can transformers predict pseudo-random numbers? arXiv 2025, arXiv:2502.10390. [Google Scholar] [CrossRef]
  12. Afify, Y.M.; Sharkawy, N.H.; Gad, W.; Khalil, B. A new dynamic DNA-coding model for gray-scale image encryption. Complex Intell. Syst. 2024, 10, 745–761. [Google Scholar] [CrossRef]
  13. Fan, W.; Li, T.; Wu, J.; Wu, J. Chaotic color image encryption based on eight-base DNA-level permutation and diffusion. Entropy 2023, 25, 1268. [Google Scholar] [CrossRef] [PubMed]
  14. National Center for Biotechnology Information. Escherichia Coli Str. K-12 Substr. MG1655, Complete Genome; GenBank Accession No. U00096.3. NCBI Nucleotide. Available online: https://www.ncbi.nlm.nih.gov/nuccore/U00096.3 (accessed on 10 January 2026).
  15. Cock, P.J.; Antao, T.; Chang, J.T.; Chapman, B.A.; Cox, C.J.; Dalke, A.; Friedberg, I.; Hamelryck, T.; Kauff, F.; Wilczynski, B.; et al. Biopython: Freely available Python tools for computational molecular biology and bioinformatics. Bioinformatics 2009, 25, 1422–1423. [Google Scholar] [CrossRef] [PubMed]
  16. National Institute of Standards and Technology. Random Bit Generation: Documentation and Software. Available online: https://csrc.nist.gov/projects/random-bit-generation/documentation-and-software (accessed on 8 June 2026).
  17. Bassham, L.E.; Rukhin, A.L.; Soto, J.; Nechvatal, J.R.; Smid, M.E.; Leigh, S.D.; Levenson, M.; Vangel, M.; Banks, D.L.; Heckert, N.A.; et al. A Statistical Test Suite for Random and Pseudorandom Number Generators for Cryptographic Applications; NIST Special Publication 800-22 Rev. 1a; National Institute of Standards and Technology: Gaithersburg, MD, USA, 2010. [Google Scholar] [CrossRef]
  18. Sönmez Turan, M.; Barker, E.; Kelsey, J.; McKay, K.; Baish, M.; Boyle, M. Recommendation for the Entropy Sources Used for Random Bit Generation; NIST Special Publication 800-90B; National Institute of Standards and Technology: Gaithersburg, MD, USA, 2018. [Google Scholar] [CrossRef] [PubMed]
  19. Buller, D.; Kaufer, A.; Roginsky, A.; Sönmez Turan, M. Discussion on the Full Entropy Assumption of the SP 800-90 Series; National Institute of Standards and Technology: Gaithersburg, MD, USA, 2023. [Google Scholar]
  20. Hernandez-Castro, J.; Barrero, D.F. Evolutionary generation and degeneration of randomness to assess the independence of the ENT test battery. In Proceedings of the 2017 IEEE Congress on Evolutionary Computation (CEC), Donostia-San Sebastián, Spain, 5–8 June 2017; pp. 1420–1427. [Google Scholar] [CrossRef]
  21. Susanti, B.H.; Jimmy, J.; Ardyani, M.W. ENT randomness test on DM-PRESENT-80 and DM-PRESENT-128-based pseudorandom number generator. In Proceedings of the 2021 4th International Seminar on Research of Information Technology and Intelligent Systems (ISRITI), Yogyakarta, Indonesia, 16–17 December 2021; pp. 324–328. [Google Scholar] [CrossRef]
  22. Jeong, Y.S.; Oh, K.J.; Cho, C.K.; Choi, H.J. Pseudo-random number generation using LSTMs. J. Supercomput. 2020, 76, 8324–8342. [Google Scholar] [CrossRef]
  23. Wu, X.; Han, Y.; Zhang, M.; Zhu, S.; Cui, S.; Wang, Y.; Peng, Y. Pseudorandom number generators based on neural networks: A review. J. King Saud. Univ. Comput. Inf. Sci. 2025, 37, 18. [Google Scholar] [CrossRef]
  24. Wu, X.; Han, Y.; Zhu, S.; Li, Y.; Cui, S.; Wang, X. Learned pseudo-random number generator based on generative adversarial networks. In Frontiers in Cyber Security: FCS 2023; Yang, H., Lu, R., Eds.; Springer Nature: Singapore, 2023; pp. 517–530. [Google Scholar] [CrossRef]
  25. Pasqualini, L.; Parton, M. Pseudo random number generation through reinforcement learning and recurrent neural networks. Algorithms 2020, 13, 307. [Google Scholar] [CrossRef]
  26. Wu, X.; Han, Y.; Zhang, M.; Li, Y.; Cui, S. GAN-based pseudo random number generation optimized through genetic algorithms. Complex Intell. Syst. 2025, 11, 31. [Google Scholar] [CrossRef]
  27. De Bernardi, M.; Khouzani, M.H.R.; Malacaria, P. Pseudo-random number generation using generative adversarial networks. In ECML PKDD 2018 Workshops; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2019; Volume 11329. [Google Scholar] [CrossRef]
  28. Okada, K.; Endo, K.; Yasuoka, K.; Kurabayashi, S. Learned pseudo-random number generator: WGAN-GP for generating statistically robust random numbers. PLoS ONE 2023, 18, e0287025. [Google Scholar] [CrossRef] [PubMed]
  29. Park, S.; Kim, K.; Kim, K.; Nam, C. Dynamical pseudo-random number generator using reinforcement learning. Appl. Sci. 2022, 12, 3377. [Google Scholar] [CrossRef]
  30. Almardeny, Y.; Benavoli, A.; Boujnah, N.; Naredo, E. A reinforcement learning system for generating instantaneous quality random sequences. IEEE Trans. Artif. Intell. 2023, 4, 402–415. [Google Scholar] [CrossRef]
  31. Iqbal, N.; Khan, M.; Khurshid, K.; Hussain, I. An efficient hybrid encryption model based on deep convolutional neural networks, deoxyribonucleic acid computing and chaotic system. Multimed. Tools Appl. 2023, 82, 13881–13903. [Google Scholar] [CrossRef]
  32. Kapoor, S.; Narayanan, A. Leakage and the reproducibility crisis in machine-learning-based science. Patterns 2023, 4, 100804. [Google Scholar] [CrossRef] [PubMed]
  33. de Vries, A. The growing energy footprint of artificial intelligence. Joule 2023, 7, 2191–2194. [Google Scholar] [CrossRef]
  34. Mukherjee, P.; Garg, H.; Pradhan, C.; Ghosh, S.; Chowdhury, S.; Srivastava, G. Best fit DNA-based cryptographic keys: The genetic algorithm approach. Sensors 2022, 22, 7332. [Google Scholar] [CrossRef] [PubMed]
  35. Kalsi, S.; Kaur, H.; Chang, V. DNA cryptography and deep learning using genetic algorithm with NW algorithm for key generation. J. Med. Syst. 2018, 42, 17. [Google Scholar] [CrossRef]
  36. Basu, S.; Karuppiah, M.; Nasipuri, M.; Halder, A.K.; Radhakrishnan, N. Bio-inspired cryptosystem with DNA cryptography and neural networks. J. Syst. Archit. 2019, 94, 24–31. [Google Scholar] [CrossRef]
  37. Reddy, M.I.; Kumar, A.S.; Reddy, K.S. A secured cryptographic system based on DNA and a hybrid key generation approach. Biosystems 2020, 197, 104207. [Google Scholar] [CrossRef] [PubMed]
  38. Sakr, A.S.; Shams, M.Y.; Mahmoud, A.; Zidan, M. Amino acid encryption method using genetic algorithm for key generation. Comput. Mater. Contin. 2022, 70, 123–134. [Google Scholar] [CrossRef]
  39. National Center for Biotechnology Information. Bacillus Subtilis Subsp. Subtilis Str. 168, Complete Genome; RefSeq Accession No. NC_000964.3. NCBI Nucleotide. Available online: https://www.ncbi.nlm.nih.gov/nuccore/NC_000964.3 (accessed on 2 June 2026).
Figure 1. Overall workflow of the proposed DNA-local PRNG framework. The figure summarizes the data-supported and reference-free regimes, the RoPE-based dual-head decoder-only. Transformer core, constraint-aware DNA sampling, and the joint generation of DNA keystream and bitstream outputs. Arrows indicate the processing flow between modules.
Figure 1. Overall workflow of the proposed DNA-local PRNG framework. The figure summarizes the data-supported and reference-free regimes, the RoPE-based dual-head decoder-only. Transformer core, constraint-aware DNA sampling, and the joint generation of DNA keystream and bitstream outputs. Arrows indicate the processing flow between modules.
Entropy 28 00694 g001
Figure 2. Dual-head decoder-only Transformer core.
Figure 2. Dual-head decoder-only Transformer core.
Entropy 28 00694 g002
Table 1. Comparison of representative PRNG and DNA-coding approaches.
Table 1. Comparison of representative PRNG and DNA-coding approaches.
Ref.Method ClassOutput
Space
DNA-Local
Generation
In-
Generation
Constraints
Dynamic
Rule Selection
Referencefree
Generation Setting
Integrated Validation
[8]Transformer-based PRNGBitNoNoNot applicableNoNo
[11]Transformer-based PRNGBitNoNoNot applicableNoNo
[22]LSTM-based PRNGBitNoNoNot applicableNoNo
[24]GAN-based PRNGBitNoNoNot applicableNoNo
[28]WGAN-GP-based PRNGBitNoNoNot applicableNoNo
[25]RL-based PRNGBitNoNoNot applicableNoNo
[30]RL-based PRNGBitNoNoNot applicableNoNo
[5]DNA coding-based approachBit → DNANoPartialPartialNoNo
[12]Dynamic DNA codingBit → DNANoPartialYesNoNo
[31]Hybrid CNN + chaos + DNABit → DNANoPartialVariableNoPartial
This workDual-head Transformer-based PRNGDNA and corresponding bitstreamYesYesYesYesYes
Table 2. Architectural comparison between the original Transformer and the proposed DNA-PRNG core.
Table 2. Architectural comparison between the original Transformer and the proposed DNA-PRNG core.
ComponentOriginal Transformer [7]Proposed DNA-PRNG Core
ObjectiveSequence-to-sequence modeling/machine translationDNA-local PRNG and dynamic DNA-to-bit rule selection
ArchitectureEncoder–decoder structure with cross-attentionDecoder-only, 3 blocks, no cross-attention
Positional codingFixed sinusoidal codingRoPE on query and key vectors; sliding window and KV cache
Capacity d m o d e l   = 512, 6 blocks d m o d e l   = 128, 3 blocks
Number of attention heads8/164
Output headsSingle token headDual head: base head (4), rule head (8)
DNA-specific constraintsNot explicitly definedApplied during generation: GC balance, homopolymer limit, lag-1 damping
SamplingTask-dependentConstraint-aware softmax, generation-time masks, and rule-guided selection
Context handlingTask-dependentKV cache and sliding window (W = 128)
ReproducibilityNot explicitly targetedSeed-controlled and traceable execution
Table 3. Eight equivalent DNA-to-bit coding rules.
Table 3. Eight equivalent DNA-to-bit coding rules.
BaseRule-1Rule-2Rule-3Rule-4Rule-5Rule-6Rule-7Rule-8
A0011001101100110
C0101101000001111
G1010010111110000
T1100110010011001
Table 4. Descriptive summary of NIST SP 800-22 test results for 10 independent 1 Mbit bitstreams under the R1, R1-ext, R2, and R3 settings.
Table 4. Descriptive summary of NIST SP 800-22 test results for 10 independent 1 Mbit bitstreams under the R1, R1-ext, R2, and R3 settings.
RegimeTestMean ± SD%95 CIMin–MaxPass Count
R1T1 Monobit0.587668 ± 0.348857[0.338111, 0.837225]0.114107–0.98085310/10
T2 Block Frequency *0.560295 ± 0.332859[0.322182, 0.798408]0.089008–0.97652210/10
T3 Runs0.646181 ± 0.298660[0.432532, 0.859830]0.224240–0.98219610/10
T4 Longest Run0.562453 ± 0.344726[0.315851, 0.809055]0.060961–0.99796310/10
T5 Rank0.500286 ± 0.241495[0.327531, 0.673041]0.152231–0.89856010/10
T6 DFT0.430075 ± 0.277980[0.231220, 0.628929]0.056296–0.83283910/10
T7 Non-overlapping Template *0.482907 ± 0.290107[0.275377, 0.690436]0.095713–0.99049010/10
T8 Overlapping Template0.603092 ± 0.283364[0.400385, 0.805798]0.094000–0.92546210/10
T9 Universal0.435935 ± 0.294194[0.225481, 0.646389]0.047189–0.92403110/10
T10 Linear Complexity0.458431 ± 0.273526[0.262762, 0.654099]0.120095–0.95835710/10
T11 Serial *0.465805 ± 0.292134[0.256826, 0.674785]0.032145–0.90701510/10
T12 Approximate Entropy0.630826 ± 0.287497[0.425163, 0.836489]0.015260–0.95094210/10
T13 Cumulative Sums (Backward)0.558479 ± 0.310912[0.336065, 0.780892]0.134201–0.96408810/10
T14 Random Excursions * 0.509390 ± 0.277053[0.311199, 0.707582]0.087099–0.94060510/10
T15 Random Excursions Variant *0.672413 ± 0.259892[0.486498, 0.858328]0.073160–0.96753010/10
R1-extT1 Monobit0.475082 ± 0.339689[0.232083, 0.718081]0.023451–0.91875710/10
T2 Block Frequency *0.460501 ± 0.164257[0.342999, 0.578003]0.273553–0.79315310/10
T3 Runs0.453489 ± 0.375930[0.184565, 0.722413]0.018546–0.96489010/10
T4 Longest Run0.704891 ± 0.264733[0.515512, 0.894269]0.112640–0.99051110/10
T5 Rank0.640300 ± 0.323552[0.408845, 0.871756]0.122663–0.98860910/10
T6 DFT0.543136 ± 0.345497[0.295982, 0.790289]0.011924–0.94878210/10
T7 Non-overlapping Template *0.507921 ± 0.305625[0.289290, 0.726552]0.081419–0.98761010/10
T8 Overlapping Template0.559410 ± 0.222796[0.400032, 0.718789]0.254728–0.90480310/10
T9 Universal0.472334 ± 0.337312[0.231036, 0.713633]0.064627–0.97672910/10
T10 Linear Complexity0.584641 ± 0.334033[0.345688, 0.823593]0.054720–0.97537710/10
T11 Serial *0.471920 ± 0.338848[0.229522, 0.714317]0.010475–0.95175510/10
T12 Approximate Entropy0.697044 ± 0.243492[0.522861, 0.871228]0.271060–0.98567510/10
T13 Cumulative Sums (Backward)0.423561 ± 0.324081[0.191727, 0.655394]0.029456–0.91303410/10
T14 Random Excursions * 0.386287 ± 0.363216[0.126458, 0.646116]0.012732–0.93465110/10
T15 Random Excursions Variant *0.430059 ± 0.268530[0.237964, 0.622153]0.071589–0.92976310/10
R2T1 Monobit0.459768 ± 0.339386[0.216986, 0.702550]0.022608–0.99840410/10
T2 Block Frequency *0.739236 ± 0.196982[0.598323, 0.880149]0.328885–0.96122210/10
T3 Runs0.538416 ± 0.267094[0.347348, 0.729484]0.145936–0.98409110/10
T4 Longest Run0.453163 ± 0.323608[0.221668, 0.684659]0.027110–0.96630610/10
T5 Rank0.546251 ± 0.279573[0.346257, 0.746245]0.135480–0.97116310/10
T6 DFT0.419401 ± 0.380305[0.147348, 0.691455]0.013919–0.94878210/10
T7 Non-overlapping Template *0.568380 ± 0.213353[0.415757, 0.721004]0.299097–0.94441110/10
T8 Overlapping Template0.462864 ± 0.376351[0.193639, 0.732089]0.017992–0.98575310/10
T9 Universal0.371665 ± 0.246323[0.195456, 0.547874]0.040213–0.92340910/10
T10 Linear Complexity0.437758 ± 0.242766[0.264094, 0.611423]0.160839–0.89615110/10
T11 Serial *0.491332 ± 0.354187[0.237962, 0.744702]0.059399–0.96718310/10
T12 Approximate Entropy0.370544 ± 0.224451[0.209981, 0.531106]0.112163–0.89237210/10
T13 Cumulative Sums (Backward)0.538987 ± 0.330027[0.302900, 0.775074]0.023874–0.98784410/10
T14 Random Excursions * 0.562245 ± 0.301074[0.346870, 0.777621]0.077111–0.93719410/10
T15 Random Excursions Variant *0.421920 ± 0.346657[0.173937, 0.669903]0.106827–0.99122710/10
R3T1 Monobit0.599651 ± 0.266945[0.408690, 0.790612]0.191553–0.92669810/10
T2 Block Frequency *0.598511 ± 0.311566[0.375631, 0.821392]0.111155–0.99025310/10
T3 Runs0.689466 ± 0.320417[0.460253, 0.918678]0.068821–0.99497810/10
T4 Longest Run0.442675 ± 0.306665[0.223300, 0.662050]0.034811–0.87118310/10
T5 Rank0.622377 ± 0.294478[0.411720, 0.833034]0.202430–0.91939110/10
T6 DFT0.622720 ± 0.241634[0.449865, 0.795574]0.215403–0.97803710/10
T7 Non-overlapping Template *0.612771 ± 0.315853[0.386824, 0.838719]0.010210–0.99092310/10
T8 Overlapping Template0.463382 ± 0.339111[0.220796, 0.705967]0.026088–0.99901010/10
T9 Universal0.554283 ± 0.301900[0.338317, 0.770250]0.058300–0.91835210/10
T10 Linear Complexity0.566379 ± 0.263632[0.377788, 0.754971]0.017217–0.96670510/10
T11 Serial *0.544197 ± 0.185944[0.411180, 0.677213]0.337268–0.87652910/10
T12 Approximate Entropy0.633706 ± 0.247900[0.456369, 0.811043]0.121313–0.97233410/10
T13 Cumulative Sums (Backward)0.602027 ± 0.293621[0.391983, 0.812070]0.213052–0.98647810/10
T14 Random Excursions * 0.546712 ± 0.321945[0.316406, 0.777018]0.037276–0.93920710/10
T15 Random Excursions Variant *0.590771 ± 0.314462[0.365818, 0.815723]0.084301–0.93604210/10
* For tests with multiple parameter-dependent or multiple p-value outputs, the reported value corresponds to the predefined compact-summary rule: M = 1000 for Block Frequency, template 000000001 for Non-overlapping Template, the second p-value for Serial, the backward direction for Cumulative Sums, the +4 state for Random Excursions, and the +9 state for Random Excursions Variant.
Table 5. SP 800-90B-inspired min-entropy, IID-related, and health-test summaries for 10 independent 1 Mbit bitstreams under the R1, R1-ext, R2, and R3 settings.
Table 5. SP 800-90B-inspired min-entropy, IID-related, and health-test summaries for 10 independent 1 Mbit bitstreams under the R1, R1-ext, R2, and R3 settings.
RegimeTest GroupMetricMean ± SD95% CI
R1Entropy tests p ( 1 ) 0.5001 ± 0.0004[0.4998, 0.5004]
H M C V (bit/bit)0.9991 ± 0.0008[0.9985, 0.9997]
H m i n (t-tuple, bit/bit)0.9964 ± 0.0004[0.9961, 0.9967]
H M a r k o v ( 1 ) (bit/bit)0.9987 ± 0.0007[0.9982, 0.9991]
H C o l l i s i o n   H 2 (bit/bit)0.9999989 ± 0.0000014[0.9999979, 0.9999999]
H C o m p r e s s i o n   L B (zlib, bit/bit)1.0000000 ± 0.0000000[1.0000000, 1.0000000]
IID and health tests Monobit   p 0.5877 ± 0.3489[0.3381, 0.8372]
Runs   p 0.6462 ± 0.2987[0.4325, 0.8598]
I ( X t ; X t 1 ) [bits](3.0 ± 4.8) × 10−7[−4.6 × 10−8, 6.5 × 10−7]
RCT max run20.7000 ± 2.4967[18.9140, 22.4860]
APT   worst-window   p (8.07 ± 7.57) × 10−4[2.65 × 10−4, 1.35 × 10−3]
R1-extEntropy tests p ( 1 ) 0.5004 ± 0.0004[0.5002, 0.5007]
H M C V (bit/bit)0.9987 ± 0.0010[0.9980, 0.9995]
H m i n (t-tuple, bit/bit)0.9955 ± 0.0010[0.9948, 0.9962]
H M a r k o v ( 1 ) (bit/bit)0.9980 ± 0.0009[0.9974, 0.9987]
H C o l l i s i o n   H 2 (bit/bit)0.9999983 ± 0.0000022[0.9999968, 0.9999998]
H C o m p r e s s i o n   L B (zlib, bit/bit)1.0000000 ± 0.0000000[1.0000000, 1.0000000]
IID and health tests Monobit   p 0.4751 ± 0.3397[0.2321, 0.7181]
Runs   p 0.4535 ± 0.3759[0.1846, 0.7224]
I ( X t ; X t 1 ) [bits](1.0 ± 1.2) × 10−6[1.1 × 10−7, 1.9 × 10−6]
RCT max run19.7 ± 1.7[18.5, 20.9]
APT   worst-window   p (4.80 ± 6.82) × 10−4[−8.25 × 10−6, 9.67 × 10−4]
R2Entropy tests p ( 1 ) 0.5003 ± 0.0005[0.5000, 0.5007]
H M C V (bit/bit)0.9987 ± 0.0011[0.9979, 0.9994]
H m i n (t-tuple, bit/bit)0.9958 ± 0.0009[0.9951, 0.9964]
H M a r k o v ( 1 ) (bit/bit)0.9983 ± 0.0008[0.9977, 0.9989]
H C o l l i s i o n   H 2 (bit/bit)0.9999982 ± 0.0000026[0.9999964, 1.0000000]
H C o m p r e s s i o n   L B (zlib, bit/bit)1.0000000 ± 0.0000000[1.0000000, 1.0000000]
IID and health tests Monobit   p 0.4598 ± 0.3394[0.2170, 0.7026]
Runs   p 0.5384 ± 0.2671[0.3473, 0.7295]
I ( X t ; X t 1 ) [bits](4.0 ± 7.0) × 10−7[−1.0 × 10−7, 9.0 × 10−7]
RCT max run20.4000 ± 1.3499[19.4343, 21.3657]
APT   worst-window   p (6.23 ± 6.20) × 10−4[1.80 × 10−4, 1.07 × 10−3]
R3Entropy tests p ( 1 ) 0.5000 ± 0.0004[0.4997, 0.5002]
H M C V (bit/bit)0.9992 ± 0.0006[0.9987, 0.9996]
H m i n (t-tuple, bit/bit)0.9957 ± 0.0010[0.9949, 0.9964]
H M a r k o v ( 1 ) (bit/bit)0.9988 ± 0.0008[0.9983, 0.9994]
H C o l l i s i o n H 2 (bit/bit)0.9999993 ± 0.0000008[0.9999987, 0.9999999]
H C o m p r e s s i o n L B (zlib, bit/bit)1.0000000 ± 0.0000000[1.0000000, 1.0000000]
IID and health tests Monobit   p 0.5997 ± 0.2669[0.4087, 0.7906]
Runs   p 0.6895 ± 0.3204[0.4603, 0.9187]
I ( X t ; X t 1 ) [bits](3.0 ± 6.7) × 10−7[−1.8 × 10−7, 7.8 × 10−7]
RCT max run20.5000 ± 2.7588[18.5265, 22.4735]
APT   worst - window   p (5.44 ± 4.91 × 10−4[1.93 × 10−4, 8.95 × 10−4]
Note: Values are reported as the mean ± sample SD and Student-t-based 95% CI calculated over 10 independent bitstreams for each setting. Symmetric CI calculations may produce lower bounds outside the natural range for metrics that are theoretically non-negative or bounded; such limits should be interpreted within the physical range of the corresponding metric. APT worst-window p-values are reported as descriptive indicators, and all RCT and APT checks remained within the predefined acceptance ranges. This analysis is inspired by SP 800-90B and should not be interpreted as a formal SP 800-90B entropy certification, a complete IID validation, or a formal proof of cryptographic security.
Table 6. Descriptive summary of ENT results for 10 independent 1 Mbit bitstreams under the R1, R1-ext, R2, and R3 settings.
Table 6. Descriptive summary of ENT results for 10 independent 1 Mbit bitstreams under the R1, R1-ext, R2, and R3 settings.
RegimeMetricIdealMean ± SD95% CI
R1Entropy (bits per byte)≈8.0000007.998543 ± 0.000131[7.998449, 7.998637]
Chi-square statistic≈255.000252.366 ± 22.251[236.448, 268.283]
Arithmetic mean≈127.5000127.5602 ± 0.2119[127.4086, 127.7118]
Monte Carlo π estimate≈3.141593.14291 ± 0.00861[3.13675, 3.14908]
Serial correlation coefficient≈0.0000000.001504 ± 0.002438[−0.000239, 0.003248]
R1-extEntropy (bits per byte)≈8.0000007.998517 ± 0.000107[7.998440, 7.998593]
Chi-square statistic≈255.000256.774 ± 18.521[243.524, 270.023]
Arithmetic mean≈127.5000127.6446 ± 0.2737[127.4488, 127.8403]
Monte Carlo π estimate≈3.141593.13687 ± 0.00984[3.12983, 3.14391]
Serial correlation coefficient≈0.0000000.000988 ± 0.002444[−0.000760, 0.002737]
R2Entropy (bits per byte)≈8.0000007.998522 ± 0.000153[7.998413, 7.998632]
Chi-square statistic≈255.000255.958 ± 26.498[237.002, 274.914]
Arithmetic mean≈127.5000127.5940 ± 0.1855[127.4613, 127.7266]
Monte Carlo π estimate≈3.141593.13976 ± 0.00691[3.13482, 3.14471]
Serial correlation coefficient≈0.000000−0.000456 ± 0.002881[−0.002517, 0.001604]
R3Entropy (bits per byte)≈8.0000007.998546 ± 0.000124[7.998457, 7.998634]
Chi-square statistic≈255.000251.970 ± 21.515[236.579, 267.360]
Arithmetic mean≈127.5000127.4989 ± 0.1523[127.3900, 127.6079]
Monte Carlo π estimate≈3.141593.13952 ± 0.01001[3.13236, 3.14668]
Serial correlation coefficient≈0.000000−0.000540 ± 0.002951[−0.002651, 0.001571]
Note: Values are reported as the mean ± sample SD and Student-t-based 95% CI calculated over 10 independent 1 Mbit bitstreams for each setting. Ideal or expected values are provided only for comparison. The chi-square statistic, arithmetic mean, Monte Carlo π estimate, and serial correlation coefficient are interpreted as descriptive indicators. No formal pass or fail decision was made based on these measures. ENT results alone do not constitute a formal proof of randomness or cryptographic security.
Table 7. Descriptive summary of DNA-specific structural metrics for 10 independent 500,000-base DNA streams under the R1, R1-ext, R2, and R3 settings.
Table 7. Descriptive summary of DNA-specific structural metrics for 10 independent 500,000-base DNA streams under the R1, R1-ext, R2, and R3 settings.
RegimeMetricIdealMean ± SD95% CI
R1GC ratio0.500.4998 ± 0.0002[0.4996, 0.4999]
Homopolymer max≤55.0 ± 0.0[5.0, 5.0]
Normalized LZ complexity≈1.000.9664 ± 0.0057[0.9623, 0.9706]
3 -mer   p -value   ( χ 2 )U(0,1)0.0 ± 0.0[0.0, 0.0]
RC-symmetry p (k = 1)U(0,1)0.8883 ± 0.1544[0.7779, 0.9988]
RC-symmetry p (k = 2)U(0,1)1.20 × 10−4 ± 3.79 × 10−4[−1.51 × 10−4, 3.91 × 10−4]
RC-symmetry p (k = 3)U(0,1)1.80 × 10−18 ± 5.69 × 10−18[−2.27 × 10−18, 5.87 × 10−18]
H(1)22.0000 ± (8.43 × 10−7)[1.9999988, 2.0000000]
H(2)43.9858 ± 0.0022[3.9842, 3.9874]
H(3)65.9659 ± 0.0070[5.9609, 5.9709]
H(4)87.9394 ± 0.0146[7.9289, 7.9498]
H(5)109.9056 ± 0.0247[9.8879, 9.9232]
H(6)1211.8586 ± 0.0374[11.8318, 11.8853]
Bit p(1)0.500.5001 ± 0.0004[0.4998, 0.5004]
zlib ratio≈0.150.1498 ± 0.0001[0.1498, 0.1499]
R1-extGC ratio0.500.4993 ± 0.0003[0.4991, 0.4995]
Homopolymer max≤55.0 ± 0.0[5.0, 5.0]
Normalized LZ complexity≈1.000.9728 ± 0.0026[0.9710, 0.9747]
3 -mer   p -value   ( χ 2 )U(0,1)0.0 ± 0.0[0.0, 0.0]
RC-symmetry p (k = 1)U(0,1)0.3991 ± 0.2420[0.2260, 0.5722]
RC-symmetry p (k = 2)U(0,1)1.60 × 10−4 ± 5.05 × 10−4[−2.01 × 10−4, 5.21 × 10−4]
RC-symmetry p (k = 3)U(0,1)4.29 × 10−51 ± 1.36 × 10−50[−5.42 × 10−51, 1.40 × 10−50]
H(1)22.0000 ± (3.75 × 10−6)[1.9999924, 1.9999978]
H(2)43.9865 ± 0.0019[3.9851, 3.9878]
H(3)65.9716 ± 0.0039[5.9688, 5.9744]
H(4)87.9549 ± 0.0061[7.9505, 7.9593]
H(5)109.9352 ± 0.0089[9.9288, 9.9415]
H(6)1211.9057 ± 0.0127[11.8966, 11.9148]
Bit p(1)0.500.5004 ± 0.0004[0.5002, 0.5007]
zlib ratio≈0.150.1498 ± 0.0001[0.1498, 0.1499]
R2GC ratio0.500.5000 ± 0.0001[0.4999, 0.5000]
Homopolymer max≤55.0 ± 0.0[5.0, 5.0]
Normalized LZ complexity≈1.000.9863 ± 0.0005[0.9860, 0.9866]
3 -mer   p -value   ( χ 2 )U(0,1)1.60 × 10−8 ± 5.06 × 10−8[−2.02 × 10−8, 5.22 × 10−8]
RC-symmetry p (k = 1)U(0,1)0.9952 ± 0.0060[0.9909, 0.9995]
RC-symmetry p (k = 2)U(0,1)0.0425 ± 0.1288[−0.0496, 0.1346]
RC-symmetry p (k = 3)U(0,1)0.0156 ± 0.0461[−0.0174, 0.0486]
H(1)22.0000 ± 0.0000[2.0000, 2.0000]
H(2)43.9997 ± 0.0001[3.9996, 3.9998]
H(3)65.9995 ± 0.0003[5.9993, 5.9996]
H(4)87.9989 ± 0.0004[7.9986, 7.9992]
H(5)109.9974 ± 0.0005[9.9971, 9.9978]
H(6)1211.9915 ± 0.0006[11.9911, 11.9920]
Bit p(1)0.500.5003 ± 0.0005[0.5000, 0.5007]
zlib ratio≈0.150.1498 ± 0.0000[0.1498, 0.1499]
R3GC ratio0.500.5000 ± 0.0000[0.5000, 0.5000]
Homopolymer max≤55.0 ± 0.0[5.0, 5.0]
Normalized LZ complexity≈1.000.9864 ± 0.0004[0.9861, 0.9867]
3 -mer   p -value   ( χ 2 )U(0,1)1.37 × 10−10 ± 4.32 × 10−10[−1.72 × 10−10, 4.46 × 10−10]
RC-symmetry p (k = 1)U(0,1)0.9999976 ± 0.0000028[0.9999956, 0.9999996]
RC-symmetry p (k = 2)U(0,1)0.9635 ± 0.0655[0.9166, 1.0103]
RC-symmetry p (k = 3)U(0,1)0.8470 ± 0.2079[0.6983, 0.9957]
H(1)22.0000 ± 0.0000[2.0000, 2.0000]
H(2)43.9999 ± 0.0000[3.9999, 3.9999]
H(3)65.9997 ± 0.0000[5.9997, 5.9997]
H(4)87.9993 ± 0.0001[7.9992, 7.9994]
H(5)109.9980 ± 0.0001[9.9979, 9.9981]
H(6)1211.9923 ± 0.0002[11.9922, 11.9925]
Bit p(1)0.500.5000 ± 0.0004[0.4997, 0.5002]
zlib ratio≈0.150.1498 ± 0.0000[0.1498, 0.1499]
Note: Values are reported as the mean ± sample SD and Student-t-based 95% CI calculated over 10 independent 500,000-base DNA streams for each setting. Stream-level tables in Appendix F are rounded for display, whereas the summary statistics in the main text were calculated from full-precision outputs. p-values are interpreted as descriptive structural indicators and were not used as standalone pass/fail decisions or as evidence of cryptographic security. Symmetric CI calculations may produce values outside the natural range for metrics that are theoretically non-negative or bounded within [0, 1]; such limits should be interpreted within the physical range of the corresponding metric.
Table 8. Summary of exact-match k-mer leakage control for R1, R1-ext, R2, and R3.
Table 8. Summary of exact-match k-mer leakage control for R1, R1-ext, R2, and R3.
RegimeReference CorpusGenerated Streamsk = 32 hitsk = 48 hitsk = 64 hitsResult
R11 M bases10 × 500 k bases000No leakage detected
R1-ext1 M bases10 × 500 k bases000No leakage detected
R21 M bases10 × 500 k bases000No leakage detected
R3Not applicable
Note: The exact-match k-mer leakage control was performed for k = 32, 48, and 64 using the corresponding 1 M-base reference/training DNA corpus in each of the R1, R1-ext, and R2 settings. The R3 setting was not included because it does not use an external training or reference corpus. The absence of exact-match hits provides evidence against direct long-fragment copying under the tested criteria. However, it should not be interpreted as formal proof that all possible forms of memorization are absent.
Table 9. Bit-domain Hamming and DNA-domain mismatch-based multi-stream independence results calculated over 45 stream pairs under the R1, R1-ext, R2, and R3 settings.
Table 9. Bit-domain Hamming and DNA-domain mismatch-based multi-stream independence results calculated over 45 stream pairs under the R1, R1-ext, R2, and R3 settings.
MetricR1R1-extR2R3
Bit
Domain-
pooled
Hamming
( H 0 :   p   =   0.5 )
Stream pairs45454545
Total n45,000,00045,000,00045,000,00045,000,000
Pooled Hamming p ^ 0.5000350.4999870.5000780.500054
95% CI[0.499888, 0.500181][0.499841, 0.500133][0.499932, 0.500225][0.499908, 0.500200]
p vs. 0.50.6430.8640.2920.471
DNA
Domain-
pooled
mismatch
( H 0 :   p   =   0.5 )
Stream pairs45454545
Total n22,500,00022,500,00022,500,00022,500,000
Pooled mismatch p ^ 0.7321840.7408470.7499150.750116
95% CI[0.732001, 0.732367][0.740666, 0.741028][0.749736, 0.750094][0.749937, 0.750295]
p vs. 0.75<1 × 10−300<1 × 10−3000.3500.204
Table 10. Summary of component sensitivity and failure-oriented stress control under the R3 setting.
Table 10. Summary of component sensitivity and failure-oriented stress control under the R3 setting.
VariantModified ComponentGC Ratio, Mean ± SDMax. Homopolymer, Mean ± SDBit p(1), Mean ± SDNormalized Rule Entropy, Mean ± SDMain Observation
fixed-ruleDynamic DNA-to-bit rule selection was disabled; a single fixed rule was used0.4984 ± 0.00165.0 ± 0.00.4905 ± 0.00090.0000 ± 0.0000DNA constraints were preserved; however, bit balance was clearly disrupted and Monobit p-values remained very low
no-
homopolymer-mask
Homopolymer mask was removed0.4929 ± 0.000918.0 ± 2.00.4999 ± 0.00020.999998 ± 0.000002Bit balance was preserved; however, long homopolymer runs emerged
no-lag1-suppressionLag-1 suppression was disabled0.4975 ± 0.00095.0 ± 0.00.5000 ± 0.00010.999998 ± 0.000002No clear degradation was observed in the main GC, homopolymer, or bit-balance metrics
no-constraintGC balancing, homopolymer mask, and lag-1 suppression were jointly disabled0.4894 ± 0.001320.7 ± 2.10.5002 ± 0.00040.999998 ± 0.000001Bit balance was largely preserved, but DNA-level structural compatibility was clearly degraded
Table 11. Descriptive summary of empirical performance results for 10 independent streams under CPU-only execution conditions in the R1, R1-ext, R2, and R3 settings.
Table 11. Descriptive summary of empirical performance results for 10 independent streams under CPU-only execution conditions in the R1, R1-ext, R2, and R3 settings.
RegimeMetricTime (min)CPU Time (min)ΔRAM (MB)Efficiency (Bases/min)
R1Mean ± SD28.0719 ± 0.7400167.8401 ± 4.342216.2880 ± 3.669017,822.5898 ± 472.5666
95% CI[27.5426, 28.6013][164.7339, 170.9463][13.6634, 18.9126][17,484.5360, 18,160.6436]
R1-extMean ± SD31.3657 ± 0.8979186.2929 ± 5.099123.4950 ± 7.496415,952.7817 ± 458.9759
95% CI[30.7234, 32.0081][182.6452, 189.9406][18.1324, 28.8576][15,624.4501, 16,281.1132]
R2Mean ± SD30.1492 ± 0.2463180.3740 ± 1.459416.9590 ± 3.992416,585.1999 ± 135.0661
95% CI[29.9730, 30.3254][179.3300, 181.4180][14.1030, 19.8150][16,488.5794, 16,681.8204]
R3Mean ± SD26.3361 ± 0.8217157.1564 ± 4.700031.7300 ± 0.967819001.6482 ± 581.2117
95% CI[25.7483, 26.9239][153.7943, 160.5186][31.0376, 32.4224][18,585.8744, 19,417.4220]
Note: Values are reported as the mean ± sample SD and Student-t-based 95% CI calculated over 10 independent runs for each regime. Time denotes total wall-clock execution time, CPU time denotes cumulative CPU time, and memory denotes the additional memory increase measured relative to the initial state. For R1, R1-ext, and R2, time and resource usage include both training and generation stages. For R3, only generation is measured.
Table 12. Comparative summary of selected machine-learning-based PRNG studies.
Table 12. Comparative summary of selected machine-learning-based PRNG studies.
Feature/Ref.This Work[8][22][25][26][30]
ModelDual-head decoder-only TransformerDecoder-only TransformerLSTMDRL + LSTMGAGANUDRL
Output
domain
DNA + bitstreamn-bitBit sequencesBit sequences256-bit output128-bit blocks
NIST SP 800-22
[16,17]
Yes; 15 tests, 4 settings, 10 × 1 MbitPartial; 11/15 testsYesYesYesYes
SP 800-90B/[18]
ENT [20,21]
Yes; both reportedNot reportedNot reportedNot reportedPartial; GM/T-like standard reported, SP 800-90B/ENT not reportedPartial; entropy-based evaluation reported, SP 800-90B/ENT not reported
DNA-
specific
metrics
GC ratio, homopolymer limit, 3-mer behavior, RC symmetry, block entropy, Lempel–Ziv-based complexityNot reportedNot reportedNot reportedNot reportedNot reported
Multi-stream/leakage controlYes; Hamming, mismatch, k-mer leakagePartial; prediction attack analysisNot reportedNot reportedPartial; Hamming/sensitivity analysisPartial; PNB/leakage analysis reported
Performance analysisYes; time, CPU, memory, efficiency, theoretical complexityPartial; training accuracy and loss curvesPartial; computational complexity reportedPartial; training/reward curvesYes; inference time and throughput reportedPartial; test and analysis reports
Main
distinction
DNA-local generation, in-generation constraint control, dynamic DNA-to-bit mapping, multilayer validationNo DNA-local validationNo DNA-specific analysisNo SP 800-90B, ENT, DNA-specific metrics, or leakage analysisNo multi-stream independence, DNA-specific validation, or regime-disentangled evaluationNo DNA-local generation, DNA-specific metrics, or in-generation constraint management
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Kaya, A.; Türkoğlu, İ. A DNA-Local, Constraint-Aware Dual-Head Transformer for Pseudorandom Stream Generation. Entropy 2026, 28, 694. https://doi.org/10.3390/e28060694

AMA Style

Kaya A, Türkoğlu İ. A DNA-Local, Constraint-Aware Dual-Head Transformer for Pseudorandom Stream Generation. Entropy. 2026; 28(6):694. https://doi.org/10.3390/e28060694

Chicago/Turabian Style

Kaya, Alev, and İbrahim Türkoğlu. 2026. "A DNA-Local, Constraint-Aware Dual-Head Transformer for Pseudorandom Stream Generation" Entropy 28, no. 6: 694. https://doi.org/10.3390/e28060694

APA Style

Kaya, A., & Türkoğlu, İ. (2026). A DNA-Local, Constraint-Aware Dual-Head Transformer for Pseudorandom Stream Generation. Entropy, 28(6), 694. https://doi.org/10.3390/e28060694

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop