Baseline-Anchored Token Compression for Long Chest X-Ray Histories in Immunocompromised Patients

Patients on chemotherapy, anti-TNF biologics, or checkpoint inhibitors accumulate long series of chest radiographs. Their most dangerous findings are often faint and slow to emerge. When the immune response is blunted, infections lack the dense, obvious inflammation that radiologists and models are trained to spot. A model reading such a series has to notice that a barely visible haze is new relative to the patient's own scan from months earlier. Today's medical vision-language models, which read images and answer in text, cannot do this. Most compare exactly two exams. The one multi-image medical instruction set we found capped sequences at three images because of GPU memory (Medical Large Vision Language Models with Multi-Image Visual Ability).

The standard fix for long visual inputs is token compression: shrinking the hundreds of patch embeddings ("tokens") per image into a few dozen before the language model reads them. The usual compression rule throws away patches that look unchanged from the previous frame. That rule is the problem. A lesion that grows slightly at every visit is "unchanged" at each step, even though it is plainly new relative to a baseline taken before immunosuppression began. We propose to compress each exam against the patient's own anchor scan rather than against its immediate predecessor. The aim is to fit ten or more exams into a token budget that currently holds two or three, while keeping exactly the slow, low-contrast changes that matter most in these patients.

Core Claim

At a fixed token budget, choosing which patches to keep by their deviation from a patient-specific anchor exam (plus the immediately prior exam) preserves slowly accumulating, low-contrast lesions far better than three alternatives: adjacent-frame pruning, uniform pooling, and learned query bottlenecks. This advantage is concentrated in the regime typical of immunocompromised hosts, namely faint lesions that grow over several visits, and should be small or absent for abrupt, high-contrast changes.

The claim is falsifiable in a specific way. If adjacent-frame pruning or a learned resampler matches anchor-based retention on slow-drift lesions at equal budget, the idea is wrong.

Where this sits in prior work

Three lines of work motivate the gap.

The first is longitudinal chest X-ray modeling, which is almost entirely two-point:

  • BioViL-T splits features into a "current state" component and an "interval change" component for a single prior–current pair.
  • CoCa-CXR restricts each current-image token to attend to its spatial neighborhood in the prior image.
  • TempA-VLP adds a cross-exam encoder.
  • DeltaNet subtracts prior features from current ones.

All four assume one comparison. All are evaluated on common conditions such as effusion, edema and cardiomegaly, not on opportunistic infection.

The second line shows that extreme compression is feasible, but only outside clinical timelines:

  • LongVU drops video frames and static background tokens relative to anchor frames within short sliding windows, reaching about two tokens per frame.
  • MIRAGE in Visual Haystacks compresses each image to 32 tokens with a Q-Former, a small module that summarizes an image through learned queries.

The third line shows why "unchanged means uninformative" is unsafe in these hosts. These clinical papers motivate the target regime but supply no method:

  • In hydrocortisone-suppressed rats, TLR4 expression and lung IL-6 were sharply blunted while bacterial load rose roughly tenfold by day 3 (Wang et al.). Infection advances with little early inflammatory signal.
  • A neutropenic leukemia patient's Fusarium infection began insidiously and was missed by blood cultures and fungal antigen tests (Liang et al.).
  • Tuberculosis risk is greatly elevated under biologics, with a standardized incidence ratio of 10.91 overall and 25.95 for infliximab (Wang et al.), and under checkpoint inhibitors, at 1.96% incidence (Zhan et al.).

The closest existing method is OmniV-Med. It prunes patches whose L1 distance to the adjacent CT slice or video frame falls below a threshold, removing 60% of tokens "without performance degradation." We reuse its premise that temporal redundancy can be pruned. We differ in three respects:

  • What a patch is compared to. We compare to a clinically chosen anchor as well as the neighbor, not only to the adjacent frame.
  • Time scale. We handle irregular gaps of weeks to months, not consecutive frames.
  • How success is judged. We measure whether faint, slow lesions survive, which OmniV-Med never tests.

Two papers constrain the design. DeltaNet's raw subtraction is vulnerable to patient rotation and inspiration differences, so a naive anchor difference would mostly flag positioning noise. Region-detector tokenizers (Dalla Serra et al.; Hu et al.) are tied to 26 to 36 fixed anatomical boxes. Hu et al. report that their model tracks at most two locations per disease, which rules out box-based compression for diffuse or multifocal infection.

Research Program

We build a multi-exam reader on a medical multi-image model of the Med-Mantis type, a Mantis-8B model fine-tuned on Med-MIM (Yang et al.). We insert a compression step between the vision encoder and the language model.

Each patient timeline contains an anchor exam $b$. The anchor is the earliest exam, or, where treatment dates are recoverable from report text, the last exam before immunosuppression started. The patch retention score is defined as follows. Let $x_i^t$ be the encoder embedding of patch $i$ in exam $t$, and let $N(i)$ be a small spatial window around patch $i$:

$$s_i^t = \max\Big(\min_{j \in N(i)} \lVert x_i^t - x_j^b \rVert,\ \min_{j \in N(i)} \lVert x_i^t - x_j^{t-1} \rVert\Big)$$

Taking the minimum over the window borrows CoCa-CXR's neighborhood idea. A patch that has merely shifted a few pixels because of positioning finds a close match nearby and scores low. A patch with genuinely new tissue finds no match and scores high.

Compression then proceeds in three steps:

  1. Each exam after the anchor keeps its top-$k$ patches by $s_i^t$, with their positions.
  2. The remaining patches are pooled into a few summary tokens.
  3. The anchor exam itself is kept at moderate resolution using 2×2 pixel shuffle, which folds neighboring patches into one wider token (Idefics3).

Each exam is also tagged with its elapsed time since the anchor. The language model is fine-tuned on interval-change question answering and report generation over timelines of up to 12 exams drawn from MIMIC-T (TiBiX), which contains around 32,000 patients with multiple studies.

We treat host status as a secondary, testable ingredient rather than the core mechanism. In one variant, immune context extracted from the report (for example "neutropenic," "transplant," "on chemotherapy") lowers the retention threshold, spending more tokens on borderline patches. We test whether this adds anything beyond simply giving the model the same text.

There is no public immunocompromised chest X-ray benchmark in the material we have. We therefore evaluate in two ways.

Controlled stress test. We insert synthetic faint opacities into real MIMIC-T timelines, grid-searching two parameters: lesion contrast, and growth per visit (the rate at which the lesion enlarges from one exam to the next). The question is which method still lets the model answer "is there a new opacity relative to baseline?" Synthetic insertion is a known realism limitation. Its role is to map where each compressor fails, not to estimate clinical accuracy.

Real-world check. We build an immunocompromised subset of MIMIC-CXR by matching report and indication text for chemotherapy, neutropenia, transplant, biologic or steroid therapy, and opportunistic infection terms. Interval-change labels come from comparison sentences in the reports. Labels will be noisy, so we will hand-verify a stratified sample before trusting the subset.

Baselines

Naive reference. The naive reference reflects current practice: feed only the most recent two exams, uncompressed, to the same Med-Mantis-style backbone. This is what the two-point literature does. The strongest published two-point number on MS-CXR-T is CoCa-CXR's 65.0% average progression accuracy across five conditions (CoCa-CXR), and we report against it. On the multi-image side, Med-Mantis reports 74.86% on held-in closed-ended temporal questions. Beating the naive reference means higher detection of baseline-relative change on timelines of three or more exams, with no loss on MS-CXR-T pairs.

Uniform compression. Uniform compression applies pixel shuffle or bilinear token downsampling (Dense Connector) to every exam at the same total budget. It is the cheapest way to fit many exams, and it treats normal lung and faint lesion identically.

Learned query bottleneck. The learned query bottleneck is a MIRAGE-style Q-Former at 32 tokens per image (Visual Haystacks), equivalent to a Flamingo-style resampler. It is the strongest learned competitor because it can, in principle, learn to keep whatever matters.

Strongest heuristic competitor. The strongest heuristic competitor, and the most direct threat, is OmniV-Med's adjacent-frame L1 pruning re-implemented on chest X-ray series. OmniV-Med reports a 60% token reduction without degradation and 93.42% closed PathVQA accuracy. We found no reported result on Lacuna for adjacent-frame pruning on multi-visit chest X-ray timelines.

Ablations. Ablations isolate the key ingredient by comparing three choices of what a patch is scored against: the anchor only, the adjacent exam only (which reduces to OmniV-Med's rule plus our neighborhood matching), and both. A further ablation removes the neighborhood minimum to show how much positioning noise it absorbs.

Fairness controls. All methods share the same backbone, fine-tuning data, number of training steps and hyperparameter search budget. Total visual tokens per timeline are matched exactly, at three budgets.

What counts as beating them. We count the comparison as won if anchor-based retention gives a statistically clear gain in detecting slow-drift lesions at matched budget. The gain must be larger at low contrast and slow growth than at high contrast. The method must also stay within noise of the best baseline on Medical-Diff-VQA (prior METEOR 0.651, Wu et al.) and MIMIC-Diff-VQA (prior 60.2% accuracy and difference CIDEr 1.027, Hu et al.).

Why not just…?

Why not just keep the last two exams? This is a real threat. Most interval-change questions in MIMIC are about the immediate prior, and the two-point models already score well there. Our bet is narrower: when a lesion grows a little per visit, the two-exam window shows almost no change, while the anchor comparison shows a lot. The stress-test grid settles this directly. If the last-two-exams baseline matches us at slow growth rates, long histories add nothing for this question, and we will report that.

Why not just tell the model the patient is immunocompromised and use uniform pooling? Text conditioning cannot restore pixels that pooling has already averaged away. A faint sub-centimeter haze merged with three normal neighbors may be unrecoverable regardless of the prompt. The proposal tests this directly: uniform pooling plus host-status text is run against our method without host text at the same budget. If the text-conditioned version wins, compression is not the bottleneck, and the host-aware retention variant becomes moot.

Why not just use a learned resampler and let training decide what to keep? Learned bottlenecks optimize for whatever dominates the training loss. In MIMIC that means common, conspicuous findings, and the rare faint opportunistic lesions are scarce. MIRAGE's results show such bottlenecks retrieve well on natural images, but nothing in the file shows that they keep low-contrast clinical detail. If the resampler does match us on the stress test, it is the simpler choice and we would recommend it. That outcome would be a useful negative result.

Why not just use OmniV-Med's adjacent-frame pruning? It is the same family of method, so the anchor ablation is the decisive comparison. Adjacent pruning was validated on slices and video frames milliseconds or millimeters apart. In those settings small per-step change really does mean redundancy. Across months of slow drift, that assumption is exactly what fails.

Decisive Checks

The single most informative experiment is the stress-test grid of lesion contrast against per-visit growth, at three matched budgets. The proposal is supported if the anchor-scored compressor's advantage over adjacent-frame pruning and the learned resampler grows as contrast falls and growth slows. It is refuted if the curves coincide.

The second check is the stratified real-data comparison: the immunocompromised MIMIC subset versus matched general-population timelines. If our gains appear only in the synthetic setting, we will say so.

The third check is a guard against positioning noise. On timelines labeled "no change," we measure how many tokens the anchor score assigns to rotation or inspiration artifacts, with and without neighborhood matching. A compressor that spends its budget on alignment errors would undercut the whole idea.

References

  1. Medical Large Vision Language Models with Multi-image Visual Ability
  2. Learning to Exploit Temporal Structure for Biomedical Vision-Language Processing
  3. CoCa-CXR: Contrastive Captioners Learn Strong Temporal Structures for Chest X-Ray Vision-Language Understanding
  4. TempA-VLP: Temporal-Aware Vision-Language Pretraining for Longitudinal Exploration in Chest X-Ray Image
  5. DeltaNet: Conditional Medical Report Generation for COVID-19 Diagnosis
  6. LongVU: Spatiotemporal Adaptive Compression for Long Video-Language Understanding
  7. Visual Haystacks: A Vision-Centric Needle-In-A-Haystack Benchmark
  8. Expression of Toll-like receptor 4 in lungs of immune-suppressed rat with Acinetobacter baumannii infection
  9. Acute lymphoblastic leukemia with Fusarium solani infection: a case report
  10. IDDF2018-ABS-0061 Risk of tuberculosis in inflammatory bowel disease and other immune-mediated diseases on biological therapy: a population-based study in hong kong
  11. Tuberculosis infection following administration of immune checkpoint inhibitors: a real world observational study
  12. OmniV-Med: Scaling Medical Vision-Language Model for Universal Visual Understanding
  13. Controllable Chest X-Ray Report Generation from Longitudinal Representations
  14. Expert Knowledge-Aware Image Difference Graph Representation Learning for Difference-Aware Medical Visual Question Answering
  15. Building and better understanding vision-language models: insights and future directions
  16. TiBiX: Leveraging Temporal Information for Bidirectional X-Ray and Report Generation
  17. Dense Connector for MLLMs
  18. Saliency Guided Longitudinal Medical Visual Question Answering