Context-Conditioned Dwell Times for Immune Tolerance

When the immune system decides whether a cell becomes a tolerant peacekeeper or an inflammatory attacker, the decision depends not just on which signals arrive but on how long each state lasts and in what order the signals were received. In lupus, regulatory T cells convert into inflammatory look-alikes only when interferon-alpha arrives after the cell's receptor has been engaged, not before — same concentration, opposite outcome (TIGIT reverses IFN-α-promoted Th1-like Tregs via in-sequence effects dependent on STAT4). Yet the computational tools used to trace immune cell fates from single-cell data, such as CellRank, assume a memoryless world: the probability of a cell's next state depends only on its instantaneous state, never on how long it has been there or what it experienced earlier (CellRank for directed single-cell fate mapping).

Speech recognition solved a mathematically identical problem decades ago. A phoneme's duration is not fixed; it stretches and shrinks depending on neighboring sounds, phrase position, and speaking rate, and recognizers that replaced memoryless state-exit probabilities with explicit, context-conditioned dwell-time distributions cut phoneme errors substantially. This proposal imports that machinery — hidden semi-Markov dwell times with context factors clustered separately from state identity — into single-cell immune trajectory modeling, and tests whether it can predict when and why immune tolerance holds or collapses.

Core Claim

The claim is that immune state dynamics are semi-Markov and context-conditioned, and that modeling them this way yields measurably better fate and timing predictions than the memoryless Markov chains underlying current single-cell tools. Concretely: a cell residing in a regulatory or intermediate state draws a dwell time from a distribution whose shape depends on microenvironmental context — local cytokine levels, receptor engagement history, and the order of past exposures — and its exit probabilities likewise depend on that history. Two results motivate this. First, in speech, replacing the implicit geometric dwell distribution of a standard hidden Markov model with explicit duration distributions conditioned on separately clustered context factors produced a 9.1% relative phoneme error reduction on the ATR Japanese Speech Database, rising to 48% with duration-weight tuning, and let a model with 2 Gaussian mixtures per state beat a standard model with 4 (A Fully Consistent Hidden Semi-Markov Model-Based Speech Recognition System). Second, in immunology, both the in-sequence interferon finding above and the observation that CD8 regulatory T cells in type 1 diabetes look numerically normal at baseline ($P = 0.104$ versus healthy donors) but lose FoxP3 stability as disease duration progresses ($r = -0.363$, $P = 0.023$) show that timing and history, not abundance, carry the pathology (Analysis of frequency changes in CD8+ regulatory T cell subsets in peripheral blood of individuals with type 1 diabetes).

Research Program

We will build a dwell-time layer, which we call TolDwell, that sits on top of existing single-cell state embeddings rather than replacing them. The architecture has three parts, each a direct transfer of a speech technique with a biological counterpart.

The first part is an explicit dwell-time distribution per state. Where CellRank's transition matrix implies a geometric decay of state occupancy, TolDwell draws the time a cell spends in state $s$ from

$$d \sim \mathrm{LogNormal}\big(\mu_s + w_s^\top \phi(c),\; \sigma_s^2\big),$$

where $c$ is a context vector (cytokine concentrations, receptor-engagement duration, encoded exposure order, disease duration) and $\phi$ is a small nonlinear encoding. Log-normal rather than Gaussian dwell times avoid the speech literature's own documented flaw that Gaussian durations assign nonzero probability to negative durations, since true residence times are strictly positive and skewed. The second part is sequence-conditioned exits: after the dwell expires, the next state is drawn from transition probabilities that depend on an order-encoding of the exposure history, so that "TCR activation then interferon" and "interferon then TCR activation" are different conditioning contexts even at identical concentrations — the exact structure the lupus result demands (TIGIT reverses IFN-α-promoted Th1-like Tregs via in-sequence effects dependent on STAT4). The third part is decoupled context clustering: the speech work's most transferable insight is that the context factors governing duration differ systematically from those governing state identity, and forcing them into one clustering degrades both (A Fully Consistent Hidden Semi-Markov Model-Based Speech Recognition System). TolDwell will learn duration-governing context partitions separately from the phenotype clustering that defines states, mirroring how tree-based state tying separates duration context from acoustic context in phoneme duration modeling (Context dependent phoneme duration modeling with tree-based state tying). Inference adapts the generalized expectation-maximization forward-backward procedure from the speech system, run over pseudo-time or, where available, real time from metabolic labeling as in CellRank 2's kernels (CellRank 2: unified fate mapping in multiview single-cell data). A known risk is search cost — explicit duration expansion blew up the speech decoding lattice (A Fully Consistent Hidden Semi-Markov Model-Based Speech Recognition System) — but single-cell macrostate counts are tens, not the thousands of phonetic contexts, so we expect this to be tractable.

Biologically, the model's falsifiable predictions are that regulatory-state dwell times shorten and exit rates toward inflammatory states rise under chronic post-activation interferon exposure; that the T1DM FoxP3 decay is recoverable as a context-driven shrinkage of the regulatory state's dwell distribution with disease duration; and, as a stretch analysis, that germinal center lifetimes — whose governing clock is explicitly unresolved (Germinal Centre Shutdown) — can be fit as a dwell-time distribution whose context dependence discriminates among the proposed shutdown drivers (antigen masking, cytokine shift, metabolic exhaustion).

Baselines

The naive reference point is static frequency gating of regulatory subsets by flow cytometry, the standard clinical assessment. It is the floor to beat because it demonstrably misses pathology: in the T1DM cohort, CD3+CD8+CD25+ frequencies did not differ from healthy donors ($P = 0.104$), and the signal appeared only when phenotype was regressed against disease duration ($r = -0.363$, $P = 0.023$) (Analysis of frequency changes in CD8+ regulatory T cell subsets in peripheral blood of individuals with type 1 diabetes). Any dynamic model should extract signal where gating finds none.

The strongest existing competitor is CellRank 2, whose kernels and estimators define the state of the art in single-cell fate mapping (CellRank 2: unified fate mapping in multiview single-cell data). It reported a Terminal State Identification score of 0.9 on human hematopoiesis and 85% terminal-state purity on intestinal organoids using a metabolic-labeling kernel, versus 67% for classical RNA velocity. We will run TolDwell and CellRank 2 on identical input embeddings, identical datasets, and the same tuning budget, comparing terminal-state identification and purity, plus a new metric CellRank does not report: calibrated state-arrival times. Beating CellRank 2 means matching or exceeding its TSI and purity while also predicting when transitions occur within measurement resolution. PACE, a geometry-aware optimal-transport trajectory method, is the second strong baseline (PACE: Geometry-Aware Bridge Transport for Single-Cell Trajectory Inference); it reduced distributional error by 23.7% across nine held-out experiments, and we will evaluate on held-out time points in the same fashion.

The key ablation is TolDwell with a single context-free dwell distribution per state — same log-normal form, same EM, but $w_s = 0$. This isolates whether the gains come from any explicit dwell modeling or specifically from context conditioning, which is the proposal's central ingredient. A second ablation couples duration and identity clustering into one partition, testing the Zen-style decoupling transfer.

Why not just…?

Why not just use CellRank 2's real-time and metabolic-labeling kernels as they are? This is the most serious alternative, and we treat it as such. Those kernels do ingest real time, and they already lifted organoid purity from 67% to 85%. But they remain memoryless in state occupancy: they estimate transport couplings and per-cell growth rates, never a state's dwell-time distribution or how that distribution shifts with exposure order and context. The lupus in-sequence result is precisely the case this structure cannot represent. The comparison above is designed to settle it honestly: if CellRank 2's real-time kernel matches TolDwell's fate and timing accuracy on the same data, the semi-Markov layer adds nothing and we will report that.

Why not just fit a survival model, like a Cox regression, on state exit times? A Cox model conditioned on context would give interpretable, context-dependent hazards at far lower cost, and we will include it as a cheap additional baseline. It falls short in two ways the immune setting exposes: it handles a single absorbing event per cell, whereas cells pass through sequences of intermediate states (naive, partially activated, regulatory, inflammatory) with measurement noise and hidden true states, which the forward-backward EM procedure handles natively (A Fully Consistent Hidden Semi-Markov Model-Based Speech Recognition System); and time-varying, order-dependent context requires the sequence-conditioned exit machinery that a static hazard cannot express. If the Cox model matches TolDwell on single-transition predictions, that would itself be a useful negative result delimiting where the heavier machinery pays off.

Why not just pool RNA and receptor data in a static multimodal model like TRIM and classify outcomes? TRIM, a conditional variational autoencoder coupling expression and T cell receptor sequences, predicts post-treatment clonal expansion with AUC 0.92 in head and neck cancer and 0.83 in colorectal cancer, while naive KNN and MLP baselines fail at chance (~0.50) (Multimodal framework for the joint analysis of single-cell RNA and T cell receptor sequencing data predicts T cell response to cancer immunotherapy). We do not aim to beat those classification numbers — that is a different question. Static classifiers predict whether an outcome occurs; they cannot predict how long a cell remains in an intermediate state or when tolerance breaks, which is our target. The same argument covers static gating: identical interferon concentrations produce opposite outcomes depending on exposure order (TIGIT reverses IFN-α-promoted Th1-like Tregs via in-sequence effects dependent on STAT4), so any time-free predictor has an irreducible error floor on these questions.

Proposed Experiments and Decisive Checks

The first experiment is a synthetic ground-truth check: generate trajectories from known semi-Markov dynamics with context-dependent dwell times and sequence-dependent exits, then fit CellRank 2, the Cox baseline, and TolDwell. The decisive result is that the memoryless estimator systematically biases fate probabilities and transition times while TolDwell recovers the true dwell distributions — quantifying the cost of the Markov assumption directly.

The second experiment runs on the benchmarks with reported numbers: human hematopoiesis (CellRank 2 reported TSI 0.9) and the intestinal organoid system with metabolic labeling (85% purity; 67% under classical velocity) (CellRank 2: unified fate mapping in multiview single-cell data). We additionally evaluate on velocity-only organoid data, where the bar is 67%, asking whether explicit dwell times recover purity comparable to the 85% that currently requires metabolic labeling. Held-out time-point distributional error, evaluated as in PACE's nine-experiment protocol (23.7% reduction is the number to exceed), forms the trajectory-quality check (PACE: Geometry-Aware Bridge Transport for Single-Cell Trajectory Inference).

The third experiment is biological: reanalysis of the multiple sclerosis blood-to-CSF cohort used by scNAT (scNAT: a deep learning method for integrating paired single-cell RNA and T cell receptor sequencing profiles), where transitioning memory CD8+ T cells were identified but not timed, asking whether TolDwell assigns them a measurable, context-sensitive dwell time; and a model-based reconstruction of the in-sequence interferon experiment, which should reproduce opposite outcome distributions for the two exposure orders from a single fitted model. The T1DM duration-decay cohort provides an external validity check: the fitted regulatory-state dwell shrinkage should be consistent with the reported $r = -0.363$ decline (Analysis of frequency changes in CD8+ regulatory T cell subsets in peripheral blood of individuals with type 1 diabetes). If the context-free ablation matches the full model across these experiments, the specific claim of this proposal fails and the contribution reduces to "semi-Markov helps, context does not" — a result we would report as such. For the germinal-center stretch goal, no reported result found on Lacuna for quantitative in-vivo lifetime tracking, which is exactly why model-based inference from published time-course summaries is the only currently feasible route (Germinal Centre Shutdown).