Compartment-Calibrated Quantization for Edge Metagenomic Diagnosis

When a patient has a deep-tissue infection, the causative pathogen is often invisible in blood: pathogens replicate in anatomically sequestered spaces and shed so little DNA into circulation that systemic tests come back falsely negative — a spinal epidural abscess with sterile blood cultures Psoriasis vulgaris of the skin caused a L3-L4 lumbar epidural spinal abscess, intestinal Epstein-Barr Virus infection missed by plasma DNA load Plasma Epstein-Barr Virus DNA load for diagnostic and prognostic assessment in intestinal Epstein-Barr Virus infection. Sampling the diseased compartment directly — bronchoalveolar lavage fluid, cerebrospinal fluid, abscess aspirate — and sequencing all nucleic acids in it unbiasedly (metagenomic next-generation sequencing, mNGS) closes this gap: BALF mNGS detected Mucorales in 14 of 14 pulmonary mucormycosis patients where fungal culture found it in one Diagnostic Utility of Bronchoalveolar Lavage Metagenomic Next-Generation Sequencing for Pulmonary Mucormycosis: A Single-Center Retrospective Cohort Study. But the diagnostic bottleneck has moved downstream: host DNA dominates these samples, and the deep-learning classifiers that could resolve mixed infections need to run where the sequencer is — at the bedside, on hardware with a few gigabytes of memory. Meanwhile, research on neural network quantization — compressing model weights from 16-bit floats to 4-bit codes — has shown that the naive approach of mapping weights onto an evenly spaced grid wastes most of its codes, because real weights pile up near zero with long sparse tails. This proposal asks a question nobody has asked: what do the weights of a genomic foundation model fine-tuned on site-specific metagenomic data actually look like statistically, and does fitting the quantization grid to that distribution decide whether a rare pathogen read survives compression?

The clinical stakes of this question are sharper than in typical compression work. In sterile compartments, a single sequencing read can be diagnostically decisive, because background commensal flora are absent — as in the Mycobacterium gordonae pneumonia case where one read from a sterile biopsy was sufficient Mycobacterium gordonae pneumonia. If 4-bit rounding perturbs a classifier just enough to discard or misassign a handful of rare reads, the cost is not a fraction of a perplexity point; it is a false negative in a patient whose blood work is already misleading the clinicians. Quantization for this domain must therefore be evaluated by rare-species recall, not average accuracy alone.

Core Claim

My claim is twofold. First, the weight distributions of genomic foundation models fine-tuned on site-specific metagenomic data deviate measurably from the statistics that current 4-bit formats assume: the Student's t heavy tails documented for language models ($\nu \approx 5$) by Learning from Students: Applying t-Distributions to Explore Accurate and Efficient Formats for LLMs and the asymmetry documented by AFPQ: Asymmetric Floating Point Quantization for LLMs were measured on LLaMA2, Mistral, and ResNet — never on a model adapted to imbalanced, host-contaminated clinical sequence data, where fine-tuning on rare pathogen classes plausibly skews classifier-head weights and fattens tails. Second, a quantization grid calibrated to the fine-tuned, compartment-specific weight distribution — rather than a generic or uniform grid — preserves rare-read pathogen detection at memory budgets compatible with point-of-care sequencing hardware, where uniform post-training quantization does not. The connecting mechanism is concrete: the grid places its finite set of code values where the actual weights live, so the subtle parameters that separate a one-read pathogen signal from background noise are encoded finely instead of being rounded away by a uniform ruler stretched to cover a few outliers.

This positions the two input directions asymmetrically. Site-specific metagenomic sampling is the application regime and the source of the evaluation problem (rare-signal detection under host contamination). Non-uniform weight distributions are the core mechanism being profiled and exploited. The distributional statistics of neural weights become a measurable, per-compartment object of study rather than a generic property of language models.

How This Differs From the Closest Existing Work

Three prior efforts come near this intersection, and the proposal is defined against each. Fast and Low-Cost Genomic Foundation Models via Outlier Removal and its companion Outlier-Free Genomic Foundation Models for Resource-Efficient Training and Low-Bit Inference (GERM/GERM-T) are the closest: they make genomic foundation models robust to low-bit deployment by replacing Softmax with a formulation whose attention weights need not sum to one, which removes activation outliers. But GERM attacks the activation side and then quantizes with standard uniform linear post-training quantization; it never profiles the weight distribution, never uses a non-uniform grid, and its authors report that GERM-T still degrades substantially at 4-bit precision. It was also validated only on the Genome Understanding Evaluation suite — promoter and splice-site tasks on single-species genomes — never on mixed metagenomic samples, host-contaminated biofluids, or rare-pathogen detection. My proposal is the complement and the test of an open tension: non-uniform quantization research embraces heavy tails by shaping the grid around them, while GERM removes outliers so that a uniform grid suffices. Whether outlier removal erases the benefit of distribution-matched grids, or whether the two stack, is unresolved and is one of the experiments below.

META$^2$: Memory-efficient taxonomic classification and abundance estimation for metagenomics with deep learning attacks the memory wall in metagenomic classification by hashing similar k-mers into shared embedding buckets and pooling sets of reads with multiple-instance learning — an architectural fix that leaves every weight in full FP32 precision and was evaluated only on simulated reads from bacterial reference genomes, with no host DNA, no viruses, and no clinical compartments. DNABERT-2: Efficient Foundation Model and Benchmark For Multi-Species Genomes supplies the compact 117M-parameter backbone I would build on, but it operates entirely in 16-bit floating point and its benchmarks cover functional genomics, not diagnostic read classification. Finally, Critical Assessment of Metagenome Interpretation: the second round of challenges (CAMI II) supplies the community benchmark and its sobering findings — classical profilers fail at the strain barrier and in the clinical pathogen challenge only 3 of 10 submissions identified the causal virus — but it evaluated no deep-learning and no quantized pipelines. Nobody in this literature has characterized the weight topology of metagenomic-adapted sequence models or deployed distribution-aware non-uniform grids on clinical metagenomic data. That is the gap.

Research Program

The program has three linked parts.

Part 1: Weight-topology profiling of site-specific fine-tuned models. I will fine-tune DNABERT-2 (117M parameters) on metagenomic read classification across distinct site-specific regimes: sterile-compartment aspirates, semi-sterile BALF-like samples with host contamination and commensal background, and the polymicrobial mixtures documented in the mucormycosis cohort, where 11 of 14 patients had co-pathogens Diagnostic Utility of Bronchoalveolar Lavage Metagenomic Next-Generation Sequencing for Pulmonary Mucormycosis: A Single-Center Retrospective Cohort Study. For each fine-tuned checkpoint and each tensor group, I will fit Student's t distributions via the Kolmogorov-Smirnov methodology of Dotzel et al. Learning from Students: Applying t-Distributions to Explore Accurate and Efficient Formats for LLMs and measure skewness per group following the protocol of AFPQ: Asymmetric Floating Point Quantization for LLMs. The deliverable is an empirical map: does site-specific fine-tuning shift $\nu$, and does class imbalance in rare-pathogen heads produce the asymmetry that AFPQ's dual positive/negative scales were built for? This is descriptive work with a direct payoff, because the answer determines which grid family to use per tensor.

Part 2: Compartment-calibrated non-uniform grids. Rather than reusing grids fit to language-model statistics, I will calibrate the grid per compartment from the profiled distributions. Concretely, for a 4-bit grid of $2^4$ codes, bin boundaries $b_k$ are placed at equal probability mass under the fitted per-group distribution:

$$b_k = F^{-1}_{\hat{\nu}_c,\hat{\mu}_c,\hat{\sigma}_c}\!\left(\frac{k}{2^b}\right),$$

where $F^{-1}$ is the quantile function of a Student's t distribution whose parameters $(\hat{\nu}_c, \hat{\mu}_c, \hat{\sigma}_c)$ are estimated from the weights of the model fine-tuned on compartment $c$ (BALF-like, CSF-like, sterile aspirate). Where profiling shows significant group skewness, the grid is replaced by the AFPQ dual-scale construction — independent positive and negative scaling anchored at the group extrema — which avoids the zero-point shift that displaces a floating-point grid's dense center away from the mode AFPQ: Asymmetric Floating Point Quantization for LLMs. The point is not to invent a new format but to show that whose weights the format is fit to matters: a t-quantile grid built on $\nu \approx 5$ from LLaMA2 is a hypothesis, not a calibration, for a model whose classifier head was trained on eleven rare fungal species.

Part 3: Rare-signal evaluation under memory constraints. The evaluation protocol is built around the failure mode that matters clinically: a pathogen present at one-to-ten reads per sample, in a background of overwhelming host DNA, in a sample where a single read can be decisive Mycobacterium gordonae pneumonia. I will measure species-level precision, recall, and abundance error as a function of read depth per species, at FP16 and at 4-bit under each grid variant, under a strict deployment memory cap chosen to match point-of-care hardware. The working hypothesis is that uniform 4-bit rounding disproportionately destroys low-abundance detections — the class boundary for a species represented by three reads sits on parameters whose fine structure a coarse center grid collapses.

A secondary thread resolves the tension with GERM head-on: I will apply the compartment-calibrated grid both to vanilla DNABERT-2 and to a GERM-style Softmax1 variant, testing whether activation-outlier removal and weight-distribution-aware grids are substitutes (either one suffices, and GERM's simpler route wins) or complements (the grid still matters once outliers are gone, or matters more, because GERM-T alone reportedly degrades at 4-bit Outlier-Free Genomic Foundation Models for Resource-Efficient Training and Low-Bit Inference).

Proposed Experiments

The primary testbed is the CAMI II benchmark suite Critical Assessment of Metagenome Interpretation: the second round of challenges, which provides blinded, realistic short-read data across four environments. I will use its clinical pathogen dataset (the unknown-infection patient sample) as the headline diagnostic task and its strain-madness set (100 samples at extreme strain diversity) to test whether quantization noise worsens the documented strain barrier above 95% average nucleotide identity. The plant-associated set, with its complex eukaryotic host background, serves as the host-contamination stress test. Second, I will replicate the META² synthetic protocol — 5.2 million NovaSeq-simulated reads from 3,332 RefSeq bacterial genomes — so results are directly comparable to the reported numbers from that benchmark, in particular the 73.9% classification accuracy that LSH-EmbedPool achieved under a sub-600 MB memory cap, versus 37.1%–64.6% for a memory-matched Kraken 2 META$^2$: Memory-efficient taxonomic classification and abundance estimation for metagenomics with deep learning. Third, to tie the work to real site-specific cohorts where raw data or reported confusion structure exists, I will use the published characteristics of the two BALF cohorts as calibration targets: the 14-patient pulmonary mucormycosis cohort with its polymicrobial mixtures Diagnostic Utility of Bronchoalveolar Lavage Metagenomic Next-Generation Sequencing for Pulmonary Mucormycosis: A Single-Center Retrospective Cohort Study and the 71-patient aspergillosis cohort, whose cell-free-DNA arm reported 89.47% combined sensitivity and AUC 0.818 against 47.37% for conventional tests The value of metagenomic next-generation sequencing with different nucleic acid extracting methods of cell-free DNA or whole-cell DNA in the diagnosis of non-neutropenic pulmonary aspergillosis; for raw sequence access I will state plainly where no reported result exists on Lacuna rather than invent figures.

Metrics are: species- and genus-level F1 (following CAMI II's profiling evaluation), causal-agent identification on the clinical challenge, rare-species recall binned by per-species read count (the decisive metric for this proposal), Jensen-Shannon divergence of abundance profiles (META²'s reported metric family), and the memory footprint and latency of the quantized model. The decisive empirical checks are three. First, at matched memory budget, the compartment-calibrated grid must recover a strictly higher fraction of species present at fewer than ten reads than uniform 4-bit post-training quantization on the same fine-tuned model; if the gap is confined to abundant species, the core claim fails. Second, the profiling study must show a measurable distributional shift between generic pre-training weights and site-specific fine-tuned weights (shifted $\nu$ or per-group skewness with effect sizes reported); if fine-tuning leaves the statistics untouched, the "compartment-calibrated" framing collapses to ordinary SF4-style calibration and the honest conclusion is that one global fit suffices. Third, the combined Softmax1-plus-calibrated-grid variant must beat GERM's own uniform-PTQ configuration on the clinical CAMI task under identical tuning budgets, or the tension resolves in GERM's favor and I will report that.

Baselines

The "do nothing" reference point is full-precision DNABERT-2 fine-tuned on the same metagenomic training data and run on unconstrained hardware. It fixes the accuracy ceiling and quantifies what compression costs at each bit-width; any quantized variant must be judged against it on the same CAMI II and META²-protocol data. No reported metagenomic classification number for FP16 DNABERT-2 exists on Lacuna — its reported results are on the GUE functional-genomics suite, where it beat the original DNABERT on 23 of 28 datasets — so this baseline will be run by us, not quoted.

The strongest existing competitor is GERM, the outlier-free genomic foundation model of Fast and Low-Cost Genomic Foundation Models via Outlier Removal and Outlier-Free Genomic Foundation Models for Resource-Efficient Training and Low-Bit Inference, which reported a "64.34% boost in quantization robustness" over DNABERT-2 with standard uniform 4-bit post-training quantization. It is the strongest competitor because it is the only published method that already puts a genomic foundation model into the low-bit regime and reports large robustness gains; if its uniform-PTQ route matches my calibrated grid on rare-species recall, the extra machinery is unjustified. The comparison is made fair by running GERM's released recipe on the identical fine-tuning data, the identical CAMI II and META²-protocol evaluation sets, the identical 4-bit weight budget, and an identical hyperparameter search budget per method; beating it means higher rare-species recall and higher species-level F1 on the clinical pathogen task at the same memory footprint, with confidence intervals over bootstrap resampling of samples.

The second competitor is the memory-efficient architecture META² (LSH-EmbedPool with multiple-instance pooling), which reported 73.9% classification accuracy under a sub-600 MB cap where downsampled Kraken 2 fell to 37.1%–64.6% META$^2$: Memory-efficient taxonomic classification and abundance estimation for metagenomics with deep learning. It represents the architectural route to edge metagenomics — shrink the model's structure rather than its number formats. It will be run at the same memory cap on the same data; beating it means exceeding 73.9% on its own protocol while also surviving the host-contaminated and strain-heavy CAMI sets where its synthetic-bacterial training regime was never tested. The key ablation isolates the proposal's single ingredient: the identical fine-tuned model, quantized once with a uniform 4-bit grid and once with the compartment-calibrated non-uniform grid, everything else held fixed. Any claimed gain must appear in that paired comparison, because it alone separates "distribution-aware grid" from "we fine-tuned better."

Why not just…?

Why not just use GERM's uniform 4-bit post-training quantization and stop there? This is the real threat, and I treat it as such rather than arguing it away. GERM already reports robust 4-bit behavior and fast edge fine-tuning, and its Softmax1 fix is elegant precisely because it makes the boring uniform grid work. But two pieces of evidence say it is not the end of the story: GERM's own companion paper reports that the continual-adaptation variant GERM-T still suffers substantial degradation at 4-bit precision Outlier-Free Genomic Foundation Models for Resource-Efficient Training and Low-Bit Inference, and GERM was never evaluated on mixed metagenomic or host-contaminated data, only on the single-species GUE tasks. The head-to-head experiment in this proposal is designed to settle it: if GERM-uniform matches my calibrated grid on rare-species recall in the clinical CAMI setting, the honest conclusion is that activation-outlier removal subsumes weight-grid calibration for this model family, and the contribution shrinks to the profiling study and a negative result worth publishing at workshop scale.

Why not just shrink the architecture like META², instead of quantizing weights? Hashing k-mers into shared embedding buckets and pooling read sets reduced META²'s embedding matrix 29-fold and delivered 73.9% accuracy under 600 MB META$^2$: Memory-efficient taxonomic classification and abundance estimation for metagenomics with deep learning, which is a genuine achievement. It falls short of the site-specific setting in ways the original evaluation makes plain: it was trained and tested only on simulated reads from bacterial reference genomes, so its behavior on eukaryotic host DNA, viruses (which CAMI II showed profilers systematically miss Critical Assessment of Metagenome Interpretation: the second round of challenges), and rare fungal pathogens is unknown, and its shallow convolutional backbone lacks the long-range context a foundation model brings. The two approaches are also not exclusive — hashing compresses the embedding table, quantization compresses the remaining weights — so the strongest version of this proposal would combine them, and I will report that combination rather than defend a turf boundary.

Why not just keep the model in the cloud and run Kraken 2 or a classical profiler there? This is the system-design alternative, and it is how clinical mNGS mostly operates today: ship samples to a central lab, align away host reads with BWA-MEM against a large reference database The value of metagenomic next-generation sequencing with different nucleic acid extracting methods of cell-free DNA or whole-cell DNA in the diagnosis of non-neutropenic pulmonary aspergillosis, and classify on a server. It falls short on two axes the clinical literature itself documents: turnaround and failure modes. Even the fast BALF mNGS workflows require 18–48 hours wet-lab plus bioinformatics Diagnostic Utility of Bronchoalveolar Lavage Metagenomic Next-Generation Sequencing for Pulmonary Mucormycosis: A Single-Center Retrospective Cohort Study, and classical profilers need tens of gigabytes of RAM — META² had to downsample Kraken 2 to 37.1%–64.6% accuracy to fit a small memory budget — while CAMI II showed that in the clinical unknown-pathogen challenge only 3 of 10 submissions, all classical workflows, identified the causal virus, and none were fully reproducible without manual curation Critical Assessment of Metagenome Interpretation: the second round of challenges. A 4-bit foundation model that runs beside a portable sequencer attacks both the latency and the database-dependence at once, but the proposal does not claim cloud deployment is wrong for well-equipped hospitals; it claims there is a deployment regime — bedside sequencing of sequestered-compartment samples where hours matter — that the cloud route serves poorly, and the experiments measure whether quantized neural inference is accurate enough to serve it at all.

Why not just distill or prune a small model instead of quantizing a big one? Structured compression of transformers is a mature alternative, and the CoFiPruning toolkit CoFiPruning makes it cheap to try. But DNABERT-2 is already small at 117M parameters — the case for distilling a 117M model into a 30M model, at the cost of a new training run and a fresh accuracy hit, is much weaker than in the multi-billion-parameter language-model setting where these techniques were developed, and its multi-species pre-training over 135 species is exactly the knowledge a small distilled model would lose. I will include a pruned baseline in the ablations for completeness; if it matches the calibrated 4-bit model's rare-species recall at equal memory, that result would argue the entire quantization thread is unnecessary, and I would report it as such.

Decisive Checks

The proposal stands or falls on two measurements. First, the paired uniform-versus-calibrated-grid ablation on rare-species recall: a gain concentrated in the under-ten-reads-per-species bins, on host-contaminated CAMI data, under the deployment memory cap, is the positive result; a null result there redirects the project toward the profiling study and the GERM comparison as its main findings. Second, the profiling result itself: if the weight statistics of site-specific fine-tuned models do not differ meaningfully from generic pre-training statistics, then the per-compartment calibration machinery reduces to a one-time global fit, the paper becomes a negative-result note on transferability of the $\nu \approx 5$ finding Learning from Students: Applying t-Distributions to Explore Accurate and Efficient Formats for LLMs] — and that, too, would be worth knowing, because it would tell the quantization community that the biological-sequence domain inherits, rather than reshapes, the weight statistics their formats assume. Either branch produces knowledge currently absent from the literature.