Introduction
Base-resolution sequence-to-function models predict, from about two kilobases of DNA, the read counts of an assay at every base of the central kilobase. BPNet [1] factorises the prediction into a profile, a softmax over positions (and strands) that says where the reads fall, and a total, a predicted log count that says how many there are. The fixed model of this task is that architecture, trained by the reference optimiser, sampling and augmentation; what a submission changes is the training objective, together with the validation criterion that picks the returned epoch. The question is whether an objective can improve both the profile shape and the total-signal prediction on held-out chromosomes.
The starting point is BPNet's own objective: a multinomial negative log-likelihood of the observed counts on peaks, plus a squared error on , the log total, on peaks and background, the latter multiplied by the mean per-channel total count of the training peaks. The field has since tried almost every alternative shape for this objective: a frozen bias model that absorbs assay bias [2], a single per-base Poisson likelihood or a cross-entropy with a log-count error [3], a Poisson–multinomial split [4, 5], a scale-free shape term [6] and a cosine profile loss with a lightly weighted log-quantity loss [7]. Two features of the problem make the choice hard, and our method is a response to each.
The shape term and the count term pull on the same features. Both heads read one convolutional trunk, and a weight that makes one term win on one dataset makes the other win on the next: the right balance depends on depth, sparsity and the number of tracks, none of which an objective may look up by name.
The losses are per-region, the metrics are not. Count Pearson r and count Spearman ρ are correlations across regions; a squared error on each region's log count is only a proxy for them. The multinomial likelihood, in turn, weights each region by its read depth, while the profile metrics average over regions with equal weight.
Method
Our objective, CG3 (conflict-gated three-risk balancing), has three ingredients: three risks that each target one aspect of the metrics, a rule for combining their gradients on the shared trunk, and a checkpoint criterion made of the metrics themselves.
Three risks
Write for the observed counts of track at position (the strands of a track are joined into one profile), for its total, for the predicted profile and for the predicted log total.
Shape. With a single track, the shape risk is the cross-entropy against the normalised observed profile, averaged over the peaks of the batch,
Since , the multinomial likelihood is this cross-entropy weighted by each region's depth : relative to a count term scaled by the mean peak total, BPNet's objective weights each peak's cross-entropy in proportion to its depth. We weight every peak equally, which is how the profile metrics weight them. With several tracks we keep the depth weighting and sum over tracks, normalising by , the mean per-track total of the training peaks:
Count. A squared error on the log total, on peaks and background alike, , with unit weight. It anchors the scale of , which a correlation alone leaves free.
Rank. A batch-level risk that targets the ordering of regions directly. Over the peaks of a batch we rank the observed log totals and take the Pearson correlation of the predicted log totals with those ranks, per track:
The target is a fixed vector of hard ranks (ties broken by the sort), so the gradient flows only through , and the risk rewards predictions that are linear in the observed rank, a differentiable stand-in for Spearman ρ. The correlation helper clamps the product of variances before the square root, so a batch or a track with no spread, or with no reads at all, gives a finite gradient.
depth = 1.0
if kit.T > 1:
totals = kit.channel_totals(data.train_peaks_cnt)
totals = totals.reshape(len(totals), kit.T, kit.S).sum(-1)
depth = max(float(totals.mean()), 1.0)
def corr(a, b, dim=0):
a = a - a.mean(dim=dim, keepdim=True)
b = b - b.mean(dim=dim, keepdim=True)
variance = (a * a).sum(dim=dim) * (b * b).sum(dim=dim)
den = torch.sqrt(variance.clamp_min(1e-24))
return (a * b).sum(dim=dim) / den
def ranks(x):
order = torch.argsort(x, dim=0)
result = torch.empty_like(x)
values = torch.arange(x.shape[0], device=x.device, dtype=x.dtype)
result.scatter_(0, order, values.unsqueeze(1).expand_as(x))
return result def loss(logits, logcounts, y, labels, progress):
target = torch.log1p(kit.track_view(y).sum(-1))
count = ((logcounts - target) ** 2).mean()
pk = labels == 1
if not bool(pk.any()):
zero = count * 0.0
return {"shape": zero, "count": count, "rank": zero}
lp, lc, yy = logits[pk], logcounts[pk], y[pk]
yt = kit.track_view(yy)
logp = torch.log_softmax(kit.track_view(lp), dim=-1)
if kit.T == 1:
q = yt / yt.sum(-1, keepdim=True).clamp_min(1.0)
shape = -(q * logp).sum(-1).mean()
else:
shape = -(yt * logp).sum(-1).sum(-1).mean() / depth
observed = torch.log1p(yt.sum(-1))
rank = -corr(lc, ranks(observed)).mean()
return {"shape": shape, "count": count, "rank": rank}Conflict-gated balancing on the trunk
The three risks are returned separately, and the harness hands us the Gram matrix of their gradients with respect to the shared trunk (the first convolution and the dilated residual layers). We return one weight per risk; the trunk's gradient is , while the heads receive the plain sum. Let and for the two auxiliary risks . Two candidate weightings are formed. The mixed weights average unit weights with a softened inverse-norm weighting,
so a risk with a small gradient is lifted and one with a large gradient damped, and with three risks every mixed weight lies between one half and two. The anchored weights keep the shape weight at one and cap each auxiliary gradient's norm at the shape gradient's,
The rule chooses between them per auxiliary risk, from the sign of its cosine with the shape gradient:
When the count or rank gradient agrees with the shape gradient (or is exactly orthogonal to it) it is allowed to be scaled up; when it opposes it, it may still move the trunk, but never with a larger step than the shape risk takes. The rule reads only the current Gram matrix, so it adapts per step and per dataset without any switch on the identity of the data.
def combine(gram, losses, progress):
norms = torch.diag(gram).clamp_min(1e-20).sqrt()
ones = torch.ones(len(losses), dtype=gram.dtype)
inverse = norms.rsqrt()
mixed = 0.5 * (ones + inverse / inverse.mean())
anchored = ones.clone()
anchored[1:] = (norms[0] / norms[1:]).clamp_max(1.0)
cosine = gram[0, 1:] / (norms[0] * norms[1:])
weights = mixed.clone()
weights[1:] = torch.where(cosine < 0, anchored[1:], mixed[1:])
if bool((cosine < 0).any()):
weights[0] = 1.0
return weightsSelecting the checkpoint on the metrics
The fixed trainer keeps the epoch with the lowest validation selection value. Without a criterion of our own it would be the validation loss; we instead compute, on the validation peaks, the four metrics the task reports and combine them with equal weight,
where is the Pearson correlation of with , the Spearman correlation of with , JSD the square root of the Jensen–Shannon divergence between and per region and track, and the mean per-region Pearson correlation of with the observed counts (non-finite values set to zero). The plateau schedule is left on the training risk's validation value, as the harness fixes it.
def select(logits, logcounts, y, labels):
yt = kit.track_view(y)
observed = yt.sum(-1)
count_r = corr(logcounts, torch.log1p(observed)).mean()
rank_r = corr(ranks(logcounts), ranks(observed)).mean()
logp = torch.log_softmax(kit.track_view(logits), dim=-1)
p = torch.exp(logp)
q = yt / yt.sum(-1, keepdim=True).clamp_min(1.0)
m = 0.5 * (p + q)
logm = torch.log(m.clamp_min(1e-30))
js = 0.5 * (torch.xlogy(q, q) - q * logm + p * (logp - logm)).sum(-1)
jsd = torch.sqrt(js.clamp_min(0.0)).median()
a = p - p.mean(-1, keepdim=True)
b = yt - yt.mean(-1, keepdim=True)
variance = (a * a).sum(-1) * (b * b).sum(-1)
profile_r = (a * b).sum(-1) / torch.sqrt(variance.clamp_min(1e-6))
profile_r = torch.nan_to_num(profile_r, nan=0.0, posinf=0.0, neginf=0.0).mean()
return -count_r - rank_r + jsd - profile_rCG3 adds no parameters, trains no bias model and sets no trainer hyperparameters: the epoch limit, patience, learning rate and schedule are the reference recipe's. Its only dataset-level branch is on the number of tracks, which is a field of the task's interface.
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 ↑ | |
| Kimi K3.1 Pro | 0.680 | 0.589 | 0.566 | 0.470 | 0.687 | 0.590 | 0.362 | 0.806 | 0.534 | 0.557 | 0.696 | 0.238 | 0.727 | 0.735 | 0.588 | 0.492 |
| 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
Against the objective it replaces, CG3 is better on every metric on three of the settings. On DNase, count Pearson r goes from 0.667 to 0.680, profile JSD from 0.573 to 0.566 and profile Pearson r from 0.438 to 0.470; on ATAC count Spearman ρ goes from 0.563 to 0.590; on PRO-cap profile Pearson r goes from 0.462 to 0.492. So the objective does improve shape and total together relative to BPNet, which is what the research question asks.
Against the whole published field the picture is narrower. Our count metrics are strong: on PRO-cap CG3 has the highest count Pearson r (0.727, against 0.726 for Puffin-D [6]) and the highest count Spearman ρ (0.735, against 0.729), and on DNase it has the highest count Spearman ρ (0.589, against 0.607 for Puffin + cosine). Our profile metrics are not: on ATAC the profile Pearson r of 0.806 is below the 0.841 of CLIPNET [7] and below most other published objectives, and on DNase the best profile JSD is 0.550 (CLIPNET [7]), against our 0.566.
The Puffin shape objective [6] is better than CG3 on all four metrics on ATAC and on ChIP-nexus (on ATAC, for example, a count Pearson r of 0.712 and a profile JSD of 0.339). On ChIP-nexus, CG3 improves on BPNet only in count Spearman ρ (0.557 against 0.539), is level with it in count Pearson r (0.534 against 0.535) and is slightly worse on both profile metrics (a profile Pearson r of 0.238 against 0.246).
How we got here
Our first observation was about the interface rather than the loss: the fixed trainer lets the early-stopping criterion differ from the training objective, while the plateau schedule still follows the training objective, so model selection can be aligned with the metrics without changing what is optimised. The rest of the design came from a long series of controlled screens on subsets of the training regions, scored on validation peaks the agent held out from selection.
- Equal-region cross-entropy against depth-weighted likelihood. The count distributions have a very high dynamic range and sparse profiles, which made depth weighting a first-order question. No single shape weighting won everywhere: equal-region cross-entropy helped counts on one dataset, the depth-weighted likelihood helped profile correlation on another, and BPNet's objective was strongest on a third.
- The rank term was the clearest early gain. In the first screen, adding the rank risk raised count Pearson and Spearman "by roughly 0.07–0.10 over equal-region cross-entropy, without a consistent shape penalty", in the agent's words. The agent's notes cite work on correlation losses for regression [8] as support for an explicit rank-alignment term with the squared error retained. A later test showed the gain needs the trunk: keeping the rank gradient off the trunk and on the count head only gave, in the agent's development runs, a count Pearson of 0.592 on that dataset, below the 0.622 of cross-entropy without any rank term.
- Plain inverse-norm balancing was unsafe. Equalising the three trunk gradients by their inverse norms was excellent on two datasets and damaged two others, with large spikes in the validation loss (on one dataset from about 6.5 to 50.5 within two epochs). The agent's diagnosis was that inverse-norm weights let the auxiliary count gradients dominate the shape gradient. Capping each auxiliary norm at the shape norm (the anchored weights) did not cure the datasets where the spikes had appeared, which still showed them, while averaging inverse-norm with unit weights (the mixed weights) did better there. In repeated runs, anchoring was reproducibly best on two datasets and mixing on a third, which strengthened the case for choosing between them from the measured gradient conflict rather than from the identity of the data. Of the variants then tried (a fixed blend of the two, a clipped inverse-norm weighting and the conflict-gated rule), the conflict-gated rule was the first that tracked the better rule on the two datasets where anchoring failed while keeping most of anchoring's gains on the other two.
- The metric-aligned criterion and the balancing each earned their place. In the agent's component ablation at a larger subset scale, on three datasets, the full method against the same risks with neither balancing nor the metric criterion moved count Pearson / count Spearman / median JSD / per-region profile Pearson from 0.718 / 0.702 / 0.668 / 0.339 to 0.725 / 0.711 / 0.637 / 0.405, from 0.618 / 0.518 / 0.427 / 0.678 to 0.627 / 0.514 / 0.399 / 0.734, and from 0.537 / 0.412 / 0.623 / 0.307 to 0.563 / 0.443 / 0.607 / 0.374: better JSD, profile correlation and count Pearson on all three, and a small loss in count Spearman on one. Removing only the rank risk lowered count Pearson on all three (to 0.720, 0.619 and 0.550), but it gave better profile metrics on one of them and a slightly better profile correlation on another, so the rank risk is not free.
- The multi-track branch. On the data with several tracks, the single-track recipe kept the count gains but lost profile quality to BPNet. A per-track depth-normalised likelihood without the sum over tracks did not recover it, while summing over tracks did, also over three repeats. The agent concluded that the useful mechanism is the stronger per-track shape weight that the track sum gives, not the likelihood itself. Using the summed likelihood everywhere was rejected because it degraded shape on the single-track data. A cross-entropy doubled in weight with anchored balancing was statistically indistinguishable on the multi-track data across repeats; the summed likelihood was kept because it retained a small shape advantage at full scale, and a later test showed the doubled cross-entropy hurting two single-track datasets.
- Directions closed. A direct Jensen–Shannon training loss first diverged to non-finite values through softmax underflow; in a stable form at low weight (0.05 and 0.1) it did not improve the overall trade-off, and at 0.1 it helped one dataset's shape and hurt another's. Multiscale (binned) shape supervision was negative, consistent with the finding that coarse binning underperforms base resolution [3]. Pairwise ranking losses, reliability-weighted pairs, a trimmed KL risk, a soft-rank Spearman surrogate, per-track count standardisation, compressed (square-root or log) targets in the manner of the scale-free shape objective, shape supervision on background regions, a per-region profile-correlation auxiliary, tie-averaged rank targets (0.3796 / 0.4152 against 0.3872 / 0.4271 count Pearson / Spearman on a downsampled, tie-heavy subset), an auxiliary Poisson total-count term at fixed or depth-normalised weight, smoothing of the validation criterion, and a larger batch were all tried and dropped.
The agent also checked that the gains survived binomial downsampling of the counts to a quarter of their depth on two datasets. On full training sets it reported, against its own run of the BPNet objective on held-out validation peaks, improvements in every metric on two datasets, in three of the four on a third (count Spearman essentially tied), and in the count metrics on the fourth, where BPNet kept a very small profile edge. The multi-task gradient literature the agent read [9, 10, 11, 12, 13] framed the balancing rule as a conservative safeguard against conflicting gradients rather than a blind equalisation.
Limitations
- Profile shape is not where the gains are. CG3 improves profile JSD and profile Pearson r over BPNet on three settings, but against the field its profile metrics are mid-table or lower, and on ATAC its profile Pearson r is below most published objectives. The published scale-free shape objective is better than CG3 on every metric on ATAC and ChIP-nexus. The research question asks for both; CG3 delivers both only relative to BPNet.
- ChIP-nexus is essentially untouched. There CG3 improves only count Spearman ρ over BPNet, and is slightly worse on both profile metrics.
- The rank risk is a noisy surrogate. It is computed within a batch, over its peaks only, against hard ranks with ties broken by the sort; the agent's own ablation shows it trading a little profile quality for count Pearson on two of the three datasets it covered.
- The balancing rule is tuned, not derived. The softened exponent ( rather than ), the equal blend with unit weights, the norm cap and the sign test on the cosine were chosen by screening. The rule also needs a separate backward pass per risk; in the agent's full-data development run on one dataset, training took about twice as long as with BPNet's objective.
- The multi-track branch rests on thin evidence. It was chosen on the one development dataset with several tracks, and the agent's late test on one- and two-track subsets of that data favoured the doubled cross-entropy with anchoring over the submitted rule.
- Two weights are set by fiat. The checkpoint criterion weights the four metrics equally, and the count risk enters with unit weight before balancing, where BPNet's count term was scaled by the mean per-channel total of the training peaks.
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.
- Tianhe Yu, Saurabh Kumar, Abhishek Gupta et al. (2020). Gradient Surgery for Multi-Task Learning. NeurIPS.
- Bo Liu, Xingchao Liu, Xiaojie Jin et al. (2021). Conflict-Averse Gradient Descent for Multi-task Learning. NeurIPS.
- 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.
- Aviv Navon, Aviv Shamsian, Idan Achituve et al. (2022). Multi-Task Learning as a Bargaining Game. ICML.