CohortFlow: A Steerable Clinical Cohort Curation Agent with Localized Semantic Correction
Summary
We introduce CohortFlow, a steerable LLM agent for clinical cohort curation that applies natural language corrections as localized updates to a structured specification, preserving unaffected computations via explicit semantic dependencies. It matches full-regeneration accuracy while reducing correction latency by 64.8% and model calls by 38.1%.
View Cached Full Text
Cached at: 10/28/26, 07:32 AM
# CohortFlow: A Steerable Clinical Cohort Curation Agent with Localized Semantic Correction
Source: [https://arxiv.org/html/2610.36100](https://arxiv.org/html/2610.36100)
Adrian SerapioAffiliation:UC Berkeley; UC San FranciscoHanxue GuAffiliation:UC San FranciscoEvan LeeAffiliation:UC BerkeleyKang WangAffiliation:UC San FranciscoYang YangAffiliation:UC San Francisco
###### Abstract
Language model agents for clinical cohort curation should accommodate evolving eligibility criteria without repeatedly processing unchanged requirements\. We introduce[CohortFlow](https://github.com/NEILCHENHENRI/cohortflow), a steerable agent that represents natural language corrections as localized updates to a structured cohort specification and reconciles them with a persistent execution graph\. Explicitly recorded semantic dependencies enable affected computations to be selectively invalidated while preserving valid prior results\. On 100 scenarios derived from clinical\-trial eligibility criteria, comprising 126 correction turns, localized steering achieves 77\.0% requirement micro\-F1 versus 76\.4% for full regeneration using the same 8B model, a small numerical advantage that is not statistically significant \(p=0\.493p=0\.493\)\. It reduces mean correction latency by 64\.8% after completion and 44\.3% during execution, with 38\.1% fewer model calls\. In a separate proof\-of\-concept evaluation over MIMIC, all 13 cohort states execute successfully, while correction trajectories demonstrate selective preservation of unaffected computations and recomputation of changed or dependent nodes\. Together, these results show that localized semantic steering can substantially reduce correction latency and model calls while maintaining strong requirement\-level accuracy\.
## 1Introduction
Clinical cohort curation is often iterative: an initial set of eligibility criteria may be revised as clinicians inspect intermediate results, clarify intent, or refine the target population\. Existing systems increasingly use language models to translate natural language criteria into computable cohort definitions or reason over electronic health records \(EHRs\)\([Yuan et al\., 2019](https://arxiv.org/html/2610.36100#bib.bib10);[Park et al\., 2024](https://arxiv.org/html/2610.36100#bib.bib12);[Shi et al\., 2024](https://arxiv.org/html/2610.36100#bib.bib15)\)\. However, conventional pipelines generally treat a revised request as a new task, potentially repeating interpretation and computation even when most of the existing cohort definition remains unchanged\.
This limitation becomes particularly important when corrections arrive during execution\. A clinician may add an exclusion criterion, modify a laboratory threshold, or revise a temporal relationship after other parts of the cohort have already been processed\. Restarting from the revised request discards valid intermediate work, while modifying only the final result risks leaving the execution state inconsistent with the revised intent\. Importantly, execution order does not determine semantic dependency: changing an earlier computation need not invalidate later computations that do not depend on it\.
We introduce a steerable cohort\-curation agent that incorporates natural language corrections without restarting the entire task\. The agent maintains an explicit cohort specification alongside execution state, allowing revisions to propagate according to semantic dependencies rather than execution order\. This enables corrections to be incorporated during execution while preserving computation that remains valid\.
Our contributions are:
- •We formulatesemantic mid\-run steering for clinical cohort curationand introduce an incrementalTask Deltamechanism that interprets natural language corrections as localized changes to an existing cohort specification while preserving unchanged structured state\.
- •We introducesemantic validity\-aware execution across cohort revisions, using stable requirement references and semantic fingerprints to selectively invalidate affected computation while retaining valid artifacts across structured database operations and unstructured clinical\-note reasoning\.
- •We develop astateful steering framework for heterogeneous EHR workflowsthat supports resumable execution, ordered interventions, and sequential or parallel correction scheduling, and evaluate its semantic correctness, computation reuse, and adaptation efficiency\.
## 2Related Work
### 2\.1Interactive and Steerable LLM Agents
Recent systems have moved beyond transactional agent interaction by allowing users to intervene during execution\. CowPilot supports interleaved human and agent actions during web navigation, while InterDeepResearch exposes intermediate research processes for inspection and steering\([Huq et al\., 2025](https://arxiv.org/html/2610.36100#bib.bib1);[Pan et al\., 2026](https://arxiv.org/html/2610.36100#bib.bib2)\)\. Plover exposes persistent plans that users can inspect and revise, allowing localized corrections to influence subsequent execution without discarding prior progress\([Venkatesan et al\., 2026](https://arxiv.org/html/2610.36100#bib.bib3)\)\. These systems demonstrate the value of exposing persistent intermediate state for user intervention\.
MUSE is particularly related to our work in reconstructing low\-level data\-science agent traces into semantic workflow representations through which users can reference and revise specific steps\([Chen et al\., 2026](https://arxiv.org/html/2610.36100#bib.bib4)\)\. Revisable by Design considers user interventions during streaming agent execution, while BoardroomAI compiles human interventions into structured updates to an evolving decision graph\([Zhai et al\., 2026](https://arxiv.org/html/2610.36100#bib.bib5);[Manivannan, 2026](https://arxiv.org/html/2610.36100#bib.bib6)\)\. Our work instead treats the user’s evolving cohort definition itself as persistent computational state\. Corrections are represented as localized Task Deltas over this specification, such that subsequent execution is defined with respect to the revised clinical intent rather than an independently edited plan, workflow, or decision graph\.
### 2\.2Dependency\-Aware Execution and Reuse
Beyond representing user revisions, a complementary line of work studies how existing computation should be treated after a change\. Revisable by Design uses Earliest\-Conflict Rollback to preserve computation preceding the earliest conflicting action, while BoardroomAI propagates interventions through dependencies in its decision graph to preserve unaffected artifacts and selectively reactivate affected computation\([Zhai et al\., 2026](https://arxiv.org/html/2610.36100#bib.bib5);[Manivannan, 2026](https://arxiv.org/html/2610.36100#bib.bib6)\)\. Execution Lineage represents agentic computation as a graph of artifact\-producing operations with explicit dependencies, Shepherd provides reversible execution traces supporting replay, revert, and fork, and AgentTether uses dependency\-aware trajectory representations to localize failures and selectively recover affected execution regions\([Rosen and Rosen, 2026](https://arxiv.org/html/2610.36100#bib.bib7);[Yu et al\., 2026](https://arxiv.org/html/2610.36100#bib.bib8);[Zhao et al\., 2026](https://arxiv.org/html/2610.36100#bib.bib9)\)\.
Our setting poses a different validity problem: when the semantics of the task itself change, existing computation must be reconsidered with respect to the revised specification rather than solely its position in an execution trace or graph\. In cohort curation, this validity may occur at different granularities across structured database results, retrieved evidence, and patient\-level note judgments\.
### 2\.3LLMs for EHR Cohort Curation and Phenotyping
Clinical cohort construction has long motivated natural language interfaces to structured health data\. Criteria2Query translates free\-text eligibility criteria into structured cohort definitions and executable database queries\([Yuan et al\., 2019](https://arxiv.org/html/2610.36100#bib.bib10)\)\. Criteria2Query 2\.0 introduces human interaction for correcting criteria selection, parsing, and concept mapping, while Criteria2Query 3\.0 incorporates generative LLMs for concept extraction, query generation, and reasoning\([Fang et al\., 2022](https://arxiv.org/html/2610.36100#bib.bib11);[Park et al\., 2024](https://arxiv.org/html/2610.36100#bib.bib12)\)\. More recent systems extend LLM\-based cohort construction and eligibility reasoning: EC2Seq2Sql maps eligibility criteria through structured representations to executable EHR queries, GDC Cohort Copilot supports interactive cohort refinement over cancer genomic data, and TrialGPT retrieves patient evidence for criterion\-level eligibility assessment\([Liu et al\., 2026](https://arxiv.org/html/2610.36100#bib.bib13);[Song et al\., 2025](https://arxiv.org/html/2610.36100#bib.bib14);[Jin et al\., 2024](https://arxiv.org/html/2610.36100#bib.bib16)\)\.
A complementary line of work reasons directly over heterogeneous patient data\. EHRAgent combines LLM reasoning with iterative code execution over EHR tables, while targeted LLM\-based phenotyping combines structured signals with retrieval and language\-model reasoning over clinical text, limiting expensive note analysis to patients insufficiently resolved by structured evidence\([Shi et al\., 2024](https://arxiv.org/html/2610.36100#bib.bib15);[Owens et al\., 2026](https://arxiv.org/html/2610.36100#bib.bib17)\)\. These systems establish many components required for LLM\-assisted cohort curation, including structured cohort representations, interactive refinement, database execution, and reasoning over unstructured clinical evidence\.
Our work instead focuses on maintaining consistency between an evolving cohort definition and ongoing computation when that definition is revised during execution\. Rather than treating a revised cohort as a new query, we treat the evolving specification and its existing execution state as a persistent computation whose validity must be maintained as clinical intent changes\.
## 3Methods
### 3\.1System Overview
We formulate cohort curation as a stateful computation over a structured cohort specification\. A natural language request is parsed into a database\-independentTaskSpeccontaining typed eligibility requirements, Boolean aggregation logic, and temporal relations\. Clinical predicates are grounded to identifiers in MIMIC\-IV dataset\([Johnson et al\., 2023](https://arxiv.org/html/2610.36100#bib.bib19)\)and compiled into deterministic database operations, while free\-text criteria are evaluated through a retrieval and adjudication pipeline\.
TheTaskSpecis compiled into an execution directed acyclic graph \(DAG\), whose intermediate artifacts persist across interactions\. User corrections are compiled incrementally into the current specification: only newly introduced or modified requirements are parsed and grounded, while unchanged requirements retain their existing representations\. The execution graph then determines which previous computations remain valid under the revised specification\. The same state model supports sequential steering and parallel correction interpretation\.
Figure 1:Architecture of the steerable clinical cohort curation system, showing initial cohort specification and execution, localized correction, and selective reconciliation of affected computations\.
### 3\.2Clinical Concept Resolution and Structured Execution
Clinical expressions are grounded directly to MIMIC\-IV source vocabularies\. Conditions and procedures are mapped to ICD dictionary entries, laboratory measurements to MIMIC laboratory\-item identifiers, and medications to drug names represented in prescriptions\.
Resolution first attempts a unique normalized exact match\. Otherwise, candidates are retrieved using an inverted token index and ranked by an IDF\-weighted overlap score,
S\(q,d\)=∑w∈𝒯\(q\)∩𝒯\(d\)log\(1\+Ndf\(w\)\)−ϵ\|𝒯\(d\)\|,S\(q,d\)=\\sum\_\{w\\in\\mathcal\{T\}\(q\)\\cap\\mathcal\{T\}\(d\)\}\\log\\left\(1\+\\frac\{N\}\{\\mathrm\{df\}\(w\)\}\\right\)\-\\epsilon\|\\mathcal\{T\}\(d\)\|,
whereqqis the clinical query,ddis a candidate dictionary entry,𝒯\(⋅\)\\mathcal\{T\}\(\\cdot\)denotes the set of normalized non\-stopword tokens,NNis the number of entries in the corresponding MIMIC dictionary,df\(w\)\\mathrm\{df\}\(w\)is the number of entries containing tokenww, andϵ=10−3\\epsilon=10^\{\-3\}is a small length\-penalty coefficient\. The IDF\-style weighting assigns greater importance to informative tokens that occur in fewer dictionary entries, while the small length penalty weakly favors concise candidate descriptions\.
If lexical retrieval fails, a medical LLM \(e\.g\., MedGemma\) generates canonical and equivalent clinical expressions that are used to repeat deterministic dictionary lookup\. When a clinical concept maps to multiple valid codes, a patient satisfying any of the selected codes is considered to satisfy the requirement\.
Instead of using an LLM, grounded requirements are compiled to parameterized SQL by deterministic operators\. The execution layer supports quantitative constraints, event counts, admission attributes, and temporalbefore/afterrelations between clinical events\.
### 3\.3Clinical Note Retrieval and Adjudication
Free\-text criteria are evaluated using a hybrid retrieval pipeline\. When permitted by the Boolean structure, structured predicates are evaluated first to restrict note retrieval to patients for whom the note criterion can still affect cohort membership\.
Clinical notes are chunked by section and indexed for hybrid retrieval\. Sparse candidates are retrieved using BM25, while dense candidates are retrieved using normalized semantic embeddings \(e\.g\., BGE\)\. Their union is subsequently scored using a cross\-encoder reranker\. For each candidate passageii, the reranker produces a logitziz\_\{i\}, which is converted to a relevance score
si=σ\(zi\),s\_\{i\}=\\sigma\(z\_\{i\}\),whereσ\(⋅\)\\sigma\(\\cdot\)denotes the sigmoid function\.
Evidence is filtered using a configurable fixed relevance thresholdτ\\tau, retaining passages withsi≥τs\_\{i\}\\geq\\tau\. Candidate limits, if any, are applied separately within each patient, without a population\-relative cutoff or shared retention cap\. Consequently, changing the candidate population does not change the evidence retained for an existing patient, provided the query, source data, models, and retrieval settings remain unchanged\. Retained passages are grouped by patient and passed to an LLM for final criterion adjudication\.
### 3\.4Mid\-Execution Steering
Corrections are applied as localized transformations of the currentTaskSpec\. Given stateTtT\_\{t\}and correctionctc\_\{t\}, an LLM produces a semantic deltaΔt\\Delta\_\{t\}describing the requested additions, removals, or modifications\. Only newly introduced or modified requirements are compiled through the same typed parsing and grounding mechanisms used for the initial request\. Unchanged requirements are not regenerated\. The compiled delta is then deterministically merged into the existing specification:
\(Tt,ct\)→interpretΔt→compilechangedcomponentsΔ^t→mergewithTtTt\+1\.\(T\_\{t\},c\_\{t\}\)\\xrightarrow\{\\mathrm\{interpret\}\}\\Delta\_\{t\}\\xrightarrow\{\\mathrm\{compile\\ changed\\ components\}\}\\widehat\{\\Delta\}\_\{t\}\\xrightarrow\{\\mathrm\{merge\\ with\}\\ T\_\{t\}\}T\_\{t\+1\}\.
Unmodified requirements retain their structured representations and stable identifiers\. Thus, correction is incremental at the specification level before dependency\-aware reuse is considered at the execution level\. Corrections are processed in semantic FIFO order: a subsequent correction is interpreted only after the preceding update has materialized its newTaskSpec\. This prevents corrections from being applied against stale state\.
Long\-running deterministic operations expose safe interruption boundaries and preserve completed work, allowing compatible computation to resume after a correction\.
### 3\.5Sequential and Parallel Steering
The system supports two scheduling policies over the same ordered state transitions\. Insequential mode, a correction waits for the active semantic action before interpretation and application\.
Inparallel mode, the first queued correction may be interpreted concurrently with an active LLM action or supported human interaction\. The resulting update is not immediately committed: it waits for the active action to complete and is then applied to the appropriate materialized state\. Subsequent corrections remain queued, preserving semantic ordering\.
Parallel steering therefore overlaps correction\-interpretation latency without parallelizing the execution DAG or changing the committed sequence ofTaskSpecstates\.
### 3\.6Dependency\-Aware Invalidation and Reuse
Each execution node is assigned a semantic fingerprint derived from its operation, dependencies, and execution configuration\. After a correction, the updated DAG is reconciled with the previous graph\. A completed nodevvis reusable when its stable identity and semantic fingerprint are unchanged, its required artifacts remain available, and all of its parent computations remain reusable\. Conceptually,
reuse\(v\)=same\(v\)∧available\(v\)∧⋀p∈parents\(v\)reuse\(p\),\\operatorname\{reuse\}\(v\)=\\operatorname\{same\}\(v\)\\land\\operatorname\{available\}\(v\)\\land\\bigwedge\_\{p\\in\\operatorname\{parents\}\(v\)\}\\operatorname\{reuse\}\(p\),
wheresame\(v\)\\operatorname\{same\}\(v\)denotes preservation of the node’s semantic identity and fingerprint\. Consequently, a semantic change invalidates only computations whose own semantics or upstream dependencies have changed rather than all computation occurring after the revision point\.
Note processing additionally uses stage\-specific reuse\. Corpus\-level chunks, indexes, and embeddings persist independently of individual note requirements\. Patient\-level adjudication is keyed by the canonical note requirement and retrieval configuration\. If an unchanged note criterion is applied to a smaller candidate population, existing decisions for surviving patients are reused; if the population expands, only new patients are processed\. Changes to the note semantics or retrieval policy invalidate the corresponding requirement\-specific results\.
This combination of graph\-level reconciliation and patient\-level note reuse allows steering to recompute only state affected by a semantic change\.
## 4Experiments
### 4\.1Experimental Setup
#### Benchmark construction\.
We construct 100 cohort\-curation scenarios using the training set of CohortX Task 1\([Alzahrani et al\., 2026](https://arxiv.org/html/2610.36100#bib.bib18)\)as source material\. Each scenario is derived from a distinct study and contains an initial clinician\-style cohort request followed by zero or more corrections\. Studies and criteria were selected heuristically to provide variation in clinical content, task complexity, and opportunities for meaningful cohort revision\. Scenarios were manually curated with assistance from Claude Code and annotated using the sameTaskSpecschema consumed by our execution framework, which represents cohort requirements as typed predicates together with their Boolean composition and optional temporal relations\. Each scenario provides a gold TaskSpec for the initial request and for each subsequent correction\. The benchmark contains 126 correction turns, including 26 multi\-correction scenarios and eight intentionally ambiguous corrections requiring clarification\. Corrections span additions, modifications, removals, replacements, and intentionally ambiguous requests requiring clarification\. All scenarios were manually reviewed and approved against their source eligibility criteria, with schema and transition consistency additionally validated automatically\.
#### Evaluation design\.
We divide evaluation into two stages\. Stage 1 evaluates semantic interpretation and steering against the goldTaskSpecs, while Stage 2 evaluates downstream cohort execution and correction\-aware reuse from frozen structured specifications\. Stage 1 systems use Qwen3\-8B with identical inference settings:bitsandbytes4\-bit NF4 quantization with double quantization,bfloat16computation, temperature 0, a maximum generation length of 1,536 tokens, and reasoning disabled\. The evaluation runs on an NVIDIA L4 GPU usingtransformers4\.57\.6 andbitsandbytes0\.50\.2\.
### 4\.2Stage 1: Semantic Steering
We compare our steerable agent against a naive restart baseline modeled after the full\-generation paradigm used in existing natural language cohort\-query systems\([Park et al\., 2024](https://arxiv.org/html/2610.36100#bib.bib12)\)\. For the initial request, both systems construct a completeTaskSpec\. Upon receiving a correction, the steerable agent interprets the requested semantic change and reconciles it with the existingTaskSpec, whereas the naive baseline restarts semantic processing and regenerates the complete specification from the updated request history\. We disable full\-regeneration fallback for the steerable agent so that its performance reflects localized steering rather than hidden restarts\. Both systems receive identical requests and use the same model and inference settings\.
We evaluate corrections under both post\-completion and mid\-run conditions\. Post\-completion corrections are submitted after the current specification has been produced\. For mid\-run steering, the benchmark harness injects the correction during predicate compilation while execution is still active\. Across the benchmark, 111 correction turns are evaluated mid\-run and 15 after completion\. For multi\-correction scenarios, corrections are processed in order so that each resultingTaskSpecbecomes the state against which the next correction is applied\.
Semantic accuracy is evaluated against the goldTaskSpecafter each turn\. We report micro\-averaged requirement precision, recall, and F1, together with Boolean logic accuracy, conditional temporal relation accuracy, structural validity, and clarification accuracy for intentionally ambiguous corrections\. Predicted and gold requirements are aligned one\-to\-one within each requirement type to maximize shared structured facts, with lexical similarity used only to break ties\. Micro\-F1 pools exact matches of kind, polarity, required status, and individual payload fields after text normalization \(Unicode, case, punctuation, and whitespace\), with no synonym expansion for simplicity or numerical tolerance and with comparison operators preserved exactly\. Relation accuracy is evaluated only when the predicates required to express the gold relation are present and alignable, preventing an upstream requirement error from being counted again as a relation error\. Efficiency is measured using wall\-clock latency, number of LLM calls, and prompt, completion, and total token counts\.
### 4\.3Stage 2: Backend Execution
Stage 2 evaluates whether the structured representations produced by the semantic layer are executable by the downstream cohort\-curation framework\. To isolate backend behavior from Stage 1 parsing errors, we use manually frozen validTaskSpecs rather than model\-generated specifications\. Ten proof\-of\-concept scenarios cover condition, patient, procedure, laboratory, medication, admission, Boolean, and temporal operations and are executed through concept resolution and database evaluation over MIMIC\. Concept disambiguation is automated by selecting the highest\-ranked candidate when confirmation is required\.
Three scenarios additionally receive pre\-specified structured corrections, yielding 13 evaluated cohort states in total\. These corrections respectively add a new condition, modify a laboratory threshold, and modify a temporal constraint, allowing us to examine distinct reconciliation behaviors\. Corrections are applied as frozenTaskDeltas to the existing execution state rather than restarting execution\. We record whether each state successfully materializes a cohort and inspect the resulting execution graph to determine whether prior computations are correctly reused or invalidated\. We use this stage to evaluate backend executability and correction\-aware graph reconciliation rather than clinical correctness of the resulting cohorts\.
## 5Results
### 5\.1Semantic Accuracy
Localized steering largely preserves requirement\-level semantic accuracy relative to full regeneration\. Across jointly scoreable correction states with goldTaskSpecs, the steerable agent achieves 77\.0% requirement micro\-F1, compared with 76\.4% for the naive restart baseline, a difference of\+0\.6\+0\.6percentage points\. The corresponding precision and recall are 73\.4% and 81\.0% for the steerable agent and 73\.0% and 80\.0% for the restart baseline\. The difference remains small across benchmark difficulty: steerable versus restart micro\-F1 is 76\.9% versus 77\.2% on simple scenarios, 80\.0% versus 78\.5% on medium scenarios, and 74\.9% versus 74\.8% on hard scenarios\.
Table 1:Semantic accuracy on correction states\. For each metric,NNdenotes the number of correction states included in the comparison\. Boolean logic and temporal relation accuracy are evaluated only on states scoreable for both systems\.Because a scenario may contain multiple successive corrections, its correction states are not independent observations\. We therefore estimate uncertainty by repeatedly resampling entire scenarios rather than individual correction turns\. In each of 100,000 bootstrap samples, all jointly scoreable correction turns belonging to a selected scenario are retained, and the same sampled scenarios are used for both systems to preserve the paired comparison\. Requirement true positives, false positives, and false negatives are pooled to recompute micro\-F1 and the steerable\-minus\-restart difference\. The resulting bootstrap distribution gives a 95% confidence interval of\[−1\.23,2\.45\]\[\-1\.23,2\.45\]percentage points for the observed\+0\.6\+0\.6percentage\-point difference\. The observed difference favors the steerable agent, although the confidence interval includes zero and therefore does not establish a statistically significant advantage\.
We additionally assess statistical significance using a paired case\-cluster randomization test\. Under the null hypothesis that the two systems are exchangeable, system labels are swapped within entire scenarios, preserving all correction turns from each scenario as a cluster\. For requirement micro\-F1, we use 100,000 randomizations and compute the two\-sidedpp\-value from the proportion of randomized absolute differences at least as large as the observed difference, with the standard\+1\+1correction\. Because the comparison is paired by scenario, thesepp\-values reflect whether one system consistently differs from the other on the same scenarios rather than simply the magnitude of the aggregate percentage\-point difference\. We usep<0\.05p<0\.05as the threshold for statistical significance\. For requirement micro\-F1,p=0\.493p=0\.493\. Thus, the small observed advantage in requirement micro\-F1 is not statistically significant\.
Boolean composition and temporal relations are evaluated on jointly scoreable correction states\. Boolean scoring requires complete predicate alignment and compares logical equivalence, while temporal scoring requires alignment of the referenced predicates and compares relation lists using aligned endpoints, ignoring generated relation identifiers\. Structures affected by missing or corrupted upstream predicates are excluded\. Table[1](https://arxiv.org/html/2610.36100#S5.T1)and the paired statistical comparisons use the same jointly scoreable states for each metric\.
For temporal relations, accuracy is 90\.5% for the steerable agent and 89\.5% for restart across 95 jointly scoreable correction states\. The paired bootstrap gives a 95% confidence interval of\[−5\.49,8\.16\]\[\-5\.49,8\.16\]percentage points, while the paired randomization test givesp=1\.000p=1\.000\. Both results provide insufficient evidence of a statistically significant difference\.
Boolean composition remains more challenging for localized steering\. Logical equivalence accuracy is 85\.7% for the steerable agent and 94\.3% for full regeneration across 35 jointly scoreable states, a−8\.6\-8\.6percentage\-point difference\. The paired bootstrap gives a 95% confidence interval of\[−23\.53,3\.13\]\[\-23\.53,3\.13\]percentage points, while the paired randomization test givesp=0\.500p=0\.500\. Neither rejects the null hypothesis at the 0\.05 level\. Given the small jointly scoreable sample \(35 states across 32 scenarios\), the observed gap should be interpreted cautiously\.
Additionally, on the eight intentionally ambiguous corrections, the steerable agent requested the expected clarification in 1/8 cases, compared with 4/8 for the restart baseline, highlighting clarification handling as an additional limitation of the current localized correction path\. Across all 126 planned correction states, valid\-output coverage is 94\.4% for the steerable agent and 99\.2% for restart\. This denominator includes the two unattempted steerable corrections as failures\.
### 5\.2Steering Efficiency
Localized steering substantially reduces correction latency and the number of model invocations\. For post\-completion corrections, mean wall\-clock latency decreases from 48\.6 s with full regeneration to 17\.1 s with steering, corresponding to a 64\.8% reduction and a2\.84×2\.84\\timesspeedup\. For mid\-run corrections, latency decreases from 69\.7 s to 38\.8 s, a 44\.3% reduction and a1\.80×1\.80\\timesspeedup\. Median latencies show the same pattern, decreasing from 47\.3 s to 17\.0 s post\-completion and from 67\.6 s to 41\.3 s mid\-run\.
Table 2:Correction efficiency under steerable and restart execution\.MetricSteerableRestartMean post\-completion latency \(s\)17\.148\.6Median post\-completion latency \(s\)17\.047\.3Mean mid\-run latency \(s\)38\.869\.7Median mid\-run latency \(s\)41\.367\.6LLM calls per correction1\.903\.07Completion tokens per correction222680Total tokens per correction4,6553,996The steerable agent requires approximately 38\.1% fewer LLM calls per correction and 67\.3% fewer completion tokens\. This reduction does not translate into lower total token usage: the steerable agent uses approximately 16\.5% more total tokens because localized correction requires a larger prompt context\. Thus, the primary efficiency benefit of steering is reduced latency and model invocation rather than reduced total token consumption\. Paired scenario\-level bootstrap intervals place the mean latency reductions at 61\.9–67\.5% after completion and 41\.6–47\.0% during execution \(95% confidence\)\. Together with the semantic results, these findings indicate that localized steering avoids substantial recomputation while achieving slightly higher observed requirement micro\-F1\.
### 5\.3Backend Execution and Reuse
All 13 Stage\-2 cohort states successfully complete backend execution and materialize a patient cohort, demonstrating executability across the tested condition, patient, procedure, laboratory, medication, admission, Boolean, and temporal operations\.
The three correction scenarios further demonstrate selective reconciliation of the execution graph\. When a new COPD condition is added to an existing cirrhosis cohort, the previously computed cirrhosis evaluation is preserved while a new COPD branch is evaluated and downstream aggregation is recomputed\. When the potassium threshold is changed from\>5\.5\>5\.5to\>6\.0\>6\.0, the affected laboratory predicate and its downstream computations are invalidated rather than reused\. Finally, when a temporal constraint between elevated potassium and paracentesis is widened from 7 to 14 days, both underlying predicate evaluations are preserved while the temporal relation and downstream cohort computations are recomputed\.
These cases demonstrate that correction handling operates below the level of full workflow restart: computations unaffected by a semantic change can remain valid, while computations dependent on the changed specification are selectively invalidated\. Because Stage 2 contains only three correction trajectories, these results should be interpreted as a proof of concept for correction\-aware reuse rather than a comprehensive quantitative evaluation of reuse efficiency\. We do not separately ablate execution reuse, since removing reuse directly reduces the system to full recomputation and provides limited additional insight beyond the reuse behavior demonstrated above\.
## 6Discussion and Limitations
Our results suggest that semantic steering can reduce the cost of revising an executing cohort\-curation workflow without requiring every correction to restart from the original request\. Requirement\-level accuracy is similar to full regeneration, while localized steering substantially reduces correction latency and model invocations\. Stage 2 further illustrates the intended execution behavior: revisions can preserve computations whose semantic dependencies remain unchanged while selectively recomputing affected portions of the graph\. However, the lower Boolean\-logic accuracy and poor clarification performance also expose an important limitation of localized revision\. Preserving individual requirements does not guarantee that their global composition remains correct, particularly when a correction changes how existing predicates interact\.
Our evaluation has several limitations\. Stage 1 uses a single 8B language model under 4\-bit quantization\. Quantization may constrain model performance, and stronger or higher\-precision models may improve correction interpretation and potentially narrow the observed accuracy gap between localized steering and full regeneration\. Evaluating this possibility across model families and scales remains future work\. Although the benchmark is grounded in real clinical\-trial eligibility criteria, its correction trajectories are constructed rather than collected prospectively from clinicians\. In addition, Stage 1 excludes clinical\-note retrieval and reasoning\. Because these operations introduce substantially more retrieval and model computation than structured specification processing, we expect selective reuse to provide greater latency benefits when the full heterogeneous workflow is exercised, but this remains to be evaluated empirically\.
Stage 2 is intentionally a proof of concept: its 13 cohort states demonstrate backend executability and representative reuse and invalidation behaviors, but do not constitute a comprehensive evaluation of reuse efficiency or clinical cohort validity\. Future work should therefore evaluate the framework with additional models, larger and more diverse EHR datasets, full note\-processing workloads, and corrections collected through clinician interaction\.
Finally, successful execution should not be interpreted as evidence that a generated cohort is clinically correct\. Errors in requirement interpretation, ambiguity handling, concept resolution, or clinical\-note reasoning can propagate to cohort membership even when the resulting execution graph is structurally valid\. The system is therefore intended to support, rather than replace, expert cohort definition and review\.
## 7Conclusion
We presented a steerable agent for clinical cohort curation that incorporates natural language corrections through localized specification updates and semantic validity\-aware execution\. By maintaining structured revision state and reconciling changes with an explicit execution graph, the framework can preserve valid prior computation rather than restarting the entire workflow after each intervention\. Our evaluation shows that localized steering maintains comparable requirement\-level semantic accuracy while substantially reducing correction latency and model invocations, and our backend experiments demonstrate selective reuse across representative cohort revisions\. These results motivate correction\-aware execution as a practical direction for interactive clinical data agents\.
## References
- Alzahraniet al\.\(2026\)A\. H\. Alzahrani, H\. Turki, M\. A\. Hadj Taieb, A\. Altammami, A\. Nebli, N\. A\. Pasha, M\. Ben Aouicha, and F\. AlmsnedCohortX Task 1: extracting cohort selection criteria from free\-texts\.Note:KaggleExternal Links:[Link](https://www.kaggle.com/competitions/cohort-x-task-1)Cited by:[§4\.1](https://arxiv.org/html/2610.36100#S4.SS1.SSS0.Px1.p1.1)\.
- Chenet al\.\(2026\)W\. Chen, W\. Tong, Y\. Tian, C\. Wang, and T\. ZhangMUSE: an interactive meta\-agent for understanding and steering LLM\-powered data science systems\.External Links:2608\.16181,[Link](https://arxiv.org/abs/2608.16181)Cited by:[§2\.1](https://arxiv.org/html/2610.36100#S2.SS1.p2.1)\.
- Fanget al\.\(2022\)Y\. Fang, B\. Idnay, Y\. Sun, H\. Liu, Z\. Chen, K\. Marder, H\. Xu, R\. Schnall, and C\. WengCombining human and machine intelligence for clinical trial eligibility querying\.Journal of the American Medical Informatics Association29\(7\),pp\. 1161–1171\.External Links:[Document](https://dx.doi.org/10.1093/jamia/ocac051)Cited by:[§2\.3](https://arxiv.org/html/2610.36100#S2.SS3.p1.1)\.
- Huqet al\.\(2025\)F\. Huq, Z\. Z\. Wang, F\. F\. Xu, T\. Ou, S\. Zhou, J\. P\. Bigham, and G\. NeubigCowPilot: a framework for autonomous and human\-agent collaborative web navigation\.InProceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies \(System Demonstrations\),Albuquerque, New Mexico,pp\. 163–172\.External Links:[Document](https://dx.doi.org/10.18653/v1/2025.naacl-demo.17),[Link](https://aclanthology.org/2025.naacl-demo.17/)Cited by:[§2\.1](https://arxiv.org/html/2610.36100#S2.SS1.p1.1)\.
- Jinet al\.\(2024\)Q\. Jin, Z\. Wang, C\. S\. Floudas, F\. Chen, C\. Gong, D\. Bracken\-Clarke, E\. Xue, Y\. Yang, J\. Sun, and Z\. LuMatching patients to clinical trials with large language models\.Nature Communications15\(1\),pp\. 9074\.External Links:[Document](https://dx.doi.org/10.1038/s41467-024-53081-z)Cited by:[§2\.3](https://arxiv.org/html/2610.36100#S2.SS3.p1.1)\.
- Johnsonet al\.\(2023\)A\. E\. W\. Johnson, L\. Bulgarelli, L\. Shen, A\. Gayles, A\. Shammout, S\. Horng, T\. J\. Pollard, S\. Hao, B\. Moody, B\. Gow, L\. H\. Lehman, L\. A\. Celi, and R\. G\. MarkMIMIC\-IV, a freely accessible electronic health record dataset\.Scientific Data10,pp\. 1\.External Links:[Document](https://dx.doi.org/10.1038/s41597-022-01899-x)Cited by:[§3\.1](https://arxiv.org/html/2610.36100#S3.SS1.p1.1)\.
- Liuet al\.\(2026\)Y\. Liu, Y\. Han, L\. Liu, X\. Jiang, Y\. Li, J\. Huang, and Q\. SuEC2Seq2Sql: patient\-trial matching with LLM agents\.PLOS ONE21\(2\),pp\. e0341827\.External Links:[Document](https://dx.doi.org/10.1371/journal.pone.0341827)Cited by:[§2\.3](https://arxiv.org/html/2610.36100#S2.SS3.p1.1)\.
- Manivannan \(2026\)S\. ManivannanBoardroomAI: dependency\-aware human\-steerable multi\-agent deliberation through evolving decision graphs\.External Links:2608\.13046,[Link](https://arxiv.org/abs/2608.13046)Cited by:[§2\.1](https://arxiv.org/html/2610.36100#S2.SS1.p2.1),[§2\.2](https://arxiv.org/html/2610.36100#S2.SS2.p1.1)\.
- Owenset al\.\(2026\)D\. Owens, J\. Cao, M\. Gupta, D\. Nguyen, E\. D\. Peterson, and A\. M\. NavarTargeted use of large language models for EHR\-based computable phenotyping\.Journal of the American Medical Informatics Association33\(6\),pp\. 1167–1178\.External Links:[Document](https://dx.doi.org/10.1093/jamia/ocag051)Cited by:[§2\.3](https://arxiv.org/html/2610.36100#S2.SS3.p2.1)\.
- Panet al\.\(2026\)B\. Pan, L\. Pan, Y\. Zhou, Q\. Jiang, Z\. Wen, M\. Zhu, and W\. ChenInterDeepResearch: enabling human\-agent collaborative information seeking through interactive deep research\.External Links:2603\.12608,[Link](https://arxiv.org/abs/2603.12608)Cited by:[§2\.1](https://arxiv.org/html/2610.36100#S2.SS1.p1.1)\.
- Parket al\.\(2024\)J\. Park, Y\. Fang, C\. Ta, G\. Zhang, B\. Idnay, F\. Chen, D\. Feng, R\. Shyu, E\. R\. Gordon, M\. Spotnitz, and C\. WengCriteria2Query 3\.0: leveraging generative large language models for clinical trial eligibility query generation\.Journal of Biomedical Informatics154,pp\. 104649\.External Links:[Document](https://dx.doi.org/10.1016/j.jbi.2024.104649)Cited by:[§1](https://arxiv.org/html/2610.36100#S1.p1.1),[§2\.3](https://arxiv.org/html/2610.36100#S2.SS3.p1.1),[§4\.2](https://arxiv.org/html/2610.36100#S4.SS2.p1.1)\.
- Rosen and Rosen \(2026\)J\. Rosen and S\. RosenFrom agent loops to deterministic graphs: execution lineage for reproducible AI\-native work\.External Links:2605\.06365,[Link](https://arxiv.org/abs/2605.06365)Cited by:[§2\.2](https://arxiv.org/html/2610.36100#S2.SS2.p1.1)\.
- Shiet al\.\(2024\)W\. Shi, R\. Xu, Y\. Zhuang, Y\. Yu, J\. Zhang, H\. Wu, Y\. Zhu, J\. C\. Ho, C\. Yang, and M\. D\. WangEHRAgent: code empowers large language models for few\-shot complex tabular reasoning on electronic health records\.InProceedings of the 2024 Conference on Empirical Methods in Natural Language Processing,Miami, Florida, USA,pp\. 22315–22339\.External Links:[Document](https://dx.doi.org/10.18653/v1/2024.emnlp-main.1245),[Link](https://aclanthology.org/2024.emnlp-main.1245/)Cited by:[§1](https://arxiv.org/html/2610.36100#S1.p1.1),[§2\.3](https://arxiv.org/html/2610.36100#S2.SS3.p2.1)\.
- Songet al\.\(2025\)S\. Song, A\. Subramanyam, Z\. Zhang, A\. Venkat, and R\. L\. GrossmanGDC Cohort Copilot: an AI copilot for curating cohorts from the genomic data commons\.Bioinformatics Advances5\(1\),pp\. vbaf295\.External Links:[Document](https://dx.doi.org/10.1093/bioadv/vbaf295)Cited by:[§2\.3](https://arxiv.org/html/2610.36100#S2.SS3.p1.1)\.
- Venkatesanet al\.\(2026\)M\. Venkatesan, S\. Wen, J\. Guo, J\. P\. Ono, L\. Ren, and D\. LiuPlover: steering GUI agents through plan\-centric interaction\.External Links:2607\.15193,[Link](https://arxiv.org/abs/2607.15193)Cited by:[§2\.1](https://arxiv.org/html/2610.36100#S2.SS1.p1.1)\.
- Yuet al\.\(2026\)S\. Yu, D\. Chong, A\. Nandi, D\. Soylu, J\. Sun, C\. D\. Manning, and W\. ShiShepherd: enabling programmable meta\-agents via reversible agentic execution traces\.External Links:2605\.10913,[Link](https://arxiv.org/abs/2605.10913)Cited by:[§2\.2](https://arxiv.org/html/2610.36100#S2.SS2.p1.1)\.
- Yuanet al\.\(2019\)C\. Yuan, P\. B\. Ryan, C\. Ta, Y\. Guo, Z\. Li, J\. Hardin, R\. Makadia, P\. Jin, N\. Shang, T\. Kang, and C\. WengCriteria2Query: a natural language interface to clinical databases for cohort definition\.Journal of the American Medical Informatics Association26\(4\),pp\. 294–305\.External Links:[Document](https://dx.doi.org/10.1093/jamia/ocy178)Cited by:[§1](https://arxiv.org/html/2610.36100#S1.p1.1),[§2\.3](https://arxiv.org/html/2610.36100#S2.SS3.p1.1)\.
- Zhaiet al\.\(2026\)Z\. Zhai, M\. Li, and X\. WangRevisable by design: a theory of streaming LLM agent execution\.External Links:2604\.23283,[Link](https://arxiv.org/abs/2604.23283)Cited by:[§2\.1](https://arxiv.org/html/2610.36100#S2.SS1.p2.1),[§2\.2](https://arxiv.org/html/2610.36100#S2.SS2.p1.1)\.
- Zhaoet al\.\(2026\)C\. Zhao, S\. Zhang, W\. Gu, Y\. Sun, D\. Pei, C\. Bansal, S\. Rajmohan, and M\. MaAgentTether: graph\-guided diagnosis and runtime intervention for reliable LLM agent operation\.External Links:2607\.06273,[Link](https://arxiv.org/abs/2607.06273)Cited by:[§2\.2](https://arxiv.org/html/2610.36100#S2.SS2.p1.1)\.
## Appendix ACode Availability
## Appendix BExample of Mid\-Run Cohort Revision
We provide an end\-to\-end example illustrating how a natural language correction changes the cohort specification and how unaffected computation is preserved during revision\.
### B\.1Initial Request and Task Specification
The initial request is:
> “Find patients with type 2 diabetes or hypertension\.”
The request is represented by the followingTaskSpec\. Stable predicate and group references make the logical structure explicit: predicatesp1andp2are combined by the disjunctiong1\.
```
{
"predicates": [
{
"ref": "p1",
"kind": "condition",
"payload": {
"term": "type 2 diabetes",
"count_min": 0
},
"polarity": "include"
},
{
"ref": "p2",
"kind": "condition",
"payload": {
"term": "hypertension",
"count_min": 0
},
"polarity": "include"
}
],
"logic": {
"ref": "g1",
"operator": "OR",
"children": [
"p1",
"p2"
]
},
"relations": []
}
```
Figure[2](https://arxiv.org/html/2610.36100#A2.F2)shows the corresponding execution after clinical concept resolution\. The two condition branches are evaluated independently and combined according to the Boolean structure of the specification\.

Figure 2:Execution of the initial cohort request\. The resolved type 2 diabetes and hypertension branches are combined by theoroperator to form the initial cohort\.
### B\.2Localized Correction
The user subsequently provides the correction:
> “Patients must be under 40 years old\.”
Rather than regenerating the complete specification, the correction interpreter identifies a localized semantic change\. For this correction, it produces the following action:
```
{
"actions": [
{
"action": "ADD",
"local_ref": "new_1",
"requirement_text":
"patients must be under 40 years old",
"excluded": false,
"anchor": "ROOT",
"operator": "AND",
"relation_memberships": []
}
],
"requires_clarification": false,
"clarification_question": null,
"clarification_rationale": null
}
```
The action introduces a new requirement at the root of the existing logical structure\. The requirement is compiled into predicatep3and attached using conjunction, while the existing disjunctiong1is retained\.
### B\.3Revised Task Specification
After deterministic reconciliation, the resultingTaskSpecis:
```
{
"predicates": [
{
"ref": "p1",
"kind": "condition",
"payload": {
"term": "type 2 diabetes",
"count_min": 0
},
"polarity": "include"
},
{
"ref": "p2",
"kind": "condition",
"payload": {
"term": "hypertension",
"count_min": 0
},
"polarity": "include"
},
{
"ref": "p3",
"kind": "patient",
"payload": {
"attribute": "age",
"operator": "<",
"value": 40
},
"polarity": "include"
}
],
"logic": {
"ref": "g2",
"operator": "AND",
"children": [
{
"ref": "g1",
"operator": "OR",
"children": [
"p1",
"p2"
]
},
"p3"
]
},
"relations": []
}
```
The revised logical expression is therefore
\(p1∨p2\)∧p3\.\(p\_\{1\}\\lor p\_\{2\}\)\\land p\_\{3\}\.The original predicates and their disjunction remain structurally unchanged, while the newly introduced age predicate requires new execution work\.
Figure[3](https://arxiv.org/html/2610.36100#A2.F3)shows the corrected execution graph and node\-level inspection of reused and newly executed work\.
Figure 3:Execution after adding the constraintage<40\\mathrm\{age\}<40\. The corrected graph preserves the original disjunction and combines it with the age predicate throughand\. Node inspection shows \(a\) reuse of the unchanged hypertension result and \(b\) execution of the age predicate as new work\.Similar Articles
Correlation-Guided Flow Matching with Annealed Masking for Spatial Transcriptomics Generation
The paper proposes CorrFlow, a correlation-guided flow matching framework for predicting spatial transcriptomics from histology images, explicitly modeling gene-gene dependencies to improve biological coherence in generated profiles.
FlowBender: Feedback-Aware Training for Self-Correcting Conditional Flows
FlowBender is a closed-loop framework that improves constraint satisfaction in diffusion and flow models by training networks to correct alignment errors using inference-time feedback, outperforming traditional supervised and guidance-based approaches.
@HuggingPapers: Stable-GFlowNet: Toward Diverse and Robust LLM Red-Teaming via Contrastive Trajectory Balance Naver AI eliminates unsta…
Naver AI introduces Stable-GFlowNet, a method to improve LLM red-teaming by eliminating unstable partition function estimation in Generative Flow Networks through contrastive trajectory balance.
Constraint-Aware Flow Matching: Decision Aligned End-to-End Training for Constrained Sampling
Proposes Constraint-Aware Flow Matching, a novel end-to-end framework that aligns the model's learning dynamics with constrained sampling procedure, mitigating distributional shift from projection corrections for high-quality constrained generation.
Beyond Steering Vector: Flow-based Activation Steering for Inference-Time Intervention
This paper introduces FLAS, a flow-based activation steering method that learns a concept-conditioned velocity field to steer language model activations at inference time. On the AxBench benchmark, FLAS is the first learned method to consistently outperform in-context prompting on held-out concepts without per-concept tuning.