---
title: 'DualAlign: Synthetic Clinical Data Framework'
url: https://www.emergentmind.com/topics/dualalign-framework
type: topic
---

# DualAlign: Synthetic Clinical Data Framework

DualAlign is a framework for generating clinically grounded synthetic clinical data that explicitly integrates both statistical fidelity and clinical plausibility through joint statistical and semantic alignment. Developed with a focus on Alzheimer’s disease (AD) as a use case, DualAlign addresses the challenge of producing synthetic electronic health records (EHRs) that are not only privacy-preserving and realistic in terms of patient demographics and comorbidities but also exhibit authentic temporal symptom trajectories as observed in real-world clinical practice. The framework combines persona-driven conditioning and empirical symptom trajectory modeling in its prompt templates to steer large language model (LLM) generation, and demonstrates substantial improvements in downstream AD symptom classification tasks relative to baseline methods [2509.10538].

## 1. Alignment Mechanisms: Statistical and Semantic

DualAlign’s overall generative process is governed by two alignment mechanisms: statistical alignment and semantic alignment.

### Statistical Alignment

Statistical alignment, labeled as “persona-driven,” conditions synthetic note generation on a structured patient profile block. Denote $D = \{d_1, ... , d_m\}$ as discrete demographic attributes (age group, sex, race/ethnicity, urban/rural), and $R = \{r_1, ..., r_n\}$ as patient risk factors and SDOH (e.g., hypertension, diabetes, depression, housing instability). The LLM is guided to maximize
$$
P(\text{note} \mid D, R)
$$
by constructing explicit prompt templates encoding “Persona” information. The framework formalizes its statistical alignment optimization target as
$$
\ell_{\text{stat}} = \mathbb{E}_{(D, R)} [ \log P_{LLM} (\text{note} \mid D, R) ].
$$

### Semantic Alignment

Semantic alignment addresses the realism of symptom trajectories over time. Let $T \in \{10, ..., 1\}$ index years before diagnosis. For each $T$, real-world data provides:
- The average number of symptom keywords per note, $\mu_{real}(T)$
- A categorical distribution over symptom domains $C \in \{\text{Speech/Language}, \text{Memory}, \text{Learning/Perception}, \text{Assistance}, \text{Physiological}, \text{Neuropsychiatric}\}$

During generation, the procedure densifies training data by multiplying $\mu_{real}(T)$ by 5, then samples $n_T \sim \text{Cat}(5 \cdot \mu_{real}(T) \text{ normalized})$ keywords per note. Each mention’s domain label is drawn $c_i \sim \text{Cat}(P_{real}(C \mid T))$, and a random within-domain keyword $w_i$ is selected uniformly. These sampled keywords are embedded in the prompt. Although no explicit semantic loss is introduced, the process can be viewed as minimizing the KL divergence between synthetic and real symptom distributions by year:
$$
L_{\text{sem}} \approx \sum_{T,C} \mathrm{KL}(P_{\text{synth}}(\#\,\text{keywords}=C|T) \,\|\, P_{real}(\#\,\text{keywords}=C|T))
$$

## 2. Generation Pipeline and Workflow

DualAlign’s end-to-end generation process can be outlined as follows:

1. **Sampling Persona**: $D$ and $R$ are sampled from national epidemiology and categorical risk factor prevalence.
2. **Simulating Timeline**: For years $T=10$ to $1$ pre-diagnosis, the number of visits and note types are sampled from empirical distributions derived from a 35,308-patient Alzheimer’s Disease cohort from the VA CDW.
3. **Sampling Symptom Keywords**: For each note at $T$, $n_T$ symptom keywords are drawn as described above, with each assigned a domain and a concrete keyword.
4. **Prompt Assembly**: A structured prompt template is filled with persona, visit type, timepoint (mapped to AD stage), and sampled keywords. Controlled noise (abbreviations, typos) is introduced.
5. **Note Generation**: The prompt is provided to GPT-4 (off-the-shelf, top-$k$/top-$p$ defaults) to produce a SOAP-style clinical note.
6. **Sentence-level Annotation**: An LLM-based annotator—trained using a clinician-curated protocol—assigns one of five symptom categories (Cognitive Impairment, Concerns by Others, Requires Assistance, Physiological Changes, Neuropsychiatric Symptoms), or labels a sentence as “negative.”

The following table summarizes the data and model flow:

| Step                | Model        | Input                                 | Output                        |
|---------------------|-------------|---------------------------------------|-------------------------------|
| 1–5: Note generation| GPT-4        | Persona + empirical trajectory prompts| Synthetic multi-year notes     |
| 6: Annotation       | LLM annotator| Synthetic note sentences              | Sentence-level symptom labels  |

## 3. Model Architecture and Fine-tuning Strategy

DualAlign does not fine-tune LLMs for note generation; instead, it steers GPT-4 using structured prompts constructed according to empirical alignment. For downstream tasks, a separate classifier is constructed as follows:

- **Architecture**: Meta’s LLaMA 3.1–8B model, with a classification head using the [CLS]-style first-token representation and a dropout rate of 0.1.
- **Fine-tuning regimen**:
  - Effective batch size: 64 (16 × 4 GPUs, gradient accumulation)
  - Optimizer: AdamW ($\beta_1=0.9$, $\beta_2=0.999$, weight decay $=10^{-2}$)
  - Learning rate: $2 \times 10^{-5}$, linear warmup (0.1 ratio), linear decay
  - Maximum sequence length: 128 tokens
  - Epochs: 3, with early stopping on validation macro-F1, and evaluation every 200 steps

Sentence-level annotation is performed for both human-annotated “gold” data (11,571 sentences from 5,112 notes, 76 patients, inter-annotator $\kappa=0.868$) and synthetic data (233,014 DualAlign-generated sentences annotated by LLM).

## 4. Empirical Dataset Construction

- **Real-world source**: VA Corporate Data Warehouse (CDW)
  - Cohort: 35,308 AD patients (2+ diagnoses, specialty confirmed, 2015–2022)
  - Demographics: Mean age 79 (SD 8.4), 2.0% women, 78.9% White, 12.9% Black
  - Longitudinal note corpus: 2000–2022, spanning multiple care settings
- **Derived empirical priors**:
  - Note-type frequencies by year relative to diagnosis
  - Symptom-keyword counts per note, by timepoint
  - Domain-level keyword proportions, by year
- **Gold annotation**: 11,571 sentences across five AD symptom categories
- **Synthetic annotation**: 233,014 sentences, guided by clinician-defined protocols

## 5. Evaluation Protocols and Key Results

DualAlign’s evaluation incorporates statistical distributional fidelity, clinical plausibility via classification performance, and expert human review:

- **Statistical Fidelity**: Agreement of synthetic note-type frequencies, symptom counts, and domain proportions with real distributions.
- **Clinical Plausibility**: Downstream LLaMA-3.1–8B classification on held-out gold test set. Metrics include precision, recall, F₁, and accuracy (5:1 negative:positive ratio).
- **Ablation**: Incrementally increasing DualAlign data during classifier training reveals a plateau at $\sim$40% of the full synthetic volume.
- **Expert Review**: Two clinicians independently assess sentence-level realism and annotation (~85% accuracy), as well as trajectory coherence for three synthetic patient histories.

Key results (test on gold set):

| Training Regimen           | F₁ (Binary) | Accuracy (Binary) | Multi-class Accuracy | Multi-class F₁ (Cog/Conc/Req/Phys/Neuro) |
|----------------------------|-------------|-------------------|---------------------|----------------------------------------|
| Gold Only                  | 0.72        | 0.87              | 0.70                | 0.77 / 0.46 / 0.57 / 0.62 / 0.71       |
| +Bronze (Unguided synthetic)| 0.77        | 0.91              | -                   | -                                      |
| +DualAlign (matched)       | 0.79        | 0.93              | -                   | -                                      |
| +DualAlign (full)          | 0.84        | 0.95              | 0.80                | 0.82 / 0.60 / 0.72 / 0.78 / 0.86       |
| DualAlign Only             | 0.47        | 0.82              | -                   | -                                      |

DualAlign yields 5–12 point absolute F₁ gains over gold-only baselines and outperforms the unguided synthetic data baseline. No p-values for statistical significance were reported. Synthetic notes exhibit rich, context-sensitive symptom content.

## 6. Methodological Limitations and Future Directions

Several limitations are acknowledged:
- **Longitudinal Coherence**: Synthetic notes may concentrate symptoms too densely; stage transitions (e.g., MCI to dementia) may lack gradualness or internal consistency.
- **Annotation Errors**: Approximately 15% sentence mislabeling occurs, especially in challenging categories due to negation or ambiguity.
- **Cohort Heterogeneity**: Despite demographic rebalancing, some risk factor combinations are occasionally implausible (residual mode collapse).
- **Evaluation Scope**: Human evaluation is based on 100 sentences and 3 synthetic trajectories; wider, structured review is needed.

Proposed next steps include integrating planning-based or memory-augmented generation to improve temporal coherence, adding domain-informed constraints or rejection sampling, enhancing semantic parsing and post-hoc corrections, and conducting broader human studies with formal rating scales and agreement measures.

## 7. Implications and Outlook

DualAlign demonstrates that joint persona-driven and symptom-guided prompting significantly improves the realism and utility of synthetic clinical text for AD research. This is achieved while preserving patient privacy and maintaining statistical fidelity to real cohorts. While DualAlign does not yet achieve full longitudinal simulation of patient trajectories, the framework offers a practical strategy for augmenting low-resource annotation settings and supporting AI development in sensitive clinical domains. A plausible implication is that such dual-alignment frameworks could be adapted to other disease domains and EHR generation challenges, provided empirically grounded priors and domain-specific annotation guidelines are available [2509.10538].

Source: https://www.emergentmind.com/topics/dualalign-framework