[Paper Review] Medical Concept Embedding with Time-Aware Attention
This paper proposes a time-aware attention mechanism within a Continuous Bag-of-Words (CBOW) framework to learn medical concept embeddings that incorporate dynamic, soft temporal contexts. By modeling attention weights over time periods around each medical concept, the method captures variable temporal scopes—such as acute vs. chronic conditions—outperforming five state-of-the-art baselines in clustering and nearest neighbor search tasks on public and proprietary EMR datasets.
Embeddings of medical concepts such as medication, procedure and diagnosis codes in Electronic Medical Records (EMRs) are central to healthcare analytics. Previous work on medical concept embedding takes medical concepts and EMRs as words and documents respectively. Nevertheless, such models miss out the temporal nature of EMR data. On the one hand, two consecutive medical concepts do not indicate they are temporally close, but the correlations between them can be revealed by the time gap. On the other hand, the temporal scopes of medical concepts often vary greatly (e.g., extit{common cold} and extit{diabetes}). In this paper, we propose to incorporate the temporal information to embed medical codes. Based on the Continuous Bag-of-Words model, we employ the attention mechanism to learn a "soft" time-aware context window for each medical concept. Experiments on public and proprietary datasets through clustering and nearest neighbour search tasks demonstrate the effectiveness of our model, showing that it outperforms five state-of-the-art baselines.
Motivation & Objective
- To address the limitation of existing medical concept embedding models that ignore temporal ordering and variable duration of medical conditions in EMRs.
- To model the temporal context of medical concepts dynamically, rather than relying on fixed-size windows.
- To learn both medical concept representations and 'soft' temporal scopes simultaneously using attention mechanisms.
- To improve downstream healthcare analytics tasks such as clustering and nearest neighbor search through more semantically and temporally informed embeddings.
Proposed method
- Extends the CBOW model by introducing a time-aware attention mechanism that assigns different weights to medical concepts based on their temporal proximity to the target concept.
- Each medical concept is embedded in a context window defined by learned attention weights over time periods, enabling a 'soft' temporal scope instead of a fixed window.
- The attention mechanism computes context contributions based on time gaps, allowing acute conditions (e.g., common cold) to have short-lived influence and chronic conditions (e.g., diabetes) to have prolonged influence.
- The model is trained end-to-end using negative sampling to optimize the prediction of the central medical concept from its temporally weighted context.
- The temporal scope is defined as a range of time units (e.g., weeks) before and after the target concept, with attention distributed across these units.
- The model learns to prioritize temporally relevant concepts—e.g., those occurring close in time—while downweighting distant or irrelevant ones.
Experimental results
Research questions
- RQ1Can a neural embedding model effectively incorporate temporal context in EMRs to improve medical concept representation?
- RQ2How does modeling variable temporal scopes (e.g., for acute vs. chronic diseases) affect embedding quality compared to fixed-window approaches?
- RQ3To what extent does attention-based soft temporal context improve performance in clustering and nearest neighbor tasks on EMR data?
- RQ4How robust is the proposed model to varying dataset sizes and temporal distributions in real-world EMR data?
Key findings
- The proposed MCE model outperforms five state-of-the-art baselines in both clustering and nearest neighbor search tasks on two datasets: NUH2012 and DE-SynPUF.
- On the DE-SynPUF dataset, MCE maintains stable performance across increasing window sizes, while CBOW and Skip-gram degrade significantly, indicating better scalability.
- On NUH2012, the MCE model achieves peak performance with a 30-week temporal context scope, suggesting optimal coverage for one-year EMR data.
- The model shows improved robustness to noise and varying window sizes, particularly outperforming GloVe and wang2vec in high-noise scenarios.
- Qualitative analysis reveals distinct attention patterns: stable influence for chronic diseases, peak influence for acute conditions, and sequela influence for severe but rare conditions.
- The attention mechanism successfully captures clinically meaningful temporal dynamics, such as the prolonged impact of nontraumatic intracerebral hemorrhage on subsequent medical codes.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.