Shorkie_LM
masked DNA language model · 165 Saccharomycetales genomes ·13,651,812 parameters← Expression modelLabPostPaperDocsThe same encoder, asked a different question
Shorkie_LM is the model Shorkie was fine-tuned from. It shares its entire encoder — an 11 bp convolutional stem, seven residual blocks pooling 16,384 positions down to 128, and eight transformer layers at that bottleneck — and then diverges completely on the way back up. Shorkie runs three U-Net stages to 1,024 positions and crops to 896 bins of 16 bp, because coverage is a 16 bp quantity. The LM runs seven, all the way back to 16,384, because a base is what it predicts.
| stage | Shorkie | Shorkie_LM |
|---|---|---|
| encoder | identical — the shared trunk, 128 positions × 384 channels at the bottleneck | |
| U-Net stages | 3 | 7 |
| output | 896 × 5,215 | 16,384 × 4 |
| head | softplus | softmax |
| parameters | 14,253,567 | 13,651,812 |
Everything on this page is precomputed and shipped — there is no model to download and nothing to wait for. Fourteen S. cerevisiae windows, the same ones the expression playground uses, with the same curated annotation, so a result here can be read directly against one there.
Three passes that are not the same number
A masked language model can be run three ways, and confusing them is the easiest mistake to make with one. This page keeps them apart everywhere and always says which it is drawing.
The unmasked pass is not a prediction. The model can see the base it is scoring, so it mostly copies its own input — and its cross-entropy is far better than the masked pass's for that reason alone, not because it knows more. It is nonetheless the pass the paper's Figure 2A logo is built on, which is worth knowing when comparing this page against that figure.
How the iterative reconstruction works, and why K = 7
The problem. A masked language model only predicts where it is masked. To get a genuine prediction at every one of the 16,384 positions you must mask every position at some point — but masking all of them at once leaves the model nothing to condition on.
The method. Partition the positions into K disjoint strided sets — position i joins set i mod K — mask each set in turn, and read every position back only from the pass that masked it. With K = 7 that puts 14.3% of positions under mask, matching the checkpoint's own mask_rate: 0.15, and the stride guarantees every masked base keeps unmasked immediate neighbours, exactly as in pretraining. Seven forward passes, about two seconds a locus.
Why the stride and not a random 15%. A partition means each position is predicted exactly once, with no position predicted twice and none missed — so the result is a function of the model, not of a seed.
The check that it is not an artefact of K. On TDH3, K = 10 gives 43.93% argmax and 1.7528 bits against K = 7's 43.00% and 1.7571 — so the stride is not what sets the number. Those two figures are TDH3's, not the page's: argmax runs 41.3% (GAL1) to 46.3% (FUN12) across the nineteen windows, and the bar above always reports the window you are looking at.
What it is not. Not the same as masking one base alone: the iterative pass also has 1/7 of the rest of the window hidden, so it is the same question asked slightly harder. And not a generative sample — each position is scored independently, so reading the argmax across a span is not "the sequence the model would write".
Where the genome is predictable
Information content, 2 − H(p), at every base — the paper's own quantity, and the model's analogue of conservation computed without an alignment. High means the model finds the base strongly determined by its surroundings.
The same curated layer the expression page carries, drawn the same way. Genes are real models — exons as blocks, introns as the gap the chevrons run through, strand-aware — not one bar per gene, because a bar paints over every intron and eight of these nineteen windows contain one. Provenance is drawn rather than merely recorded: a ChIP-supported site is solid, a conserved-only call hollow, a PWM match a hairline. A grey cap marks a feature clipped by the window edge, so that edge is never mistaken for a real boundary.
Drag to zoom the logo below. The curve is smoothed for display at this width — one pixel covers many bases — and the per-base values are exact in the logo.
The constraint logo
The same drawing as the expression page, answering the opposite question. There, one letter survives per position — the input is one-hot, so an attribution is identically zero at the three bases that are not there — heights are signed, and the axis is the attribution's own range. Here every base has a probability, letter height is p × IC, nothing is signed, and the axis is a fixed 0–2 bits. A tall column means constrained, not influential.
How the logo is built, and what a tall column does not mean
The formula is the paper's verbatim: conservation = 2 − entropy, with H(p) = −Σ p log₂ p over the four bases and each letter drawn at p × IC. Letters stack ascending by probability, the PWM convention, over a fixed 0–2 bit axis — not descending by magnitude with a zero rule, which is the attribution convention on the other page.
Glyphs are the paper's: real DejaVu Sans Bold outlines at its hand-tuned per-letter offsets, scaled 1.35× on both axes, in its saturated X11 colours (A green, C blue, G orange, T red), fixed across every theme because a figure's base colours are part of the figure.
A tall column is not a functional site. It says the model can predict the base from its context. Homopolymer runs, repeats and strongly biased composition all produce high information content with no regulatory meaning whatever — which is exactly why the enrichment panel below tests constraint against annotation rather than asserting the connection.
Quantisation. Probabilities ship as uint8 in log space, not linear: the displayed quantity is the entropy and −p log₂ p is steepest where p is smallest, which is where a linear grid is coarsest. Measured across all nineteen loci the worst entropy error is under 0.02 bits on a 2-bit axis.
Ask the model what belongs here
Click any base in the logo above. This is the canonical language-model question, and the answer is a distribution rather than a letter.
Can it put a motif back?
Every curated, ChIP-supported binding site in this window, masked whole, with what the model puts in the hole. Read the identity column against the composition floor beside it — the score you get by guessing the window's most common base at every position.
Why a whole-site mask is a different task from the one it was trained on
The method. Zero the four DNA channels across the entire site — the model's own masking, indistinguishable from a run of N — run one forward pass, and read the argmax across the masked span.
The mismatch. Pretraining masks 15% of positions scattered, so every masked base keeps unmasked immediate neighbours. A contiguous 7–11 bp hole removes exactly that local context, and the model has never been asked to fill one. The same positions, masked in the scattered pattern instead, are recovered far more often — the two numbers are on the same page above.
Read identity against the floor, never against zero. A promoter that is 60% A/T rewards a constant-A guess, so an unanchored "recalled 6 of 11 bases" has no scale. The floor is the largest single-base frequency in that window.
What a success would and would not mean. Recovering a site's sequence from its surroundings is evidence the model has learned that this sequence is likely in this context. It is not evidence the model represents the transcription factor, and it says nothing about whether the site is used.
Is constraint where the biology is?
The same statistic the expression page uses, on a different signal: mean information content inside each annotation class over mean across the window, against a null from circularly shifting the annotation. 1.00× means no preference.
The falsifiable prediction this panel exists to test
The released checkpoint's params.json carries four loss weights that are not mentioned in the paper text: exon_loss_scale: 0.1 and repeat_loss_scale: 0.1, against 1.0 for non-exon and non-repeat. The model was deliberately trained to care ten times less about exons and repeats.
That is a prediction, not a description: if the loss weights did what they were meant to, the LM should be measurably less constrained over coding sequence than over the intergenic sequence around it. The CDS row in the table above is that test.
Measured across all nineteen windows, the exon half of the prediction fails and the repeat half holds. Coding sequence scores above 1.0 in 19 of 19 loci — mean 1.120×, range 1.041–1.266 — so the model is more certain over exons, not less, despite their loss being weighted at a tenth. Repeats go the other way, but on far thinner evidence: the curated annotation for these windows contains no transposon features at all and just three solo LTRs — delta elements, one each in the TDH3, PGK1 and RPL26A windows — scoring 0.68–0.80×. All three fall on the same side, which is suggestive, but three features in three windows is not the fourteen-window result the CDS row is. The table in Constraint across all nineteen windows shows a — for the sixteen windows that contain no LTR, so the support is visible rather than implied.
The likely reason is that the two classes are not comparable targets. A repeat is only predictable because it recurs, and down-weighting it removes the incentive to memorise it. Coding sequence is predictable because the genetic code constrains it — reading frame, codon bias, amino-acid composition — and that structure is there to be learned from the 90% of the loss that remains. A loss weight can discourage memorisation; it cannot make a compositionally constrained sequence look random.
The null is a circular shift, the same one the expression page uses: rotating the annotation preserves the feature count, every length and every gap, and destroys only the alignment. Offsets are deterministic and zero is excluded, so a published ratio is reproducible rather than a draw.
What it cannot tell you. Constraint and function are different things. Repeats and homopolymers are highly predictable and carry no regulatory meaning; a class can be enriched here because it is compositionally simple rather than because it matters.
Constraint across all nineteen windows
Every panel above shows one window, so the claims this page makes across windows have to be taken on trust. This is them. Click a gene to open its window.
Coding sequence is more constrained in 19 of 19 windows — mean 1.120×, range 1.041–1.266 — despite exon_loss_scale: 0.1 weighting it at a tenth. The three solo LTRs in this set go the other way at 0.68–0.80×. Those are three features in three windows, not a fourteen-window result, and the table shows the — where a window has none. The ChIP sites column carries its feature count for the same reason, and any window with fewer than ten is greyed: a ratio over three or four sites is a draw, not a measurement.
How this table is computed, and why it is precomputed
The statistic is the one in the panel above — mean |information content| inside a class over its mean across the window, against a null of 256 deterministic circular shifts of the annotation mask. Rotation preserves the feature count, every length and every gap, and destroys only alignment.
Why precomputed. That null is 256 passes over 16,384 positions per class per locus; doing it live for nineteen would mean fetching all nineteen planes (2.3 MB) and running ~25,000 passes in the browser. It is computed once by scripts/shorkie/make_lm_summary.py from the shipped packs — no model, no checkpoint — into src/data/shorkieLmSummary.json.
Why the two agree exactly. The generator reimplements weightedEnrichment and circularShiftOffsets in Python, and JavaScript rounds halves up where Python rounds them to even. At 16,384 positions and 256 shifts there are no exact halves — 257 is prime and does not divide 16,384 — so the offsets are identical. Change either constant and that has to be rechecked rather than assumed.
Mean IC is low everywhere (~0.19–0.27 bits on a 0–2 axis), so read the ratios rather than the absolute column: differences between windows are larger than differences within one.
What the bottleneck separates
Each of the 128 bottleneck positions is a 384-dimensional vector from the first self-attention layer — the representation the paper's Figure 2E clusters. Each point is one position, coloured by what the annotation says is there. One point covers 128 bp.
PCA here, t-SNE in the paper — and why the difference matters
This is PCA, computed in the browser by power iteration from a fixed seed. The paper's Figure 2E uses t-SNE. The swap is deliberate: a projection whose axes move between page loads cannot be written about, and t-SNE distances are not distances — its cluster separations and gaps are famously not interpretable as magnitudes. PCA's axes are the directions of greatest variance and its distances are real, at the cost of showing less separation.
So a lack of visible clustering here is weaker evidence than a lack in the paper's figure would be, and the reverse is stronger: anything PCA does separate is separated along genuine high-variance directions.
One point is 128 bp, so a position's label is whatever annotation covers most of that stretch — at this resolution a 7 bp binding site cannot have its own point, and the classes shown are the ones large enough to dominate a cell.
What is not here
Live inference. Everything is precomputed, so an arbitrary edited sequence cannot be scored — the iterative pass covers every position of the shipped windows, and the motif sweep covers every curated site, but a span you choose yourself would need the model in the browser. The expression page carries that machinery; this one deliberately does not, in exchange for working instantly with no download.
The pretraining ablation. The published Shorkie_Random_Init — the same architecture and data trained from scratch — is what would measure what pretraining actually bought. It is not on the site.
TF-MoDISco motifs. The paper derives motifs from contributions and matches them with TomTom. This page reports constraint and reconstruction directly and does not attempt de-novo motif discovery.