Who Brought What: Dialogue-Style Source Attribution for Prophage-Encoded Virulence Genes

When a bacterium carries a toxin, an antibiotic-resistance gene, or an immune-evasion factor, the first question a clinician or microbiologist asks is deceptively simple: did the bacterium's own chromosome encode it, or did an integrated virus — a prophage — donate it? The answer changes everything downstream, because prophage-encoded virulence factors mark recent horizontal acquisition, carry reactivation risk, and, in settings from colorectal tumors to ulcerative colitis, track with inflammation and treatment resistance (Whole-genome sequencing of Streptococcus oralis CRC211; Gut mucosal virome alterations in ulcerative colitis). Yet current computational tools cannot answer this question on real data. Homology pipelines flag regions that resemble known phages but cannot draw boundaries or distinguish true prophage cassettes from look-alike host DNA (VIBES), and deep classifiers only sort fragments into "virulent" versus "temperate" without saying which genetic entity each functional gene came from (DeePhage).

This proposal argues that the missing problem — binding accessory genes to their source genome inside a mosaic, fragmented sequence — is structurally the same problem NLP researchers solved for "who said what" in multi-party dialogue, where models extract content correctly but attach it to the wrong participant. Dialogue work has produced three concrete, validated fixes: partitioning identity signals into quiet dimensions of the positional encoding (Naraki et al.), contrastive training on deliberately speaker-swapped hard negatives (CONFIT), and coreference-guided attention that forces related entities to attend to one another (Coreference-Aware Dialogue Summarization). None has ever been applied to biological sequences. We will transfer all three to genomic source attribution, treating the bacterial chromosome and the prophage as two "speakers" whose interleaved genetic "utterances" must be correctly bound.

Core Claim

Misattribution of functional genes across genomic sources in mosaic metagenomic contigs is an entity-attribution failure with the same mechanism as speaker attribution error in dialogue, and the architectural remedies proven in dialogue — frequency-partitioned origin embeddings, origin-aware co-attention, and contrastive training on synthetically swapped integration junctions — will substantially outperform homology-based and tag-based baselines at assigning virulence-associated genes to prophage versus host origin, at contig lengths down to the short fragments that dominate real metavirome data.

The analogy is exact, not decorative. In dialogue, standard Transformers flatten turns into one token stream; the representation of an action entangles with nearby speaker tags, so models attribute the action to the wrong participant (Naraki et al.; Zhong et al.). In a mosaic contig, a toxin gene sits adjacent to both prophage structural genes and host operon genes; a model that pools context globally will bind the toxin to whichever flanking source dominates locally — the genomic version of a "Wrong Reference" error, which in dialogue summarization afflicted 37–46% of baseline model outputs (CONFIT). The parallel extends to the failure of shallow fixes: adding identity embeddings to every dimension of a dialogue model's positional encoding degraded performance, while isolating them in the low-frequency fourth quarter improved ROUGE-1 from 50.82 to 51.39 on SAMSum and from 38.65 to 40.05 on MediaSum (Naraki et al.) — evidence that where you put the identity signal matters more than whether you have it. And the parallel extends to plausibility traps: large generative models make fluent but unsupported "circumstantial" inferences (38% of LLM dialogue errors versus 1% for BART), which standard NLI-style metrics detect at near-chance 40–50% balanced accuracy (Ramprasad et al.); a genomic predictor that globally "over-infers" will likewise assign host stress-adaptation genes to prophage payloads, or vice versa, with confident fluency.

Research Program

The program has three components: a labeled benchmark, a model architecture, and a training objective.

The benchmark, which we call GenAtt, is built by simulation with known ground truth, following the contig-fragmentation methodology already established in this literature. DeePhage evaluated on curated genomes (77 virulent and 148 temperate phages) and on 1,211 virulent plus 429 temperate RefSeq genomes, fragmenting them with MetaSim into 100–1,800 bp contigs (DeePhage); VIBES provides a second, independently validated source of labeled prophage-host boundaries — 517 full-length Pf integrations across 1,072 Pseudomonas isolate genomes, filtered to 13,850 likely integrations of mean length 5,095 nucleotides (VIBES). We will splice confirmed prophage regions into their cognate host chromosomes at the recorded positions, then fragment the mosaics into the same four contig-length bins DeePhage used (100–400, 400–800, 800–1,200, 1,200–1,800 bp). Every gene in every contig receives a source label: prophage, host, or integration-junction. This yields the first dataset where the "which entity brought what" question has an unambiguous answer, including for the clinically important payloads this direction cares about — the dfrA resistance genes shown to alter host fitness when phage-encoded (Wang et al.) and the toxin and immune-evasion genes found in prophage regions of tumor isolates (Streptococcus oralis CRC211).

The model is a Transformer encoder over nucleotide tokens with two dialogue-derived modifications. First, origin-partitioned identity embeddings: rather than prepending [PHAGE] and [HOST] tag tokens (the genomic analogue of "Speaker 1:" markers, which dialogue evidence shows entangle with content through unrestricted attention), each candidate segment carries an origin-identity embedding added only to the fourth quarter — the lowest-frequency band — of the sinusoidal positional encoding, exactly the placement Naraki et al. showed avoids interference while preserving positional signal (Naraki et al.). Second, co-attention within predicted origin clusters: once an auxiliary head proposes which spans share a source, a parameter-free guided-attention layer forces spans in the same cluster to attend to one another, mirroring Coref-Attention, which raised factual accuracy on SAMSum from 0.60 to 1.16 on a 2-point human scale and cut Wrong Reference errors by 45% (Coreference-Aware Dialogue Summarization). Critically, we avoid the pipeline version of this idea — running an external segmenter first — because dialogue work showed that upstream coreference tools fail on informal structure and their errors cascade downstream (Coreference-Aware Dialogue Summarization); we learn the clustering jointly instead.

The training objective combines a per-token attribution cross-entropy with a contrastive term on synthetic hard negatives, directly transferring CONFIT's design. CONFIT built hard negatives from its error taxonomy — including participant swaps — and added a self-supervised loss asking whether two utterances share a speaker, cutting Wrong Reference errors from 37% to 17% in BART and from 46% to 13% in T5 (CONFIT). Our genomic hard negatives are corrupted copies of training contigs in which we swap the integration junction (reattaching the prophage cassette at a wrong host position), shuffle moron cassettes between sources, or mask the attachment-site flanks — the exact signals VIBES identifies as the unsolved boundary problem (VIBES). The model must prefer the true contig over its corrupted twin. Writing $x$ for a contig, $y_i$ for the source label of token $i$, and $x'$ for a corrupted negative, the loss is

$$ \mathcal{L} = -\sum_i \log p_\theta(y_i \mid x) \;-\; \lambda \log \frac{e^{s_\theta(x)}}{e^{s_\theta(x)} + e^{s_\theta(x')}}, $$

where $p_\theta$ is the attribution head, $s_\theta$ a shared-source verification score (the analogue of CONFIT's speaker-matching loss), and $\lambda$ a fixed weight. We will also build a small diagnostic question set in the spirit of DIAC-FactQA, whose 1,484 probing questions exposed a 36.1% average error rate in LLMs on who-did-what-to-whom (She et al.): questions of the form "is gene G located within a prophage-derived region of contig C?", stratified by distance-to-junction and fragment length, so that failure modes can be localized rather than averaged away.

Proposed Experiments

The primary evaluation is per-gene source-attribution accuracy and macro-F1 on held-out GenAtt contigs, reported separately for each of the four length bins, because the open problem in the field is specifically short fragments, where phages lack universal marker genes and reads cannot be reliably assigned (DeePhage). Secondary metrics are junction-boundary precision (fraction of predicted prophage-host boundaries within, say, 500 bp of the truth — a capability VIBES explicitly lacks, since it omits att site detection) and wall-clock compute, benchmarked against the documented cost of profile search: VIBES's nhmmer component consumed over 13,500 CPU hours for its 1,072-genome cohort (VIBES), so any learned model should clear that by orders of magnitude, as DeePhage already did for lifestyle classification by running 245 times faster than PhagePred and 810 times faster than PHACTS (DeePhage). A third experiment tests the plausibility-trap claim directly: we measure how often each model commits genomic "circumstantial" errors — assigning a gene to the prophage because its function is typically phage-associated, when the ground truth says host — and check whether standard homogeneity-based confidence scores detect these errors as poorly as SummaC and QAFactEval detected circumstantial dialogue errors at 40–50% balanced accuracy (Ramprasad et al.). Finally, we apply the trained model to the real bovine rumen and human gut metavirome cohorts where DeePhage validated on real data (DeePhage), reporting the proportion of virulence-associated genes assigned to prophage origin and how that proportion shifts in ulcerative-colitis samples, where Caudovirales blooms are documented reservoirs of beta-lactamases (Gut mucosal virome alterations in ulcerative colitis).

Baselines

The do-nothing reference point assigns every gene in a contig to the majority source of the contig's best database hit — the implicit behavior of current practice, where a contig labeled "temperate phage" by a tool like DeePhage has all its genes assumed phage-derived. This is the naive baseline because DeePhage's own scope stops at binary lifestyle classification and it makes no per-gene source claim (DeePhage); measuring how often the majority assumption is wrong on GenAtt quantifies the size of the attribution problem itself. No reported result exists on Lacuna for per-gene prophage-versus-host attribution accuracy by any method, so this baseline must be run, not cited.

The strongest existing competitor is homology-based attribution: for each gene, take the best alignment hit against phage-specific databases (PHROGs, as used by VIBES's BATH step) versus bacterial databases (Prokka annotations), and assign origin by which wins, with contested and diverged genes resolved by profile search. This is the strongest competitor because it is the only method family that currently operates on integrated prophage-host boundaries at scale — it recovered 517 full-length Pf integrations and 13,850 filtered integrations across the Pseudomonas cohort (VIBES) — and because the dfrA work shows that combining lenient sequence thresholds with structural machine learning genuinely finds functional genes inside phage genomes (Wang et al.). We will run it on identical GenAtt contigs with the same databases and its own compute budget (which, at VIBES's documented 13,500-plus CPU hours for a genus cohort, is not the binding constraint), and we will report its runtime as a first-class result. Beating it means higher macro-F1 in the short-fragment bins and better boundary precision, not just matching it on long contigs where homology is strong. Its known weaknesses give us the target: it is less sensitive to diverged prophages, cannot resolve ambiguous attribution near boundaries, and omits att sites entirely (VIBES).

Two further baselines isolate the proposal's ingredients. A plain Transformer encoder of matched parameter count, trained on the same GenAtt data with [PHAGE]/[HOST] delimiter tokens and no origin embeddings or co-attention, isolates the value of the dialogue-derived architecture beyond ordinary supervised learning. And an ablation that adds origin embeddings across all positional dimensions rather than only the fourth quarter, following the "Whole SE" condition Naraki et al. showed degrades performance (Naraki et al.), isolates the specific placement claim — if whole-dimension injection works as well as fourth-quarter injection on genomic data, the frequency-interference story does not transfer and the proposal's core mechanism is wrong. A contrastive-only ablation (hard negatives without the architectural changes) and an architecture-only ablation complete the picture. All models receive the same training data, parameter budget, and tuning protocol.

Why not just…?

Why not just use BLAST or nhmmer against phage databases? This is the real workhorse and the one to beat, not to dismiss. The evidence in the file says it falls short on exactly our regime: sensitive profile search consumed over 13,500 CPU hours for one genus (VIBES), BLAST annotations underperformed DeePhage on fragmented real metavirome contigs (DeePhage), and homology cannot annotate att boundaries or distinguish diverged prophages from homologous non-phage regions (VIBES). Still, it is a genuine threat on long, non-diverged contigs, which is why our headline metric is macro-F1 in the 100–800 bp bins where homology is weakest, and why the homology baseline is run with full databases rather than a strawman version. If it matches us there, the proposal fails on its own terms.

Why not just tag segments with [PHAGE]/[HOST] tokens and fine-tune a standard encoder? This is the most serious alternative, because it is simple and because supervised training on GenAtt may do most of the work by itself. The dialogue evidence predicts it will not: plain speaker markers still let content representations entangle with nearby wrong tags (Naraki et al.), baseline models with speaker tags misattribute at 37–46% rates (CONFIT), and distractor proximity alone — other entity names in context — systematically corrupts attribution (Zhong et al.). Genomic mosaics are the distractor-proximity problem at its worst, since host and prophage genes interleave at every junction. But this is precisely why the delimiter-tag baseline is in the experimental matrix as the ingredient-isolating control: the claim is falsifiable, and the whole-dimension versus fourth-quarter embedding ablation settles whether the placement mechanism specifically is what transfers.

Why not just prompt a large language model to classify each gene's origin? Zero-shot LLM prompting is attractive because it needs no benchmark, but the file's evidence is unambiguous about entity-tracking failures: LLMs averaged a 36.1% error rate on DIAC-FactQA's who-did-what-to-whom probes, with GPT-4 failing 18.5% (She et al.), and their dominant error mode is confident circumstantial over-inference that automated detectors catch at only 40–50% balanced accuracy (Ramprasad et al.). A model that assigns a toxin to the prophage because "toxins are usually phage-encoded" would be making exactly this error. We will include a prompted-LLM baseline on the GenAtt question set for completeness, and we expect the failure pattern to replicate; if it does not, that itself is a finding worth reporting.

Why not just extend DeePhage to a three-way classifier? Retraining DeePhage's 1D CNN — which achieved up to 89% 5-fold cross-validation accuracy on its curated 225-genome benchmark (DeePhage) — with an extra "host" class is a cheap, credible baseline, and we will run it. Its documented limitation is architectural: as a local CNN on one-hot DNA it classifies isolated fragments without modeling cross-segment context (DeePhage), and per-gene attribution inside a single mosaic contig is exactly a cross-segment binding problem. The comparison is fair in both directions: if the CNN matches our Transformer on short bins, the added architecture is unjustified cost.

Decisive Checks

Three outcomes would decide the proposal. First, fourth-quarter origin embeddings must beat both whole-dimension injection and delimiter tags on GenAtt macro-F1 in the short-fragment bins; if placement does not matter on DNA, the transfer claim is dead even if absolute accuracy is good. Second, the model must beat the homology baseline specifically on diverged prophages and junction-proximal genes — the regimes VIBES documents as unresolved (VIBES) — while remaining within an order of magnitude of DeePhage's inference speed. Third, on the diagnostic question set, the rate of genomic circumstantial errors (function-driven misassignment against ground truth) must be measurably lower than the prompted-LLM baseline and must not be invisible to the model's own confidence scores in the way LLM dialogue errors are invisible to SummaC and QAFactEval (Ramprasad et al.). A positive result on all three would establish source attribution as a well-posed, learnable problem for mosaic genomes and give the virulence field what it currently lacks: per-gene provenance from the fragmented data it actually has.