CH i LL : Zero-shot Custom Interpretable Feature Extraction from Clinical Notes with Large Language Models (2023)

Abstract: We propose CHiLL (Crafting High-Level Latents), an approach for natural-language specification of features for linear models. CHiLL prompts LLMs with expert-crafted queries to generate interpretable features from health records. The resulting noisy labels are then used to train a simple linear classifier. Generating features based on queries to an LLM can empower physicians to use their domain expertise to craft features that are clinically meaningful for a downstream task of interest, without having to manually extract these from raw EHR. We are motivated by a real-world risk prediction task, but as a reproducible proxy, we use MIMIC-III and MIMIC-CXR data and standard predictive tasks (e.g., 30-day readmission) to evaluate this approach. We find that linear models using automatically extracted features are comparably performant to models using reference features, and provide greater interpretability than linear models using “Bag-of-Words” features. We verify that learned feature weights align well with clinical expectations.

## introduction llms have greatly advanced few-and zero-shot capabilities in nlp, reducing the need for annotation. this is especially exciting for the medical domain, in which supervision is often scant and expensive. however, given the high-stakes nature of clinical work and the challenges associated with developing models (e.g., long-tail data distributions, weakly informative supervision), predictions can rarely be trusted blindly. clinicians therefore tend to favor simple models with interpretable predictors over opaque llms that rely on dense learned representations. risk prediction tools are often linear models with handcrafted features. such models have the advantage of associating features with weights; these can be inspected to ensure clinical tenability and may avoid undesired fragilities of large neural models. however, a downside to relying on interpretable features is that one often has to manually extract them from patient records. this can be particularly difficult when features are high-level and must be inferred from unstructured (free-text) fields within ehr. in this work we investigate the potential of zeroshot extraction for definition and abstraction of interpretable features from unstructured ehr to use as inputs for simple (linear) models (figure 1 ). recent work @xcite has shown that llms are capable zero-shot extractors of clinical information, i.e., they can extract structured information from records without explicitly being trained to do so. these can be high-level features specified in natural language, which allows practitioners to define features that they hypothesize may be relevant to a downstream task. such features, even if noisy, are likely to be more interpretable than low-level features such as bag-of-words (bow) representations. the motivation of this work is to evaluate the viability of training small linear models over high-level features automatically extracted via llms-without explicit supervision-from unstructured data in ehr. a secondary concern that this paper seeks to address is any reliance on closed-source llms for healthcare, which is undesirable for a number of reasons. first, such models are inherently opaque, precluding interpretability analysis which is especially important in healthcare. second, ehr data is sensitive, and so submitting this to an api (e.g., as provided by openai) is potentially problematic. in this work we show that despite the specialized domain, flan-t5 @xcite variants-which can fit on a single gpu and be run locally-can perform zero-shot feature extraction from ehr with reasonable accuracy. our contributions are as follows. our promising initial results suggest several avenues for further exploration, e.g., modeling correlations between inferred features, probing the degree to which such predictors provide useful and reliable interpretability, and modifying trained linear models directly based on expert judgement. ## methods we consider binary classification of patients on the basis of free text from their ehr data. a now standard approach to such tasks would entail adopting a neural language encoder e to induce a fixedlength d-dimensional distributed representation of an input x-e.g., the [cls] embedding in bert @xcite , 2019) modelsand feeding this forward to a linear classification head to yield a logit: this approach operates over (transformations of) token counts, and therefore the learned w has a natural correspondence to words in the vocabulary. linear models that operate over tens of thousands of word predictors occupy an intermediate space between the interpretability afforded by simpler, smaller models defined over high-level features and neural models which use opaque representations. for some clinical tasks, however, bow with large vocabularies can be competitive with respect to downstream performance. in this paper, we use instruction-tuned llms to perform zero-shot inference of intermediate, highlevel, features @xmath0, ..., t n : predictions from the llm for the high-level binary features will be imperfect, and are naturally associated with a confidence under the llm: the probability of the token "yes" normalized by the mass assigned to either "yes" or "no". as a simple means of incorporating uncertainty in extracted features, we can use this continuous value in place of binary feature indicators. for feature n (elicited using template t n ), the feature value f cont n is: ## evaluation to evaluate the proposed approach, we consider four tasks on publicly available mimic data to permit reproducibility. we start with standard clinical predictive tasks in mimic-iii @xcite , section 3.1): readmission, mortality, and phenotype prediction. for these we treat icd codes as proxies for highlevel features. foot_0 this allows us to evaluate the accuracy of the zero-shot extraction component, and to compare the performance of a linear model defined over the true icd codes as compared to the same model when operating over inferred features. we then consider x-ray report classification using the mimic-cxr dataset @xcite @xcite ; section 3.2). in this setting, we elicited queries for intermediate feature descriptions from a radiologist co-author. queries take the form of questions that a radiologist might a priori believe to be relevant to the report classification categories defined in chexpert (e.g., "does this patient have a normal cardiac silhouette?"; see appendix table b for all examples). this demonstrates the flexibility of the approach-and the promise of allowing domain experts to specify features in natural languagebut we are limited in our ability to evaluate the extraction performance directly in this case. ## results we aim to address the following research questions. feature extraction (4.1) how accurate are zeroshot extracted features, as compared to reference (manually extracted) predictors? downstream classification performance (4.2) how does classification based on exper our approach compare to black box and simple models on the ultimate downstream classification? interpretability (4.3) do the inferred features permit intuitive interpretation, and do the resultant coefficients align with clinical expectations? data and feature efficiency (4.4) do these features offer additional benefits in terms of data and/or feature efficiency? ## discussion small linear models over well-defined features offer transparency in that one can read off coefficients for predictors and inspect which most influenced the output for a given instance (e.g., figure 7 ). this is in stark contrast to deep neural network models (like clinical bert; @xcite , which operate over dense learned embeddings. however, in healthcare high-level features must often be manually extracted from unstructured ehr. in this work we proposed to allow domain experts to define high-level predictors with natural language queries that are used to infer feature values via llms. we then define small linear models over the resulting features. the promise of this approach is that it enables one to capitalize on llms while still building models that provide interpretability. our approach allows domain experts to craft features that align with questions a clinician might seek to answer in order to make a diagnosis and then use the coefficients from a trained linear model to determine which features inform predictions. using such "abstract" features in place of word frequency predictors confers greater interpretability (figure 5 ). ## conclusions we have proposed using large language models (llms) to infer high-level features from unstructured electronic health records (ehrs) to be used as predictors in small linear models. these highlevel features can be specified in arbitrary natural language queries composed by domain experts, and extracted using llms without explicit supervision. on three clinical predictive tasks, we showed that this approach yields performance comparable to that achieved using "reference" high-level features (here, icd codes). on a fourth task (x-ray report classification), we enlisted a radiologist collaborator to provide high-level features in natural lan-guage. we showed a model using these features as automatically extracted via an llm realized strong predictive performance, and-more importantlyprovided varieties of model transparency which we confirmed aligned with clinical judgement, and which provided insights to the domain expert. this work demonstrates the promise of using llms as high-level feature extractors for small linear models, which may admit varieties of interpretability. however, this is complicated by the issues discussed in the limitations section, below. we believe that more research into this hybrid approach is therefore warranted.