Manuscript Offprint
arXiv:2610.41736Locality-Controlled Out-of-Distribution Guidance for Robust Regulatory DNA Sequence Design
Abstract
Designing regulatory DNA sequences for targeted gene-expression control is an important challenge. Recent approaches frame this task as property-conditioned generation, where diffusion models trained on natural sequences are guided toward high predicted activity through reward-based fine-tuning or sampling-time guidance. We show that single-reward evaluation can obscure reward-hacking behavior. By decomposing evaluation into property, novelty, and plausibility, we identify an empirically underexplored region of the evaluation space in which all three objectives are satisfied, but no existing baseline succeeds. We postulate that this gap arises because prior methods treat guidance primarily as a matter of magnitude. In regulatory DNA, however, sequence grammar is spatially nonuniform: motif positions are sensitive to perturbation, while background regions allow more exploration. We therefore propose LOCOGEN by reformulating guidance as a problem of locality. LOCOGEN learns an invariant motif mask through sequence-level invariance learning to protect motif positions, while applying OOD damping only to background positions. It operates at sampling time on a frozen diffusion backbone, without retraining the backbone. Across HepG2, K562, and SK-N-SH, LOCOGEN reaches this previously underexplored region of the property–novelty–plausibility space. Code is available at https://github.com/Lotfollahi-lab/LocoGen.
1 Introduction
Diffusion models are powerful generative models used in many domains, including images, language, molecules, and biological sequences. Beyond unconditional generation, recent work increasingly focuses on property-conditioned generation, such as generating regulatory DNA sequences that optimize a target property (e.g. gene expression). These advances make diffusion models useful for de novo regulatory DNA design, where candidate sequences can be generated and tested in a lab-in-the-loop setting.
We argue that the generated candidates must satisfy three axes simultaneously: (i) high target property, (ii) novelty, and (iii) plausibility —preservation of the natural grammar of regulatory DNA (e.g. motif usage diversity/density). No single axis suffices. High property without plausibility fails to reproduce in the wet lab; high novelty without plausibility drifts off the functional manifold; high property without novelty merely reproduces the training distribution. Only when all three axes are jointly satisfied is a candidate worth its wet-lab budget.
To date, DNA sequence generative models have largely treated candidate generation as a single-objective problem: maximizing the target property. However, when evaluation is decomposed into property, novelty, and plausibility, methods that appear strong under single-axis evaluation reveal trade-offs on the remaining axes (Fig. 1B). Moreover, their apparent property gains often arise not from targeted regulatory improvement, but from distortions of regulatory motif structure, exposing a common limitation of existing guidance methods ( ).
40th Conference on Neural Information Processing Systems (NeurIPS 2026).

Figure 1: LOCOGEN balances property, novelty, and plausibility.
Although these methods differ in their reward-hacking mechanisms, they all control optimization through a single scalar magnitude knob (e.g. guidance scale) without specifying where in the sequence the reward should act. This is problematic because regulatory DNA grammar is positional: motif sites are highly constrained, whereas intervening background regions are more permissive. Thus, in the property–novelty–plausibility design space, current baselines fall short of the desired regime: high activity on both readouts, high novelty, and low compositional deviation. We call this unoccupied region the empty corner, and ask whether guidance can shift the empirical trade-off landscape toward it.
We propose LOCOGEN, a locality-controlled guidance method for de novo regulatory DNA generation (Fig. 1A). Rather than increasing guidance globally, LOCOGEN controls where it acts. A masked separator model identifies foreground and background positions with an invariant mask; during sampling, out-of-distribution (OOD) guidance is applied only to background positions. This generates novel sequences in permissive regions while preserving regulatory motifs, thereby improving novelty without sacrificing enhancer-like composition or functional activity.
- Locality-controlled guidance. We reformulate sampling-time guidance as a locality problem and instantiate it as localized OOD control with an invariant subsequence mask. The method operates on a frozen backbone, requires no retraining, and exposes per-position spatial control absent from standard classifier-guidance methods.
2 Related Work
Discrete diffusion and flow matching on biological sequences. Two frameworks have emerged for generative modeling of categorical sequences. Discrete diffusion operates directly on categorical sequences and learns to denoise progressively masked tokens [Austin et al., 2021, Sahoo et al., 2024, Lou et al., 2024]. Continuous diffusion and flow matching instead work in a continuous relaxation of the categorical space, typically the probability simplex whose vertices correspond to the discrete tokens [Stark et al., 2024, Davis et al., 2024] Both have been applied to regulatory DNA design [Stark et al., 2024, DaSilva et al., 2026, Tang et al., 2025]. We build on the discrete diffusion line, using a pretrained masked discrete diffusion language model (MDLM) [Sahoo et al., 2024] as a backbone and steering generation with inference-time guidance.
Reward-based fine-tuning of diffusion backbones. A first family of methods directly fine-tunes the backbone against a reward signal, often framed as reinforcement learning. DRAKES [Wang et al., 2025] backpropagates a differentiable reward to pre-trained masked discrete diffusion model; DRaFT [Clark et al., 2024] applies the same differentiable-reward principle in the continuous setting. When the reward is non-differentiable, policy-gradient or gradient-free alternatives are used instead [Cao et al., 2025]. These methods can each optimize toward a particular property, but they do not expose a post-hoc control knob: changing the target reward generally requires re-specifying the training objective and running a separate fine-tuning pass, even when recent variants reduce its cost or handle multiple objectives jointly. Although recent methods reduce the cost of retraining [Cao et al., 2025], they inherently require backbone retraining for each new objective.
Training-free guidance. Classifier guidance instead allows the guidance signal to be adjusted entirely at inference time through an external scoring network [Uehara et al., 2025, Rojas et al., 2026]. DNA-Diffusion [DaSilva et al., 2026], by contrast, conditions on cell-type labels rather than optimizing a reward, and therefore serves as a non-optimizing reference rather than a competing optimizer. Another method that bypasses backbone retraining is by sampling many candidates and selecting the highest-scoring ones. SVDD [Li et al., 2024] performs soft value-based decoding, evaluating generated candidates at each step and resampling proportionally to a learned value.
3 Preliminary
3.1 Notation
We consider DNA sequences of fixed length over the nucleotide alphabet . A DNA sequence is denoted by , where represents the nucleotide at position . Its one-hot representation is denoted by , where each row satisfies .
3.2 Problem formulation
We consider paired observations , where denotes a DNA sequence and denotes an associated scalar property (e.g., target gene activity). Let denote a base generative model over DNA sequences, and let denote an auxiliary property predictor. For a target property value , classifier-based guidance aims to reweight the base generative distribution according to the predicted property likelihood as follows,
where controls the guidance strength. Since our goal is to generate novel regulatory sequences, effective generation guidance must balance three objectives: (i) achieving the target property , (ii) producing novel sequences that depart from the training distribution rather than memorizing it, and (iii) maintaining plausibility.
3.3 Masked Discrete Diffusion Language Models
MDLM [Sahoo et al., 2024] generates sequences by progressively denoising a fully masked input rather than autoregressively generating tokens. We extend the alphabet with an absorbing mask token , defining . Its one-hot representation is denoted by . The masked sequence at diffusion time is denoted by .
During training, MDLM learns to recover clean tokens from a masked sequence . In the forward process, each clean token in is independently replaced with with probability , yielding , where decreases monotonically from (clean) to (fully masked). In the reverse process, a denoising network approximates the clean sequence by predicting the categorical distribution over clean nucleotides at each position, assigning zero probability to the mask token.
At inference time, generation proceeds by sampling a less-masked state from the current state , with :
Here, denotes the conditional distribution of the token at position in the next denoising step while denotes a point mass at the current token, ensuring that previously unmasked positions remain unchanged (See §S1.2.2 for details).
The time corresponds to the next, less-masked diffusion state in the reverse process. Masked positions are either kept as or filled in using the model's prediction. Generation terminates when all positions are unmasked. In this work, we use a pretrained unconditional MDLM over fixed-length DNA sequences as the base model and guide its generation toward specific objectives.
3.4 Classifier guidance with OOD control
MOOD [Lee et al., 2023] is a score-based diffusion framework that combines OOD control with property guidance to generate novel molecules with desirable properties beyond the training distribution. It operates on continuous representations of molecular graphs. Let denote a noise-perturbed molecular graph representation at diffusion time , where is the continuous space of molecular graph representations, and let denote a differentiable property scorer trained on molecular data. In the score-based diffusion framework, classifier guidance modifies the reverse-time SDE drift by adding the gradient of ,
where denotes the marginal density of the forward diffusion process, and are its drift and diffusion coefficients, respectively, is a reverse-time Wiener process, and controls the guidance strength. The SDE is integrated backward in time.
MOOD additionally introduces an OOD-control coefficient that rescales the generative score:
where generates samples from property-guided diffusion without OOD control, and increasing encourages exploration of lower-density regions, thus generating more OOD samples. MOOD applies a single global OOD-control coefficient to the generative score across all graph components, without adapting this coefficient to their individual contributions to the target property.
4 Method
We propose LOCOGEN, a localized sequence generation framework that controls both the magnitude and locality of generated sequences. The uniform application of guidance and OOD control in Eq. 4 encodes an implicit assumption: that all sequence positions should be perturbed by the same amount. We argue this assumption is not perfectly suited for regulatory DNA. Functional motifs occupy a small fraction of each sequence and are highly constrained by sequence grammar, while the remaining background is comparatively unconstrained. Pushing motifs off-manifold destroys the very signal that makes a sequence functional, while pushing background off-manifold contributes novelty without sacrificing function.
4.1 Module 1: Masked Separator for Invariant–Environment Decomposition
Problem formulation. We aim to identify subsequences whose contribution to activity is invariant across data subpopulations, i.e., positions whose predictive role does not change from one subpopulation to another. A straightforward approach is to train an activity predictor and use saliency, but such scores reflect what a single trained model happens to rely on, without explicitly accounting for invariance. We instead build this requirement into the learning objective: the selected positions are encouraged to predict activity equally well across subpopulations.
Approach. Inspired by the invariant-environment decomposition of chemical graphs [Li et al., 2022], we introduce a learned soft mask that splits each sequence into an invariant part and an environment part , with close to 1 marking position as invariant and close to 0 as environment, jointly satisfying: (a) alone is sufficient to predict activity; (b) its prediction error remains consistent across auto-discovered environments; and (c) is sparse and contiguous.
Invariant learning for subsequence disentanglement. We jointly train a separator producing the soft mask and a predictor on the invariant subsequence with disjoint weights. The environment encoder on the environment subsequence is randomly initialized and kept frozen. Keeping frozen prevents the environment encoder itself from adapting to trivially collapse the environment representations, leaving the separator to determine the partition of sequence information. The environment is still not static since depends on the current mask. To prevent information leakage through masked positions, we fill them with a learnable token , where is the nucleotide alphabet size (initialized uniformly to ):
where and . The predictor and the environment encoder read out and 's counterpart , respectively.
Since environment labels are unavailable, we infer them via -means clustering with clusters on , following GIL [Li et al., 2022]. At the start of each epoch, we freeze a snapshot of , encode a fixed reference batch, and refit the centroids, which are then cached and used to assign environment labels throughout that epoch. Deriving both the centroids and the embeddings from the same snapshot keeps the label assignment self-consistent. See §S1.3.3 for details.
Training objective.
Our objective consists of four losses for sufficiency, for invariant learning via V-REx, for density regularization, and for total variation smoothing. encourages the predictor to recover from invariant sequence alone, : , where indexes the samples of a minibatch. For robust prediction, we adopt variance risk extrapolation (V-REx) [Krueger et al., 2021] to encourage consistent predictive performance across inferred environments. Let and be the -means environment label of sample . With per-environment risk ,
Together with , this encourages the predictor to perform equally well in every environment: any environment-specific information leaking into would inflate the variance and incur a penalty. keeps the average mask density near a target , and is a fused-lasso total variation penalty [Javanmardi et al., 2016] encouraging contiguous selected blocks. See §S1.3.2 for details on loss definition. The trained separator and final centroids are saved and remain frozen during sampling.
4.2 Module 2: Sampler with localized OOD control
Problem. The MOOD framework (§3.4) promotes novel, high-scoring samples by combining sample-level OOD drift with property guidance. For regulatory DNA, this global control is too coarse: without distinguishing constrained motifs from permissive background regions, OOD drift can erase regulatory syntax and compromise activity.
Approach. We let damping act only on positions the separator marks as environment. By restricting OOD control to environment positions, we aim to preserve activity-relevant sequence patterns while encouraging exploration in less constrained regions. This is the localization in LOCOGEN: a structural prior on where OOD pressure may act, instead of one global knob trading off the two objectives.
Reverse unmasking process. At each step , the reverse process over nucleotide at position is
where is the probability mass that MDLM assigns to the nucleotide channels at a masked position (Eq. 2), and is the gradient of the activity guidance model evaluated on the current -prediction obtained by softmaxing the nucleotide channels of , following the masked-diffusion parameterization of MDLM. The three factors push three forces in parallel: (a) flattens background nucleotide distributions toward uniform, (b) preserves MDLM's prescribed unmasking rate, and (c) pulls toward high activity
Where OOD control acts. OOD control reduces by a factor , flattening the per-position categorical distribution toward uniform and thus injecting randomness. We apply OOD damping to positions identified as environment by the separator, using the predicted mask :
Restricting damping to masked positions keeps already-decoded nucleotides untouched, consistent with the SUBS parameterisation of MDLM, and is activated only in the latter half of sampling, when provides a more reliable estimate for the separator. At invariant positions, , leaving the base nucleotide distribution unchanged before property guidance.
Auto-balanced property scale. The two forces in Eq. (8), the model prior and the activity gradient , live on different scales that drift across reverse steps, so a fixed either lets the property pull dominate (yielding unrealistic sequences) or lets it vanish (yielding low-activity sequences). Following Lee et al. [2023], we set adaptively at each step so that the gradient magnitude matches the prior up to a user ratio :
where the bars denote means over the four nucleotide channels after excluding the DRAKES sentinel values () at already-unmasked positions, and caps the scale when is small. With fixed, the property pull stays at a constant fraction of the prior throughout sampling.
To preserve the MDLM unmasking schedule, we add the scaled gradient only to the four nucleotide log-probabilities and renormalise them so that their total mass remains ; the mask channel is left untouched. Property guidance therefore reshapes the categorical distribution within nucleotides without altering when MDLM chooses to unmask a position.
5 Experiments
5.1 Experimental Setting
Dataset. We follow the experimental setup of DRAKES [Wang et al., 2025] to ensure direct comparability under an established benchmark protocol, adopting the same chromosomal train/test split. The benchmark is based on the publicly available large-scale enhancer dataset of Gosai et al. [2024], consisting of approximately 700k 200-bp human enhancer sequences with expression measurements quantified in three human cell lines: HepG2, K562, and SK-N-SH.
Generation protocol and evaluation. We follow the DRAKES evaluation scheme [Wang et al., 2025]: each method generates sequences (20 batches 32), which are then re-scored by independent held-out oracle to avoid circularity between guidance and evaluation. This oracle has three MPRA readouts (HepG2, K562, SK-N-SH), is never used for any method's guidance or fine-tuning, and serves as our canonical MPRA-property axis. As a second, MPRA-independent functional readout, we additionally report chromatin accessibility from the binary ATAC classifier [Wang et al., 2025]. For more detailed evaluation protocol, see §S2.
Baselines. We compare LOCOGEN with baselines spanning three categories of regulatory sequence generative models: (1) non-optimizing references: MDLM [Sahoo et al., 2024] (2) Reward-based fine-tuning: DRAKES [Wang et al., 2025], and (3) Training-free guidance: MDLM with classifier guidance (MDLM+CG), SVDD [Li et al., 2024], and DNA-diffusion [DaSilva et al., 2026]. All baselines are run with their authors' released checkpoints and original decoding hyperparameters. We acknowledge concurrent DNA generative models, e.g GLID2E [Cao et al., 2025], Ctrl-DNA [Chen et al., 2025], and GFlowNet [Bengio et al., 2021], but do not include them as baselines since no public checkpoints are available and retraining their upstream models is out of scope. Computation resource requirements are reported in §S1.5.
5.2 Three-axis evaluation framework
We evaluate a generated set against the training set along three axes, (1) property, (2) novelty, and (3) compositional plausibility under a fixed protocol decoupled from each method's training or guidance loop. All metrics are reported as mean standard deviation across three sampling seeds.
5.2.1 Property axis.
We assess functional activity using two complementary held-out predictors from Wang et al. [2025]: regulatory potency, measured by target gene expression, and chromatin accessibility, which is required for transcription factors to bind regulatory sequences and modulate gene expression. See §S2.2 for details.
Pred-activity We use an independently released oracle that maps a sequence to a scalar prediction of gene expression, with separate heads for cell lines . For each cell line, we report the median predicted activity over generated samples.
ATAC_acc. We use an independently released classifier that maps each sequence to a predicted probability of chromatin accessibility, formulated as a binary classification task distinguishing accessible from inaccessible sequences. We report the mean predicted accessibility over generated samples.
5.2.2 Novelty axis.
Authenticity [Alaa et al., 2022]. We report authenticity score to measure novelty and explicitly diagnose training-set memorization. For each generated sequence , let be its nearest training neighbour under Euclidean distance in 4-mer frequency space, and let be that neighbour's leave-one-out 1-NN distance within the training set. We report the fraction of samples that lie farther from their nearest neighbour than the neighbour's natural spacing,
with higher values indicating less memorisation.
Rarity [Han et al., 2023]. For each training sample , let be its distance to its -th nearest neighbour in 4-mer frequency space, defining a training -NN ball of that radius. The per-sample rarity of an on-manifold generated sequence is the radius of the smallest ball containing it,
with off-manifold samples (outside every ) excluded so that isolates on-manifold rarity. To remove dependence on feature scale and sample size, we report in IQR units relative to the leave-one-out training rarity . Thus at the training median and at , with larger values marking samples in rarer training-density regions.
5.2.3 Compositional plausibility axis
We assess preservation of the natural compositional grammar of regulatory DNA using two sub-metrics, reported as absolute deviations from the training set, . Smaller deviations indicate better preservation.
. Motif-usage diversity is measured by the Gini index over motif counts from JASPAR scans of generated and training sequences [Rauluseviciute et al., 2024]. denotes uniform motif usage, while indicates domination by a small subset of motifs. For sorted per-motif counts ,
See §S2.1 for more details.
hits. To measure motif density, we compute hits/seq, the mean number of above-threshold motif occurrences per generated sequence, hits/seq = , where is the motif hit count for . Given hits/seq of natural sequences, deviation in either direction indicates motif under- or over-insertion.
5.3 Diagnostic: two structurally distinct hacking modes
Among baselines, both SVDD and DRAKES successfully push predicted activity upward, but along distinct non-natural directions. Natural enhancers rely on the combinatorial cooperation of multiple TFs, with motifs distributed at a characteristic density. Beyond previously reported metrics, we assess how closely the functional motif composition of generated sequences approaches that of natural regulatory sequences by measuring motif usage diversity and density via Gini and hits. A large Gini indicates that generated sequences are dominated by a few repeated motifs, while a large hits indicates stuffed motif within a sequence. In either case, predictor scores can remain high even as the sequence drifts away from natural enhancer composition.
A1. Motif packing diagnostic per sequence

B1. GC-content
A2. Repetitive motif occurrence
B2. 3-mer composition
Figure 2: Diagnostics of existing sequence design baselines.
SVDD: motif inflation. In SVDD, motif density per sequence inflates to the natural baseline ( hits = 0.248, from 0.561 to 0.809; Tab. 1, Fig. 2A1), while motif usage concentrates on a narrow subset of the JASPAR repertoire ( Gini = 0.231, from 0.308 to 0.539; Tab. 1, Fig. 2A2). Repeated use of functionally important motifs is itself biologically plausible; the pathology of SVDD, rather, is that it repeats a single motif up to saturation within a single sequence. Together, these observations suggest that SVDD raises predicted activity by repeatedly stuffing a small set of presumably activity-driving motifs into sequence, rather than by employing the diverse motif vocabulary characteristic of natural enhancers.
DRAKES: GC-rich composition drift. Unlike SVDD, DRAKES does not overpack motifs ( hits = 0.06; Tab. 1, Fig. 2A1-2), but its motif usage is still skewed toward a narrow subset of the JASPAR repertoire ( Gini = 0.261; Tab. 1). To understand which motifs DRAKES preferentially favors, we examined the over-represented entries and found that they are predominantly GC-rich (Fig. 2B1). The composition of the generated sequences depart substantially from the natural compositional baseline (Fig. 2B2). Together, these observations suggest that DRAKES inflates predicted activity by drifting toward a generic GC-rich background, rather than by concentrating on the functionally relevant motifs of the target cell line.
5.4 Reaching the empty corner with LOCOGEN
Table 1: Three axis benchmark in HepG2 cell line. 1st, 2nd, and 3rd best results are highlighted.
| Method | Property | Novelty | Plausibility | |||
|---|---|---|---|---|---|---|
| Pred-activity ↑ | ATAC_acc ↑ | Authenticity ↑ | Rarity (IQR) ↑ | |Δ Gini| ↓ | |Δ hits| ↓ | |
| Train | 2.406 | 0.244 | 0.728 | - | - | - |
| MDLM | 0.157 ± 0.024 | 0.329 ± 0.198 | 0.777 ± 0.033 | -0.15 ± 0.03 | 0.051 ± 0.006 | 0.071 ± 0.001 |
| MDLM+CG | 4.516 ± 0.151 | 0.481 ± 0.022 | 0.809 ± 0.014 | +0.21 ± 0.02 | 0.169 ± 0.013 | 0.043 ± 0.007 |
| DNA-Diff | 2.595 ± 0.087 | 0.688 ± 0.293 | 0.821 ± 0.015 | -0.07 ± 0.03 | 0.002 ± 0.002 | 0.010 ± 0.002 |
| DRAKES | 5.610 ± 0.070 | 0.804 ± 0.159 | 0.873 ± 0.004 | +1.08 ± 0.09 | 0.261 ± 0.007 | 0.060 ± 0.010 |
| SVDD | 6.830 ± 0.024 | 0.442 ± 0.375 | 0.894 ± 0.008 | +0.84 ± 0.03 | 0.231 ± 0.010 | 0.248 ± 0.008 |
| LocoGen | 4.679 ± 0.021 | 0.716 ± 0.019 | 0.906 ± 0.006 | +0.71 ± 0.00 | 0.055 ± 0.005 | 0.057 ± 0.003 |
Note. For natural sequences (Train), Gini = 0.308 and hits = 0.561.
Tables 1, S4, S5, and Figure 1 show that LOCOGEN occupies a distinct region of the three-axis benchmark space. Single-axis optimization leads to clear trade-offs: SVDD and DRAKES obtain the strongest property scores but incur large plausibility shifts, whereas DNA-Diff closely matches the training distribution but yields weaker property optimization and limited rarity. LOCOGEN avoids both failure modes. It achieves competitive property optimization, the best authenticity, positive rarity, and top-three performance on both plausibility metrics. Thus, our claim is not that LOCOGEN is absolutely superior on every metric, but that it is the property-optimizing method that fills the empty corner of the design space: maintaining acceptable performance on property, novelty, and plausibility simultaneously. We further verify that the masked separator learns a meaningful invariant/environmental decomposition rather than an arbitrary partition. The invariant subsequence remains close to the natural baseline, is enriched for activity-associated JASPAR motifs, and has a larger functional impact under ablation than random regions; see §S3.2 for details.
5.4.1 Ablation study
To better understand what drives LOCOGEN's performance, we investigate two complementary questions: (i) Which components of LOCOGEN contribute to its performance? (ii) Can a non-generative approach based on localization and shuffling achieve comparable results?
(i) Table 2 disentangles the contributions of guidance and locality in LOCOGEN. CG applies classifier guidance alone (), while Loc. OOD (Learnt) represents the full model, restricting OOD damping to the mask separator-identified background. Glob. OOD control positions at random rather than from the masked separator signal with minimal overlap with the invariant region (Fig. S2). In contrast, Attack reverses property guidance at invariant positions, actively disrupting the regions identified by the masked separator. Disabling CG substantially reduces both property optimization and novelty while leaving plausibility largely unaffected, highlighting the critical role of classifier guidance in property optimization (rows 1-3 vs. the last row). With CG enabled, replacing Loc. OOD (Learnt) with Glob. OOD mildly but consistently degrades property and novelty metrics (row 5 vs. the last row), providing additional evidence that the separator identifies activity-sensitive positions. Meanwhile, the comparison against global OOD damping supports a modest but consistent benefit from localizing OOD control. Removing OOD control substantially degrades all metrics except hits| (row 4 vs. the last row). Thus, classifier guidance with OOD control helps discover sequences with stronger properties and greater novelty, while concentrating motif usage on a narrower subset of motifs; the total number of motif hits remains close to the reference distribution. We further examine the effect of OOD control strength to assess how strongly to apply distributional calibration during sampling. See Appendix §S3.3.1 for the full results.
Table 2: Locality ablation on HepG2 cell line.
| Component | Property | Novelty | Plausibility | |||||
|---|---|---|---|---|---|---|---|---|
| CG | Glob. OOD | Loc. OOD | Pred-activity ↑ | ATAC_acc ↑ | Authenticity ↑ | Rarity (IQR) ↑ | |Δ Gini| ↓ | |Δ hits| ↓ |
| - | 0.157 ± 0.024 | 0.329 ± 0.198 | 0.777 ± 0.033 | -0.15 ± 0.03 | 0.051 ± 0.006 | 0.071 ± 0.001 | ||
| ✓ | - | 0.300 ± 0.028 | 0.314 ± 0.008 | 0.946 ± 0.002 | +0.46 ± 0.03 | 0.246 ± 0.002 | 0.167 ± 0.007 | |
| Learnt | 0.309 ± 0.020 | 0.311 ± 0.009 | 0.947 ± 0.003 | +0.46 ± 0.03 | 0.244 ± 0.004 | 0.166 ± 0.006 | ||
| ✓ | - | 4.516 ± 0.151 | 0.481 ± 0.022 | 0.809 ± 0.014 | +0.21 ± 0.02 | 0.169 ± 0.013 | 0.043 ± 0.007 | |
| ✓ | ✓ | - | 4.608 ± 0.061 | 0.691 ± 0.041 | 0.887 ± 0.012 | +0.62 ± 0.11 | 0.065 ± 0.021 | 0.044 ± 0.015 |
| ✓ | Attack | 3.881 ± 0.038 | 0.656 ± 0.004 | 0.887 ± 0.012 | +0.64 ± 0.06 | 0.025 ± 0.007 | 0.083 ± 0.006 | |
| ✓ | Learnt | 4.679 ± 0.021 | 0.716 ± 0.019 | 0.906 ± 0.006 | +0.71 ± 0.00 | 0.055 ± 0.005 | 0.057 ± 0.003 | |
(ii) To distinguish the contribution of learned localization from that of generative optimization, we conducted a non-generative control experiment based on a segment-and-shuffle strategy (Tab. S7). See details in §S3.3.2. LearnedMask outperformed heuristic segmentation methods (e.g., predicted activity of 0.442 vs. 0.359 for GC-content masking under uniform shuffling), suggesting that learned localization better identifies activity-relevant regions. Nevertheless, preserving these regions while shuffling the background remained substantially less effective than full LOCOGEN (predicted activity: 0.442 vs. 4.679; ATAC accessibility: 0.280 vs. 0.716). These results suggest that localization alone is insufficient to reproduce LocoGen’s performance, highlighting the importance of combining learned localization with a property-guided generative model.
5.5 Robustness to evaluation configuration
To verify that the balanced three-axis profile is not an artifact of our evaluation setup, we evaluated LOCOGEN under (1) independent oracles and (2) a hyperparameter sweep. We first re-evaluated all methods with two publicly available alternative oracles released by prior work [Li et al., 2024, Genentech, 2025]. See §S3.4 for details. Swapping in these oracles leaves most of the ranking intact (Tab. S8,S9,S10). Its three-axis profile is therefore not tied to a specific oracle. Next, we swept LOCOGEN and every baseline over the ranges given in each method’s paper or official repository; see §S3.5 for details. Across these sweeps, LOCOGEN retains its balanced three-axis advantage, confirming that the result does not rely on a cherry-picked hyperparameter configuration.
6 Conclusion
We studied sampling-time guidance for regulatory DNA generation and showed that single-axis evaluation can obscure distinct reward-hacking modes. By decomposing evaluation into property, novelty, and plausibility, we identified a desirable region that existing baselines fail to reach. We showed that this gap can be addressed by treating guidance as a problem of locality (which positions to modify) rather than scalar strength. Implemented as localized OOD control with an invariant motif mask, this approach improves the three-axis balance on a frozen backbone without retraining. More broadly, our results suggest that locality-aware guidance may be useful in other structured domains with spatially or functionally nonuniform grammars. See §S4 for further discussions on limitations and impact of this work.
Acknowledgments and Disclosure of Funding
We acknowledge core funding from the Wellcome Trust (WT220540/Z/20/A), as well as funding and support from Open Targets.
References
Ahmed Alaa, Boris Van Breugel, Evgeny S Saveliev, and Mihaela Van Der Schaar. How faithful is your synthetic data? sample-level metrics for evaluating and auditing generative models. In International conference on machine learning, pages 290–306. PMLR, 2022.
Stephen F Altschul and Bruce W Erickson. Significance of nucleotide sequence alignments: a method for random sequence permutation that preserves dinucleotide and codon usage. Molecular biology and evolution, 2(6):526–538, 1985.
Jacob Austin, Daniel D Johnson, Jonathan Ho, Daniel Tarlow, and Rianne Van Den Berg. Structured denoising diffusion models in discrete state-spaces. Advances in neural information processing systems, 34:17981–17993, 2021.
Emmanuel Bengio, Moksh Jain, Maksym Korablyov, Doina Precup, and Yoshua Bengio. Flow network based generative models for non-iterative diverse candidate generation. Advances in neural information processing systems, 34:27381–27394, 2021.
Hanqun Cao, Haosen Shi, Chenyu Wang, Sinno Jialin Pan, and Pheng-Ann Heng. Glid2e: A gradient-free lightweight fine-tune approach for discrete biological sequence design. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025.
Xingyu Chen, Shihao Ma, Runsheng Lin, Jiecong Lin, and Bo Wang. Ctrl-DNA: Controllable cell-type-specific regulatory DNA design via constrained RL. In Advances in Neural Information Processing Systems, 2025. Spotlight.
Kevin Clark, Paul Vicol, Kevin Swersky, and David J Fleet. Directly fine-tuning diffusion models on differentiable rewards. In The Twelfth International Conference on Learning Representations, 2024.
Lucas Ferreira DaSilva, Simon Senan, Judith F Kribelbauer-Swietek, Zain Munir Patel, Lithin Karmel Louis, Aniketh Janardhan Reddy, Sameer Gabbita, Jonathan D Rosen, Zach Nussbaum, César Miguel Valdez Córdova, et al. Designing synthetic regulatory elements using the generative ai framework dna-diffusion. Nature Genetics, 58(1):180–194, 2026.
Oscar Davis, Samuel Kessler, Mircea Petrache, Ísmail Í Ceylan, Michael Bronstein, and Avishek J Bose. Fisher flow matching for generative modeling over discrete data. Advances in Neural Information Processing Systems, 37:139054–139084, 2024.
Genentech. human-atac-catlas-model. https://huggingface.co/Genentech/human-atac-catlas-model, 2025. Enformer fine-tuned with gReLU on the human ATAC CATlas dataset; accessed 2026-10-26.
Sager J Gosai, Rodrigo I Castro, Natalia Fuentes, John C Butts, Kousuke Mouri, Michael Alasoadura, Susan Kales, Thanh Thanh L Nguyen, Ramil R Noche, Arya S Rao, et al. Machine-guided design of cell-type-targeting cis-regulatory elements. Nature, 634(8036):1211–1220, 2024.
Jiyeon Han, Hwanil Choi, Yunjey Choi, Junho Kim, Jung-Woo Ha, and Jaesik Choi. Rarity score: A new metric to evaluate the uncommonness of synthesized images. In International Conference on Learning Representations (ICLR). International Conference on Learning Representations, 2023.
Mehran Javanmardi, Mehdi Sajjadi, Ting Liu, and Tolga Tasdizen. Unsupervised total variation loss for semi-supervised deep learning of semantic segmentation. arXiv preprint arXiv:1605.01368, 2016.
David Krueger, Ethan Caballero, Joern-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Dinghuai Zhang, Remi Le Priol, and Aaron Courville. Out-of-distribution generalization via risk extrapolation (rex). In International conference on machine learning, pages 5815–5826. PMLR, 2021.
Seul Lee, Jaehyeong Jo, and Sung Ju Hwang. Exploring chemical space with score-based out-of-distribution generation. In International Conference on Machine Learning, pages 18872–18892. PMLR, 2023.
Haoyang Li, Ziwei Zhang, Xin Wang, and Wenwu Zhu. Learning invariant graph representations for out-of-distribution generalization. Advances in Neural Information Processing Systems, 35: 11828–11841, 2022.
Xiner Li, Yulai Zhao, Chenyu Wang, Gabriele Scalia, Gokcen Eraslan, Surag Nair, Tommaso Biancalani, Aviv Regev, Sergey Levine, and Masatoshi Uehara. Derivative-free guidance in continuous and discrete diffusion models with soft value-based decoding. In Advances in Neural Information Processing Systems, 2024.
Stuart Lloyd. Least squares quantization in pcm. IEEE transactions on information theory, 28(2): 129–137, 1982.
Aaron Lou, Chenlin Meng, and Stefano Ermon. Discrete diffusion modeling by estimating the ratios of the data distribution. In Proceedings of the 41st International Conference on Machine Learning, pages 32819–32848, 2024.
Christos Louizos, Max Welling, and Diederik P Kingma. Learning sparse neural networks through l_0 regularization. arXiv preprint arXiv:1712.01312, 2017.
Ieva Rauluseviciute, Rafael Riudavets-Puig, Romain Blanc-Mathieu, Jaime A Castro-Mondragon, Katalin Ferenc, Vipin Kumar, Roza Berhanu Lemma, Jeremy Lucas, Jérémy Chèneby, Damir Baranasic, et al. JASPAR 2024: 20th anniversary of the open-access database of transcription factor binding profiles. Nucleic Acids Research, 52(D1):D174–D182, 2024.
Kevin Rojas, Ye He, Chieh-Hsin Lai, Yuhta Takida, Yuki Mitsufuji, and Molei Tao. Improving classifier-free guidance in masked diffusion: Low-dim theoretical insights with high-dim impact. In The Fourteenth International Conference on Learning Representations, 2026.
Subham S Sahoo, Marianne Arriola, Yair Schiff, Aaron Gokaslan, Edgar Marroquin, Justin T Chiu, Alexander Rush, and Volodymyr Kuleshov. Simple and effective masked diffusion language models. Advances in Neural Information Processing Systems, 37:130136–130184, 2024.
Hannes Stark, Bowen Jing, Chenyu Wang, Gabriele Corso, Bonnie Berger, Regina Barzilay, and Tommi Jaakkola. Dirichlet flow matching with applications to dna sequence design. In International Conference on Machine Learning, pages 46495–46513. PMLR, 2024.
Sophia Tang, Yinuo Zhang, Alexander Tong, and Pranam Chatterjee. Gumbel-softmax flow matching with straight-through guidance for controllable biological sequence generation. ArXiv, pages arXiv–2503, 2025.
Masatoshi Uehara, Yulai Zhao, Chenyu Wang, Xiner Li, Aviv Regev, Sergey Levine, and Tommaso Biancalani. Inference-time alignment in diffusion models with reward-guided generation: Tutorial and review. arXiv preprint arXiv:2501.09685, 2025.
Chenyu Wang, Masatoshi Uehara, Yichun He, Amy Wang, Tommaso Biancalani, Avantika Lal, Tommi Jaakkola, Sergey Levine, Hanchen Wang, and Aviv Regev. Fine-tuning discrete diffusion models via reward optimization with applications to DNA and protein design. In International Conference on Learning Representations, 2025.
Kai Zhang, James D Hocker, Michael Miller, Xiaomeng Hou, Joshua Chiou, Olivier B Poirion, Yunjiang Qiu, Yang E Li, Kyle J Gaulton, Allen Wang, et al. A single-cell atlas of chromatin accessibility in the human genome. Cell, 184(24):5985–6001, 2021.
Supplementary material
CONTENTS
S1 Supplementary methods 14
S1.1 Notation ..... 14
S1.2 Reverse process of MDLM ..... 14
S1.3 Masked separator ..... 15
S1.4 Localization-guided sampler ..... 17
S1.5 Computational cost ..... 17
S2 Evaluation protocol 17
S2.1 Evaluation metric ..... 17
S2.2 Baseline re-scoring and the DRAKES oracle ..... 18
S3 Supplementary results 18
S3.1 Benchmark analysis on other cell lines. ..... 18
S3.2 Masked separator faithfully disentangles invariant and environmental subsequences. 19
S3.3 Ablation study ..... 19
S3.4 Robust to choice of oracle ..... 20
S3.5 Robust to hyperparameter sweep ..... 21
S4 Discussion 22
S4.1 Limitations. ..... 22
S4.2 Social Impact ..... 22
S1 Supplementary methods
This section fixes the notation used throughout the paper (§S1.1, Table S1), gives the derivation details of the MDLM reverse step omitted from §3.3 (§S1.2), and then documents the two LOCOGEN modules in the order in which they are introduced in §4: the masked separator (§S1.3) and the localization-guided sampler (§S1.4).
S1.1 Notation
Table S1: Summary of notation. Symbols are grouped by the section in which they are introduced.
| Symbol | Description |
|---|---|
| Sequences and diffusion (§3) | |
| Nucleotide alphabet | |
| Alphabet size | |
| DNA sequence length ( in all experiments) | |
| Position index and nucleotide-channel index | |
| Sample index within a minibatch and minibatch size | |
| Discrete DNA sequence | |
| Nucleotide at position | |
| One-hot encoded DNA sequence; its row at position | |
| Mask symbol and its one-hot representation in | |
| Masked sequence (diffusion state) at diffusion time | |
| Next, less-masked diffusion time in the reverse process | |
| MDLM masking schedule | |
| Unmasking mass (Eq. 2) | |
| Frozen base (MDLM) generative model | |
| Auxiliary property predictor | |
| Target property value | |
| Property guidance strength in the guided distribution | |
| MOOD diffusion state, property scorer, and guidance strength | |
| OOD-control strength | |
| Masked separator (§4.1) | |
| Separator producing the soft mask | |
| Invariant predictor and frozen environment encoder | |
| Soft invariance mask; its channel-broadcast form | |
| Invariant and environment subsequences (Eq. 5) | |
| Learnable fill token and its sequence-broadcast form | |
| Number of auto-discovered environments | |
| Environment label, per-environment risk, and centroid | |
| Target mask density | |
| Loss weights in Eq. 6 | |
| Localization-guided sampler (§4.2) | |
| Activity guidance model and its gradient w.r.t. | |
| Current -prediction obtained by softmaxing the nucleotide channels | |
| Mask predicted at diffusion time | |
| Localized OOD damping factor (Eq. 9) | |
| Mask and diffusion-time thresholds gating the damping | |
| Property-pull scale, its cap, and the target magnitude ratio (Eq. 10) | |
S1.2 Reverse process of MDLM
S1.2.1 Factorization over positions
The per-position transition in Eq. 2 is applied independently at every position, so the reverse transition of the whole sequence factorizes as
S1.2.2 Point mass at already-decoded positions
At diffusion time , let denote the categorical token at position , with one-hot representation
The first branch of Eq. 2 is then the point mass
which freezes every position whose token has already been decoded; only positions still carrying m are resampled. This is the SUBS parameterization that LOCOGEN inherits, and it is the reason the damping in §S1.4 can act only on still-masked positions.
S1.3 Masked separator
S1.3.1 Backbone architecture
Each of the three networks , , and is a stack of dilated 1D convolutions of identical capacity to the DRAKES classifier [Wang et al., 2025], with the hyperparameters of Table S2: 5 stacks of 5 dilations with rates , kernel size 9, hidden width , residual connections within each stack, and ReLU activations. The input is the one-hot tensor with and . The separator head applies a position-wise sigmoid to produce , with its output bias initialized at so that at the start of training. The predictor reads out the invariant subsequence through a 2-layer head on global mean pooling,
while the environment encoder produces a single embedding per sequence,
where denotes the convolutional trunk before pooling. We write for the pooled embedding throughout, as in §4.1.
The three networks share architecture but not weights, and only and are trained: is randomly initialized and kept frozen. A trainable environment encoder can lower by collapsing the embedding space itself rather than by improving the partition; tying to has the same effect, since the predictor's collapse attractor would then corrupt the embedding space used for -means (§S1.3.3). Freezing leaves the separator as the only route by which the environment partition can change, which is what makes the V-REx penalty informative about the mask.
S1.3.2 Auxiliary loss terms
Mask anchoring ( ). A symmetric quadratic penalty pulling the average mask density to the target , with an optional bimodal sub-term:
The first term is expected- anchoring [Louizos et al., 2017]. We set : with the valleys become attractors and combine with the mean term to collapse the separator within the first epoch. The target density is held as a frozen buffer rather than a trainable parameter; when made learnable it gets pulled toward , which hollows out the penalty whenever the mask collapses.
Spatial smoothness ( ). A fused-lasso total-variation penalty on adjacent mask values [Javanmardi et al., 2016]:
This encourages contiguous selected blocks rather than scattered single positions, consistent with the cis-regulatory grammar in which functional elements occupy short contiguous motifs.
V-REx variance estimator. in Eq. 7 is computed in its biased form. Environments containing fewer than two samples are dropped from the variance estimate; if fewer than two environments survive, we set for that batch.
S1.3.3 Environment inference by k-means
Because is defined by the current mask, the inferred environments shift as is updated. We therefore refit k-means at the start of every epoch, so that the V-REx penalty is always measured against the partition induced by the current mask, and hold the labels fixed within the epoch, which prevents the separator from lowering by reshuffling the environments themselves (the standard GIL alternating optimization [Li et al., 2022]). Writing for the epoch index, one round proceeds as follows.
Step 1 — Snapshot collection. At the start of each epoch , a copy of the current parameters is frozen; since is already frozen, the snapshot pins the separator, and hence the mask that defines . Up to samples are drawn from the train loader and their environment embeddings are collected. For this pass alone we use hard-input mixing: the fill token is not injected, so k-means clusters on actual background nucleotide content rather than on a b-contaminated mixture.
Step 2 — k-means fit. Lloyd’s algorithm [Lloyd, 1982] is run with clusters and iterations, initialized by random-sample seeding indexed by the epoch number. The resulting centroids are cached.
Step 3 — Minibatch assignment. During each training step within the epoch, samples are assigned to the nearest cached centroid under squared distance:
These labels feed (Eq. 7). Because both the centroids and the embeddings are taken from the same frozen snapshot , environment labels and centroids stay mutually consistent for the whole epoch.
Warmup. For the first epoch no centroids exist; we set and train as pure ERM on . Subsequently the refit runs at the start of every epoch.
Persistence. The final centroids are saved with the model checkpoint for reproducibility and for the environment diagnostics of §S3.2. The sampler of §S1.4 consumes only the separator output and does not consult the centroids.
Table S2: Hyperparameters for the masked separator (§S1.3).
| Symbol | Value | Description | Source |
|---|---|---|---|
| 128 | hidden dim of CNN backbones | model_hidden_dim | |
| stacks | 5 | dilated-CNN stack depth | model_num_cnn_stacks |
| dropout | 0.1 | per-conv dropout | model_dropout |
| 0.3 | target invariant mask density | init_rho | |
| 1.0 | V-REx weight | config | |
| 5.0 | mask-anchoring weight | config | |
| 0.1 | fused-lasso TV weight | config | |
| 0.0 | bimodal sub-term weight (disabled) | config | |
| 3 | number of k-means environments | num_envs | |
| 20 | k-means Lloyd iterations | kmeans_iters | |
| 8192 | k-means subsample cap | kmeans_samples | |
| 1 epoch | ERM-only warmup | warmup_epochs | |
| optimiser | Adam | lr , grad-clip max-norm 1.0 | train.lr |
S1.4 Localization-guided sampler
The sampler operates entirely at inference time on frozen components: the MDLM prior , the separator , and the activity guidance model . At each reverse step it evaluates once, forms the -prediction , queries the separator to obtain , and combines the three factors of Eq. 8: the localized damping of Eq. 9, the MDLM unmasking mass , and the auto-balanced property pull of Eq. 10. Damping is gated by two thresholds: it acts only where , i.e. on environment positions, and only for , i.e. in the second half of sampling, where is informative enough for to classify positions reliably. Because already-decoded positions are frozen by the point mass of §S1.2.2, damping is in effect restricted to still-masked positions.
Sentinel-aware normalization. The auto-balance of Eq. 10 normalizes the property pull by the mean magnitude of the prior log-probabilities. DRAKES [Wang et al., 2025] writes a large negative sentinel at positions whose token has already been determined, in order to block re-sampling. Taken without filtering, these sentinel entries dominate , inflate the ratio, and pin at its cap at every step, which silently disables auto-balance. We therefore restrict the mean to non-sentinel entries (). The same correction is applied when running the classifier-guided baselines, so that no method is penalized by this implementation detail.
Finalization. Tokens are drawn from the renormalized categorical distribution over the four nucleotide channels, with the copy rule of MDLM keeping already unmasked positions fixed. After the final reverse step, one additional forward pass with per-position arg max removes any residual mask tokens, as in DRAKES [Wang et al., 2025].
Remaining architecture and configuration details are provided in the code; hyperparameter settings are summarized in Table S3.
Table S3: Hyperparameters for the localization-guided sampler (§S1.4).
| Symbol | Value | Description |
|---|---|---|
| 0.7 | OOD damping strength (, Eq. 9) | |
| 0.5 | mask threshold; damping acts where | |
| 0.5 | damping time threshold (active only for ) | |
| 3.0 | target property-pull-to-prior magnitude ratio (Eq. 10) | |
| 20 | cap on when is small | |
| sentinel cutoff | threshold below which is excluded from the norm | |
| batch / seeds | 32 / 3 | sampling batch size and number of seeds |
| 640 | sequences per method per cell line per seed () |
S1.5 Computational cost
All experiments were run on a single NVIDIA H200 GPU per job, with 16 CPU cores and 40 GB of host RAM. Training the masked separator required approximately 5.5 hours per epoch, with peak host-side RAM usage of 4.6 GB. For sequence generation, sampling 640 sequences with 128 reverse-diffusion steps took 191 wall-clock seconds per random seed, with peak host-side RAM usage of 3.5 GB.
S2 Evaluation protocol
This section presents further details omitted from the main text due to space constraints.
S2.1 Evaluation metric
Gini. We scan generated/training sequences against the JASPAR motif database TF position-specific scoring matrices [Rauluseviciute et al., 2024], thresholded at false positive rate under a uniform ACGT background. Following Gosai et al. [2024], motifs are restricted to those whose constituent TF subunits are all expressed at TPM > 1 in the target cell type. The Gini coefficient over per-motif counts sorted by ascending order is
S2.2 Baseline re-scoring and the DRAKES oracle
To avoid circularity from using the same predictor for both classifier-guided generation and evaluation, we used separate independent oracles for generation guidance and sequence evaluation, following the DRAKES protocol [Wang et al., 2025]. Specifically, reward_oracle_ft. ckpt is used only for guidance or reward-based fine-tuning, whereas evaluation is performed using the separately distributed reward_oracle_eval. ckpt. This held-out evaluator is a gReLU EnformerPretrainedModel with three MPRA readouts corresponding to HepG2, K562, and SK-N-SH, and never contributes to the guidance or fine-tuning signal of any method. As a second functional readout independent of MPRA, we additionally report chromatin accessibility from the binary ATAC classifier binary_atac_cell_lines. ckpt [Wang et al., 2025]; the two predictors are trained independently.
S3 Supplementary results
S3.1 Benchmark analysis on other cell lines.
Table S4: Three axis benchmark in K562 cell line ( seeds, mean std). 1st, 2nd, and 3rd best results are highlighted.
| Method | Property | Novelty | Plausibility | |||
|---|---|---|---|---|---|---|
| Pred-activity↑ | ATAC_acc↑ | Authenticity↑ | Rarity (IQR)↑ | Gini| ↓ | hits| ↓ | |
| Train | 2.700 | 0.281 | 0.717 | - | - | - |
| MDLM | ||||||
| MDLM+CG | ||||||
| DNA-Diff | ||||||
| DRAKES | ||||||
| SVDD | ||||||
| LocoGen | ||||||
Note. For natural sequences (Train), Gini = 0.312 and hits = 0.555
Table S5: Three axis benchmark in SK-N-SH cell line ( seeds, mean std). 1st, 2nd, and 3rd best results are highlighted.
| Method | Property | Novelty | Plausibility | |||
|---|---|---|---|---|---|---|
| Pred-activity↑ | ATAC_acc↑ | Authenticity↑ | Rarity (IQR)↑ | Gini| ↓ | hits| ↓ | |
| Train | 2.376 | 0.212 | 0.713 | - | - | - |
| MDLM | ||||||
| MDLM+CG | ||||||
| DNA-Diff† | ||||||
| DRAKES | ||||||
| SVDD | ||||||
| LocoGen | ||||||
Note. For natural sequences (train set), Gini = 0.321 and hits = 0.572. †:DNA-Diff [DaSilva et al., 2026] trained on GM12878, HepG2, hESCCT0, K562; SK-N-SH not in label set. K562-anchored seqs scored under SK-N-SH oracle head.
S3.2 Masked separator faithfully disentangles invariant and environmental subsequences
We next asked whether the masked separator module recovers a meaningful invariant/environmental decomposition. Three lines of evidence support that it does (Fig. S1). First, the three environmental subsequences exhibit clearly distinct GC-content distributions while the invariant subsequence sits near the natural baseline (Fig. S1A), and the same separation holds in 3-mer PCA space, where each environment forms a distinct cluster around its own centroid (Fig. S1B). Second, the invariant subsequence is enriched for canonical activity-driving JASPAR motifs, predominantly ETS-family factors (Fig. S1C). Third, ablating only the invariant subsequence causes a substantially larger drop in oracle-predicted activity than ablating an equally-sized random region (Fig. S1D), showing that the invariant region is functionally responsible for the predicted activity rather than being an arbitrary partition.

B. 3-mer PCA - distinct clusters
C. Top-20 JASPAR motif enriched
D. Activity drop under ablation
Figure S1: Sequence-level invariance learning recovers regulatory grammar.
S3.3 Ablation study
To better interpret the global-OOD setting in §5.4.1, we conducted an additional experiment in which the same number of masked positions was distributed uniformly at random across the sequence (Fig. S2). We confirmed that these randomly selected positions exhibited minimal overlap with the invariant region.
S3.3.1 Effect of OOD control strength
Table S6 studies the effect of the OOD control strength . Without OOD control the model achieves reasonable predicted activity but shows weak ATAC accessibility, low authenticity, limited rarity, and a large deviation in . Increasing to 0.3 substantially improves ATAC accessibility, authenticity, rarity, and both plausibility metrics, indicating that moderate OOD control leads to generate more plausible sequences. At , LOCOGEN achieves the best authenticity, rarity, and , while also maintaining strong predicted activity and the highest ATAC accessibility. Although gives slightly higher pred-activity and the lowest , the setting provides the most balanced operating point across property, novelty, and plausibility. These results support the role of OOD control as a calibration mechanism that controls the trade-off between aggressive property optimization and distributional realism.
A. Learnt vs random mask

B.

Figure S2: The learnt invariant region is not a random subset of positions. (A) For ten HepG2 enhancers, the learnt invariant mask (dark) and a count-matched random mask (purple) along the 200bp window; the light band is the OOD-damped background. Both masks select the same number of positions, so any difference in the ablation is attributable to which positions are spared rather than how many. (B) Per-sequence Jaccard index between the two masks.
Table S6: OOD strength sweep on HepG2.
| γ | Pred-activity ↑ | ATACacc ↑ | Auth.↑ | Rarity (IQR)↑ | |ΔGini| ↓ | |Δhits| ↓ |
|---|---|---|---|---|---|---|
| 0.0 | 4.516 ± 0.151 | 0.481 ± 0.022 | 0.809 ± 0.011 | +0.22 ± 0.01 | 0.169 ± 0.010 | 0.043 ± 0.005 |
| 0.3 | 4.738 ± 0.061 | 0.651 ± 0.007 | 0.870 ± 0.004 | +0.53 ± 0.03 | 0.095 ± 0.003 | 0.027 ± 0.002 |
| 0.7 | 4.679 ± 0.0 | 0.716 ± 0.019 | 0.906 ± 0.005 | +0.71 ± 0.00 | 0.055 ± 0.004 | 0.057 ± 0.002 |
S3.3.2 Segment and shuffle baseline
We uniformly sampled regulatory sequences from the training set, preserved positions designated as foreground, and shuffled the remaining background positions. Here, foreground and background refer to regions selected for preservation and modification, respectively, rather than the invariant and environment components defined in LOCOGEN. We evaluated combinations of three foreground segmentation methods × two background replacement strategies.
• Foreground segmentation
– Position-specific scoring matrix (PSSM) motif scan
– GC content-based segmentation
– Predictor saliency
• Background replacement
– Uniform random replacement
– Altschul-Erickson dinucleotide shuffle (i.e., dinucleotide-preserving) [Altschul and Erickson, 1985]
S3.4 Robust to choice of oracle
To demonstrate the generalizability of LOCOGEN across different experimental settings, we evaluated robustness to different oracles for activity and accessibility evaluation. We evaluated our method using two publicly available alternative oracles released by prior work [Li et al., 2024, Genentech, 2025].
Table S7: Comparison with non-generative segment-and-shuffle controls on HepG2.
| Segmentation | Replacement | Property | Novelty | Plausibility | |||
|---|---|---|---|---|---|---|---|
| Pred-act. ↑ | ATAC_acc ↑ | Authent. ↑ | Rarity (IQR) ↑ | |ΔGini| ↓ | |Δhits| ↓ | ||
| JASPAR PSSM | Uniform random | 0.275 | 0.206 | 0.928 | +0.25 | 0.155 | 0.114 |
| JASPAR PSSM | Dinuc.-preserving | 0.122 | 0.092 | 0.815 | -0.12 | 0.069 | 0.066 |
| GC content | Uniform random | 0.359 | 0.252 | 0.907 | +0.13 | 0.148 | 0.129 |
| GC content | Dinuc.-preserving | 0.078 | 0.086 | 0.809 | -0.16 | 0.054 | 0.076 |
| Saliency | Uniform random | 0.288 | 0.249 | 0.961 | +0.30 | 0.167 | 0.138 |
| Saliency | Dinuc.-preserving | 0.199 | 0.129 | 0.840 | -0.03 | 0.101 | 0.095 |
| LearnedMask | Uniform random | 0.442 | 0.280 | 0.955 | +0.38 | 0.166 | 0.171 |
| LearnedMask | Dinuc.-preserving | 0.287 | 0.109 | 0.823 | -0.05 | 0.067 | 0.113 |
| LocoGen | 4.679 | 0.716 | 0.906 | +0.71 | 0.055 | 0.057 | |
-
Activity oracle [Li et al., 2024]: an independent Enformer-based predictor trained on the same Gosai dataset, but with a different train/test split and substantially more training data than the DRAKES oracle.
-
Accessibility oracle [Genentech, 2025]: an independent Enformer-based predictor trained on the Human ATAC Atlas [Zhang et al., 2021], a different dataset for chromatin accessibility prediction.
Overall, LOCOGEN consistently maintains strong property performance across independent evaluation oracles, demonstrating that our conclusions are not tied to a specific oracle.
Table S8: Robustness to oracle choice (HepG2). Beyond the DRAKES evaluation oracles used in the main text, we add two predictors that differ in training split and in data source, respectively. Rank across the six methods in parentheses; values are mean ± s.d. where seed replicates are available.
| Method | Activity | Accessibility | ||
|---|---|---|---|---|
| DRAKESPred-activity | SVDD DNA_evaluationalternative training split | DRAKESATAC_acc | human-atac-catlasdifferent data source | |
| MDLM | 0.157 (6) | 0.408 ± 0.013 (6) | 0.329 (6) | 0.050 ± 0.009 (6) |
| MDLM+CG | 4.516 (4) | 4.434 ± 0.097 (4) | 0.481 (4) | 0.459 ± 0.014 (5) |
| DNA-Diff | 2.595 (5) | 2.721 ± 0.046 (5) | 0.688 (3) | 0.517 ± 0.020 (4) |
| DRAKES | 5.610 (2) | 5.135 ± 0.076 (2) | 0.804 (1) | 0.829 ± 0.006 (1) |
| SVDD | 6.830 (1) | 6.187 ± 0.018 (1) | 0.442 (5) | 0.547 ± 0.010 (3) |
| LocoGen | 4.679 (3) | 4.660 ± 0.011 (3) | 0.716 (2) | 0.729 ± 0.002 (2) |
Table S9: Robustness to oracle choice (K562). Same four oracles and conventions as Table S8; rank across the six methods in parentheses, values are mean ± s.d. where seed replicates are available.
| Method | Activity | Accessibility | ||
|---|---|---|---|---|
| DRAKESPred-activity | SVDD DNA_evaluationalternative training split | DRAKESATAC_acc | human-atac-catlasdifferent data source | |
| MDLM | 0.106 (6) | 0.381 ± 0.031 (6) | 0.367 (6) | 0.055 ± 0.006 (6) |
| MDLM+CG | 6.433 (3) | 6.191 ± 0.042 (2) | 0.852 (4) | 0.688 ± 0.022 (4) |
| DNA-Diff | 2.979 (5) | 3.038 ± 0.036 (5) | 0.479 (5) | 0.359 ± 0.009 (5) |
| DRAKES | 6.493 (2) | 6.031 ± 0.114 (4) | 0.863 (3) | 0.837 ± 0.005 (3) |
| SVDD | 9.479 (1) | 8.490 ± 0.064 (1) | 0.928 (1) | 0.899 ± 0.005 (1) |
| LocoGen | 6.285 (4) | 6.085 ± 0.014 (3) | 0.900 (2) | 0.846 ± 0.002 (2) |
S3.5 Robust to hyperparameter sweep
We ran a hyperparameter sweep of both our method and the baselines, sweeping each over the range specified in its paper or official repository. Across these sweeps, LOCOGEN retains its balanced three-axis advantage, confirming that the result does not rely on a cherry-picked configuration.
Table S10: Robustness to oracle choice (SK-N-SH). Same four oracles and conventions as Table S8; rank across the six methods in parentheses, values are mean ± s.d. where seed replicates are available.
| Activity | Accessibility | |||
|---|---|---|---|---|
| Method | DRAKES Pred-activity | SVDD DNA_evaluation alternative training split | DRAKES ATAC_acc | human-atac-catlas different data source |
| MDLM | 0.112 (5) | (6) | 0.391 (4) | (6) |
| MDLM+CG | 5.047 (4) | (4) | 0.429 (3) | (3) |
| DNA-Diff | 0.033 (6) | (5) | 0.079 (6) | (5) |
| DRAKES | 6.992 (2) | (2) | 0.879 (1) | (1) |
| SVDD | 7.989 (1) | (1) | 0.356 (5) | (4) |
| LocoGen | 5.304 (3) | (3) | 0.747 (2) | (2) |
A.

B.
| Method | Property | Novelty | Plausibility | |||
|---|---|---|---|---|---|---|
| Pred-activity | ATAC_acc | Authenticity | Rankly (OOD) | |||
| LOCOGEN (x=0.3) | 4.528 | 0.473 | 0.070 | 0.034 | 0.085 | 0.027 |
| LOCOGEN (x=0.5) | 4.407 | 0.688 | 0.090 | 0.058 | 0.089 | 0.041 |
| LOCOGEN (x=0.7) | 4.485 | 0.737 | 0.066 | 0.712 | 0.055 | 0.057 |
| LOCOGEN (x=1) | 3.002 | 0.633 | 0.017 | 0.712 | 0.048 | 0.007 |
| LOCOGEN (x=2) | 4.319 | 0.724 | 0.094 | 0.796 | 0.039 | 0.002 |
| MDLM+CG (cap=20) | 3.426 | 0.376 | 0.002 | 0.089 | 0.173 | 0.005 |
| MDLM+CG (cap=50) | 4.139 | 0.527 | 0.702 | 0.254 | 0.277 | 0.091 |
| MDLM+CG (cap=100) | 4.418 | 0.581 | 0.770 | 0.368 | 0.313 | 0.102 |
| SVDD (tweedie H=3) | 4.000 | 0.344 | 0.049 | 0.201 | 0.165 | 0.146 |
| SVDD (tweedie H=5) | 5.909 | 0.393 | 0.064 | 0.765 | 0.236 | 0.236 |
| SVDD (tss a=0.1) | 4.414 | 0.592 | 0.627 | 0.261 | 0.303 | 0.037 |
| SVDD (tss a=0.3) | 5.548 | 0.743 | 0.798 | 0.061 | 0.334 | 0.008 |
| SVDD (tss a=1.0) | 2.423 | 0.388 | 0.061 | 0.114 | 0.073 | 0.008 |
| SVDD (tweedie H=10) | 0.714 | 0.458 | 0.070 | 1.027 | 0.237 | 0.249 |
| DNA-Diff (g=0.0) | 1.698 | 0.454 | 0.011 | -0.106 | 0.041 | 0.027 |
| DNA-Diff (g=0.5) | 2.202 | 0.650 | 0.011 | -0.115 | 0.039 | 0.017 |
| DNA-Diff (g=1.0) | 2.554 | 0.677 | 0.044 | -0.106 | 0.002 | 0.009 |
| DRAKES (retrained) | 5.500 | 0.864 | 0.073 | 1.879 | 0.241 | 0.060 |
LOCOGEN
MDLM+CG
SVDD
DNA-Diff
DRAKES (retrained ref)
Figure S3: (A). Balanced score over three evaluation axis where LOCOGEN achieves the highest balanced score across sweep points. (B) Evaluation metrics across the sweep, with one row per hyperparameter setting. The value in parentheses indicates each method's strength setting: denotes OOD/calibration strength (ood_1lambda); r denotes the property-pull ratio (alpha_ratio) at (the paper default r = 3.0 corresponds to the row, while r = 1, 2 are lower-pull variants); cap denotes the MDLM+CG classifier-guidance -cap (alpha_cap); M denotes the number of SVDD candidates per step (Tweedie/SVDD-PM); denotes the SVDD-TDS importance-resampling temperature; and gs denotes the DNA-Diff classifier-free guidance scale (cond_weight; author default 1.0). DRAKES fine-tunes model weights for a fixed reward rather than steering generation at inference time, and is therefore included as a retraining reference rather than a directly comparable operating point.
S4 Discussion
S4.1 Limitations
Our experiments are conducted on a single backbone, MDLM, to isolate the effect of localized OOD guidance from backbone-dependent variation. Validation on alternative backbones, such as flow matching or autoregressive models, and a full comparison across backbones are left to future work. Computational evaluation alone, while standard in this domain, cannot substitute for in vivo experimental validation of generated sequences, a precondition for treating any sampling-time guidance method as practically useful.
S4.2 Social Impact
Our work may contribute to bioengineering by improving the ability to generate novel biological sequences beyond the training distribution. Such capability can expand the searchable design space and accelerate the discovery of sequences with useful properties. In practical settings, this could reduce the cost and time required for experimental screening, while supporting applications in therapeutic development, enzyme engineering, antibody design, and synthetic biology.
However, the broader impact of biological sequence generation depends on how the technology is used. Since generative models can produce sequences that differ substantially from naturally observed examples, they may also introduce biosafety and dual-use risks. For example, the same methods that help design beneficial proteins or regulatory elements could potentially be misused to explore harmful biological functions. Therefore, responsible use requires careful consideration of dataset provenance, model access, downstream experimental validation, and risk assessment tailored to the intended application.