arXiv:2609.06590cs.LGSep 2026

Manuscript Offprint

arXiv:2609.06590

Layer-Wise Gate-Controlled Prompt Truncation in a Multimodal Chest X-Ray Classifier

Jingtao Lei, Hongji Li, Dexiang Shu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Mixture of Prompt Experts (MoPE) adapts multimodal transformers through input-dependent prompt composition, while retaining a fixed prompt length. We investigate a layer-wise gating extension in a binary chest X-ray classification pilot study. The controller predicts a retention ratio for each sample, averages these ratios within a mini-batch, and uses the resulting integer length to truncate the static and mixed visual prompts. Retained mixed prompts are also scaled by the individual ratios. In one recorded run per configuration, the gated model reached a best validation accuracy of 0.8966, compared with 0.8969 for the fixed-length baseline; the corresponding final values were 0.8963 and 0.8802. The exported gate statistics imply a retained length of one at all recorded training points, relative to a configured maximum of six. This reduces the complete visual sequence from 210 to 200 tokens, but no direct runtime measurements establish an acceleration benefit. Report-derived labels, report text as input, sequential data partitioning, and the absence of repeated controlled experiments limit interpretation. The findings document prompt shortening under the configured gate penalty; they do not establish sample-specific length allocation, superiority over fixed short prompts, or clinical utility. Code is available at: https://github.com/jingtaolei/mope-dynamic-prompt-truncation.

Keywords: multimodal learning; visual prompt tuning; mixture of prompt experts; prompt truncation; parameter-efficient adaptation; chest X-ray classification

1 Introduction

Transformer architectures underpin many pretrained language and vision models [1–3]. Adapting these models to a new task can require substantial task-specific storage and optimization. Continuous prompt tuning addresses this problem by learning additional token representations while retaining pretrained backbone weights [4–7]. Low-rank adaptation provides an alternative through trainable low-rank weight updates [8]. These methods motivate the study of adaptation capacity as an explicit design choice rather than an unrestricted consequence of full fine-tuning.

Multimodal adaptation must also coordinate information across input modalities. Mixture of Prompt Experts (MoPE) represents adaptation prompts as combinations of expert prompt banks, with routing weights conditioned on multimodal features [9]. This mechanism varies prompt composition across samples. However, the number of prompt tokens supplied to a transformer layer remains fixed. Prompt composition and prompt length therefore represent different dimensions of adaptation.

We investigate a gate-controlled extension that changes the retained visual prompt length at each layer. A two-layer feed-forward network predicts a ratio from the current visual class token and a mapped report representation. The implementation averages these ratios over the mini-batch before discretization, so each batch shares one retained length at a given layer. The sample-specific ratios additionally scale the mixed prompts. The controller therefore combines batch-dependent length selection with sample-specific amplitude modulation.

We examine this mechanism in a derived normal-versus-abnormal classification task using chest radiographs and reports. The study focuses on prompt behavior in this specific multimodal optimization setting. The construction of the report-derived target and its overlap with the text input are detailed in Section 3.1.

The study contributes a precise account of the implemented gate and its gradient paths, a reanalysis of the recorded comparison with a fixed-length model, and explicit accounting of prompt tokens and controller parameters. The observed gate statistics are consistent with minimum-length collapse rather than demonstrated allocation according to input difficulty. We therefore examine whether the evidence supports prompt shortening, and identify the controls required to establish an advantage over a short fixed prompt.

References (15)