\documentclass[11pt]{article}

% Change "review" to "final" to generate the final (sometimes called camera-ready) version.
% Change to "preprint" to generate a non-anonymous version with page numbers.
\usepackage[final]{acl}

% Standard package includes
\usepackage{times}
\usepackage{latexsym}

% For proper rendering and hyphenation of words containing Latin characters (including in bib files)
\usepackage[T1]{fontenc}
% For Vietnamese characters
% \usepackage[T5]{fontenc}
% See https://www.latex-project.org/help/documentation/encguide.pdf for other character sets

% This assumes your files are encoded as UTF8
\usepackage[utf8]{inputenc}

% This is not strictly necessary, and may be commented out,
% but it will improve the layout of the manuscript,
% and will typically save some space.
\usepackage{microtype}

% This is also not strictly necessary, and may be commented out.
% However, it will improve the aesthetics of text in
% the typewriter font.
\usepackage{inconsolata}

%Including images in your LaTeX document requires adding
%additional package(s)
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{tcolorbox}
\usepackage{graphicx}
\usepackage{subcaption} % Add this to your preamble

%\setlength\titlebox{<dim>}
%
% and set <dim> to something 5cm or larger.

\title{LAMAR-2 at MedGenVidQA 2026: Visual Answer Localization in Medical Videos via Multimodal LLM and Context-Augmented Prompting
}

% Author information can be set in various styles:
% For several authors from the same institution:
% \author{Author 1 \and ... \and Author n \\
%         Address line \\ ... \\ Address line}
% if the names do not fit well on one line use
%         Author 1 \\ {\bf Author 2} \\ ... \\ {\bf Author n} \\
% For authors from different institutions:
% \author{Author 1 \\ Address line \\  ... \\ Address line
%         \And  ... \And
%         Author n \\ Address line \\ ... \\ Address line}
% To start a separate ``row'' of authors use \AND, as in
% \author{Author 1 \\ Address line \\  ... \\ Address line
%         \AND
%         Author 2 \\ Address line \\ ... \\ Address line \And
%         Author 3 \\ Address line \\ ... \\ Address line}

\author{
  \textbf{Watcharitpol Sermsrisuwan\textsuperscript{1,2}},
  \textbf{Nopporn Lekuthai\textsuperscript{1,2}},
  \textbf{Seksan Yoadsanit\textsuperscript{1,2}},
  \\
  \textbf{Titipat Achakulvisut\textsuperscript{1}}
  \\
  \\
  \textsuperscript{1} Department of Biomedical Engineering, Faculty of Engineering, Mahidol University,\\ Nakhon Pathom, Thailand
  \\
  \textsuperscript{2} Faculty of Medicine Ramathibodi Hospital, Mahidol University, Bangkok, Thailand
  \\
  \small{
    \textbf{Correspondence:} \href{mailto:titipat.ach@mahidol.ac.th}{titipat.ach@mahidol.ac.th}
  }
}

%\author{
%  \textbf{First Author\textsuperscript{1}},
%  \textbf{Second Author\textsuperscript{1,2}},
%  \textbf{Third T. Author\textsuperscript{1}},
%  \textbf{Fourth Author\textsuperscript{1}},
%\\
%  \textbf{Fifth Author\textsuperscript{1,2}},
%  \textbf{Sixth Author\textsuperscript{1}},
%  \textbf{Seventh Author\textsuperscript{1}},
%  \textbf{Eighth Author \textsuperscript{1,2,3,4}},
%\\
%  \textbf{Ninth Author\textsuperscript{1}},
%  \textbf{Tenth Author\textsuperscript{1}},
%  \textbf{Eleventh E. Author\textsuperscript{1,2,3,4,5}},
%  \textbf{Twelfth Author\textsuperscript{1}},
%\\
%  \textbf{Thirteenth Author\textsuperscript{3}},
%  \textbf{Fourteenth F. Author\textsuperscript{2,4}},
%  \textbf{Fifteenth Author\textsuperscript{1}},
%  \textbf{Sixteenth Author\textsuperscript{1}},
%\\
%  \textbf{Seventeenth S. Author\textsuperscript{4,5}},
%  \textbf{Eighteenth Author\textsuperscript{3,4}},
%  \textbf{Nineteenth N. Author\textsuperscript{2,5}},
%  \textbf{Twentieth Author\textsuperscript{1}}
%\\
%\\
%  \textsuperscript{1}Affiliation 1,
%  \textsuperscript{2}Affiliation 2,
%  \textsuperscript{3}Affiliation 3,
%  \textsuperscript{4}Affiliation 4,
%  \textsuperscript{5}Affiliation 5
%\\
%  \small{
%    \textbf{Correspondence:} \href{mailto:email@domain}{email@domain}
%  }
%}

\begin{document}
\maketitle
\begin{abstract}
This paper presents an approach to localizing visual answers within continuous medical videos using a multi-step multimodal generation pipeline with the MedGenVidQA dataset. We frame visual answer localization as a multimodal fusion problem, integrating raw video, timestamped ASR transcripts, and VLM-generated scene descriptions into structured contextual blocks, enabling the model to cross-reference spoken commentary against observable physical events. We show that targeted guidance, which forces the model to treat audio transcripts as supplementary hints with observable visual movements, significantly outperforms baseline approaches. It achieves state-of-the-art performance on the test leaderboard, yielding an mIoU of 79.55, alongside IoU@0.3, IoU@0.5, and IoU@0.7 scores of 93.75, 90.00, and 77.50, respectively. Our findings highlight the effectiveness of combining multimodal context fusion with targeted guidance to overcome text bias, establishing a promising approach for achieving the micro-level precision required in the medical domain. We release our code on GitHub at \href{https://github.com/biodatlab/medgenvidqa-lamar}{github.com/biodatlab/medgenvidqa-lamar}.
\end{abstract}

\section{Introduction}

Multimodal data captures the complexity of medicine and advances medical question answering \cite{AlSaad2024Multimodal}. Medical video question answering (MedVidQA) with large language models (LLMs) supports healthcare professionals by providing information from procedural videos. \cite{Li2024LLaVA-Surg:} State-of-the-art models generate fluent, in most cases, medically accurate responses but lack spatiotemporal precision to localize visual answers in videos \cite{Xiao2023Can}. 

The shift toward multimodal large language models (MLLMs) has improved audio-visual QA by combining spatial and temporal cues with textual data \cite{Zhang2023Video-LLaMA:}. These models succeed in understanding general video but reveal a gap in the medical domain \cite{Wang2025SurgVidLM:}. General-purpose MLLMs often suffer from temporal hallucinations, providing broad or incorrect timestamps that fail to pinpoint clinical task boundaries \cite{11092739}. In medical procedural, identifying these requires more than simple object recognition. It demands a strict visual distinction between the preparation and the actual start of a medical step \cite{Timoh2023A}.

We propose a novel approach for localizing visual answers in the MedGenVidQA 2026 Task C dataset \cite{gupta-etal-2026-medgenvid-qa-overview}. This task requires pinpointing precise start and end timestamps within continuous medical videos to directly answer a natural language clinical query. Our empirical analysis reveals that arbitrary text chunking fragments the continuous chronological flow required for observable physical events. Therefore, we reframe visual answer localization as an end-to-end multimodal generation task. Our architecture integrates timestamped ASR transcripts, VLM-generated structural scene descriptions, and raw video directly into the Gemini-3-Flash model. Guided by procedurally-targeted heuristic prompt that prioritizes physical visual movements over auditory dialogue, our system achieves state-of-the-art IoU@0.3, IoU@0.5, IoU@0.7, and mIoU scores of 93.75, 90.00, 77.50, and 79.55, respectively, on the leaderboard.

\section{Related work}

Medical Visual Answer Localization (MVAL) benchmarks, such as MedVidQA and MedVidCL \cite{gupta2023dataset}, alongside automated corpora like HealthVidQA \cite{gupta-etal-2024-towards}, establish the foundation for medical instructional video analysis. While Temporal Answer Grounding in Videos frequently treats localization as a text-span prediction problem—relying on subtitles and learned visual prompts \cite{10552074}—this approach struggles with the temporal asynchrony of complex medical procedures because spoken commentary often misaligns with physical execution.

Temporal sentence grounding isolates video segments that match natural language queries \cite{10075491}. While classical methods relied on cross-modal interactions to predict boundaries \cite{cao-etal-2021-pursuit, 10.1145/3394171.3413862, zhang-etal-2021-parallel}, the field has recently shifted toward unified frameworks that consolidate grounding tasks for large-scale pretraining and zero-shot application \cite{10377813}.

Despite the proven potential of multimodal LLMs in healthcare, accurate temporal grounding in medical videos remains a persistent challenge \cite{AlSaad2024Multimodal, Chen2025SurgLLM:, Xiao2023Can}. Recent corpus-level frameworks attempt to optimize large-scale retrieval and localization using subtitle enhancement and contrastive learning \cite{10179965}. However, their fundamental reliance on textual alignment excels only at macro-level identification, leaving the micro-temporal asynchrony of individual surgical procedures unresolved. This gap highlights the necessity for strictly bounded, visually anchored multimodal fusion strategies. These strategies ensure that localization accurately reflects the physical execution in the videos.

\section{Datasets}

We utilized the MedVidQA dataset \cite{gupta2023dataset}, originally comprising 3,010 human-annotated QA pairs from 900 health-related videos. Due to platform-level download restrictions, we use and evaluate 49 unique videos consisting of 148 QA pairs from the dataset. The development set features a mean video length of 445.62 $\pm$ 239.89 seconds and an average annotation span of  57.72 $\pm$ 41.84 seconds. For the final evaluation, we used the official MedGenVidQA 2026 Task C test data set \cite{gupta-etal-2026-medgenvid-qa-overview}, which contains 80 medical questions assigned to 65 unique instructional videos  with a mean video duration of 544.72 $\pm$ 432.74 seconds.

As the organizers withhold the official test ground truth, we conducted a manual annotation of the 80 test QA pairs. We utilized these annotations exclusively for qualitative error analysis, ensuring our primary quantitative metrics reflect our official leaderboard submission.

\section{Methodology}
\label{section:methodology}

We frame temporal localization as a generative prediction task: given a medical video and a clinical query, a large language model (LLM) must output the start and end timestamps of the relevant action. Our core hypothesis is that enriching the LLM's input with structured, multi-source context yields more accurate localization than any single modality alone.  To test this, we evaluated context configurations using transcript only, video only, and their combination with VLM-generated scene descriptions to identify the strongest data representation.

\subsection{Unimodal Baselines}
\label{subsection:unimodal}

To isolate the predictive contribution of each modality, we established two baselines. \textbf{Transcription-Only} provides the LLM with only the clinical query and the full ASR transcript composed of timestamp-aligned, sentence-level groupings, predicting temporal boundaries from spoken commentary alone. \textbf{Video-Only} provides the LLM with only the clinical query and the raw untrimmed video, relying entirely on visual reasoning without any textual input. These baselines quantify whether temporal boundaries are primarily signaled by spoken commentary or by observable physical actions, and they provide a lower bound for multimodal integration.


\subsection{Retrieval-Augmented Generation (RAG) on Transcripts}
\label{subsection:rag}

Medical transcripts are often lengthy and noisy. Rather than feeding the full transcript to the LLM, we also experimented using RAG \cite{10.5555/3495724.3496517} to select only the most query-relevant segments. We evaluated two complementary partitioning schemes, each tuned empirically on the development set: \textbf{time-based chunking and retrieving}, which applies a temporal sliding window with a fixed overlap to preserve context across boundaries and retrieve a fixed number of top candidates, and \textbf{sentence-based chunking and retrieving}, which applies a sentence-count sliding window with a fixed overlap to maintain chronological continuity. We utilized a dynamic percentage threshold for retrieval to ensure proportional and adaptive content coverage.

\subsubsection*{Temporal Reciprocal Rank Fusion.} 
Because arbitrary chunk boundaries can split a continuous medical action, we designed a rank-based temporal merging algorithm \cite{Rackauckas2024RAGFusionAN}. Each retrieved chunk, $c$, receives a base weight inversely proportional to its retrieval rank. Adjacent chunks whose time spans overlap are iteratively fused into a single segment, $C$, with an accumulated relevance score:
\begin{equation}
  \label{eq:rrf}
  \text{Score}(C) = \sum_{c_i \in C} \frac{1}{\text{rank}(c_i)}
\end{equation}
Merging continues until no remaining candidates overlap. The fused segment with the highest accumulated score is selected as the context block for the generative model.

\subsection{Generating Scene Description Context}
\label{subsection:scene-description -context}

To produce a structured visual context, we partitioned each video into segments at natural camera cuts using PySceneDetect \cite{castellano_pyscenedetect}. Each segment was then passed through Qwen3-VL \cite{Qwen3-VL}, which generated a textual description of the observable physical events within that time span. We temporally aligned the ASR transcript with these VLM-generated scene descriptions. The resulting fused contextual blocks, each containing both the visual scene descriptions and spoken dialogue for a specific time span, served as the structured context input for the LLM (Figure \ref{fig:experiments}).

\subsection{VLM-Enhanced Context}
\label{subsection:integration}

We hypothesize that enriching the LLM's input with structured, multi-source context, rather than relying on any single modality, yields more accurate temporal localization. Specifically, by fusing raw video with fused contextual blocks, the model can cross-reference spoken commentary against observable physical events, resolving ambiguities that neither modality addresses alone. Under this hypothesis, the primary lever for improving performance is not architectural modification or retrieval tuning, but contextual guidance: carefully designing what information the LLM sees and how it is structured.

We evaluated two approaches that combine visual information and ASR transcripts. \textbf{Transcript-Video Fusion} processes the raw video, the full ASR transcript, and the query through the LLM. \textbf{VLM-Enhanced Context} processes the raw video with fused contextual blocks, and the query. This approach adds observable physical events rather than transcripts alone. 

\begin{figure}[t]
  \centering
  \includegraphics[width=\columnwidth]{latex/pipelineVLM.pdf} 
  \caption{Overview of the proposed VLM-Enhanced Context pipeline for medical video analysis.}
  \label{fig:experiments}
\end{figure}

\subsection{Boundary Trimming}
\label{subsection:trimming}
Across all pipelines, final temporal localization was performed by Gemini-3-Flash. The data representation varied by pipeline, ranging from full transcript, RAG-filtered context block, raw video, to video with fused contextual block, to output precise start and end timestamps for the queried action.

\subsection{Inference-Time Contextual Guidance}
\label{subsection:inference-guidance}
To improve upon the model's clinical reasoning and enforce temporal precision within the surgical domain, we evaluated four constraint-based guidance. Each strategy constrains how the MLLM weighs textual evidence against visual observations during inference.

%These dictate how the VLM weighs competing multimodal inputs during inference.
\begin{itemize}
    \item \textbf{Zero-Shot with Reasoning:} The model was instructed to directly predict temporal boundaries, explicitly requiring a justification of its visual logic (intermediate reasoning) prior to outputting the final timestamps.
    \item \textbf{Strict Visual Boundary:} The instruction explicitly guide the model to prioritize visual evidence over auditory commentary excluding unrelated sections such as pre-operative verbal planning, introductory remarks.
    \item \textbf{Chain of thought (CoT):} The model was required to identify specific observable physical events e.g., scalpel makes first tissue contact and the end of the event. This intermediate reasoning step prevents the model from copying timestamps from the transcript.
    \item \textbf{Heuristic Context (Loose):} In this strategy, the transcript and audio were treated as supplementary heuristics only, and boundaries were derived from physical movements in the video.
\end{itemize}

\section{Evaluation}

We measure temporal localization performance using Intersection over Union (IoU) between the predicted and ground-truth time intervals. MedVidQA benchmark \cite{gupta2023dataset} reports accuracy at three IoU thresholds (0.3, 0.5, and 0.7) where a prediction is counted as correct if its IoU with the ground truth meets or exceeds the threshold. 


% \section{Experimental Setup}

%Our experimental framework evaluates visual answer localization as an end-to-end generative process (Figure \ref{fig:experiments}).
% \subsection{Data Processing and Feature Extraction}

% \begin{itemize}
%     \item \textbf{Video and Audio Acquisition:} All video data was acquired using YT-DLP \cite{}, adhering to the platform's Terms of Service. Audio tracks were extracted as 16 kHz mono WAV files using FFmpeg \cite{}.
%     \item \textbf{ASR Model Selection:} We evaluated three ASR models: Parakeet \cite{} (natively sentence-level timestamps), Whisper large-v3  \cite{} (word-level timestamps), and Qwen3-ASR-1.7B \cite{} (word-level timestamps). To ensure a standardized input format, the precise word-level outputs from Whisper and Qwen3-ASR-1.7B were programmatically grouped into timestamp-aligned, sentence-level blocks before being fed to the LLM. Each model's transcripts were then evaluated through the Text-Only baseline using Gemini-3-Flash \cite{}, scored by mIoU and IoU at thresholds of 0.3, 0.5, and 0.7. Based on this comparison, we selected Qwen3-ASR-1.7B, augmented with a forced aligner, as the standard transcription model for all subsequent pipelines.
%     \item \textbf{Visual Scene Segmentation:} We used PySceneDetect \cite{} to partition each video at natural camera cuts. The resulting clips were processed through Qwen3-VL \cite{} to generate the chronological scene descriptions used in the VLM-Enhanced Context pipeline.
% \end{itemize}

% \subsection{Retrieval and Chunking Parameters}

% Hyperparameters for both chunking strategies were tuned empirically on the development set, optimizing for IoU. For time-based chunking, we used 20-second windows with 2-second overlap, retrieving a fixed number of top candidates (top-$k$=10). For sentence-based chunking, we used 5-sentence blocks with 4-sentence overlap, retrieving the dynamic top 40\% of all candidates chunks. All chunks were embedded using EmbeddingGemma (\texttt{google/embeddinggemma-300m}) [cite] and ranked by cosine similarity to the query before temporal fusion via the Temporal RRF algorithm.

% \subsection{Generative Boundary Trimming}
% Across all evaluated pipelines, the final temporal boundary predictions were generated by Gemini-3-Flash \cite{}. For the text-driven pipelines (Text-Only and RAG), the model processed only the textual context alongside the clinical query. For the visually-driven and multimodal pipelines (Video-Only, Transcript-Video Fusion, and VLM-Enhanced Context), the model directly ingested the raw video file alongside the query and any applicable textual representations.

% We initially evaluated three ASR models to generate transcript context: Parakeet, Whisper large-v3, and Qwen3-ASR-1.7B. To standardize the input, word-level outputs were programmatically grouped into timestamp-aligned, sentence-level blocks. Based on preliminary unimodal testing (Section \ref{subsection:unimodal}), we selected Qwen3-ASR-1.7B, augmented with a forced aligner, as the standard transcription model to provide the word-level timestamps for our multimodal fusion. As for the Scene Segment Context Generation was done as detailed in \ref{subsection:scene-segment-context})

% \subsection{Retrieval and Chunking Parameters}
% RAG hyperparameters (Section \ref{subsection:rag}) were tuned on the development set to optimize IoU. Time-based chunking used 20-second windows with a 2-second overlap (top-$k$=10). Sentence-based chunking employed 5-sentence blocks with a 4-sentence overlap (dynamic top 40\%). All chunks were embedded via \texttt{google/embeddinggemma-300m}, ranked by cosine similarity to the query, and fused using the Temporal RRF algorithm.

% \subsection{Integration and Inference}
% Across all pipelines, final boundaries were predicted by Gemini-3-Flash (Section \ref{subsection:trimming}). Inputs varied by configuration: text-driven approaches (Text-Only, RAG) processed only the query and textual context, while visually-driven and multimodal approaches (Video-Only, Transcript-Video Fusion, VLM-Enhanced Context) directly ingested raw video alongside the query, transcript, and scene contexts. Inference was guided by prompts detailed in Section \ref{subsection:inference-guidance}.

\section{Results and Discussions}

\begin{table*}[t]
    \centering
    % This forces the table to exactly fit the page margins
    \resizebox{\textwidth}{!}{%
    \begin{tabular}{lllcccc}
        \hline
        \textbf{Pipeline Configuration} & \textbf{Modality} & \textbf{Guidance Prompt} & \textbf{mIoU} & \textbf{IoU@0.3} & \textbf{IoU@0.5} & \textbf{IoU@0.7} \\
        \hline
        \multicolumn{7}{l}{\textit{Comparison of ASR model}} \\
        %\hline
        Transcription-Only (Parakeet) & Transcript Only     & Zero-Shot & \textbf{66.03} & \textbf{82.58} & \textbf{72.26} & \textbf{56.13} \\
        Transcription-Only (Qwen3-ASR)  & Transcript Only     & Zero-Shot & 65.20 & \textbf{82.58} & 71.61 & 54.84 \\
        Transcription-Only (Whisper)   & Transcript Only     & Zero-Shot & 57.86 & 81.94 & 60.65 & 40.65 \\
        \hline
        \multicolumn{7}{l}{\textit{Visual, Retrieval, and Multimodal Architectures}} \\
        %\hline
        Video-Only & Video Only   & Zero-Shot & 71.78 & 89.03 & 78.71 & \textbf{67.10} \\
        RAG (Time-based Chunking)      & Transcript Only     & Zero-Shot & 40.09 & 54.84 & 38.71 & 28.39 \\
        RAG (Sentence-based Chunking)  & Transcript Only     & Zero-Shot & 46.62 & 63.23 & 50.97 & 32.90 \\
        Transcript-Video Fusion & Video + Transcript & Zero-Shot & \textbf{72.35} & \textbf{90.32} & 78.71 & 63.87 \\
        VLM-Enhanced Context           & Video + Fused contextual block & Zero-Shot with Reasoning & 68.75 & 87.74 & \textbf{79.35} & 58.06 \\
        VLM-Enhanced Context& Video + Fused contextual block & Strict Visual Boundary & 67.56 & 87.10 & 77.42 & 56.77 \\
        VLM-Enhanced Context& Video + Fused contextual block & Chain-of-Thought (CoT) & 68.41  & 88.39 & 78.06 & 60.00  \\
        VLM-Enhanced Context& Video + Fused contextual block & Heuristic Context (Loose) & 70.59 & 89.03 & 78.71 & 63.87 \\
        \hline
        \multicolumn{7}{l}{\textit{Test Phase}} \\
        %\hline
        Video-Only & Video Only & Zero-Shot & 79.51 & \textbf{96.25} & 87.50 & 73.75 \\
        VLM-Enhanced Context& Video + Fused contextual block & Zero-Shot with reasoning & 70.95 & 90.00 & 78.75 & 63.75 \\
        VLM-Enhanced Context& Video + Fused contextual block & Strict Visual Boundary & 76.44 & 92.50 & 85.00 & 70.00 \\
        VLM-Enhanced Context& Video + Fused contextual block & Chain-of-Thought (CoT) & 74.53 & 92.50 & 83.75 & 68.75 \\
        VLM-Enhanced Context& Video + Fused contextual block & Heuristic Context (Loose) & \textbf{79.55} & 93.75 & \textbf{90.00} & \textbf{77.50} \\
        \hline
    \end{tabular}%
    }
    \caption{Development and test phase performance. Development results compare ASR models, unimodal baselines, multimodal fusion, and RAG pipelines. Test results evaluate Inference-Time Contextual Guidance on the best-performing configuration. Test phase metrics reflect official MedGenVidQA leaderboard scores}
    \label{tab:comprehensive_dev_set}
\end{table*}

Our experimental framework evaluates visual answer localization as an end-to-end generative process (Figure \ref{fig:experiments}). Across all pipelines, final boundaries were predicted by Gemini-3-Flash. Inputs varied by configuration: text-driven approaches processed only the query and textual context, while multimodal approaches directly ingested raw video alongside the query, transcript, and scene description.

\subsection{Development Phase: Transcription-only Pipeline Comparison}

% Quantitative analysis of the unimodal ASR baselines revealed that Parakeet achieved the highest overall mIoU (66.03), demonstrating a slight edge over Qwen3-ASR (65.20) in strict boundary regression (Table \ref{tab:comprehensive_dev_set}). While both models tied at the IoU@0.3 threshold (82.58), Parakeet outperformed Qwen3-ASR at the stricter 0.5 and 0.7 thresholds. Both models, however, maintained a significant performance gap over Whisper large-v3 across all precision metrics.

% Despite Parakeet's marginal quantitative advantage, we selected Qwen3-ASR as the standard transcription context generator for all subsequent experiments. This architectural decision prioritizes downstream structural utility over isolated metric gains. Specifically, Qwen3-ASR natively generates precise word-level timestamps, providing the essential granular foundation required to successfully implement the text alignment in our pipelines.

To generate the transcript context, we initially evaluated three transcription models: Parakeet-tdt-0.6b-v2 \cite{nvidia2024parakeet}, Whisper large-v3 \cite{radford2022whisper}, and Qwen3-ASR-1.7B \cite{Qwen3-ASR}. To standardize the input, word-level outputs were programmatically grouped into timestamp-aligned, sentence-level blocks. 

Quantitative analysis of these unimodal transcription-only baselines revealed that Parakeet achieved the highest overall mIoU (66.03), demonstrating a slight edge over Qwen3-ASR (65.20) in strict boundary regression (Table \ref{tab:comprehensive_dev_set}). While both models tied at the IoU@0.3 threshold (82.58), Parakeet outperformed Qwen3-ASR at the stricter 0.5 and 0.7 thresholds. Whisper large-v3 lagged significantly across all metrics.

Despite Parakeet's marginal advantage, we selected Qwen3-ASR, as the standard transcription for all subsequent experiments. This architectural decision prioritizes downstream structural utility: Qwen3-ASR with forced aligner generates the precise word-level timestamps essential for successfully implementing text alignment in our multimodal pipelines. 

\subsection{Development Phase: Architecture and Modality Evaluation}

With the base modalities established, we tuned our integration strategies. For Retrieval-Augmented Generation baselines, hyperparameters were tuned empirically to optimize IoU. Time-based chunking utilized 20-second windows with a 2-second overlap (top-$k$=10), while sentence-based chunking employed 5-sentence blocks with a 4-sentence overlap (dynamic top 40\%). The chunks were embedded using \texttt{google/embeddinggemma-300m} \cite{embedding_gemma_2025} and fused using the Temporal RRF algorithm.

As shown in Table \ref{tab:comprehensive_dev_set}, RAG strategies performed worst overall. Because standard RAG retrieves text based on semantic keyword matching, it frequently pulled out-of-sync narrative snippets, reflecting the asynchronous nature of instructional medical videos. 

Conversely, the Transcript-Video Fusion pipeline achieved the highest overall mIoU of 72.35 and IoU@0.3 of 90.32. However, the Video-Only baseline maintained the highest precision at the strictest threshold. Introducing fused contextual block underperformed the simpler fusion pipeline, suggesting that over-engineering the context block with secondary descriptions or rigid reasoning constraints introduces noise that distracts from the primary visual signal.

\subsection{Test Phase Evaluation}

In the test phase, the Video-Only baseline achieved a highly competitive mIoU of 79.51. Consistent with development set findings, introducing textual data with complex reasoning constraints (Zero-Shot with Reasoning) significantly degraded performance, dropping the mIoU to 70.95 and IoU@0.7 to 63.75. This confirms that generative models suffer from text-reliance bias \cite{Winterbottom2020OnMB}, prematurely aligning boundaries with spoken dialog rather than actual physical interventions.

To counteract this bias, we evaluated explicitly constrained guidances. The Strict Visual Boundary (mIoU 76.44) and Chain-of-Thought (mIoU 74.53) strategies recovered substantial precision by forcing the model to anchor predictions to observable actions. However, these rigid constraints occasionally caused over-correction, leading the model to discard valuable macro-level transcript context.

The Heuristic Context (Loose) strategy proved most effective, achieving the highest overall mIoU (79.55) and peak performance at strict thresholds (IoU@0.5 of 90.00, IoU@0.7 of 77.50). By framing the transcript as a supplementary heuristic rather than heavily penalizing its use, this strategy establishes a two-step framework: macro-localization followed by micro-trimming. The model uses spoken commentary to broadly navigate to the correct procedural phase, but the prompt dictates that final timestamps must strictly bound the active physical procedure, explicitly excluding verbal introductions or planning segments.

While the Heuristic Context offers only a marginal quantitative gain over the Video-Only baseline (mIoU 79.51), it delivers a critical leap in clinical reliability. The Video-Only baseline model efficiently recognizes raw physical movements, but struggles with abstract queries requiring a broader procedural context. The Heuristic pipeline resolves this by using transcripts for macro-localization during visually obscured or repetitive phases, while its strict visual micro-trimming preserves the boundary precision of a dedicated vision model.

\subsection{Qualitative Error Analysis}

We conducted a qualitative diagnostic review to evaluate the impact of text-reliance bias and our mitigation strategies across both validation and test sets. Since official test labels are withheld, our test set analysis is based on manual inspection of model outputs rather than comparison against gold-standard annotations (Figure \ref{fig:erroranalysis}). We categorize our observations into three scenarios: transcript-assisted correction, transcript-induced bias, and visual guidance as a fix.



\begin{figure*}[t] % figure* spans both columns
    \centering
    % Subfigure 1 (page 1) on top
    \begin{subfigure}[b]{\linewidth} 
        \centering
        \includegraphics[width=\linewidth, page=1]{latex/figure.pdf}
    \end{subfigure}
    
    \vspace{1em} % Vertical space between images

    % Subfigure 2 (page 2) below
    \begin{subfigure}[b]{\linewidth} 
        \centering
        \includegraphics[width=\linewidth, page=2]{latex/figure.pdf}
    \end{subfigure}
    
    \caption{Qualitative error analysis illustrating three scenarios across development and test samples.}
    \label{fig:erroranalysis}
\end{figure*}

\textbf{Scenario A: Transcript-Assisted Correction.} Visual features should theoretically be enough to locate a procedure yet Video-Only baselines sometimes fail due to visual distractions or a lack of step-by-step reasoning. In a validation video of an AC joint test (Sample 2812), the baseline starts at 05:01, capturing the test itself but missing the necessary first step of locating the AC joint (04:18–05:01). This shows that video-only models can jump straight to the most obvious action and ignore the clinical context. In a test video of smile reconstruction (C64), the baseline predicts 03:38–03:42, which shows only a title slide, while missing the actual procedure (03:42–03:51). Our Heuristic Context guidance fixes these errors by using the transcript to ensure all required medical context is included.


\textbf{Scenario B: Transcript-Induced Bias.} The spoken transcript can also mislead the model when narration and physical action are not temporally aligned. In a test video of an endoscopic surgery (C34), the VLM-Enhanced Context pipeline with Zero-Shot with reasoning guidance starts at 00:39, which is the exact moment the instructor mentions the procedure. However, this includes 19 seconds of an MRI scan before surgery actually begins at 00:58. Similarly, in a validation video of a chin-tuck exercise (Sample 2796), the same pipeline starts at 07:23 during the anatomical explanation, capturing a 41-second gap before the physical exercise starts at 08:04. In both cases, the model anchors on spoken keywords rather than visual evidence, causing it to include verbal explanations.

\textbf{Scenario C: Visual Guidance as a Fix.} Our Heuristic Context guidance corrects this misalignment by requiring visual confirmation before anchoring the start boundary. In the surgical video (C34), the model uses the transcript to find the general timeframe but is guided to wait for the active surgical field to appear, successfully starting at 00:58. In the chin-tuck video (Sample 2796), the pipeline ignores the 41-second explanation and correctly starts at the onset of physical movement (08:08). These results demonstrate that adding visual constraints helps the model resolve the temporal gap between speech and action, resulting in higher boundary precision.

%\subsection{Qualitative Error Analysis}

%To evaluate the impact of text-reliance bias and our mitigation strategies, we conducted a qualitative diagnostic review across both validation and test sets. Because official test labels are withheld, we utilized our internal manual annotations for the test set videos to ensure a consistent evaluation. As illustrated in Figure X, we isolated specific error patterns into three scenarios.

%\textbf{Scenario A: Transcript Guidance Helps (Macro-Localization).} While visual features should theoretically suffice for macro-localization, unconstrained baselines occasionally fail in complex medical videos. They can be derailed by visual distractors, such as static title slides, or by poor clinical reasoning—prematurely snapping to a procedure demonstration while skipping essential prerequisite steps like anatomical localization. Our pipeline resolves this by using the fused contextual block, which contains the transcript. Leveraging textual cues to bypass visual noise and enforce procedural prerequisites, the pipeline successfully establishes the correct macro-level timeframe.

%\textbf{Scenario B: Transcript Misleads (Text-Reliance Bias).} Conversely, when unconstrained models attempt micro-level localization, they struggle with the temporal asynchrony inherent in instructional voiceovers. Instructors frequently explain a procedure's mechanics or benefits well before physical execution begins. Lacking strict visual constraints, the baseline model prematurely triggers its start prediction the exact moment the target keywords are spoken, capturing the prolonged verbal explanation rather than the physical action itself. This over-reliance on textual cues severely degrades micro-level temporal precision.

%\textbf{Scenario C: Visual-First Prompting Resolves Asynchrony.} Our Heuristic pipeline directly resolves this text-vision misalignment. When presented with these delayed-action scenarios, the model utilizes the contextual block to navigate to the general timeframe, but is strictly guided to wait for physical visual confirmation—such as the subject actively initiating the targeted physical movement—before anchoring the final boundary. By forcing this visual micro-trimming, our pipeline demonstrates that rigorous visual constraints successfully overcome the substantial lag between spoken instruction and physical execution, yielding highly precise temporal boundaries.

%Qualitative Error Analysis Because official test labels are withheld, we manually annotated the videos to conduct a fine-grained diagnostic review. Using these internal labels, we isolated specific errors to evaluate the impact of text-reliance bias and our mitigation strategies across three scenarios.Scenario A: Transcript Guidance Helps(Macro-Localization). Pure visual models are easily confused by static title slides or text over-lays. In Video C64, the Video-Only baseline anchors its prediction to an introductory slide, resulting in a complete localization failure. In contrast, our Heuristic pipeline uses the spoken transcript to bypass these visual distractors, suc- cessfully navigating to the true start of the physical procedure. Scenario B: Transcript Misleads (Text- Reliance Bias). Conversely, unconstrained mul- timodal models struggle with the temporal asyn- chrony inherent in medical instruction. In Video C34, the instructor mentions the queried disease at the 39-second mark, but the video displays a static MRI scan for the next 19 seconds. Lacking strict visual constraints, our Zero-Shot with Rea- soning pipeline prematurely triggers at the spoken keyword, severely degrading micro-level precision. Scenario C: Visual-First Prompting Resolves Asynchrony. Our Heuristic Context (Loose) strat- egy resolves this exact misalignment. In the same Video C34 scenario, the model uses the spoken cue to locate the general timeframe but explicitly waits the additional 19 seconds for the visual transition to the active surgical field. By anchoring the start boundary exactly at 58 seconds, it demonstrates that strict visual constraints successfully overcome the lag between spoken intent and physical execu-tion.

\section{Conclusion}

In this paper, we addressed the challenge of precise temporal localization in medical videos through a generative, multimodal lens. We identified a vulnerability in standard multimodal LLM architectures: \textit{text-reliance bias}. We demonstrated that naively feeding textual commentary or RAG-retrieved chunks into a generative model degrades temporal precision. The model prematurely aligns boundaries to spoken words rather than physical surgical actions.

To overcome this, we introduced a highly constrained, end-to-end multimodal pipeline utilizing Gemini-3-Flash. By directly fusing raw video with fused contextual block and employing a "Heuristic Context" guidance strategy, we successfully forced the generative model to treat textual context as supplementary hints while anchoring its final temporal boundaries to visual physical evidence. This approach achieved an mIoU of 79.55 and a strict IoU@0.5 of 90.00 on the test set. Our findings suggest that for complex medical video question-answering, decoupling text-based context from actual physical execution through rigorous visual prompting is essential for achieving micro-level temporal precision.


\section*{Limitations}

Despite its precision, our approach has several limitations. First, final boundary prediction relies on a proprietary model (Gemini-3-Flash), as current open-source alternatives struggle with our strict reasoning constraints. This commercial dependency poses privacy and reproducibility barriers for local clinical deployment, emphasizing the need for fine-tuned, end-to-end open-source systems. Second, our evaluation is limited to the English-centric, procedure-specific MedVidQA dataset; validating our prompting strategies on diverse, multilingual corpora remains essential. 

Finally, explicitly prioritizing visual evidence introduces modality-specific vulnerabilities. Our system is highly sensitive to visual degradation common in real-world surgical recordings (e.g., lens obstruction or sudden focus loss). Furthermore, this visual-first approach is ill-suited for dialogue-heavy clinical videos, such as patient history-taking, where temporal cues are inherently audio-driven and require transcription-reliant processing.


% Bibliography entries for the entire Anthology, followed by custom entries
%\bibliography{anthology,custom}
% Custom bibliography entries only
\bibliography{custom}

\appendix

\section{Appendix}
\setcounter{figure}{0}
\renewcommand{\thefigure}{\Alph{figure}}

\subsection{Inference-Time Contextual Guidance Templates}
\label{appendix:prompts}
In this section, we provide the complete prompt templates used to evaluate our final multimodal architecture on the test dataset. Because optimal temporal localization requires careful cross-modal reasoning, we experimented with varying levels of constraint-based guidance. The following templates illustrate the progression from a baseline extraction method (Zero-Shot with Reasoning) to increasingly constrained visual-priority strategies (Strict Visual Boundary, CoT, and Heuristic Context).

\begin{figure}[!htbp]
\begin{tcolorbox}[colframe=black!70, colback=gray!5, title=\textbf{Prompt: Zero-Shot with Reasoning}, fonttitle=\bfseries, fontupper=\small, boxsep=2pt,left=6pt,right=6pt,top=6pt,bottom=6pt, arc=1mm]

Role: You are an expert medical video analyst. You will be provided with a medical question, a medical video, and supplemental data (including visual context descriptions and audio transcripts).
\vspace{6pt}

\textbf{Your Task:}\\
Identify the precise timestamp boundaries in the video that comprehensively answers the user's question. \textbf{Visual evidence is your absolute highest priority.} You must prioritize what is actively being shown or demonstrated on screen, using the additional data primarily as supporting verification.
\vspace{6pt}

\textbf{Step-by-Step Instructions:}
\begin{enumerate}
    \item \textbf{Analyze:} Analyze the given medical question to understand exactly what information, anatomical structure, or procedure is being asked about.
    \item \textbf{Locate (Visuals First):} Find the exact moment the video \textit{visually} demonstrates the answer. If the audio discusses it but the visuals do not show it, exclude it.
    \item \textbf{Refine Boundaries:} Do not simply copy the provided supplemental segment times. Crop your timestamps tightly to the exact start and end of the visual answer.
    \item \textbf{Explain:} Briefly justify your visual logic in the "reasoning" field.
\end{enumerate}
\vspace{2pt}

\textbf{Output Format:}\\
You MUST output a valid JSON object ONLY. Do not include any conversational text outside of the JSON block. Use the following exact keys and data types:

\begin{tcolorbox}[colframe=black!50, colback=white, boxrule=0.3mm, sharp corners, fontupper=\ttfamily\footnotesize]
\{ \\
\hspace*{4mm} "reasoning": "A brief explanation of why these specific visuals answer the question.",\\
\hspace*{4mm} "answer\_start": "MM:SS",\\
\hspace*{4mm} "answer\_end": "MM:SS"\\
\}
\end{tcolorbox}
\vspace{2pt}

\textbf{Inputs:}\\
\textbf{The Question:} \{question\}\\
\textbf{Context and Transcription:} \{Additional\}

\end{tcolorbox}
\caption{The system prompt for the Zero-Shot Baseline pipeline.}
\label{fig:prompt_zeroshot}
\end{figure}
\begin{figure}[!htbp]
\begin{tcolorbox}[colframe=black!70, colback=gray!5, title=\textbf{Prompt: Strict Visual Boundary}, fonttitle=\bfseries, fontupper=\small, boxsep=2pt,left=6pt,right=6pt,top=6pt,bottom=6pt, arc=1mm]

Role: You are an expert medical video analyst. Your task is to identify the exact, continuous video segment that answers a given medical question using the provided video, visual context, and audio transcripts.
\vspace{6pt}

\textbf{Core Directives:}
\begin{enumerate}
    \item \textbf{Visuals > Audio:} Visual evidence is the absolute priority; audio is strictly for verification. Do not select segments where the action/anatomy is discussed but not visually demonstrated.
    \item \textbf{Tight Surgical Boundaries:} Timestamps must strictly bound the active physical procedure. Exclude all introductions, verbal planning, and text slides. Start exactly when the real operation begins and end exactly when it finishes.
    \item \textbf{Visual Hierarchy:} If actual surgical footage is unavailable, fallback to a physical demonstration. If that is also unavailable, fallback to a text-based explanation.
\end{enumerate}
\vspace{2pt}

\textbf{Output Format:}\\
Output ONLY a valid JSON object. Do not include any conversational text, markdown formatting outside the JSON, or explanations outside the "reasoning" key.

\begin{tcolorbox}[colframe=black!50, colback=white, boxrule=0.3mm, sharp corners, fontupper=\ttfamily\footnotesize]
\{ \\
\hspace*{4mm} "reasoning": "Brief explanation prioritizing why the visual context (supported by audio) answers the question.",\\
\hspace*{4mm} "answer\_start": "MM:SS",\\
\hspace*{4mm} "answer\_end": "MM:SS"\\
\}
\end{tcolorbox}
\vspace{2pt}

\textbf{Inputs:}\\
\textbf{The Question:} \{question\}\\
\textbf{Context and Transcription:} \{Additional\}

\end{tcolorbox}
\caption{The system prompt for the Strict Visual Boundary strategy.}
\label{fig:prompt_strict}
\end{figure}

\begin{figure}[!htbp]
\begin{tcolorbox}[colframe=black!70, colback=gray!5, title=\textbf{Prompt: Chain-of-Thought (CoT)}, fonttitle=\bfseries, fontupper=\small, boxsep=2pt,left=6pt,right=6pt,top=6pt,bottom=6pt, arc=1mm]

Role: You are an expert medical video analyst. Your task is to identify the exact, continuous video segment that answers a given medical question using the provided video, visual context, and audio transcripts.
\vspace{6pt}

\textbf{Core Directives:}
\begin{enumerate}
    \item \textbf{Visuals > Audio:} Visual evidence is the absolute priority; audio is strictly for verification. Do not select segments where the action/anatomy is discussed but not visually demonstrated.
    \item \textbf{Tight Surgical Boundaries:} Timestamps must strictly bound the active physical procedure. Exclude all introductions, verbal planning, and text slides. Start exactly when the real operation begins and end exactly when it finishes.
    \item \textbf{Do Not Echo Context:} The provided context and transcripts are rough temporal guides, NOT the final answer. You must independently discover the micro-boundaries within them. Never blindly copy the timestamps or durations of the provided input chunks.
    \item \textbf{Visual Hierarchy:} If actual surgical footage is unavailable, fallback to a physical demonstration. If that is also unavailable, fallback to a text-based explanation.
    \item \textbf{Visual Anchoring (Mandatory):} You must explicitly describe the exact visual event that marks the start and end of the segment BEFORE outputting timestamps.
\end{enumerate}
\vspace{2pt}

\textbf{Output Format:}\\
Output ONLY a valid JSON object. Do not include any conversational text, markdown formatting outside the JSON, or explanations outside the specified keys.

\begin{tcolorbox}[colframe=black!50, colback=white, boxrule=0.3mm, sharp corners, fontupper=\ttfamily\footnotesize]
\{ \\
\hspace*{4mm} "visual\_start\_anchor": "Describe the exact visual frame where the answer physically begins (e.g., 'Scalpel makes first contact with skin').",\\
\hspace*{4mm} "visual\_end\_anchor": "Describe the exact visual frame where the answer physically concludes (e.g., 'Suture is cut and tool is removed from frame').",\\
\hspace*{4mm} "reasoning": "Brief explanation of how these visual anchors directly answer the question, ensuring the timestamps are tighter than the provided transcript chunks.",\\
\hspace*{4mm} "answer\_start": "MM:SS",\\
\hspace*{4mm} "answer\_end": "MM:SS"\\
\}
\end{tcolorbox}
\vspace{2pt}

\textbf{Inputs:}\\
\textbf{The Question:} \{question\}\\
\textbf{Rough Segments (Context/Audio):} \{Additional\}

\end{tcolorbox}
\caption{The system prompt for the Chain-of-Thought (CoT) strategy.}
\label{fig:prompt_cot}
\end{figure}

\begin{figure}[!htbp]
\begin{tcolorbox}[colframe=black!70, colback=gray!5, title=\textbf{Prompt: Heuristic Context (Loose)}, fonttitle=\bfseries, fontupper=\small, boxsep=2pt,left=6pt,right=6pt,top=6pt,bottom=6pt, arc=1mm]

\textbf{Role:} Expert Medical Video Analyst.\\
\textbf{Task:} Identify the exact video segment that answers the question.
\vspace{6pt}

\textbf{Inputs:}\\
\textbf{Question:} \{question\}\\
\textbf{Reference Notes (Transcripts \& Scenes):} \{Additional\}
\vspace{6pt}

\textbf{Instructions:}\\
Watch the video. The Reference Notes are provided only as a background hint. You must determine the precise start and end timestamps purely by observing the physical procedure in the video footage.
\vspace{6pt}

\textbf{Output Format:}\\
Output ONLY a valid JSON object:

\begin{tcolorbox}[colframe=black!50, colback=white, boxrule=0.3mm, sharp corners, fontupper=\ttfamily\footnotesize]
\{ \\
\hspace*{4mm} "first\_physical\_movement": "Briefly state the visual action that starts the segment.",\\
\hspace*{4mm} "final\_physical\_movement": "Briefly state the visual action that ends the segment.",\\
\hspace*{4mm} "answer\_start": "MM:SS",\\
\hspace*{4mm} "answer\_end": "MM:SS"\\
\}
\end{tcolorbox}

\end{tcolorbox}
\caption{The system prompt for the Heuristic Context (Loose) strategy.}
\label{fig:prompt_loose}
\end{figure}%

\subsection{Implementation Details and Hyperparameters}
All multimodal generative inferences were executed utilizing the Gemini API (\texttt{gemini-3-flash-preview}). Experiments were systematically conducted between February and April 2026. The model operated with a knowledge cutoff of January 2025 and utilized a context window of 1 million input tokens and 64,000 output tokens. We enforced a JSON output constraint via the API configuration (\texttt{response\_mime\_type="application/json"}). All sampling hyperparameters were retained at their model defaults, notably a Temperature of 1.0, with the internal reasoning parameter (thinking level) set to high (dynamic).

%\begin{table*}[t]
%\centering
%\caption{Source URLs for Qualitative Analysis Videos}
%\begin{tabularx}{\textwidth}{l X} % \textwidth makes it span the whole page width
%\hline
%\textbf{Sample ID} & \textbf{URL} \\ \hline
%Sample 2796 & \url{https://www.youtube.com/watch?v=fsdchGejKmU} \\
%Sample 2812 & \url{https://www.youtube.com/watch?v=4h3V6F4Rl_k} \\
%C34 & \url{https://bionlp.nlm.nih.gov/openivideos/videos/PMC8121742_10143_2020_1343_MOESM2_ESM.mp4} \\
%C64 & \url{https://bionlp.nlm.nih.gov/openivideos/videos/PMC6952147_gox-7-e2322-s001.mp4} \\ \hline
%\end{tabularx}
%\end{table*}



%\subsection{Qualitative Analysis Video Links}
%\label{appendix:video_links}

%The following table provides the source URLs for the specific video samples discussed in Section 6.4 (Qualitative Error Analysis). 




\end{document}
