Skip to main content

RANGER: Sparsely-Gated Mixture-of-Experts with Adaptive Retrieval Re-ranking for Pathology Report Generation

AuthorsYixin Chen et al.
Year2026
FieldComputer Vision
arXiv2603.04348
PDFDownload
Categoriescs.CV, cs.AI

Abstract

Pathology report generation remains a relatively under-explored downstream task, primarily due to the gigapixel scale and complex morphological heterogeneity of Whole Slide Images (WSIs). Existing pathology report generation frameworks typically employ transformer architectures, relying on a homogeneous decoder architecture and static knowledge retrieval integration. Such architectures limit generative specialization and may introduce noisy external guidance during the report generation process. To address these limitations, we propose RANGER, a sparsely-gated Mixture-of-Experts (MoE) framework with adaptive retrieval re-ranking for pathology report generation. Specifically, we integrate a sparsely gated MoE into the decoder, along with noisy top-kk routing and load-balancing regularization, to enable dynamic expert specialization across various diagnostic patterns. Additionally, we introduce an adaptive retrieval re-ranking module that selectively refines retrieved memory from a knowledge base before integration, reducing noise and improving semantic alignment based on visual feature representations. We perform extensive experiments on the PathText-BRCA dataset and demonstrate consistent improvements over existing approaches across standard natural language generation metrics. Our full RANGER model achieves optimal performance on PathText dataset, reaching BLEU-1 to BLEU-4 scores of 0.4598, 0.3044, 0.2036, and 0.1435, respectively, with METEOR of 0.1883, and ROUGE-L of 0.3038, validating the effectiveness of dynamic expert routing and adaptive knowledge refinement for semantically grounded pathology report generation.


Engineering Breakdown

Plain English

This paper tackles pathology report generation from whole slide images (WSIs), which are gigapixel-scale medical images with complex tissue heterogeneity that make automated report generation extremely difficult. The authors propose RANGER, a Mixture-of-Experts framework with sparse gating and adaptive retrieval re-ranking that improves upon existing transformer-based approaches by using specialized decoder experts instead of a single homogeneous decoder. The key innovation is integrating sparsely-gated MoE routing with noisy top-k selection and load-balancing regularization to reduce noisy external knowledge injection while enabling the model to specialize different experts for different morphological patterns. This addresses a genuine bottleneck in digital pathology: prior transformer approaches either use static retrieval or suffer from irrelevant external knowledge contaminating the generation process.

Core Technical Contribution

The core technical novelty is a sparsely-gated Mixture-of-Experts architecture applied specifically to the decoder of pathology report generation systems, combined with adaptive retrieval re-ranking. Unlike prior work that uses a single decoder architecture with static or non-selective knowledge retrieval, RANGER introduces multiple specialized experts in the decoder where each expert can specialize in generating reports for different tissue types and morphological patterns. The noisy top-k routing mechanism with load-balancing regularization is critical—it prevents mode collapse where all examples route to the same expert while also filtering out irrelevant retrieved documents that would otherwise degrade report quality. This represents a shift from homogeneous to heterogeneous decoder design for medical text generation, allowing the model to learn when to trust external knowledge versus when to rely on visual understanding alone.

How It Works

The input is a gigapixel WSI that must first be processed to extract visual features (likely through patch embedding or hierarchical feature extraction given the scale). These visual features feed into a transformer encoder that builds a rich representation of the slide's morphology. The decoder then uses MoE routing: for each generation step, the model runs the input through multiple expert networks and a gate network that computes sparse routing weights, typically selecting only k experts (e.g., top-2 or top-3) rather than using all experts. Simultaneously, an adaptive retrieval module retrieves candidate pathology snippets or knowledge base entries, but instead of naively concatenating all of them, the re-ranking component filters and weights these retrieved items before they're passed to the decoder. The output is the final pathology report generated autoregressively, with the load-balancing regularization during training ensuring that experts maintain balanced utilization and don't collapse to a subset. This three-part system (sparse routing + expert specialization + ranked retrieval) means the model learns which types of morphology should be handled by which experts and when external knowledge is actually helpful versus noise.

Production Impact

For production pathology systems, RANGER offers concrete improvements in report quality and reliability without requiring massive increases in model scale. Engineers could replace existing transformer decoders with this MoE variant and potentially see faster inference per expert (smaller individual expert networks vs. one large decoder) and more interpretable failures since you can inspect which expert handled which tissue type—critical for clinical validation and debugging. The adaptive retrieval re-ranking is particularly valuable: current systems often struggle with irrelevant knowledge contamination that generates hallucinated pathological findings, and the ranking mechanism directly addresses this by filtering noise. However, the trade-off is increased complexity: MoE routing adds computational overhead during inference (must run through multiple experts + gate network), requires careful load-balancing tuning during training to prevent expert collapse, and demands more sophisticated deployment logic than a standard decoder. For a large hospital deployment processing thousands of slides daily, this could mean 10-20% higher per-slide latency but potentially 5-15% reduction in report quality errors—a worthwhile trade in high-stakes medical settings if engineering resources are available for proper implementation and monitoring.

Limitations and When Not to Use This

The paper's abstract does not specify performance metrics, failure analysis, or edge cases, so we cannot evaluate whether RANGER generalizes across different cancer types, stain variations, or tissue preparation methods—critical questions for real clinical deployment. The MoE approach assumes that clear expert specialization exists and that morphological patterns are separable enough for routing to be meaningful; if tissue types overlap heavily or the routing is ambiguous, the sparse routing could force incorrect expert assignment and degrade results. Load-balancing regularization is mentioned but not detailed, which is problematic because MoE systems are notoriously difficult to tune and prone to pathological behaviors like all-expert routing or expert collapse if the regularization weight is wrong. Additionally, the retrieval re-ranking component is described only as 'adaptive' without clarity on computational cost, retrieval database size, or how it performs when no relevant knowledge exists in the knowledge base—critical for real-world deployment where knowledge bases are incomplete or domain-specific. The gigapixel scale problem is acknowledged but not solved transparently; it's unclear whether the visual encoding is still a bottleneck or whether the method requires hierarchical/patched processing that could lose fine-grained morphological details.

Research Context

This work builds on two established research directions: transformer-based medical image analysis (particularly vision transformers for histopathology) and Mixture-of-Experts scaling for language models. The MoE application here is novel because prior MoE work focused on language or general vision tasks, whereas histopathology requires handling extreme resolution (gigapixels vs. typical image classification at 224x224) and specialized morphological knowledge. The retrieval component relates to retrieval-augmented generation (RAG) systems popularized by papers like REALM and Atlas, but the adaptive re-ranking is a refinement addressing the specific problem that naïve RAG injects too much noise into medical text generation. RANGER likely improves upon recent pathology report benchmarks (if any exist like VQA-Rad or PathVQA for WSIs), though the abstract doesn't cite baseline numbers, making it hard to assess the magnitude of improvement. This opens research directions in adaptive expert routing for domain-specialized document generation, better knowledge filtering for medical LLMs, and methods to handle extreme-scale images without hierarchical patch processing that loses information.


:::tip Subscribe Get weekly breakdowns of papers like this in AI Letters - the newsletter for engineers building production AI systems. :::


Back to Research Lab → · Subscribe to AI Letters →

© 2026 EngineersOfAI. All rights reserved.