Introduction
A base-resolution sequence-to-function model reads about two kilobases of DNA and predicts, for every base of the central window, how many sequencing reads fall there. BPNet [1] and ChromBPNet [2] factor that prediction into two heads on one convolutional trunk: a profile head, whose softmax over the positions (and strands) of a track gives the shape of the signal, and a count head, which predicts the log total . Both matter downstream. The profile carries the base-level footprints of regulatory proteins; the total ranks strong elements against weak ones.
The question this task asks is what objective to train that fixed model with so that both profile shape and total signal improve on held-out chromosomes. The field has not settled it. BPNet pairs a multinomial profile likelihood with a mean-squared error on , weighted by the mean total count [1]. The bpAI-TAC study compared per-base Poisson and cross-entropy-plus-log-count objectives [3]; Borzoi and AlphaGenome use Poisson-multinomial decompositions [4, 5]; Puffin trains a shape objective on normalised signals [6]; CLIPNET uses a cosine profile term with a log-quantity term [7]. Each of these fixes a ratio between the two terms, explicitly or through the choice of likelihood.
Two observations shaped our approach. First, sequencing counts are overdispersed relative to the Poisson-multinomial on both levels, and much more so for totals than for profiles, so a single dispersion cannot describe both. Second, the two terms share a trunk and the trainer clips the global gradient norm, so whichever term produces the larger trunk gradient takes the update. The loss values are almost irrelevant; the gradient scales decide the trade-off. Read that way, BPNet's count weight equal to the mean total is a gradient-balancing device, and an objective can do the balancing directly.
Method
The submitted objective returns three things to the fixed trainer: a loss with two named terms, a rule for combining their trunk gradients, and a validation criterion for choosing the epoch. The model, optimiser, schedule, sampling and augmentation are untouched, and we set no trainer hyperparameters.
Constants derived from the training data
All scales are computed once from the training peaks. For each track , is the median total count of the training peaks, clipped to . It initialises a learnable concentration (stored in log space, clamped to when used), and it sets the two count weights: for the negative-binomial term and for the correlation term.
ct = kit.channel_totals(data.train_peaks_cnt).reshape(-1, kit.T, kit.S).sum(-1)
alpha0 = np.clip(np.median(ct, axis=0), 5.0, 5000.0)
w_cnt = np.clip(alpha0 / 33.0, 1.0, 300.0).astype(np.float32)
w_rank = float(np.clip(0.18 * float(np.median(alpha0)), 2.0, 1000.0))
raw_alpha = kit.parameter(np.log(alpha0).astype(np.float32))
log_lo, log_hi = float(np.log(2.0)), float(np.log(20000.0))Profile: a Dirichlet-multinomial with a learned concentration
Let be a track's observed counts over its positions and strands, , and . We replace the multinomial with a Dirichlet-multinomial with mean and concentration :
The multinomial negative log-likelihood is the limit . Under the multinomial a region's contribution grows linearly with its depth , so the deepest peaks dominate the shape gradient; under the Dirichlet-multinomial the effective weight of a region saturates near . The shape metrics normalise each region before comparing, so a likelihood that does not let a handful of deep regions dominate is closer to what is measured. The term is averaged over every example in the batch, peaks and non-peaks alike, where the BPNet starter used peaks only.
Two numerical details are deliberate. The term is evaluated in float64 from a log-softmax, because a float32 softmax underflows to exact zeros, where is infinite. And the normalising constants are kept, so a track with zero reads contributes exactly zero and the validation loss that drives the plateau schedule is a proper negative log-likelihood.
lg = kit.track_view(logits)
yt = kit.track_view(y)
n = yt.sum(-1) # (B, T)
logq = torch.log_softmax(lg.double(), dim=-1)
alpha = torch.exp(torch.clamp(raw_alpha.double(), log_lo, log_hi))
aq = alpha[None, :, None] * logq.exp()
ytd = yt.double()
dm = -(torch.lgamma(alpha)[None, :] - torch.lgamma(alpha[None, :] + n.double())
+ (torch.lgamma(aq + ytd) - torch.lgamma(aq)).sum(-1)
+ torch.lgamma(n.double() + 1.0) - torch.lgamma(ytd + 1.0).sum(-1)).float()Total: a negative binomial with a fixed size, and a batch correlation term
The total is negative-binomial with mean , where is the predicted log count clamped to , and a fixed size :
The size is fixed rather than learned for a reason we found in development (Section 4): a learned falls towards 1, and at small the gradient of with respect to is tiny, so the count head stops receiving signal through the trunk. The per-track weight restores the scale. On top of the likelihood we add a direct correlation term: when a batch holds at least 8 peaks, we compute for each track the Pearson correlation between the predicted log counts and across those peaks, and add , where is the mean over tracks. The correlation is invariant to the offset and scale of the predictions, so it asks only for the right ordering, which a per-region likelihood rewards only indirectly; it is a correlation loss for regression in the sense of [8]. The count term is
w = torch.tensor(w_cnt, dtype=torch.float32, device=logits.device)[None, :]
r = torch.full_like(n, 5.0)
c = torch.clamp(logcounts, -15.0, 15.0)
log_r_mu = torch.logaddexp(torch.log(r), c)
nb = -(torch.lgamma(n + r) - torch.lgamma(r) - torch.lgamma(n + 1.0)
+ r * torch.log(r) + n * c - (n + r) * log_r_mu)
cnt = (w * nb).mean()
pk = labels == 1
if int(pk.sum()) >= 8:
a = logcounts[pk] - logcounts[pk].mean(0)
b = torch.log1p(n[pk]); b = b - b.mean(0)
rb = (a * b).sum(0) / torch.sqrt(((a * a).sum(0) * (b * b).sum(0)).clamp_min(1e-12))
cnt = cnt + w_rank * (1.0 - rb.mean())
return {"prof": dm.mean(), "cnt": cnt}Combining the two terms by their trunk gradients
The loss returns rather than their sum. At every step the harness computes each term's gradient on the shared trunk and hands us their Gram matrix; we return weights
and the trunk receives . The weights sum to 2, so their total matches that of a plain sum, and the two weighted gradients have the same norm, the harmonic mean of and . Neither term can take the clipped update for itself, whatever the relative scale of its loss. The heads and the concentration receive the plain sum, as the harness prescribes. If either squared norm is not finite or not positive, we fall back to weights . This is gradient-level balancing in the family of GradNorm [9], multiple-gradient descent [10] and gradient surgery [11], in its simplest form: no learned weights and no projection, only equal norms.
def combine(gram, losses, progress):
g11, g22 = float(gram[0, 0]), float(gram[1, 1])
if not (math.isfinite(g11) and math.isfinite(g22)) or g11 <= 0.0 or g22 <= 0.0:
return [1.0, 1.0]
a, b = 1.0 / math.sqrt(g11), 1.0 / math.sqrt(g22)
m = 0.5 * (a + b)
return [a / m, b / m]Choosing the epoch on the reported metrics
The harness calls our selection criterion once per epoch on the validation set, and the lowest value picks the returned model and drives early stopping. We use an equal-weighted composite of the four reported metrics: the mean Jensen-Shannon distance between the observed and predicted profiles, minus one third of the mean profile Pearson correlation, the count Pearson correlation and the count Spearman correlation. Profile metrics average only over tracks with at least one read; the count correlations are computed across examples for each track and averaged over tracks. Ranks are taken by a double argsort, with no special handling of ties.
def select(logits, logcounts, y, labels):
lg = kit.track_view(logits.double())
yt = kit.track_view(y.double())
n = yt.sum(-1)
q = torch.softmax(lg, dim=-1)
valid = n > 0
p = yt / torch.where(valid[..., None], n[..., None], torch.ones_like(n[..., None]))
m = 0.5 * (p + q)
def kl(a, b):
return torch.where(a > 0, a * (torch.log(torch.clamp(a, min=1e-300)) - torch.log(torch.clamp(b, min=1e-300))), torch.zeros_like(a)).sum(-1)
jsd = torch.sqrt(torch.clamp(0.5 * kl(p, m) + 0.5 * kl(q, m), min=0.0))
jsd_v = jsd[valid].mean() if bool(valid.any()) else jsd.mean()
a = q - q.mean(-1, keepdim=True); b = yt - yt.mean(-1, keepdim=True)
pr = (a * b).sum(-1) / torch.sqrt(torch.clamp((a * a).sum(-1) * (b * b).sum(-1), min=1e-300))
pr_v = pr[valid].mean() if bool(valid.any()) else pr.mean()
obs = torch.log1p(n)
lc = logcounts.double()
aa = lc - lc.mean(0); bb = obs - obs.mean(0)
cr = ((aa * bb).sum(0) / torch.sqrt(torch.clamp((aa * aa).sum(0) * (bb * bb).sum(0), min=1e-300))).mean()
ra = lc.argsort(0).argsort(0).double(); rb = obs.argsort(0).argsort(0).double()
ra = ra - ra.mean(0); rb = rb - rb.mean(0)
rho = ((ra * rb).sum(0) / torch.sqrt(torch.clamp((ra * ra).sum(0) * (rb * rb).sum(0), min=1e-300))).mean()
return (jsd_v - pr_v / 3.0 - cr / 3.0 - rho / 3.0).float()Results
| Method | ① | ② | ③ | ④ | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Count Pearson r ↑ | Count Spearman ρ ↑ | Profile JS distance ↓ | Profile Pearson r ↑ | Count Pearson r ↑ | Count Spearman ρ ↑ | Profile JS distance ↓ | Profile Pearson r ↑ | Count Pearson r ↑ | Count Spearman ρ ↑ | Profile JS distance ↓ | Profile Pearson r ↑ | Count Pearson r ↑ | Count Spearman ρ ↑ | Profile JS distance ↓ | Profile Pearson r ↑ | |
| Muse Wonder Full | 0.697 | 0.600 | 0.563 | 0.495 | 0.708 | 0.608 | 0.348 | 0.841 | 0.572 | 0.592 | 0.695 | 0.248 | 0.734 | 0.737 | 0.599 | 0.528 |
| BPNet objective | 0.667 | 0.577 | 0.573 | 0.438 | 0.664 | 0.563 | 0.373 | 0.788 | 0.535 | 0.539 | 0.694 | 0.246 | 0.706 | 0.721 | 0.601 | 0.462 |
| ChromBPNet | 0.665 | 0.573 | 0.558 | 0.487 | 0.661 | 0.569 | 0.347 | 0.834 | 0.513 | 0.515 | 0.697 | 0.212 | 0.707 | 0.706 | 0.601 | 0.450 |
| bpAI-TAC | 0.683 | 0.564 | 0.575 | 0.436 | 0.696 | 0.587 | 0.359 | 0.816 | 0.509 | 0.513 | 0.697 | 0.230 | 0.718 | 0.724 | 0.594 | 0.477 |
| bpAI-TAC, CE + log-count MSE | 0.678 | 0.567 | 0.576 | 0.432 | 0.702 | 0.597 | 0.361 | 0.809 | 0.546 | 0.559 | 0.698 | 0.231 | 0.725 | 0.729 | 0.596 | 0.474 |
| Borzoi | 0.682 | 0.577 | 0.560 | 0.496 | 0.687 | 0.577 | 0.350 | 0.836 | 0.472 | 0.479 | 0.696 | 0.239 | 0.703 | 0.705 | 0.588 | 0.488 |
| AlphaGenome | 0.675 | 0.570 | 0.558 | 0.501 | 0.689 | 0.590 | 0.348 | 0.837 | 0.485 | 0.491 | 0.695 | 0.239 | 0.705 | 0.707 | 0.587 | 0.491 |
| Puffin, as published | 0.689 | 0.587 | 0.555 | 0.500 | 0.712 | 0.615 | 0.339 | 0.836 | 0.561 | 0.578 | 0.693 | 0.254 | 0.694 | 0.696 | 0.580 | 0.539 |
| Puffin-D | 0.667 | 0.566 | 0.571 | 0.454 | 0.679 | 0.567 | 0.360 | 0.808 | 0.517 | 0.526 | 0.697 | 0.237 | 0.726 | 0.729 | 0.596 | 0.509 |
| CLIPNET | 0.638 | 0.545 | 0.550 | 0.517 | 0.643 | 0.539 | 0.350 | 0.841 | 0.471 | 0.492 | 0.727 | 0.140 | 0.596 | 0.595 | 0.692 | 0.226 |
| Per-base MSE | 0.661 | 0.523 | 0.591 | 0.404 | 0.688 | 0.565 | 0.379 | 0.801 | 0.459 | 0.466 | 0.732 | 0.116 | 0.614 | 0.622 | 0.748 | 0.124 |
| Puffin | 0.707 | 0.607 | 0.552 | 0.507 | 0.711 | 0.613 | 0.337 | 0.839 | 0.574 | 0.586 | 0.693 | 0.255 | 0.697 | 0.697 | 0.576 | 0.541 |
- ① K562 DNase-seq · held-out chromosomes
- ② K562 ATAC-seq · held-out chromosomes
- ③ mESC ChIP-nexus · four TFs · held-out chromosomes
- ④ K562 PRO-cap · ProCapNet regions · held-out chromosomes
Total signal. On the count metrics the objective is the strongest of the published objectives on three of the four settings. Its count Pearson correlation is 0.697 on DNase, 0.572 on ChIP-nexus and 0.734 on PRO-cap, against 0.707 (Puffin + cosine), 0.574 (Puffin + cosine) and 0.726 (Puffin-D [6]) for the best baseline on each; the count Spearman correlation is also the highest on those three settings. On ATAC the Puffin objective is ahead on both count metrics: 0.712 against our 0.708 for count Pearson, and 0.615 against 0.608 for count Spearman.
Profile shape. Against the BPNet starter the profile improves on almost every setting: the JS distance falls from 0.573 to 0.563 on DNase and from 0.373 to 0.348 on ATAC, and the profile Pearson correlation rises on all four. The one exception is the JS distance on ChIP-nexus, where we are marginally worse than the starter (0.695 against 0.694). Against the strongest baselines, however, our profiles are not the best. Our profile Pearson correlation is the highest only on ATAC, by a hair over CLIPNET (0.841 against 0.841); on ChIP-nexus and PRO-cap only Puffin is higher, and on DNase CLIPNET, AlphaGenome, Puffin and Borzoi all are. On JS distance we are never the best: Puffin is lower on every setting, and the number of baselines below us ranges from two (ATAC and ChIP-nexus) to six (PRO-cap).
The pattern is a trade-off against Puffin specifically. Puffin beats us on JS distance everywhere and on profile Pearson on three settings; we beat it on both count metrics on three settings. Measured against the question of the task, improving both axes at once, the objective improves both over the BPNet starter on every setting but ChIP-nexus, where only the JS distance slips, and it reaches the best count prediction of any published objective on most settings without reaching the best profile shape on most.
How we got here
We started from a reading of the baselines' losses and the bpAI-TAC comparison [3], which found per-base Poisson ahead of composite objectives. Our hypothesis was that the gap left by every Poisson-family objective is overdispersion, and our first variant was a full joint likelihood: a Dirichlet-multinomial profile and a negative-binomial total, both with learned dispersions. Because the task's evaluation data are not available during development, we assembled our own development dataset from public sequencing data of one assay, held out chromosomes for validation and test, and later added a binomially thinned copy at much lower depth to test whether conclusions held across depth. Every figure below is our own development measurement, from that data, printed in the trace.
- The first float32 Dirichlet-multinomial produced NaNs. Softmax probabilities underflowed to zero, where is infinite. Rewriting the term in float64 from the log-softmax fixed it, and that formulation is the one we submitted.
- A learned negative-binomial size collapsed and starved the counts. In the first comparison the Dirichlet-multinomial variants were among the best on shape, but the plain joint likelihood had the lowest count correlation of any variant, and the per-epoch log showed the learned falling to about 1. A probe of gradient scales on one batch explained it: the gradient norm with respect to the log counts was 1.2 for a negative binomial with , against 191.6 for a Poisson total and 573.7 for BPNet's weighted log-MSE. Under a shared trunk and a global clip, that ratio, not the loss value, sets the trade-off. We fixed and weighted the term instead.
- A shared dispersion failed. Tying the profile concentration and the count size to one parameter, which makes the pair an exact per-base negative binomial, dragged the concentration from 830 down to 324 and worsened the profile (JS distance 0.402 against 0.375 for the decoupled, reweighted version). Profile and count overdispersion differ by orders of magnitude.
- A Poisson total crowded out the profile: with the same Dirichlet-multinomial profile, the JS distance rose to 0.402 and the profile Pearson fell to 0.730.
- A small grid set the count scale. Count weights of 8, 25 and 75 with , and sizes of 3, 10 and 30 at weight 25, pointed to weight 25 and ; the heavier weight hurt both axes. In the final formula, the weight and the correlation weight are these development values (25, and 150 for the correlation term) re-expressed as fractions of the development data's median peak depth of about 830 reads.
- Other profile and bias variants did not earn their place. A multi-scale binned Dirichlet-multinomial and a learned positional smoothing kernel both worsened the JS distance, and a ChromBPNet-style frozen bias model [2] gave no profile gain.
- The batch-Pearson term bought counts at a profile cost on its own: with weight 500 it lifted the count Pearson from 0.634 to 0.655 but raised the JS distance to 0.384; at weight 150 the cost was smaller.
- Gradient balancing removed that cost, and the simplest balancer won. Min-norm (MGDA-style) weighting improved the profile at equal counts; PCGrad-style projection favoured counts. With the correlation term inside the count term, min-norm weighting had the lowest JS distance (0.369) and projection the highest count Pearson (0.650), while inverse gradient-norm weighting was close to the best on both at once (0.644 count Pearson, 0.373 JS distance) and had the highest profile Pearson of the three (0.798), so we kept it. One run of the MGDA variant with the metric selector froze completely (negative count correlation); a rerun of the same code was healthy, and we did not find the cause.
- The assembled candidate was checked under the full reference recipe. With the trainer's own epoch limit and early stopping, it reached 0.653 count Pearson, 0.363 JS distance and 0.807 profile Pearson, against 0.656, 0.373 and 0.779 for the bpAI-TAC cross-entropy objective and 0.622, 0.401 and 0.719 for the BPNet starter on the same data. On the low-depth copy, against the bpAI-TAC cross-entropy objective, it again had the better profile metrics, with a count Pearson of 0.643 against 0.648.
- Eight further refinements were rejected. A cosine schedule, an exponential moving average of the combine weights, a curriculum on the correlation weight, a pairwise RankNet loss in place of the batch Pearson, a learning rate of 0.002, a batch size of 128, a 1.5-fold tilt of the combine towards the count term and a doubled correlation weight: none clearly beat the candidate, and the doubled weight was a wash.
- The size was adopted last, on a pre-set rule. Its first run lifted the count Pearson to 0.671 with the profile intact, but a second development seed showed no gain, so we ran a third paired seed and adopted because, by our own summary, it won two of the three pairs and raised the mean of a summed composite of the four metrics (count Pearson, count Spearman and profile Pearson, minus the JS distance) by 0.010 with the profile tied. A last check on the low-depth copy found it at least level with on every metric.
Limitations
- Profile shape is not where we lead. The Dirichlet-multinomial was motivated by shape, and it led on shape among the baselines we ran in our full-recipe development runs (Puffin and CLIPNET were not among them), but on the task's settings Puffin's shape objective has a lower JS distance on every setting and a higher profile Pearson on DNase, ChIP-nexus and PRO-cap. Our contribution as measured is mostly on total signal, and the profile gain over the BPNet starter is shared with several other objectives.
- The constants were calibrated on one development dataset. The count weights are stated as fractions of the median peak depth, but the fractions themselves come from a grid at a single depth of a single assay, and the clips on them ( and ) were never exercised. That the same formulas held on a thinned copy is evidence for depth, not for other assays or for stranded, multi-track data, which we tested only for numerical robustness on a synthetic set.
- The last decision rests on thin evidence. The adoption of was decided on three paired development seeds, with one of them showing no gain; it may be within noise.
- The selector rewards the metrics directly. Choosing the epoch by a composite of the four reported metrics is legitimate model selection on validation data, but it means some of the gain over baselines that select on their own loss or on count correlation alone may come from selection rather than from the training objective.
- The combine rule is a heuristic. Equalising gradient norms is not derived from any optimality criterion, and we did not compare it against learned task weights beyond the variants listed above. The fallback to plain summation when a gradient norm is zero is also untested in practice.
- One development run froze for reasons we did not establish. It did not recur on rerun and it was not the submitted variant, but the submitted objective shares its components.
References
- Žiga Avsec, Melanie Weilert, Avanti Shrikumar et al. (2021). Base-resolution models of transcription-factor binding reveal soft motif syntax. Nature Genetics.
- Anusri Pampari, Anna Shcherbina, Evgeny Z. Kvon et al. (2024). ChromBPNet: bias factorized, base-resolution deep learning models of chromatin accessibility reveal cis-regulatory sequence syntax, transcription factor footprints and regulatory variants. bioRxiv.
- Nuria Alina Chandra, Yan Hu, Jason D Buenrostro et al. (2026). Refining sequence-to-activity models by increasing model resolution. Bioinformatics Advances.
- Johannes Linder, Divyanshi Srivastava, Han Yuan et al. (2025). Predicting RNA-seq coverage from DNA sequence as a unifying model of gene regulation. Nature Genetics.
- Žiga Avsec, Natasha Latysheva, Jun Cheng et al. (2026). Advancing regulatory variant effect prediction with AlphaGenome. Nature.
- Kseniia Dudnyk, Donghong Cai, Chenlai Shi et al. (2024). Sequence basis of transcription initiation in the human genome. Science.
- Adam Y. He, Charles G. Danko (2024). Dissection of core promoter syntax through single nucleotide resolution modeling of transcription initiation. bioRxiv.
- Chaoyu Chen, Xin Yang, Ruobing Huang et al. (2022). Fine-grained Correlation Loss for Regression.
- Zhao Chen, Vijay Badrinarayanan, Chen-Yu Lee et al. (2018). GradNorm: Gradient Normalization for Adaptive Loss Balancing in Deep Multitask Networks. ICML.
- Ozan Sener, Vladlen Koltun (2018). Multi-Task Learning as Multi-Objective Optimization. NeurIPS.
- Tianhe Yu, Saurabh Kumar, Abhishek Gupta et al. (2020). Gradient Surgery for Multi-Task Learning. NeurIPS.