| \documentclass[runningheads]{waica} |
|
|
| \usepackage[T1]{fontenc} |
| \usepackage{graphicx} |
| \usepackage{booktabs} |
| \usepackage{multirow} |
| \usepackage{amsmath} |
| \usepackage{url} |
| \usepackage{xcolor} |
|
|
| \newcommand{\methodname}{EvoDiff-Enhancer} |
|
|
| \begin{document} |
|
|
| \title{Mask-Ratio Controlled Diffusion for Evolutionary Enhancer Sequence Generation} |
|
|
| \titlerunning{Mask-Ratio Controlled Diffusion for Enhancer Generation} |
|
|
| |
| |
| |
| |
| |
|
|
| \maketitle |
|
|
| \begin{abstract} |
| Enhancer design requires generating DNA sequences that are syntactically valid, functionally active, diverse, and close to natural regulatory sequence distributions. |
| Autoregressive genomic language models provide a direct way to sample DNA, but their left-to-right generation process can drift into low-complexity repetitive continuations that score well under an activity predictor while departing from enhancer-like sequence statistics. |
| Motivated by biological evolution, where regulatory sequences are often altered by partial mutation rather than complete rewriting, we study a masked discrete diffusion formulation for enhancer generation. |
| In this framework, the mask ratio acts as an explicit mutation budget: low ratios correspond to local editing, while high ratios approach de novo generation. |
| Using the DeepSTARR enhancer activity benchmark, we compare unconditional autoregressive generation, bucket-conditioned autoregressive generation, and bucket-conditioned masked diffusion under a unified predictor-guided evaluation protocol. |
| On the validation split, all evaluated methods produce valid DNA. |
| However, autoregressive baselines exhibit strong sequence artifacts, including GC content near 0.255 and mean maximum homopolymer length above 79, despite obtaining higher predictor scores. |
| In contrast, conditioned masked diffusion preserves reference-like GC content, homopolymer length, and $k$-mer distributions, with GC content 0.423, mean maximum homopolymer length 5.66, and 4-mer Jensen--Shannon divergence 0.0006 to reference sequences. |
| The diffusion predictor score is stable across three sampling seeds with mean $-3.871$ and standard deviation 0.018. |
| These results suggest that masked diffusion is a more conservative and distribution-preserving generator for enhancer design, while predictor-only optimization can favor biologically implausible artifacts. |
|
|
| \keywords{Enhancer design \and Regulatory DNA generation \and Discrete diffusion \and Genomic foundation models \and Controllable generation} |
| \end{abstract} |
|
|
| \section{Introduction} |
|
|
| Enhancers are non-coding regulatory elements that influence gene expression across cell types, tissues, and developmental states. |
| The ability to design enhancer sequences with desired regulatory activity is important for synthetic biology, functional genomics, and gene therapy. |
| Deep learning models such as DeepSTARR have shown that enhancer activity can be predicted directly from DNA sequence and that such predictors can guide the search for synthetic regulatory elements~\cite{dealmeida2022deepstarr}. |
| At the same time, genomic foundation models make it possible to generate candidate DNA sequences at scale. |
| The central question is not only whether a model can emit valid DNA, but whether it can generate DNA that is active, diverse, and biologically plausible. |
|
|
| Autoregressive language models are a natural baseline for sequence generation. |
| They generate DNA by repeatedly sampling the next token from a prefix. |
| This formulation is convenient, but enhancer design is not inherently a left-to-right continuation task. |
| Enhancer function depends on motif content, spacing, sequence composition, and global regulatory grammar. |
| Moreover, biological evolution rarely rewrites regulatory DNA from scratch; it typically explores sequence space through mutation, selection, and accumulation. |
| This motivates a generative model that can explicitly control how much of a sequence is changed. |
|
|
| We therefore formulate enhancer generation as mask-ratio controlled sequence mutation. |
| A masked discrete diffusion model corrupts a DNA sequence by masking a subset of bases and learns to recover the original bases. |
| At generation time, the fraction of masked positions can be interpreted as a mutation budget. |
| Small mask ratios preserve most of the input sequence and perform local edits. |
| Large mask ratios enable broader exploration. |
| A fully masked sequence recovers the de novo generation setting. |
|
|
| In this paper, we present \methodname{}, a masked diffusion framework for controllable enhancer generation. |
| We use low, middle, and high activity bucket tokens to condition generation and evaluate the generated sequences with a separately trained DeepSTARR activity predictor. |
| We compare diffusion against unconditional and bucket-conditioned autoregressive baselines. |
| Our results show a clear trade-off: autoregressive baselines obtain higher predictor scores but suffer from severe low-complexity sequence artifacts, whereas diffusion better preserves enhancer-like sequence statistics. |
|
|
| \begin{figure} |
| \centering |
| \includegraphics[width=\textwidth]{figures/fig_pipeline_overview.png} |
| \caption{Overview of the enhancer generation and evaluation pipeline. DeepSTARR sequences are bucketed by activity, a predictor is trained as an evaluation oracle, autoregressive baselines are compared with mask-ratio controlled diffusion, and generated sequences are evaluated for predicted activity, controllability, sequence quality, distributional fidelity, and diffusion pseudo-likelihood.} |
| \label{fig:pipeline} |
| \end{figure} |
|
|
| Our contributions are: |
| \begin{itemize} |
| \item We formulate enhancer generation as mask-ratio controlled mutation, connecting local editing and de novo generation in one framework. |
| \item We implement bucket-conditioned masked discrete diffusion on DeepSTARR enhancer sequences. |
| \item We compare diffusion with unconditional and conditioned autoregressive genomic language model baselines. |
| \item We show that predictor score alone can be misleading: autoregressive baselines obtain higher predicted activity but produce low-GC repetitive artifacts, while diffusion better preserves reference-like sequence statistics. |
| \end{itemize} |
|
|
| \section{Related Work} |
|
|
| \paragraph{Enhancer activity prediction.} |
| DeepSTARR predicts enhancer activity from DNA sequence and enables in silico design of synthetic enhancers~\cite{dealmeida2022deepstarr}. |
| Such predictors are useful oracles for ranking generated sequences, but predictor-guided evaluation can overestimate biological quality if a generator exploits predictor artifacts. |
| Our evaluation therefore combines predicted activity with sequence composition and distributional metrics. |
|
|
| \paragraph{Generative regulatory DNA design.} |
| Prior work has explored generative models for regulatory DNA, including deep generative design of expression-controlling sequences~\cite{zrimec2022expressiongan}, cell-type-directed synthetic enhancer design~\cite{taskiran2024celltypedirected}, and machine-guided cis-regulatory element design~\cite{gosai2024coda}. |
| These studies highlight that regulatory DNA should be evaluated by function, diversity, specificity, and grammar. |
| We follow this multi-objective view and emphasize that high predictor score is insufficient when sequence artifacts are present. |
|
|
| \paragraph{Controllable genomic language models.} |
| Autoregressive language models and reinforcement learning have recently been applied to controllable DNA sequence design~\cite{su2025atgcgen,yang2025rldna}. |
| These methods provide flexible sampling interfaces, but left-to-right generation can create repetitive continuations and reward-hacking behavior. |
| We use autoregressive models as baselines and compare them with masked diffusion. |
|
|
| \paragraph{Discrete diffusion for biological sequences.} |
| Discrete diffusion has been used for regulatory DNA design with tunable activity~\cite{sarkar2024d3}, reward-optimized biological sequence generation~\cite{wang2024drakes}, and synthetic regulatory element design~\cite{dasilva2026dnadiffusion}. |
| Our work is aligned with this direction but emphasizes the interpretation of the mask ratio as a mutation budget for enhancer design. |
|
|
| \section{Methods} |
|
|
| \subsection{Problem Formulation} |
|
|
| Let $x=(x_1,\ldots,x_L)$ denote an enhancer sequence of length $L$, where $x_i \in \{A,C,G,T\}$. |
| Each DeepSTARR sequence has two activity labels $y=(y_0,y_1)$. |
| We define a scalar score for bucket construction: |
| \begin{equation} |
| s(y) = y_0 + y_1. |
| \end{equation} |
| Using the training split, we assign sequences to low, middle, and high activity buckets by the 25th and 75th percentiles of $s(y)$. |
| The corresponding condition tokens are $\langle sp0\rangle$, $\langle sp1\rangle$, and $\langle sp2\rangle$. |
|
|
| The goal is to learn a generator $p_\theta(x \mid c)$, where $c$ is an activity bucket. |
| For mutation-like generation, the generator may also receive a reference sequence and a mask ratio $\rho$ that determines the fraction of bases to regenerate. |
| This paper reports completed validation and test results for de novo diffusion generation, a denoising-step ablation, seed repeats, and two preliminary mask-range ablations. |
| The full mask-ratio sweep is left for future work. |
|
|
| \subsection{Activity Predictor} |
|
|
| We train a sequence-to-activity predictor $f_\phi(x)$ using a genomic foundation model with a regression head. |
| The predictor outputs two activity dimensions: |
| \begin{equation} |
| f_\phi(x) = (\hat{y}_0,\hat{y}_1). |
| \end{equation} |
| It is used only for evaluation and candidate scoring. |
| On the DeepSTARR test split, the predictor obtains overall Pearson correlation 0.652, $R^2=0.417$, MAE 0.590, and MSE 0.605. |
| Label 1 is predicted more accurately than label 0, with Pearson correlations 0.727 and 0.581, respectively. |
|
|
| \subsection{Autoregressive Baselines} |
|
|
| We consider two autoregressive baselines. |
| The unconditional baseline is fine-tuned on enhancer sequences and generates continuations from DNA prefixes. |
| The conditioned baseline prepends an activity bucket token to each training sequence and learns $p_\theta(x_t \mid c,x_{<t})$. |
| At evaluation time, each model receives a prefix and generates the remaining bases. |
| These baselines test whether standard left-to-right generation and simple activity-token prompting are sufficient for enhancer generation. |
|
|
| \subsection{Masked Discrete Diffusion} |
|
|
| The diffusion model is trained with a masked language modeling objective. |
| For each training sequence, we sample a diffusion step $t \in \{1,\ldots,T\}$ and convert it to a masking probability: |
| \begin{equation} |
| p_{mask}(t) = p_{min} + (p_{max}-p_{min})\frac{t}{T}. |
| \end{equation} |
| Only DNA base positions are maskable; condition tokens and special tokens are not prediction targets. |
| Given a corrupted sequence $\tilde{x}$ and mask set $M$, the model minimizes: |
| \begin{equation} |
| \mathcal{L}(\theta) = -\sum_{i \in M}\log p_\theta(x_i \mid \tilde{x},c). |
| \end{equation} |
| At sampling time, the model starts from masked positions and iteratively fills bases from the restricted vocabulary $\{A,C,G,T\}$. |
| In the de novo setting, all bases are initially masked. |
| In the mutation-like setting, only a subset of positions is masked and regenerated. |
|
|
| \subsection{Evaluation Metrics} |
|
|
| We evaluate generated sequences along four axes. |
| First, functional activity is measured by the predictor scores $\hat{y}_0$, $\hat{y}_1$, and $\hat{y}_0+\hat{y}_1$. |
| Second, controllability is measured by comparing predicted activity across low, mid, and high condition buckets. |
| Third, sequence quality is measured by valid DNA rate, unique rate, GC content, maximum homopolymer length, nearest-reference Hamming distance, and pairwise Hamming distance. |
| Fourth, distributional fidelity is measured by 3-mer and 4-mer Jensen--Shannon divergence to reference sequences. |
| For diffusion, we also compute a pseudo-log-likelihood score by masking base positions and averaging the log probability of the true base. |
|
|
| \section{Experiments} |
|
|
| \subsection{Dataset and Implementation} |
|
|
| We use the DeepSTARR enhancer activity dataset with train, validation, and test splits. |
| The downloaded splits contain 402,296 training sequences, 40,570 validation sequences, and 41,186 test sequences. |
| Sequences are approximately 249 bp in the original dataset. |
| Generation experiments use 246 bp generated sequences to match the model input and evaluation setting. |
|
|
| The autoregressive baselines are fine-tuned from a GENERator eukaryotic genomic foundation model. |
| The diffusion model is fine-tuned from a GENERanno masked language model. |
| The predictor is trained from the same genomic foundation model family with a regression head. |
| Unless otherwise stated, reported generator comparisons are on the validation split. |
| We additionally evaluate the conditioned diffusion model on the test split and repeat validation sampling under three random seeds. |
|
|
| \begin{table} |
| \caption{Dataset split sizes.} |
| \label{tab:dataset} |
| \centering |
| \begin{tabular}{lrr} |
| \toprule |
| Split & Sequences & Approx. sequence length \\ |
| \midrule |
| Train & 402,296 & 249 bp \\ |
| Validation & 40,570 & 249 bp \\ |
| Test & 41,186 & 249 bp \\ |
| \bottomrule |
| \end{tabular} |
| \end{table} |
|
|
| \subsection{Predictor Reliability} |
|
|
| Because the predictor is the functional oracle for generated sequences, its held-out performance must be established before interpreting generation results. |
| The predictor achieves moderate accuracy on the test set. |
| The two DeepSTARR activity dimensions are not equally easy to predict: label 1 has higher Pearson correlation and $R^2$ than label 0. |
| This motivates using the predictor for relative in silico comparison while also reporting sequence-distribution metrics. |
|
|
| \begin{figure} |
| \centering |
| \includegraphics[width=\textwidth]{figures/predictor_metrics.png} |
| \caption{Predictor validation on the DeepSTARR test split. The predictor provides useful but imperfect activity estimates, so generation quality is evaluated with both predictor scores and sequence-distribution metrics.} |
| \label{fig:predictor} |
| \end{figure} |
|
|
| \begin{table} |
| \caption{Activity predictor performance on the test split.} |
| \label{tab:predictor} |
| \centering |
| \begin{tabular}{lrrr} |
| \toprule |
| Metric & Label 0 & Label 1 & Overall \\ |
| \midrule |
| Pearson & 0.581 & 0.727 & 0.652 \\ |
| $R^2$ & 0.337 & 0.494 & 0.417 \\ |
| MAE & 0.627 & 0.554 & 0.590 \\ |
| MSE & 0.671 & 0.539 & 0.605 \\ |
| \bottomrule |
| \end{tabular} |
| \end{table} |
|
|
| \subsection{Autoregressive Baselines Produce Predictor-Active but Low-Complexity Sequences} |
|
|
| Both autoregressive baselines generate valid DNA. |
| The unconditional AR model has valid DNA rate 1.000 and generation-summary unique rate 0.479. |
| The conditioned AR model also has valid DNA rate 1.000 and generation-summary unique rate 0.466. |
| Their mean base-prediction accuracies against matched reference continuations are 0.300 and 0.297, respectively. |
|
|
| However, these models exhibit strong low-complexity artifacts. |
| In the unified sequence metrics, AR unconditional and AR conditioned have GC contents 0.255 and 0.255, far below the reference GC content of 0.417. |
| Their mean maximum homopolymer lengths are 81.35 and 79.05, compared with 5.77 for reference sequences. |
| Their 4-mer JS divergences are 0.1593 and 0.1600, much larger than diffusion and random GC-matched controls. |
| This indicates that the AR models often generate repetitive low-GC continuations. |
|
|
| \begin{figure} |
| \centering |
| \includegraphics[width=\textwidth]{figures/fig_generator_quality_summary.png} |
| \caption{Generator quality summary. Autoregressive baselines obtain valid DNA but deviate strongly from reference sequence statistics, especially in GC content and maximum homopolymer length.} |
| \label{fig:quality} |
| \end{figure} |
|
|
| \subsection{Predictor Scores Alone Are Misleading} |
|
|
| Autoregressive samples obtain better mean predictor scores than diffusion. |
| The mean predictor score $\hat{y}_0+\hat{y}_1$ is $-3.582$ for AR unconditional, $-3.546$ for AR conditioned, and $-3.845$ for conditioned diffusion. |
| At first glance, this suggests that AR generation is more active. |
| However, the same AR samples contain severe sequence artifacts, suggesting a predictor-artifact trade-off. |
|
|
| Matched-reference scoring also reveals that scalar activity can hide label-level trade-offs. |
| For AR conditioned generation, the mean scalar prediction improves by $+0.292$ relative to matched references. |
| This improvement is driven by label 0, which increases by $+0.479$ on average, while label 1 decreases by $-0.188$. |
| Thus, optimizing or selecting by $y_0+y_1$ can obscure deterioration in one activity dimension. |
|
|
| \begin{figure} |
| \centering |
| \includegraphics[width=\textwidth]{figures/fig_predicted_activity_by_method.png} |
| \caption{Predicted activity by method. AR baselines obtain higher mean predictor scores, but these gains must be interpreted together with their sequence artifacts. Diffusion preserves sequence statistics more faithfully but has lower average predicted activity.} |
| \label{fig:activity} |
| \end{figure} |
|
|
| \subsection{Conditioned Diffusion Preserves Enhancer-Like Distribution} |
|
|
| Conditioned diffusion generates valid and unique DNA while preserving reference-like composition. |
| Its mean GC content is 0.423, close to the reference value 0.417. |
| Its mean maximum homopolymer length is 5.66, close to the reference value 5.77. |
| Its 3-mer and 4-mer JS divergences to reference are 0.00026 and 0.00058, respectively. |
| These values are much smaller than the AR baselines and even smaller than the GC-matched random baseline for $k$-mer divergence. |
|
|
| The diffusion model also shows partial activity controllability. |
| In the generated diffusion samples, the high bucket has mean predictor score $-3.627$, while the low and mid buckets have mean scores $-3.998$ and $-4.000$. |
| This indicates that the high condition shifts generated sequences upward in predicted activity. |
| However, the separation is weaker than in reference sequences, where the high bucket has mean score $-2.909$. |
| Thus, current conditioning provides activity bias but not yet precise target matching. |
| The same diffusion model shows nearly identical average predictor score on the test split, with generated mean score $-3.875$ compared with matched reference score $-3.831$. |
| On the test split, the high generated bucket remains higher than low and mid buckets ($-3.627$ vs. $-3.998$ and $-4.000$), while the matched reference high bucket reaches $-3.129$. |
|
|
| \begin{figure} |
| \centering |
| \includegraphics[width=\textwidth]{figures/fig_generation_gc_content.png} |
| \caption{GC content comparison. Diffusion closely matches the reference GC distribution, while autoregressive baselines collapse toward much lower GC content.} |
| \label{fig:gc} |
| \end{figure} |
|
|
| \subsection{Diffusion Step and Seed Analyses} |
|
|
| We further evaluate whether diffusion sampling quality depends on the number of denoising steps and random seed. |
| Increasing the number of denoising steps improves the mean predictor score from $-3.981$ at 16 steps to $-3.911$ at 32 steps and $-3.875$ at 64 steps. |
| This suggests that additional reverse steps help the model construct sequences with higher predicted activity, although the improvement from 32 to 64 steps is smaller than from 16 to 32 steps. |
|
|
| Across three random seeds, conditioned diffusion has mean predictor scores $-3.851$, $-3.886$, and $-3.877$. |
| The mean is $-3.871$ with standard deviation 0.018, indicating that the reported diffusion performance is stable under sampling randomness. |
| The completed mask-range ablations yield mean predictor scores of $-3.925$ for 0.15--0.30 and $-3.964$ for 0.30--0.50. |
| The lower mask range gives the stronger mean score in the completed runs, while both settings remain preliminary because they do not cover the full local-edit to de novo continuum. |
|
|
| \begin{figure} |
| \centering |
| \includegraphics[width=\textwidth]{figures/fig_diffusion_ablation_summary.png} |
| \caption{Diffusion ablation analyses. Increasing the number of denoising steps improves predicted activity up to 64 steps, seed repeats are stable, conditioning restores high-bucket control, and the preliminary mask-range experiment shows that the lower mask range preserves stronger high-bucket activity in the completed runs.} |
| \label{fig:diffusion-ablation} |
| \end{figure} |
|
|
| \subsection{Main Comparison} |
|
|
| Table~\ref{tab:generator-comparison} summarizes the generator comparison. |
| The key observation is a trade-off between predicted activity and biological plausibility. |
| AR generation scores higher under the predictor but produces low-GC repetitive sequences. |
| Diffusion scores slightly lower but preserves enhancer-like statistics much better. |
| For a biological design workflow, the latter behavior is important because low-complexity predictor artifacts are unlikely to be useful experimental candidates. |
|
|
| \begin{table} |
| \caption{Generator comparison on the validation split. Predictor score is $\hat{y}_0+\hat{y}_1$ when available. Lower 4-mer JS divergence indicates closer reference distribution.} |
| \label{tab:generator-comparison} |
| \centering |
| \begin{tabular}{lrrrrrr} |
| \toprule |
| Method & Valid & Unique & Activity & Homopolymer & 4-mer JS & NN dist \\ |
| \midrule |
| GC random & 1.000 & 1.000 & -- & 4.92 & 0.0140 & 157.92 \\ |
| AR uncond. & 1.000 & 1.000 & -3.582 & 81.35 & 0.1593 & 131.14 \\ |
| AR cond. & 1.000 & 1.000 & -3.546 & 79.05 & 0.1600 & 131.49 \\ |
| Diffusion cond. & 1.000 & 1.000 & -3.845 & 5.66 & 0.0006 & 148.05 \\ |
| Reference & 1.000 & 1.000 & -- & 5.77 & 0.0000 & 117.77 \\ |
| \bottomrule |
| \end{tabular} |
| \end{table} |
|
|
| \section{Discussion} |
|
|
| The current results support a cautious but useful conclusion. |
| Masked diffusion is not yet the strongest method in terms of raw predictor score. |
| Instead, its main advantage is distributional fidelity. |
| It generates sequences whose GC content, homopolymer statistics, and $k$-mer distributions are close to reference enhancers. |
| This contrasts with the autoregressive baselines, which achieve higher predictor scores but generate sequences with obvious repetitive artifacts. |
|
|
| This distinction matters for regulatory DNA design. |
| If generated sequences exploit a predictor by producing low-complexity patterns, high predicted activity may not translate into biological function. |
| A generator that stays closer to natural enhancer statistics may provide better candidates for downstream filtering, motif analysis, or experimental validation. |
| The results therefore argue for evaluating enhancer generators with both functional predictors and sequence-distribution metrics. |
|
|
| The mask-ratio interpretation remains the central conceptual motivation of the method. |
| In principle, the mask ratio gives a direct handle on mutation magnitude, enabling a continuum from local editing to de novo generation. |
| The present simple paper reports the completed de novo diffusion results, denoising-step ablation, seed repeats, and two preliminary mask-range ablations, but does not yet include the full mask-ratio sweep. |
| Completing that sweep is necessary before claiming robust control over mutation budget. |
|
|
| \paragraph{Limitations.} |
| First, all functional conclusions are based on an in silico predictor with moderate accuracy. |
| Second, although conditioned diffusion has been evaluated on the test split, the AR baselines and all ablations should also be fully repeated on the test split before making final benchmark claims. |
| Third, the full mask-ratio ablation and motif analysis are not included in this simple version. |
| Fourth, the bucket condition is based on $y_0+y_1$, which can hide trade-offs between the two activity dimensions. |
| Future work should include external predictors, motif enrichment analysis, wet-lab validation, and explicit multi-objective optimization of both activity dimensions. |
|
|
| \section{Conclusion} |
|
|
| We studied mask-ratio controlled diffusion for enhancer sequence generation and compared it with autoregressive genomic language model baselines. |
| The key empirical finding is that predictor score alone can be misleading: AR baselines obtain higher predicted activity but produce low-GC, long-homopolymer artifacts. |
| Conditioned masked diffusion produces slightly lower predictor scores but preserves reference-like sequence statistics much more faithfully. |
| These results position masked diffusion as a promising conservative generator for enhancer design, especially when biological plausibility and distributional fidelity are valued alongside predicted activity. |
|
|
| \begin{credits} |
| \subsubsection{\ackname} |
| Acknowledgments will be added in the final version. |
|
|
| \subsubsection{\discintname} |
| The authors have no competing interests to declare that are relevant to the content of this article. |
| \end{credits} |
|
|
| \bibliographystyle{waica} |
| \bibliography{references} |
|
|
| \end{document} |
|
|