Beyond Long Context: When Semantics Matter More than Tokens
Tarun Kumar Chawdhury, Jon D. Duke
TL;DR
This work evaluates the Clinical Entity Augmented Retrieval (CLEAR) approach for semantic question answering over long, unstructured EHR notes embedded in FHIR DocumentReference, offering a platform to benchmark CLEAR against zero-shot long-context and embedding-based RAG baselines. The Enhanced CLEAR pipeline introduces keyword-based entity extraction, section-aware processing, a targeted context selection strategy, and token optimization to improve clinical reasoning while reducing token usage. On synthetic, de-identified notes spanning 10k–65k tokens, CLEAR achieves higher semantic similarity (avg ~0.878) and a 58.3% win rate, with substantial token savings (~78%) versus wide-context processing, and shows strong scalability for very long documents. The result is a reproducible evaluation framework that supports robust, cost-aware clinical QA research and informs deployment decisions in resource-constrained healthcare environments.
Abstract
Electronic Health Records (EHR) store clinical documentation as base64 encoded attachments in FHIR DocumentReference resources, which makes semantic question answering difficult. Traditional vector database methods often miss nuanced clinical relationships. The Clinical Entity Augmented Retrieval (CLEAR) method, introduced by Lopez et al. 2025, uses entity aware retrieval and achieved improved performance with an F1 score of 0.90 versus 0.86 for embedding based retrieval, while using over 70 percent fewer tokens. We developed a Clinical Notes QA Evaluation Platform to validate CLEAR against zero shot large context inference and traditional chunk based retrieval augmented generation. The platform was tested on 12 clinical notes ranging from 10,000 to 65,000 tokens representing realistic EHR content. CLEAR achieved a 58.3 percent win rate, an average semantic similarity of 0.878, and used 78 percent fewer tokens than wide context processing. The largest performance gains occurred on long notes, with a 75 percent win rate for documents exceeding 65,000 tokens. These findings confirm that entity aware retrieval improves both efficiency and accuracy in clinical natural language processing. The evaluation framework provides a reusable and transparent benchmark for assessing clinical question answering systems where semantic precision and computational efficiency are critical.
