- The paper introduces Prior-Fitted Functional Flows (PFFs), a simulation-free generative model that transports Gaussian process priors to dataset-informed posteriors for PK trajectories.
- The paper demonstrates that PFFs outperform traditional NLME and state-of-the-art deep learning methods, achieving lower log-RMSE scores and higher sample fidelity across 18 compounds.
- The paper provides a modular, in-context approach enabling rapid virtual trial generation and individualized drug response prediction under sparse data conditions.
Prior-Fitted Functional Flow: In-Context Generative Models for Pharmacokinetics
Introduction
"Prior-Fitted Functional Flow: In-Context Generative Models for Pharmacokinetics" (2604.17670) introduces Prior-Fitted Functional Flows (PFFs), a generative foundation model for pharmacokinetic (PK) modeling. The work addresses the dual challenge in PK inference: modeling individual-level time-continuous drug concentration trajectories under sparse, irregular sampling, and capturing population-level heterogeneity. The approach circumvents data scarcity and manual parameter fitting by amortizing the inference of PK concentration function distributions via pretraining on a large-scale, physiologically validated synthetic corpus. The core contribution is the conditional, simulation-free transport of reference Gaussian process priors to dataset-informed posteriors in function space, leveraging advances in flow-matching and neural operator architectures.
Methodology
PFF learns the distribution over continuous-time concentration functions as a conditional transport map in function space, parameterized by a neural operator trained with flow matching. The model operates on two conditioning levels:
Study-level conditioning utilizes the entire population context, encoding the cohort's structure, dosing, and sampling irregularity. This context modulates the vector field in the flow via attention-based mechanisms.
Individual-level conditioning allows optional forecasting of a new individual, leveraging partial early observations. Here, PFF forecasts the unobserved trajectory segment by transporting the probability mass only in the unobserved temporal domain while conditioning on the observed prefix.
The model’s triangular map formulation ensures the context variable remains invariant during the generative process (static across the flow field). The reference measure for synthesis is a GP prior, switching to a GP posterior for forecasting. The functional neural operator (context-conditional transformer) induces the velocity field used for ODE-based sampling of functions from the posterior distribution.
The synthetic training corpus is generated via a hierarchical Bayesian simulation framework: compartmental PK models with time-varying stochastic parameters, validated against a literature-mined corpus of real-world PK parameters.
Figure 1: The model conditions on a population study (green) and dosing schedules (yellow), and performs probabilistic forecasting for new patients using partial observations (blue) and generating continuations (black/red).
The PFF framework formalizes the conditional optimal transport (OT) problem by learning a triangular map that transports a reference measure (GP) to the posterior induced by the context:
(TF​(c,⋅))#​ηF​=ν(⋅∣c)
Learning is performed via flow-matching—a simulation-free, regression-based objective using interpolations between matched pairs from the reference and target distributions, optimized by minimizing the difference between the model-parameterized velocity field and the ideal conditional velocity. The context is incorporated in a continuum-attention transformer architecture that supports variable-length, irregularly-spaced time series both for the population context and individual observations.
Figure 2: The context encoder processes time series from study individuals, while the decoder generates future sample continuations for a target, using operator attention and time-aware positional encoding.
Special care is taken to handle irregular time grids via continuum attention mechanisms and an exact past-future decomposition for forecasting. Masking is applied to guarantee that only unobserved future values are transported during the flow trajectory, with the observed prefix remaining invariant.
Empirical Evaluation and Results
The model is benchmarked against classical nonlinear mixed-effects (NLME) frameworks and state-of-the-art deep learning approaches, including AICMET (amortized in-context mixed-effects transformer). Evaluation is conducted on real-world datasets (PK-DB, including several drugs and their metabolites) and comprehensive synthetic benchmarks. Metrics include log-RMSE for forecasting performance, and sample fidelity via MMD and classifier AUC using signature kernels for distributional assessment.
Key findings include:
- PFF achieves the lowest log-RMSE scores across the majority of 18 compounds, outperforming NLME, NODE-PK, and AICMET baselines.
- Generative evaluation demonstrates high sample fidelity and distributional concordance with held-out empirical and synthetic trajectories, as seen in both AUC metrics and MMD.
- Visual Predictive Checks (VPC) and predictive plots indicate robust uncertainty calibration and high-quality forecasting under partial observation regimes.


Figure 3: Predictive trajectories for three compounds demonstrate strong conditional inference for new individuals given sparse initial data.
Figure 4: Visual predictive checks: simulated prediction intervals align closely with observed drug concentration measurements, establishing reliable generative modeling.
Theoretical and Practical Implications
PFF establishes a new paradigm for zero-shot, in-context generative modeling of individual drug response, capable of downstream population synthesis without dataset-specific re-tuning. By decoupling the mechanistic prior (simulator) from the inference engine, and fusing literature-informed prior calibration with simulation-based pretraining, the approach brings amortized, simulation-free Bayesian inference to the PK domain at function-space level—a significant upgrade in expressivity and computational efficiency. PFF's architecture is modular, supports arbitrary time discretizations, and does not rely on compressed latent representations, mitigating underfitting and miscalibrated uncertainty prevalent in previous approaches.
Pragmatically, this enables flexible adaptation to real-world, small-sample PK studies, rapid virtual trial generation, and robust individualized prediction under sparse observation, which are essential for early-stage drug development, dose optimization, and regulatory applications.
Limitations and Future Directions
Notwithstanding its strengths, the reliance on purely synthetic pretraining rooted in literature-mined priors limits model exposure to pathological heterogeneity not well-captured by surrogate data. Incorporating empirically observed clinical trial data into model pretraining or adaptation is a necessary next step. Current validation is restricted to single-dose studies; the extension to multi-dosing regimes and more complex intervention protocols is nontrivial but essential for broader pharmacometric applicability. In extremely data-sparse regimes, all generative models—including PFF—bear the risk of sampling plausible but incorrect trajectories, underscoring the importance of further work in uncertainty quantification and validation.
Figure 5: Comparison of key PK characteristics between simulated data and literature demonstrates realistic coverage and reinforces physiological plausibility.
Conclusion
The introduction of Prior-Fitted Functional Flows provides a principled, performant architecture for generative PK inference, unifying simulation-based priors with flow-matched neural function generators. It achieves state-of-the-art predictive accuracy, sample fidelity, and recalibration in forecasting and population synthesis for pharmacokinetics. Extending this paradigm to richer clinical domains and integrating real-world data stands as a highly promising trajectory for future foundation models in computational pharmacometrics and personalized medicine.