Accessibility settings

Published on in Vol 14 (2026)

Preprints (earlier versions) of this paper are available at https://preprints.jmir.org/preprint/96744, first published .
Elderly man using a tablet, demonstrating senior technology use and online communication.

Large Language Models for Identifying Patient Goals and Preferences in Patient Portal Messages: Comparative Evaluation Study

Large Language Models for Identifying Patient Goals and Preferences in Patient Portal Messages: Comparative Evaluation Study

Authors of this article:

Samah Fodeh1 Author Orcid Image ;   Yan Wang1 Author Orcid Image ;   Makoto Jones2 Author Orcid Image ;   Jonathan Nebeker3 Author Orcid Image

Original Paper

1Department of Emergency Medicine, Yale University, New Haven, CT, United States

2VA Salt Lake City Healthcare System, Salt Lake City, UT, United States

3Office of Clinical Informatics, United States Department of Veterans Affairs, Washington, DC, United States

Corresponding Author:

Samah Fodeh, PhD

Department of Emergency Medicine

Yale University

464 Congress Ave

New Haven, CT, 06519

United States

Phone: 1 2037375806

Email: samah.fodeh@yale.edu


Background: Recognizing what is most important to patients, including their goals and preferences, helps inform treatment decisions that are not only clinically effective but also personally meaningful. Large language models (LLMs) may help identify this information in unstructured communication between patients and health care providers.

Objective: This study compared 3 LLMs for identifying predefined patient goal and preference categories and evaluated whether fine-tuning improved performance.

Methods: We analyzed a random sample of 1000 secure portal messages from patients with depression or substance use disorder. GPT-4o-mini, DeepSeek-R1-Distill-Llama-70B, and Llama-3.3-70B-Instruct segmented the messages and assigned predefined goal or preference categories. Model outputs were examined through human review and pairwise span overlap. Llama-3.3-70B-Instruct was subsequently fine-tuned and evaluated on a held-out annotated set.

Results: There was considerable variation in how the models interpreted and extracted information. Llama-3.3-70B-Instruct captured the broadest range of functional and psychosocial goals, GPT-4o-mini produced fewer candidates with narrower coverage, and DeepSeek showed intermediate behavior and the greatest overlap with Llama across all 22 populated categories (micro-F1-score=0.350). Fine-tuned Llama increased candidate-verification micro-F1-score from 0.484 to 0.548 on the 217-example held-out set, below the constant-no majority-class baseline of 0.728. Macro-F1-score was higher for fine-tuned Llama than for this baseline (0.524 vs 0.421).

Conclusions: The evaluated LLMs differed in how they identified patient goals and preferences from portal communication. Llama provided the broadest candidate coverage, whereas DeepSeek overlapped most closely with Llama across all 22 populated categories (micro-F1-score=0.350). Fine-tuning increased candidate-verification micro-F1-score relative to untuned Llama but remained below the majority-class baseline (0.548 vs 0.728).

JMIR Med Inform 2026;14:e96744

doi:10.2196/96744

Keywords



Overview

Integrating patients’ goals and preferences into clinical care is vital to achieving truly patient-centered outcomes. Patients’ goals and preferences in clinical management often include improving measures such as blood pressure, glucose levels, cholesterol, BMI, or tumor burden. While these clinical goals indicate progress toward better health outcomes, they do not fully capture what patients consider meaningful in achieving broader personal goals and supporting their ability to function, maintain independence, and live well. For example, a patient may value the ability to walk to the park with their grandchildren or return to work consistently just as much as achieving a lower blood pressure reading. Understanding what matters most to patients through their goals and preferences helps guide treatment decisions that are both clinically effective and personally meaningful, rather than focusing solely on biomarkers or disease metrics [1-6].

Patient Goals and Preferences

Patient goals refer to the specific, desired outcomes that patients hope to achieve through health care. These goals are functional, health-related, or life-oriented targets that patients identify as important to their well-being or quality of life. Goals can be measurable or observable. Examples of patients’ goals include avoiding stroke, returning to work, caregiving for others, and living independently at home. Goals are actionable and can help guide treatment planning, and they often require ongoing assessment and monitoring over time [1-6].

Patient preferences, on the other hand, refer to the individual’s likes and dislikes regarding the process and context of their care. Preferences reflect how a person wants care to be delivered and what trade-offs they are (or are not) willing to make. For example, a patient preference could be related to using oral medications over injections, wanting to avoid hospitalization or intensive care, or choosing hospice over aggressive treatment at the end of life. Preferences are subjective and can help shape choices between options, especially when more than one medically appropriate path exists [1-6].

Study Context

This study advances patient-centered research by examining the use of large language models (LLMs) to identify patient goals and preferences from unstructured portal communication. Whereas many approaches rely on structured data or manual abstraction, this work provides an initial step toward automating the extraction of patient-valued outcomes beyond biomarkers or disease metrics.

Patient goal elicitation is often incomplete and inconsistent because patients may not fully know or articulate their goals and preferences at a single point in time. Collecting this information naturally over time and integrating it into a dynamic, longitudinal view may provide a useful approach for representing changing priorities. This study does not integrate the identified information into care plans or clinical decision support, but it establishes a foundation for making patient goals and preferences more accessible for future patient-centered applications.

Background and Related Work

Overview

Patients express diverse health goals and care preferences, some of which are measurable in the electronic health record—such as blood pressure control and hemoglobin A1c stabilization. These goals gain greater significance when linked to what matters most to patients, such as staying active with family and minimizing symptoms that disrupt daily life. Beyond physiological outcomes, patients often prioritize emotional well-being and preferred approaches to care, such as receiving palliative support. Achieving these goals requires shared decision-making and systematic documentation, yet scalable methods to routinely capture this information in clinical care, as well as to extract it from health records, remain limited. Prior clinical natural language processing studies have identified goals-of-care documentation, and recent work has applied LLMs to clinical information extraction and patient portal tasks; however, direct comparison for this goal taxonomy remains limited. Prior work by Earp et al [7] explored using machine learning to predict likely patient preferences in scenarios involving substituted judgment. In contrast, our study focuses on applying LLMs to extract patient goals and preferences from portal communications involving patients, offering a direct approach to understanding what matters most to patients at scale [1-17].

Quantifiable Goals and Preferences

Many functional goals and preferences are quantifiable and can be directly monitored using data available in the electronic health record, such as preventing weight gain, reducing pain, stabilizing hemoglobin A1c levels, minimizing hospital admissions, and controlling blood pressure. These goals can take on deeper significance when tied to individual patients’ personal goals, such as staying active with family or managing symptoms that affect work performance. Other potentially quantifiable goals, if tracked consistently over time, include the ability to perform activities of daily living (ADLs; ie, eating, dressing, and bathing), maintaining memory and cognitive clarity, decreasing the frequency of urination (especially in diabetics), avoiding falls, preserving strength and energy, overcoming fatigue, and avoiding assistive devices such as walkers or oxygen tanks. Other patients hope to return to or continue working consistently, attend social events, or perform caregiving duties. Reducing medication side effects (eg, dizziness or sleep disturbance) is another common preference that may not always be prioritized by clinicians but is deeply important to patients. Patients also express a desire for stability in their emotional and psychological well-being by addressing symptoms such as anxiety, depression, or mood changes [18-26].

Nonquantifiable Goals and Preferences

Nonquantifiable goals and preferences are equally essential. For example, many patients express preferences related to how and where they age or receive care, such as aging in place rather than in institutional settings or receiving only supportive care in advanced stages of illness. Many prefer quality of life over extending life and avoid life-sustaining measures if these would lead to long-term disability or substantial discomfort. End-of-life preferences also vary, with some patients preferring hospice or end-of-life care in a facility, while others prefer hospice care at home surrounded by family. Some are open to short-term stays in nursing homes for help with ADLs, while others may plan for long-term residence if independence cannot be maintained. Incorporating these diverse goals and preferences into clinical care requires active listening and thoughtful navigation. Ultimately, tailoring care to individual preferences not only improves adherence and satisfaction but also ensures that health care remains aligned with what matters most in patients’ lives [18-26].

Language Models for Goals and Preferences

A growing body of research has explored natural language processing methods for extracting patient goals and preferences from clinical documentation. Early efforts used rules and keyword matching to identify advance care planning and goals-of-care documentation, while later studies applied supervised classifiers and machine-learning approaches to electronic health records [8-10]. Natural language processing has also been used to analyze patient-clinician communication and identify primary concerns in secure portal messages [11,12]. These studies demonstrate the potential of unstructured clinical text while also showing the importance of task-specific reference labels and carefully defined clinical settings.

Recent peer-reviewed studies have evaluated LLMs for clinical information extraction, structured medical information retrieval, electronic health record feature extraction, and emergency triage of portal messages [13-17]. Other work has used machine learning to predict likely patient preferences when substituted judgment is required [7]; that approach infers preferences rather than extracting goals expressed in clinical communication. Direct comparative evaluation of LLMs for the goal and preference taxonomy used in this study remains limited. Our work therefore examines model behavior on unstructured portal communication while separating extraction volume and intermodel agreement from correctness.

Study Aim

This study aimed to compare the extraction volume, category distribution, human-review findings, and intermodel overlap of GPT-4o-mini, DeepSeek-R1-Distill-Llama-70B, and Llama-3.3-70B-Instruct when applied to secure portal communications and to evaluate whether fine-tuning improved Llama candidate verification. We hypothesized that the models would differ in the number and types of candidate goals identified and that fine-tuning would improve verification performance. The study did not evaluate integration into clinical workflows.


Study Sample

The dataset consisted of secure messages exchanged asynchronously between patients and health care providers through the patient portal during 2021-2022. The source cohort included patients diagnosed with depression or substance use disorder. A separate random-sampling procedure selected 1000 patients and 1 secure message per patient for analysis. Messages included communications directed to patients and communications originating from patients, as represented by the TO_PAT direction field. Complete messages (not segmented sentences) were supplied to the models, which performed their own segmentation.

The messages varied in length and structure and often contained informal or conversational language, abbreviations, and multiple concerns within a single communication. This variability reflects the communication style encountered in routine portal use and motivated evaluation of models capable of interpreting context and segmenting complete messages. Table 1 presents the demographic characteristics of the 1000-patient sample.

Table 1. Demographic characteristics of 1000 patients with depression or substance use disorder whose randomly selected secure portal messages were included in this retrospective study, 2021-2022.
CategoryPatients, n (%)
Gender

Female672 (67.2)

Male328 (32.8)
Race

White783 (78.3)

Black or African American97 (9.7)

Asian17 (1.7)

Other103 (10.3)
Age (years)

18-34152 (15.2)

35-49240 (24)

50-64284 (28.4)

≥65324 (32.4)

Ethical Considerations

The study was conducted in accordance with institutional review board policies and federal regulations governing human-subject research at the Department of Veterans Affairs and Yale University. Use of secure messaging data to analyze the content and nature of patient communication was approved by an institutional review board under protocol number 2000038687. The institutional review board granted a waiver of informed consent and of Health Insurance Portability and Accountability Act (HIPAA) authorization because the study was a retrospective secondary analysis of existing records that posed no more than minimal risk and could not practicably have been conducted with individual consent. The analyzed messages were not deidentified because the message text was the object of analysis. All data were stored and analyzed within a secure, access-controlled Department of Veterans Affairs research computing environment available only to approved study personnel. Llama-3.3-70B-Instruct and DeepSeek-R1-Distill-Llama-70B were run locally within this environment, and GPT-4o-mini was accessed through a Department of Veterans Affairs–approved Azure OpenAI service under which submitted data are not retained or used for model training. No participants were recruited or contacted, and no compensation was provided. Results are reported in aggregate, and no participant images or direct quotations are included in the manuscript or Multimedia Appendices 1-3.

Categories of Goals and Preferences

Patient goals and preferences span several clinical domains, including symptom, functional, psychosocial, and care-preference domains. Some describe symptom control, such as reducing pain, fatigue, urinary frequency, or symptoms of depression and anxiety. Others concern day-to-day function, including maintaining independence, performing ADLs, working consistently, preserving strength, and avoiding assistive devices. Care preferences may concern the desired approach to treatment, hospitalization, hospice or palliative care, place of care, and the balance between quality and length of life. These concepts can overlap; for example, maintaining independence may coexist with the ability to perform ADLs.

The extraction prompt contained 29 predefined goal and preference labels plus “others” (30 total labels). Each model-generated unit received exactly 1 label. Textbox 1 provides the single short reporting-label set used consistently in all tables and figures. These reporting labels are included for clarity and were not additional model instructions. Multimedia Appendix 1 maps the reporting labels to the verbatim prompt labels.

Textbox 1. Short reporting labels and plain-language descriptions for the 29 patient-goal and preference labels used in this retrospective portal-message study. ADL indicates activity of daily living; Multimedia Appendix 1 provides the verbatim prompt labels.

Improve day-to-day symptoms

  • Effectively control symptoms such as fatigue, dizziness, or frequent urination to minimize their effect on daily functioning and work.

Aware/knowledgeable/compassionate doctor

  • Prefer a physician who understands the patient’s condition and provides knowledgeable, attentive, and compassionate care.

Reduce pain

  • Reduce physical pain and its interference with daily activities and quality of life.

Reduce depression/anxiety symptoms

  • Address and alleviate anxiety, depression, or other mood symptoms that affect well-being and daily life.

Slow disease progression

  • Delay disease progression.

Decrease blood pressure

  • Lower and manage blood pressure to support health and reduce complications.

Prevent weight gain

  • Prevent undesirable weight gain and support maintenance of a healthy weight.

Reduce fatigue

  • Reduce persistent fatigue and improve the energy needed for daily activities.

Maintain independence

  • Maintain independence in mobility, self-care, and everyday decision-making.

Avoid strength/energy loss

  • Preserve physical strength and energy and prevent functional decline.

Work consistently

  • Support the patient’s ability to maintain regular employment and attend work consistently.

ADL capability

  • Preserve the ability to perform activities of daily living, including eating, dressing, and bathing.

Reduce hospital admissions

  • Prevent avoidable hospitalization or readmission and support care outside the hospital when appropriate.

Avoid assistive devices

  • Maintain function without, or delay reliance on, mobility or other assistive devices.

Avoid aggressive intervention without family interaction

  • Prefer meaningful interaction over aggressive intervention in severe illness.

Decrease urination frequency

  • Reduce urinary frequency and its disruption of sleep or daily activities.

Improve balance

  • Improve balance and stability and reduce the risk of falls.

Recognize/communicate with family

  • Preserve recognition of and communication with family.

Maintain/improve memory

  • Preserve or improve memory, cognitive function, and mental clarity.

Maintain normal sex life

  • Preserve sexual function or activity.

Seek palliative care consultation

  • Prefer consultation with palliative care.

Age in place

  • Remain at home or in the community while aging.

Prefer quality over length of life

  • Prioritize quality over length of life.

Accept life support if no long-term disability

  • Accept life-sustaining treatment subject to a functional-outcome condition.

Prefer hospice after treatment failure

  • Prefer hospice after treatment failure.

Prefer death at home

  • Prefer home as the place of death.

Short-term nursing-home ADL support

  • Accept a short nursing-home stay for assistance.

Long-term nursing-home ADL support

  • Accept long-term nursing-home residence for assistance.

Extend life while heart is beating

  • Prefer continued life extension.

LLM Models and Prompt Engineering

Overview

We selected GPT-4o-mini, DeepSeek-R1-Distill-Llama-70B, and Llama-3.3-70B-Instruct to compare a compact proprietary model with 2 open-weight 70-billion-parameter models representing different development approaches [27-29]. These models provided a practical comparison of instruction-following and distilled reasoning architectures within the study workflow; the comparison was not intended to cover all contemporary LLMs.

GPT-4o-mini

GPT-4o-mini is a compact proprietary model developed by OpenAI for efficient instruction following and text-processing tasks [27]. Its ability to follow structured prompts and return schema-constrained output made it a practical model for identifying and categorizing goals and preferences in portal messages. It was accessed through the OpenAI chat-completions interface with temperature 0, JSON response formatting, a function schema enumerating all categories, and forced function selection. Maximum tokens and top_p were not set in the recorded call. The dated model snapshot and inference date were not recorded.

Llama-3.3-70B-Instruct

Llama-3.3-70B-Instruct is an open-weight, multilingual, instruction-tuned 70-billion-parameter model released by Meta [28]. Its instruction tuning and capacity for contextual language understanding made it suitable for extracting functional, psychosocial, and care-preference concepts from conversational clinical text. Saved run records dated May 20, 2025, show deterministic decoding (do_sample=False), temperature 0, a maximum of 1024 generated tokens, and JSON_END as a stopping string.

DeepSeek-R1-Distill-Llama-70B

DeepSeek-R1-Distill-Llama-70B is a 70-billion-parameter model distilled from DeepSeek-R1 using a Llama-family base [29]. Distillation was intended to retain reasoning and instruction-following capabilities in a model that could be run in the local workflow, making it relevant for structured information extraction. The retained run records show the same local decoding settings used for Llama-3.3-70B-Instruct. Exact local checkpoint revisions, inference framework and version, batch settings, hardware, and computational cost were not recorded.

Prompt and Segmentation

Prompt engineering was used to provide a consistent clinical task definition across the 3 models. Complete communications (not presegmented sentences) were supplied to each model. The prompt instructed the model to identify minimal meaningful sentences or clauses, determine whether each unit expressed a patient goal or preference, and assign exactly 1 label from 29 predefined categories or “others.” This standardized format supported comparison across models while allowing each model to perform its own segmentation. The “others” label provided a fallback for nonclinical or unmatched content, although the single-label requirement could not represent statements belonging to multiple overlapping categories. The complete prompt is reproduced in Multimedia Appendix 1.

Output Parsing and Postprocessing

Each model independently segmented the same 1000 complete communications. The parsing pipeline yielded 6645 analysis units for GPT-4o-mini, 4817 for DeepSeek-R1-Distill-Llama-70B, and 5546 for Llama-3.3-70B-Instruct. Units labeled “others” were excluded from category-specific candidate analyses. Under the saved strict parser, an output that did not yield a recognized list of category-span objects was replaced by 1 “others/none” default record; this occurred for 52 DeepSeek communications and 4 Llama communications. All 29 predefined categories were retained. Outputs outside that label pool were excluded: 2 DeepSeek units and 4 Llama units.

Human Evaluation of LLM-Identified Patient Goals and Preferences

To assess whether extracted spans supported their assigned clinical categories, 2 reviewers with clinical natural language processing experience independently evaluated model-identified spans using the category definitions in Textbox 1. For each model, 274 candidate category-span pairs were selected by stratified random sampling across represented categories, with the allocation reflecting the model’s candidate distribution. Before review, the reviewers received an orientation to the goal and preference definitions and the yes/no decision rule. A span was labeled “yes” when its wording supported the assigned category and “no” when it did not. Reviewers necessarily viewed the assigned category but were blinded to each other’s decisions during independent evaluation; model identity was not used in the decision rule.

Joint acceptance was the number of spans labeled yes by both reviewers. Observed agreement captured the proportion of all 274 decisions for which the reviewers gave the same yes/no judgment. Given a 2 × 2 table with a (yes/yes), b (yes/no), c (no/yes), d (no/no), and N=a+b+c+d, observed agreement was as follows:

Because observed agreement can be inflated by agreement expected from the reviewers’ marginal response distributions, Cohen κ was also calculated. Expected agreement was as follows:

and Cohen κ was as follows:

Cohen κ ranges from −1 to 1. Because review was limited to model-selected candidates, this evaluation assesses the reproducibility of candidate verification and does not measure false negatives or end-to-end recall.

Pairwise Model Evaluation

Pairwise evaluation quantified the extent to which 2 models identified similar spans for the same goal or preference category. Exact string matching would treat small differences in span boundaries or wording as disagreement, so token-level Jaccard similarity was used to provide a soft comparison. Every parsed candidate unit was retained, including duplicate text, so category counts and pairwise denominators corresponded exactly to Table 2. The 22 categories populated by at least 1 model were evaluated.

For 2 spans represented by lowercased whitespace-token sets, token-level Jaccard similarity was defined as the size of the token intersection divided by the size of the token union. Within each category, spans were sorted deterministically and paired greedily without reuse. For each span from the first model, the unmatched span from the second model with the highest Jaccard similarity was selected when similarity was at least 0.6; deterministic lexical ordering resolved ties. The 0.6 threshold permits modest boundary and wording differences while requiring a majority of unique tokens to overlap.

For span sets S1 and S2 and matched-pair count M, as follows:

In every reported pair, the first named model supplies S1 and the second named model supplies S2. These directional terms describe pairwise overlap rather than estimates of accuracy, clinical validity, or recall against an independent human gold standard.

Macro-F1-score was the unweighted mean of category-level F1-scores across all 22 populated categories. A category populated by the third model but absent from both models in a particular pair contributed an F1-score of 0 to that pair’s macro average. Micro-F1-score was calculated as 2 times the sum of category-specific matches divided by the combined candidate counts. Weighted-F1-score was calculated by weighting category-level F1-scores by the average candidate count of the 2 models. Under these definitions, it is algebraically equal to micro-F1-score. Tables 2-4 were generated by 1 analysis script from the same frozen output set used for all 3 models.

Table 2. Goal and preference spans identified in 1000 portal messages from patients with depression or substance use disorder, 2021-2022. Percentages use model-specific output-unit denominators: GPT-4o-mini=6645, DeepSeek-R1-Distill-Llama-70B=4817, and Llama-3.3-70B-Instruct=5546. Categories are ordered by descending total candidate count across models, with prompt order resolving ties.
CategoryGPT-4o-mini, n (%)DeepSeek, n (%)Llama, n (%)
Improve day-to-day symptoms200 (3)457 (9.5)789 (14.2)
Aware/knowledgeable/compassionate doctor4 (0.1)56 (1.2)283 (5.1)
Reduce pain101 (1.5)76 (1.6)143 (2.6)
Reduce depression/anxiety symptoms63 (0.9)79 (1.6)129 (2.3)
Slow disease progression5 (0.1)47 (1)59 (1.1)
Decrease blood pressure37 (0.6)36 (0.7)30 (0.5)
Prevent weight gain26 (0.4)27 (0.6)28 (0.5)
Reduce fatigue19 (0.3)6 (0.1)22 (0.4)
Maintain independence4 (0.1)9 (0.2)28 (0.5)
Avoid strength/energy loss3 (0)7 (0.1)29 (0.5)
Work consistently5 (0.1)18 (0.4)15 (0.3)
ADL capability17 (0.3)8 (0.2)6 (0.1)
Reduce hospital admissions14 (0.2)2 (0)14 (0.3)
Avoid assistive devices1 (0)6 (0.1)15 (0.3)
Avoid aggressive intervention without family interaction0 (0)3 (0.1)11 (0.2)
Decrease urination frequency4 (0.1)5 (0.1)4 (0.1)
Improve balance1 (0)4 (0.1)8 (0.1)
Recognize/communicate with family0 (0)0 (0)13 (0.2)
Maintain/improve memory5 (0.1)2 (0)4 (0.1)
Maintain normal sex life3 (0)1 (0)1 (0)
Seek palliative care consultation1 (0)0 (0)3 (0.1)
Age in place0 (0)1 (0)1 (0)
Prefer quality over length of life0 (0)0 (0)0 (0)
Accept life support if no long-term disability0 (0)0 (0)0 (0)
Prefer hospice after treatment failure0 (0)0 (0)0 (0)
Prefer death at home0 (0)0 (0)0 (0)
Short-term nursing-home ADL support0 (0)0 (0)0 (0)
Long-term nursing-home ADL support0 (0)0 (0)0 (0)
Extend life while heart is beating0 (0)0 (0) 0 (0)
Table 3. Category-level pairwise span overlap at Jaccard similarity 0.6 across all 22 populated categories. For each pair, the first named model supplies S1 (the precision denominator), and the second supplies S2 (the recall denominator). GPT, Llama, and DeepSeek indicate GPT-4o-mini, Llama-3.3-70B-Instruct, and DeepSeek-R1-Distill-Llama-70B, respectively.
Category and model pairPrecision (%)Recall (%)F1-score (%)Both models
Improve day-to-day symptoms

GPT vs Llama6416.225.9Yes

GPT vs DeepSeek52.52332Yes

Llama vs DeepSeek33.557.842.4Yes
Aware/knowledgeable/compassionate doctor

GPT vs Llama751.12.1Yes

GPT vs DeepSeek503.66.7Yes

Llama vs DeepSeek7.839.313Yes
Reduce pain

GPT vs Llama49.53541Yes

GPT vs DeepSeek39.652.645.2Yes

Llama vs DeepSeek31.559.241.1Yes
Reduce depression/anxiety symptoms

GPT vs Llama49.22432.3Yes

GPT vs DeepSeek38.130.433.8Yes

Llama vs DeepSeek24.840.530.8Yes
Slow disease progression

GPT vs Llama605.19.4Yes

GPT vs DeepSeek404.37.7Yes

Llama vs DeepSeek2227.724.5Yes
Decrease blood pressure

GPT vs Llama40.55044.8Yes

GPT vs DeepSeek37.838.938.4Yes

Llama vs DeepSeek5041.745.5Yes
Prevent weight gain

GPT vs Llama65.460.763Yes

GPT vs DeepSeek57.755.656.6Yes

Llama vs DeepSeek60.76361.8Yes
Reduce fatigue

GPT vs Llama47.440.943.9Yes

GPT vs DeepSeek15.85024Yes

Llama vs DeepSeek22.783.335.7Yes
Maintain independence

GPT vs Llama253.66.2Yes

GPT vs DeepSeek2511.115.4Yes

Llama vs DeepSeek3.611.15.4Yes
Avoid strength/energy loss

GPT vs Llama33.33.46.2Yes

GPT vs DeepSeek000Yes

Llama vs DeepSeek3.414.35.6Yes
Work consistently

GPT vs Llama602030Yes

GPT vs DeepSeek4011.117.4Yes

Llama vs DeepSeek46.738.942.4Yes
ADL capability

GPT vs Llama23.566.734.8Yes

GPT vs DeepSeek23.55032Yes

Llama vs DeepSeek5037.542.9Yes
Reduce hospital admissions

GPT vs Llama21.421.421.4Yes

GPT vs DeepSeek000Yes

Llama vs DeepSeek14.310025Yes
Avoid assistive devices

GPT vs Llama1006.712.5Yes

GPT vs DeepSeek10016.728.6Yes

Llama vs DeepSeek13.333.319Yes
Avoid aggressive intervention without family interaction

GPT vs Llama000No

GPT vs DeepSeek000No

Llama vs DeepSeek9.133.314.3Yes
Decrease urination frequency

GPT vs Llama505050Yes

GPT vs DeepSeek1008088.9Yes

Llama vs DeepSeek504044.4Yes
Improve balance

GPT vs Llama10012.522.2Yes

GPT vs DeepSeek1002540Yes

Llama vs DeepSeek12.52516.7Yes
Recognize/communicate with family

GPT vs Llama000No

GPT vs DeepSeek000No

Llama vs DeepSeek000No
Maintain/improve memory

GPT vs Llama607566.7Yes

GPT vs DeepSeek4010057.1Yes

Llama vs DeepSeek5010066.7Yes
Maintain normal sex life

GPT vs Llama000Yes

GPT vs DeepSeek000Yes

Llama vs DeepSeek000Yes
Seek palliative care consultation

GPT vs Llama000Yes

GPT vs DeepSeek000No

Llama vs DeepSeek000No
Age in place

GPT vs Llama000No

GPT vs DeepSeek000No

Llama vs DeepSeek000Yes
Table 4. Overall pairwise span-overlap F1-score at Jaccard similarity 0.6 across all 22 categories populated by at least 1 model in the retrospective analysis of 1000 portal messages from patients with depression or substance use disorder, 2021-2022. Results were generated from the same frozen GPT-4o-mini, DeepSeek-R1-Distill-Llama-70B, and Llama-3.3-70B-Instruct output set used for Table 2.
PairCategories, nMatched pairs, nMacro-F1-score (%)Micro-F1-score (%)Weighted-F1-score (%)
GPT vs Llama2227523.325.625.6
GPT vs DeepSeek2222023.832.332.3
Llama vs DeepSeek2243526.235 35

Llama Fine-Tuning

Fine-tuning was performed to examine whether task-specific human judgments could improve Llama’s ability to verify extracted patient-goal and preference candidates. The human evaluation produced 822 annotated category-span pairs (274 from each model). Reviewer disagreements were treated as conflicts and excluded; 736 pairs had concordant yes/no judgments. A total of 13 duplicate category-span pairs were then removed, yielding 723 examples for supervised candidate-verification fine-tuning. Each instance used the proposed category and extracted span as input and the concordant yes/no verification decision as the target. The examples were randomly divided into 506 training examples and 217 held-out test examples, with stratification by source model. All spans originating from the same source message were assigned to the same partition. No exact category-span pairs or source messages were shared between the training and test sets. Stratification did not enforce the yes/no verification-label distribution.

Llama-3.3-70B-Instruct was adapted using quantized low-rank adaptation (QLoRA), a parameter-efficient technique that updates a small set of adapter weights rather than all model parameters. Four-bit NormalFloat quantization and bfloat16 computation were used. Low-rank adapters used rank 16, alpha 32, and dropout 0.05. Training used AdamW with a learning rate of 2 × 10–4, weight decay of 0.01, a total batch size of 8, a maximum sequence length of 512 tokens, and 3 epochs on 1 NVIDIA H200 GPU. Training required approximately 2 H200 GPU-hours. Overfitting risk was limited through parameter-efficient adaptation, adapter dropout, weight decay, the 3-epoch limit, stratification, and evaluation only on the untouched 217-item test set.

Fine-tuned Llama was compared with GPT-4o-mini, DeepSeek-R1-Distill-Llama-70B, and untuned Llama-3.3-70B-Instruct on the same test examples. Micro-, macro-, and weighted-F1-score were calculated across both verification labels. Micro-F1-score equals accuracy in this single-label binary task. Positive-class precision, recall, F1-score, and predicted yes/no counts were also calculated. A constant-no predictor provided the majority-class baseline. Exact 2-sided McNemar tests compared fine-tuned Llama with GPT-4o-mini and untuned Llama.

The 3 baseline models performed zero-shot verification using the same system instruction and category-span prompt, reproduced in Multimedia Appendix 1. The prompt required a yes-or-no response without explanation. GPT-4o-mini used temperature 0; maximum tokens and top_p were not explicitly set. Llama-3.3-70B-Instruct and DeepSeek-R1-Distill-Llama-70B used deterministic decoding (do_sample=False), temperature 0, and a maximum of 1024 generated tokens. Extraction-specific JSON response formatting, function calling, and the JSON_END stopping string were not used for verification. Only the final yes/no decision was used for scoring; any reasoning content was discarded before comparison with the concordant human reference labels.


LLM Identification of Patient Goals and Preferences

The 3 models independently segmented the same 1000 complete portal messages. Their parsing pipelines yielded 6645 units for GPT-4o-mini, 4817 for DeepSeek-R1-Distill-Llama-70B, and 5546 for Llama-3.3-70B-Instruct. Of these, 513, 850, and 1635 units, respectively, were assigned to 1 of the 29 predefined goal or preference labels. The remaining units were primarily assigned to “others.”

Table 2 reports counts and percentages for all 29 goal and preference labels in descending order of the total candidate count across the 3 models, with prompt order resolving ties. Percentages use each model’s complete output-unit denominator—6645 for GPT-4o-mini, 4817 for DeepSeek, and 5546 for Llama—and therefore represent the proportion of all units generated by that model rather than the proportion among goal candidates. Llama-3.3-70B-Instruct identified the largest number of goal-category spans across most categories, GPT-4o-mini identified the fewest, and DeepSeek generally produced intermediate counts. Span volume describes extraction coverage and does not by itself establish correctness.

Human Evaluation of LLM Performance

Two reviewers independently evaluated 274 randomly selected category-span pairs per model (Table 5). Joint acceptance was 67, 83, and 74 spans for GPT-4o-mini, Llama-3.3-70B-Instruct, and DeepSeek, respectively. Observed agreement was 244/274 (89.1%), 256/274 (93.4%), and 236/274 (86.1%), with Cohen κ values of 0.740, 0.853, and 0.693. These measures describe reviewer agreement and candidate verification rather than end-to-end accuracy or recall.

Table 5. Human evaluation of 274 category-span pairs per model in the retrospective portal-message study of patients with depression or substance use disorder, 2021-2022. Joint acceptance requires yes from both reviewers; observed agreement includes joint yes and joint no decisions.
ModelEvaluated, nReviewer (yes), n/NJoint acceptance, nReviewer agreement, n/N (%)Cohen κ
GPT27473/9167244/274 (89.1)0.740
Llama27483/10183256/274 (93.4)0.853
DeepSeek27481/10574236/274 (86.1)0.693

Differential Coverage of Categories by LLMs

The distribution of span percentages revealed distinct thematic emphases. All models frequently identified spans related to improving day-to-day symptoms, reducing pain, and addressing depression or anxiety. Llama-3.3-70B-Instruct also allocated a larger proportion of its output to categories such as independence, avoiding loss of strength, and having an aware, knowledgeable, and compassionate physician. GPT-4o-mini concentrated on fewer high-frequency categories, whereas DeepSeek showed an intermediate pattern and produced percentages similar to the other models for categories such as decreasing blood pressure and preventing weight gain. These patterns describe differential coverage, not comparative clinical accuracy. Figure 1 displays the 10 most prevalent categories to keep labels legible at publication size; Table 2 reports all 29 categories.

‎
Figure 1. Percentages for the 10 most prevalent goal and preference categories identified in 1000 portal messages from patients with depression or substance use disorder, 2021-2022. Percentages use all model-generated output units; Table 2 reports all 29 goal and preference categories.

Pairwise Evaluation of LLMs

Evaluation Across 22 Populated Categories

Table 3 reports pairwise overlap for every category populated by at least 1 of the 3 models. Precision and recall use the same integer matched-pair count: the first named model supplies the precision denominator (S1), and the second supplies the recall denominator (S2). Values are displayed to 1 decimal place; unrounded metrics and their underlying matched-pair and model-span counts are supplied in the supplementary CSV files in Multimedia Appendix 2.

The greatest overlap appeared for several measurable goals, including maintaining or improving memory, preventing weight gain, and decreasing urination frequency. Pain-related spans showed moderate and relatively consistent overlap across model pairs. Lower or asymmetric overlap occurred for broader functional and preference categories, including maintaining independence, avoiding strength or energy loss, and preferring an aware, knowledgeable, and compassionate physician. Overall, DeepSeek and Llama had the greatest pairwise overlap. These patterns describe intermodel consistency and do not determine which extraction was clinically correct.

Overall Evaluation Across 22 Populated Categories

Llama and DeepSeek had the greatest overall overlap, with micro-F1-score and weighted-F1-score of 35%. GPT and DeepSeek had corresponding values of 32.3%, and GPT and Llama had values of 25.6%. Macro-F1-score ranged from 23.3% to 26.2%. Weighted-F1-score equals micro-F1-score under the stated average-support weighting and category-constrained aggregation.

Llama Fine-Tuning

The 822 reviewed category-span pairs yielded 736 concordant reviewer decisions after 86 conflicts were excluded. Removing 13 duplicate category-span pairs produced 723 examples, of which 506 were used for training and 217 were held out for testing. Fine-tuned Llama and all 3 baseline models were evaluated on the same 217-item test set. All baseline responses were valid yes/no decisions. Invalid or unparseable responses were 0/217 (0%) for each baseline. No examples were excluded or scored as incorrect because of response-format failures. On the held-out test set, fine-tuned Llama-3.3-70B-Instruct achieved micro-F1-score of 0.548, macro-F1-score of 0.524, and weighted-F1-score of 0.573 (Table 6). Untuned Llama was the strongest LLM baseline, with corresponding values of 0.484, 0.473, and 0.507. The experiment evaluated candidate/category verification on the annotated span set rather than end-to-end extraction from complete messages. Figure 2 summarizes candidate-verification performance.

The held-out reference labels were yes for 59/217 (27.2%) examples and no for 158/217 (72.8%) examples. A constant-no predictor achieved accuracy/micro-F1-score of 0.728, macro-F1-score of 0.421, and weighted-F1-score of 0.614 (Table 6). Fine-tuned Llama exceeded this predictor on macro-F1-score (0.524 vs 0.421), but not on accuracy/micro-F1-score (0.548 vs 0.728). Table 7 reports positive-class precision, recall, F1-score, and predicted yes/no counts. All 4 LLMs predicted yes more often than the reference labels. DeepSeek returned yes for all 217 examples, representing complete label collapse rather than a response-format failure.

Exact 2-sided McNemar tests compared paired correctness on the same 217 test items. Fine-tuned Llama had 22 wins vs 8 losses against untuned Llama (P=.02) and 63 wins vs 35 losses against GPT-4o-mini (P=.006). The comparison against DeepSeek was omitted from paired inference because its constant-yes output was uninformative about verification capability. Figure 3 presents the discordant correctness counts and corresponding McNemar comparisons.

Table 6. Candidate-verification F1-score for fine-tuned Llama-3.3-70B-Instruct, 3 LLM baselines, and a constant-no majority-class baseline on the same 217 held-out portal-message category-span pairs from patients with depression or substance use disorder. The reference labels comprise 59 yes and 158 no decisions. Micro-F1-score equals accuracy in this single-label binary task.
ModelMicro-F1-scoreMacro-F1-scoreWeighted-F1-score
GPT-4o-mini0.4190.4020.448
DeepSeek-R1-Distill-Llama-70B0.2720.2140.116
Llama-3.3-70B-Instruct0.4840.4730.507
Fine-tuned Llama-3.3-70B-Instruct0.5480.5240.573
Constant-no majority baseline0.7280.4210.614
‎
Figure 2. Micro-, macro-, and weighted-F1-score for 3 LLM baselines, QLoRA-fine-tuned Llama-3.3-70B-Instruct, and a constant-no majority-class baseline on the same 217 held-out portal-message category-span pairs from patients with depression or substance use disorder. Micro-F1-score equals accuracy; the reference labels comprise 59 yes and 158 no decisions.
Table 7. Predicted yes/no decisions and positive-class verification performance on the same 217 held-out portal-message category-span pairs from patients with depression or substance use disorder. “Yes” is the positive class, indicating that the span supports its assigned category.
ModelPredicteda, nYes, precisionYes, recallYes, F1-score

YesNo


GPT-4o-mini121960.2230.4580.300
DeepSeek-R1-Distill-Llama-70B21700.2721.0000.428
Llama-3.3-70B-Instruct127900.2910.6270.398
Fine-tuned Llama-3.3-70B-Instruct1091080.3210.5930.417
Constant-no majority baseline0217—b0.0000.000

aPredicted yes/no gives the number of each decision.

bPrecision is undefined for the constant-no predictor because it makes no positive predictions; its positive-class recall and F1-score are 0.

‎
Figure 3. Discordant correctness counts and exact 2-sided McNemar P values for fine-tuned Llama vs untuned Llama-3.3-70B-Instruct and GPT-4o-mini on the same 217 held-out portal-message category-span pairs from patients with depression or substance use disorder.

Principal Findings

Our comparative analysis demonstrates that LLMs can help identify patient goals and preferences from unstructured portal communication, but substantial variation exists in how models segment messages and assign categories. Llama-3.3-70B-Instruct provided the broadest candidate coverage, GPT-4o-mini exhibited more conservative extraction behavior, and DeepSeek-R1-Distill-Llama-70B produced intermediate coverage. DeepSeek and Llama had the greatest intermodel overlap across all 22 populated categories (micro-F1-score=0.350). QLoRA fine-tuning increased Llama’s candidate-verification micro-F1-score from 0.484 to 0.548, but it remained below the constant-no majority-class baseline of 0.728. Fine-tuned Llama had a higher macro-F1-score than this baseline (0.524 vs 0.421).

Many individuals may not perceive the urgency to seek or adhere to treatment, especially in the context of chronic or behavioral health conditions. This makes it especially important to engage patients in shared decision-making that considers their personal values, health priorities, and daily life circumstances. When treatment plans align with patient goals, such as maintaining independence, minimizing medication side effects, or preserving emotional well-being, adherence and outcomes may improve. Clinical strategies must therefore evolve to capture these goals in a scalable and interpretable way. Because extraction volume is not equivalent to correctness, model-coverage differences should be interpreted together with human evaluation and pairwise overlap.

LLM Comparative Analysis

Category-level analysis showed relatively high overlap for measurable and somatic goals, including preventing weight gain, maintaining or improving memory, and decreasing urination frequency. Pain and fatigue showed partial rather than complete agreement. Divergence was more pronounced for broader functional goals such as independence and avoiding loss of strength, and for subjective or implicit preferences such as wanting an aware, knowledgeable, and compassionate physician. These patterns may reflect differences in segmentation, sensitivity to wording, training exposure, or model architecture, although the present analysis cannot isolate their causes. DeepSeek and Llama showed the greatest overall overlap, while GPT differed more from both 70-billion-parameter models. Intermodel overlap nevertheless does not establish clinical validity. That is, models may agree on an incorrect extraction or identify different boundaries for the same underlying concept.

Several explicit care-preference categories, including hospice, place of death, and quality-vs-quantity preferences, yielded few or no candidates in this cohort. The study cannot determine whether this reflects cohort prevalence, implicit wording, taxonomy choice, or model behavior.

Llama Fine-Tuning

QLoRA fine-tuning yielded higher micro-, macro-, and weighted-F1-score than all 3 LLM baselines on the held-out 217-item test set, but accuracy/micro-F1-score remained below the constant-no majority-class baseline (0.548 vs 0.728). Macro-F1-score exceeded the majority baseline (0.524 vs 0.421). The relative accuracy improvement over untuned Llama was supported by the paired McNemar comparison (P=.02), although accuracy remained below the majority baseline of 0.728. The experiment does not establish improved end-to-end extraction from complete messages. The fine-tuning examples originated from outputs of the evaluated models and may therefore favor their segmentation and category choices. The 723-example dataset was also small relative to the 70-billion-parameter base model. QLoRA, dropout, weight decay, limited epochs, stratification, and held-out evaluation reduced—but did not eliminate—overfitting risk; independent data are needed to assess generalization.

Clinical Implications

If validated against complete-message human annotation, extracted goals could support a clinician-facing longitudinal view of patient priorities. Candidate displays could retain the source, author, date, and context and allow patients or clinicians to confirm, revise, supersede, or deactivate entries rather than treating them as established facts. Because goals and preferences evolve, such a view could also distinguish short-, intermediate-, and long-term priorities and serve as supporting context rather than independently determining treatment or goals-of-care decisions. Care setting should be represented separately from type of care. Hospice, for example, may be delivered at home, in a residential hospice, or in another facility. Hospice and home death should not be treated as mutually exclusive preferences.

Limitations

This study focused on patients with substance use disorder or depression, a population with important and often underrepresented behavioral and chronic-care needs. Their portal communication and expressed priorities may differ from those of patients with cancer, cardiovascular disease, or other chronic illnesses. The source cohort and portal-message data may not represent other populations, institutions, or portal workflows; therefore, external generalizability remains uncertain.

Human review evaluated model-selected spans rather than exhaustively annotating complete messages. It supports candidate verification but cannot quantify false negatives or recall, and judgments may be affected by overlapping categories, annotation subjectivity, and limited context.

LLM performance may vary with prompt wording, input phrasing, and task framing. Only one prompt was evaluated, and the requirement to assign exactly one category may oversimplify statements that express multiple overlapping goals. Pairwise F1-score is consequently interpreted as intermodel agreement rather than correctness. Although fine-tuning improved candidate verification relative to untuned Llama, accuracy/micro-F1-score remained below the constant-no majority-class baseline (0.548 vs 0.728). Independent data and complete-message gold standards are needed to assess generalization and end-to-end extraction.

Future Work

Future work should prioritize multiannotator, multilabel gold-standard annotation of complete messages and external validation across health systems and clinical populations. Cohorts with advanced cancer, end-stage chronic obstructive pulmonary disease, or end-stage heart failure may be particularly informative because explicit care preferences may be more common. Subsequent studies could evaluate prompt sensitivity, temporal updating, and safe clinician-facing integration.

Conclusions

This study applied LLMs to identify patient goals and preferences from unstructured portal communication. Consistent with the comparative aim, the models differed in extraction volume, category distribution, human verification, and pairwise overlap: Llama-3.3-70B-Instruct produced the broadest candidate coverage, DeepSeek produced intermediate coverage, and GPT-4o-mini was more conservative. DeepSeek and Llama had the greatest overlap across all 22 populated categories (micro-F1-score=0.350). QLoRA fine-tuning increased candidate-verification micro-F1-score relative to untuned Llama (0.484 to 0.548), but remained below the constant-no majority-class baseline of 0.728. Fine-tuned Llama had a higher macro-F1-score than this baseline (0.524 vs 0.421). The findings support further evaluation using complete-message gold standards and external validation before clinical use.

Acknowledgments

The authors thank the clinical and research staff who supported data collection and study coordination. The views expressed in this article are those of the authors and do not necessarily reflect the position or policy of the Department of Veterans Affairs or the United States Government.

Funding

This work was partially supported by the US Department of Veterans Affairs under contract number 776C53014, the National Cancer Institute under grant 1R01CA285737-01A1 (to SF), and the Patient-Centered Outcomes Research Institute under award number ME-2023C2-31367 (to SF).

Data Availability

The portal communications contain protected health information and are not publicly available. Aggregate category counts that do not contain message text are provided in Multimedia Appendix 2. Aggregate confusion matrices and candidate-verification metrics are also provided in the supplementary CSV in Multimedia Appendix 3.

Generative AI Use

OpenAI Codex was used during manuscript revision for language editing, formatting, and code review. The authors reviewed the resulting text and take responsibility for the manuscript’s content.

Authors' Contributions

SF contributed to conceptualization, methodology, formal analysis, original draft, and writing, review, and editing. YW was responsible for investigation, formal analysis, and writing. MJ and JN contributed to clinical domain expertise, validation, and writing.

Conflicts of Interest

None declared.

Multimedia Appendix 1

Extraction and zero-shot verification prompts, baseline verification decoding settings, and mapping between reporting labels and the 29 verbatim goal/preference labels plus Others (30 total labels).

DOCX File , 20 KB

Multimedia Appendix 2

Supplementary category counts, per-category matched-pair and model-span counts, and unrounded pairwise overlap metrics underlying Tables 2–4, with reporting-label mappings, model-output flow counts, and frozen-input file hashes.

ZIP File (Zip Archive), 6 KB

Multimedia Appendix 3

Confusion matrices, predicted Yes/No counts, and full-precision candidate-verification metrics for 4 large language models and a constant-No majority-class baseline on 217 held-out category-span pairs.

ZIP File (Zip Archive), 1 KB

  1. Barry MJ, Edgman-Levitan S. Shared decision making—pinnacle of patient-centered care. N Engl J Med. 2012;366(9):780-781. [CrossRef] [Medline]
  2. Charles C, Gafni A, Whelan T. Shared decision-making in the medical encounter: what does it mean? (or it takes at least two to tango). Soc Sci Med. 1997;44(5):681-692. [CrossRef] [Medline]
  3. Elwyn G, Frosch D, Thomson R, Joseph-Williams N, Lloyd A, Kinnersley P, et al. Shared decision making: a model for clinical practice. J Gen Intern Med. 2012;27(10):1361-1367. [FREE Full text] [CrossRef] [Medline]
  4. Epstein RM, Street RL. The values and value of patient-centered care. Ann Fam Med. 2011;9(2):100-103. [FREE Full text] [CrossRef] [Medline]
  5. Fried TR, Street RL, Cohen AB. Chronic disease decision making and "what matters most". J Am Geriatr Soc. 2020;68(3):474-477. [FREE Full text] [CrossRef] [Medline]
  6. Grudniewicz A, Gray CS, Boeckxstaens P, De Maeseneer J, Mold J. Operationalizing the chronic care model with goal-oriented care. Patient. 2023;16(6):569-578. [FREE Full text] [CrossRef] [Medline]
  7. Earp BD, Porsdam Mann S, Allen J, Salloch S, Suren V, Jongsma K, et al. A personalized patient preference predictor for substituted judgments in healthcare: technically feasible and ethically desirable. Am J Bioeth. 2024;24(7):13-26. [FREE Full text] [CrossRef] [Medline]
  8. Lee RY, Brumback LC, Lober WB, Sibley J, Nielsen EL, Treece PD, et al. Identifying goals of care conversations in the electronic health record using natural language processing and machine learning. J Pain Symptom Manage. 2021;61(1):136-142.e2. [FREE Full text] [CrossRef] [Medline]
  9. Lee RY, Kross EK, Torrence J, Li KS, Sibley J, Cohen T, et al. Assessment of natural language processing of electronic health records to measure goals-of-care discussions as a clinical trial outcome. JAMA Netw Open. 2023;6(3):e231204. [FREE Full text] [CrossRef] [Medline]
  10. Lindvall C, Deng CY, Moseley E, Agaronnik N, El-Jawahri A, Paasche-Orlow MK, et al. Natural language processing to identify advance care planning documentation in a multisite pragmatic clinical trial. J Pain Symptom Manage. 2022;63(1):e29-e36. [FREE Full text] [CrossRef] [Medline]
  11. Raisa A, Alpert JM, Bylund CL, Jarad-Fodeh S. Identifying the mechanisms of patient-centred communication in secure messages between clinicians and cancer patients. PEC Innov. 2023;2:100161. [FREE Full text] [CrossRef] [Medline]
  12. Ren Y, Wu Y, Fan J, Khurana A, Fu S, Wu D, et al. Automatic uncovering of patient primary concerns in portal messages using a fusion framework of pretrained language models. J Am Med Inform Assoc. 2024;31(8):1714-1724. [FREE Full text] [CrossRef] [Medline]
  13. Sivarajkumar S, Kelley M, Samolyk-Mazzanti A, Visweswaran S, Wang Y. An empirical evaluation of prompting strategies for large language models in zero-shot clinical natural language processing: algorithm development and validation study. JMIR Med Inform. 2024;12:e55318. [FREE Full text] [CrossRef] [Medline]
  14. Wiest IC, Ferber D, Zhu J, van Treeck M, Meyer SK, Juglan R, et al. Privacy-preserving large language models for structured medical information retrieval. NPJ Digit Med. 2024;7(1):257. [FREE Full text] [CrossRef] [Medline]
  15. Gu B, Shao V, Liao Z, Carducci V, Brufau SR, Yang J, et al. Scalable information extraction from free text electronic health records using large language models. BMC Med Res Methodol. 2025;25(1):23. [FREE Full text] [CrossRef] [Medline]
  16. Yuan K, Yoon CH, Gu Q, Munby H, Walker AS, Zhu T, et al. Transformers and large language models are efficient feature extractors for electronic health record studies. Commun Med (Lond). 2025;5(1):83. [FREE Full text] [CrossRef] [Medline]
  17. Liu S, Wright AP, McCoy AB, Huang SS, Steitz B, Wright A. Detecting emergencies in patient portal messages using large language models and knowledge graph-based retrieval-augmented generation. J Am Med Inform Assoc. 2025;32(6):1032-1039. [FREE Full text] [CrossRef] [Medline]
  18. Singer PA, Martin DK, Kelner M. Quality end-of-life care: patients' perspectives. JAMA. 1999;281(2):163-168. [CrossRef] [Medline]
  19. Steinhauser KE, Christakis NA, Clipp EC, McNeilly M, McIntyre L, Tulsky JA. Factors considered important at the end of life by patients, family, physicians, and other care providers. JAMA. 2000;284(19):2476-2482. [CrossRef] [Medline]
  20. Teno JM, Clarridge BR, Casey V, Welch LC, Wetle T, Shield R, et al. Family perspectives on end-of-life care at the last place of care. JAMA. 2004;291(1):88-93. [CrossRef] [Medline]
  21. Gomes B, Calanzani N, Gysels M, Hall S, Higginson IJ. Heterogeneity and changes in preferences for dying at home: a systematic review. BMC Palliat Care. 2013;12:7. [FREE Full text] [CrossRef] [Medline]
  22. Temel JS, Greer JA, Muzikansky A, Gallagher ER, Admane S, Jackson VA, et al. Early palliative care for patients with metastatic non-small-cell lung cancer. N Engl J Med. 2010;363(8):733-742. [CrossRef] [Medline]
  23. Wiles JL, Leibing A, Guberman N, Reeve J, Allen RES. The meaning of "aging in place" to older people. Gerontologist. 2012;52(3):357-366. [CrossRef] [Medline]
  24. Kessler RC, Demler O, Frank RG, Olfson M, Pincus HA, Walters EE, et al. Prevalence and treatment of mental disorders, 1990 to 2003. N Engl J Med. 2005;352(24):2515-2523. [FREE Full text] [CrossRef] [Medline]
  25. Hofmann SG, Smits JAJ. Cognitive-behavioral therapy for adult anxiety disorders: a meta-analysis of randomized placebo-controlled trials. J Clin Psychiatry. 2008;69(4):621-632. [FREE Full text] [CrossRef] [Medline]
  26. Nazarov S, Manuwald U, Leonardi M, Silvaggi F, Foucaud J, Lamore K, et al. Chronic diseases and employment: which interventions support the maintenance of work and return to work among workers with chronic illnesses? A systematic review. Int J Environ Res Public Health. 2019;16(10):1864. [FREE Full text] [CrossRef] [Medline]
  27. GPT-4o mini: advancing cost-efficient intelligence. OpenAI. URL: https://openai.com/index/gpt-4o-mini-advancing -cost-efficient-intelligence/ [accessed 2026-08-17]
  28. Llama-3.3-70B-instruct model card. Hugging Face. URL: https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct [accessed 2026-08-17]
  29. Guo D, Yang D, Zhang H, Song J, Wang P, Zhu Q, et al. DeepSeek-R1 incentivizes reasoning in LLMs through reinforcement learning. Nature. 2025;645(8081):633-638. [CrossRef] [Medline]


‎
ADL: activity of daily living
HIPAA: Health Insurance Portability and Accountability Act
LLM: large language model
QLoRA: quantized low-rank adaptation


Edited by A Coristine; submitted 31.Mar.2026; peer-reviewed by M-E Yeow, R Hosch; comments to author 21.Jul.2026; revised version received 04.Nov.2026; accepted 09.Nov.2026; published 04.Dec.2026.

Copyright

©Samah Fodeh, Yan Wang, Makoto Jones, Jonathan Nebeker. Originally published in JMIR Medical Informatics (https://medinform.jmir.org), 04.Dec.2026.

This is an open-access article distributed under the terms of the Creative Commons Attribution License (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work, first published in JMIR Medical Informatics, is properly cited. The complete bibliographic information, a link to the original publication on https://medinform.jmir.org/, as well as this copyright and license information must be included.