Making the Most Out of the Limited Context Length: Predictive Power Varies with Clinical Note Type and Note Section

Hongyi Zheng, Yixin Zhu, Lavender Yao Jiang, Kyunghyun Cho, Eric Karl Oermann

TL;DR

When using Large Language Models (LLMs) for clinical predictions, the limited context window forces researchers to choose which parts of a patient's massive medical record to include. This paper demonstrates that predictive power is not distributed evenly: while discharge notes are most informative at their beginning and end, nursing notes provide consistent predictive value throughout, offering a viable path for early-stage risk assessment.

What Problem Does This Paper Address?

Electronic Health Records (EHRs) are a goldmine for predicting patient outcomes, like the risk of being readmitted to the hospital within 30 days. However, clinical notes present a "needle in a haystack" problem. They are incredibly long (often exceeding 10,000 tokens), span weeks or months, and are filled with noisy, domain-specific jargon.

Standard LLMs have limited context windows (e.g., 512 tokens for BERT). Most researchers handle this by either using simple truncation (taking just the beginning) or relying on manual "domain knowledge" to pick specific sections. This paper asks a more fundamental, data-driven question: If you can only look at a small slice of the data, which slice gives you the most predictive power?

Methods

The authors developed a framework to systematically analyze the predictive power of different note sections using two models: ClinicalBERT (512-token limit) and ClinicalLongformer (4096-token limit).

Their core technique involves a parameterized sliding window. They defined a parameter $p \in [0, 1]$ to represent the midpoint of a text segment. By sweeping $p$ from 0.0 (the very beginning of a note) to 1.0 (the very end), they could map out which parts of a document contain the most useful information for predicting 30-day readmission.

They also experimented with Mixing Notes, where the limited context window was split between different types of information—for example, allocating half the tokens to a nursing note and half to a discharge note.

Datasets

The study utilized the MIMIC-III database, a standard benchmark in clinical NLP. They focused on approximately 40,000 admission records that contained both nursing and discharge notes. The data was split into 75% training, 12.5% validation, and 12.5% testing sets.

Key Insights and Ideas

  • The "U-Shaped" Discharge Note: Discharge notes show a distinct "dip" in predictive power in the middle. The most valuable information is concentrated at the very beginning (patient history/status) and the very end (follow-up plans).
  • The Uniform Nursing Note: Unlike discharge notes, nursing notes have a relatively flat distribution of predictive power. Any segment of a nursing note is roughly as useful as any other.
  • Early Intervention Potential: Nursing notes, while slightly less predictive than discharge notes overall, still achieve respectable AUC ROC scores (>0.7). Because nursing notes are written throughout a stay—long before a discharge note exists—they could be used for real-time risk monitoring.
  • Context Size Matters for Mixing: There is a trade-off when combining different note types. If your context window is small (like BERT's), trying to squeeze in two types of notes actually hurts performance because you don't get enough depth in either. If your window is large (like Longformer's), mixing notes provides a significant performance boost.

Key Results

The authors found that for discharge notes, a "fragmented" approach—taking the first $n/2$ tokens and the last $n/2$ tokens—outperformed simply taking the first $n$ tokens.

Performance of ClinicalBERT across different sections (p values). Note the U-shape for discharge notes vs. the flat lines for nursing notes.

As shown in Figure 1, the discharge notes (blue line) show a significant dip in predictive power between $p=0.2$ and $p=0.5$.

When testing the ClinicalLongformer (Figure 3), the authors found that allocating tokens to different note types (e.g., First Nursing + Discharge) consistently beat the "Discharge Only" baseline (the red dashed line) by 0.013 to 0.019 AUC ROC points. However, for the smaller ClinicalBERT, this same strategy actually caused performance to drop below the baseline.

Comparison of mixed note strategies for ClinicalBERT and ClinicalLongformer.

Limitations and Future Work

The authors identified several areas for further exploration:

  • Fixed Splits: In the mixing experiments, they used a simple 50/50 split ($n/2$) for tokens. A more sophisticated search might find an optimal ratio (e.g., 30% nursing, 70% discharge).
  • Note Diversity: The study was limited to nursing and discharge notes due to data scarcity in MIMIC-III. Future work using MIMIC-IV could incorporate physician notes, ECG reports, and other specialized documentation.
  • Authorship Influence: The researchers noted that discharge notes (written by doctors) are more structured than nursing notes. Investigating how the "authorship" and intended purpose of a note affect its predictive distribution is a promising next step.

Summary updated

BibTeX
@misc{zheng2023making,
  author = {Hongyi Zheng and Yixin Zhu and Lavender Yao Jiang and Kyunghyun Cho and Eric Karl Oermann},
  title = {{Making the Most Out of the Limited Context Length: Predictive Power Varies with Clinical Note Type and Note Section}},
  year = {2023},
  eprint = {2307.07051},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.07051},
}
Figure