WorksComputer Science
Factor Dimensionality and the Bias-Variance Tradeoff in Diffusion Portfolio Models
Abstract
In this paper, we implement and evaluate a conditional diffusion model for asset return prediction and portfolio construction on large-scale equity data. Our method models the full distribution of future returns conditioned on firm characteristics (i.e.\ factors), using the resulting conditional moments to construct portfolios. We observe a clear bias–variance tradeoff: models conditioned on too few factors underfit and produce overly diversified portfolios, while models conditioned on too many factors overfit, resulting in unstable and highly concentrated allocations with poor out-of-sample performance. Through an ablation over factor dimensionality, we reveal an intermediate number of factors that achieves the best generalization and outperforms baseline portfolio strategies.
Introduction
Predicting asset returns is a fundamental problem in quantitative finance. Linear factor models (Fama & French, 1993; 2015) provide a tractable framework for modeling asset returns but struggle to capture nonlinear and higher-order market dynamics. Chen et al. (2026) introduces generative approaches that learn full conditional return distributions rather than point forecasts. In this paper, we evaluate the conditional diffusion framework of Gao et al. (2025), which generates returns conditioned on observable firm characteristics (i.e. factors). We show that factor dimensionality induces a clear bias–variance tradeoff in diffusion-based return modeling: too few factors lead to underfitting and an excessively diverse portfolio, while too many produce high-variance models with overly concentrated allocations. Empirical ablations reveal an optimal dimensionality that outperforms baseline strategies. We use data from Wharton Research Data Services (WRDS) based on the procedure specified by Jensen et al. (2023). We defer dataset details and related work to the appendix (Appendix § 4.§ 1, Appendix § 4.§ 2).
Diffusion-Based Conditional Return Modeling
We follow Gao et al. (2025) which formulates asset return prediction as learning a conditional return distribution given observable firm characteristics. denotes a vector of returns for assets observed in time periods and let denote the corresponding set of asset-level characteristics (i.e. factors) observed at time . Returns are assumed to satisfy , where is an unknown, potentially nonlinear function and captures unpredictable shocks independent of information known at . The objective is to learn the full conditional distribution , rather than only conditional means.
To estimate this distribution, we adopt a conditioning denoising diffusion probabilistic model (Ho et al., 2020). The forward diffusion process gradually corrupts observed returns by adding Gaussian noise over a fixed number of steps, transforming the data into an isotropic Gaussian distribution. A neural network is then trained to reverse this process by predicting the noise added at each diffusion step, conditional on characteristics . The reverse diffusion process is implemented using a diffusion transformer architecture. Following Gao et al. (2025) in modifying Peebles & Xie (2023), each asset is represented as a token and cross-sectional dependence among assets is captured through self-attention layers. Conditioning on firm characteristics is performed locally at the token level via adaptive normalization layers. This approach allows the denoising dynamics of each asset to depend on its own characteristics while still modeling joint return behavior across assets. After training, the model generates Monte Carlo samples from the conditional distribution for each period, which are used to estimate the conditional mean and covariance of returns that serve as inputs to the portfolio construction procedure (i.e. mean–variance optimization).
Results
Each month , we estimate the conditional mean vector and the covariance matrix of the next-month returns. We then compute long-only portfolio weights solving a constrained mean-variance optimization problem subject to and with as the expected return vector, as the return covariance matrix, as the risk-aversion parameter, and are portfolio weights (Markowitz, 1952). We follow Gao et al. (2025) in comparing the diffusion factor portfolio with three simpler baseline portfolios (Appendix § 4.§ 3).
For small , the portfolio weights are relatively dispersed across assets, reflecting a low-capacity model that produces broadly diversified allocations (Figure 1). As increases, the weight distribution becomes more concentrated, with larger positions placed on a smaller set of assets (Figure 1). We observe that the moderately diverse portfolio (b) outperforms EW, Emp, and ShrEmp in terms of cumulative returns, where the low capacity (a) () and the high capacity (c) () fail to do so (Figure 2). See Appendix § 5.§ 1 and Appendix § 5.§ 2 for the full ablation results. Future work should evaluate these results against the framework of Chen et al. [3] (2026) which implicitly learns a low-dimensional factor structure through score decomposition during score estimation, eliminating the need for explicit factor selection (Appendix § 5.§ 3).

Figure 1. Heatmaps for 200 samples show monthly asset weights (top 25 assets by average allocation over the time period) learned under different factor dimensionalities. A low-capacity model (left) distributes weight broadly, reflecting underfitting and high bias. An intermediate model (middle) concentrates allocations on persistent signals, indicating effective factor utilization. A high-capacity model (right) produces sparse, unstable allocations consistent with overfitting and high variance.

Figure 2. Cumulative portfolio return for 200 samples over the test months for four strategies. Bias–variance tradeoff illustrated through model capacity. A low-capacity model (left) underfits the data, exhibiting high bias. An intermediate model (middle) achieves a favorable bias–variance balance and the best generalization (we verify this with a larger sample size in Figure 17). An overly expressive model (right) overfits, showing high variance and reduced out-of-sample stability.
Figure 17. Cumulative returns ()
Appendix
Data
Our analysis uses the Global Factor Data constructed by Jensen, Kelly, Pederson and distributed through Wharton Research Data Services (WRDS). The dataset combines information from CRSP and Compustat to provide a comprehensive panel of firm-level characteristics and return for publicly traded equities. The dataset includes data from January 2010 until February 2025. The data includes more than 400 characteristics constructed following the procedures documented in (Jensen et al., 2023).
To align the WRDS factor data with the diffusion framework, we apply standard cross-sectional preprocessing and construct a fix-shape monthly panel. We restrict the sample to U.S. common stocks and define the prediction target as next-month return by shifting realized returns forward. Returns are winsorized cross-sectionally to mitigate outliers, while firm characteristics are imputed using cross-sectional means, standardized, and clipped within each month. For each month, we retain a fixed number of assets and organize the resulting data into tensors of characteristics and returns with dimensions and , respectively, where denotes the number of months, denotes the number of assets, and the number of firm-level characteristics. We use , , . These tensors serve as inputs to the conditional diffusion model.
Related Work
Diffusion Models: Diffusion models learn complex data distributions by progressively corrupting data with noise and training a neural network to reverse this process. The model learns the score function via score matching, enabling sampling by iteratively denoising from noise back to data {(citep)}(Ho et al., 2020; Song et al., 2021). For time series, prior work uses diffusion either (i) as a conditional scenario generator for forecasting or (ii) as a conditional model for missing-data problems {(citep)}(Rasul et al., 2021; Tashiro et al., 2021). Surveys synthesize highlight evaluation pitfalls in diffusion-based time-series forecasting {(citep)}(Meijer & Chen, 2024; Su et al., 2025).
In finance, diffusion is mainly used as a conditional scenario generator for returns, with several papers emphasizing controllability or finance-specific noise structure. Shen et al. propose a non-autoregressive conditional diffusion model for generating future time-series trajectories conditioned on historical data, which can be applied to financial return forecasting {(citep)}(Shen & Kwok, 2023). Tanaka et al. focus on controllable conditional generation for financial time series, adding explicit controls to steer the sampled trajectories toward desired attributes {(citep)}Tanaka et al. (2025). Kim et al. modify the diffusion forward noising process to reflect financial structure (e.g., heteroskedasticity and multiplicative noise), targeting more realistic synthetic dynamics and improved conditional sampling {(citep)}Kim et al. (2025). Wang et al. study finance-tailored denoisers and Takahashi et al. propose methods aimed at synthetic financial time-series generation with finance-specific modeling choices {(citep)}(Wang & Ventre, 2024; Takahashi & Mizuno, 2024). Beyond return/path generation, Jin et al. apply diffusion in an option-centric setting by forecasting the implied-volatility surface {(citep)}(Jin & Agarwal, 2025).
Factor Models Factor models are a standard framework for portfolio construction, with widely used specifications such Fama & French {(citep)}(1993; 2015); Carhart {(citep)}(1997). Modern portfolio risk systems build on this framework by estimating factor exposures and covariance structures Rosenberg & Marathe {(citep)}(1974) and its practical development for quantitative portfolio construction Grinold & Kahn {(citep)}(2000). A limitation of factor models is estimation error in high dimensions {(citep)}(Ledoit & Wolf, 2004; Fan et al., 2008; 2013). Work in empirical asset pricing shows that large panels of firm characteristics improve return prediction but introduce redundancy and model selection challenges {(citep)}(Gu et al., 2020; Kelly et al., 2019). As the number of proposed factors has expanded, recent studies emphasize systematic testing, dimensionality control, and the risk of overfitting in high-dimensional factor spaces {(citep)}(Feng et al., 2026; Borri et al., 2025).
Portfolio Constructions
In the transaction cost setting, we augment the objective with linear trading costs. Portfolio returns are computed as the inner product of portfolio weights and realized returns, and performance is summarized using mean return, volatility, and annualized Sharpe ratio.
Equal-Weighted (EW) assigns uniform weights and does not estimate return moments.
Empirical (Emp) estimates mean and covariance directly from historical returns using a rolling window.
Shrinkage Empirical (ShrEmp) applies covariances shrinkage to improve stability while retaining the sample covariance mean {(citep)}
(James & Stein, 1992).
We obtain moment estimates the conditional distribution of next-period returns using the conditional diffusion model outlined above. Monte Carlo samples drawn from this distribution are used to estimate the conditional mean and covariance of returns. We use 200 samples in the results diagrams.
Additional Figures
Let denote the number of factors. We perform an ablation for .
Cumulative Returns
The figures in this section illustrate how performance varies as the number of factors increases. When is small, the model is overly constrained and fails to capture sufficient structure in the data. This high-bias regime leads to underfitting: cumulative returns closely track or underperform the baseline. As increases, performance improves and the model begins to capture meaningful relationships. It begins to out-perform the baseline when . However, for very large , performance deteriorates again. The model enters a high-variance regime in which additional factors primarily fit noise rather than signal. This is reflected in reduced out-of-sample performance, with returns again failing to outperform the baseline.
Figure 3. Cumulative returns ()
Figure 4. Cumulative returns ()
Figure 5. Cumulative returns ()
Figure 6. Cumulative returns ()
Figure 7. Cumulative returns ()
Figure 8. Cumulative returns ()
Figure 9. Cumulative returns ()
Figure 10. Cumulative returns ()
Figure 11. Cumulative returns ()
Figure 12. Cumulative returns ()
Figure 13. Cumulative returns ()
Figure 14. Cumulative returns ()
Figure 15. Cumulative returns ()
Figure 16. Cumulative returns ()
We verify the performance of , raising the number of samples to 1000, again observing that it outperforms the baseline.
Portfolio Weights
In this section, we show how increasing the number of factors progressively changes the structure of the learned portfolios. For small , the weights are broadly distributed across many assets, indicating a diffuse allocation consistent with an under-parameterized model. As grows, the portfolio weights become increasingly concentrated, with larger magnitudes assigned to a smaller subset of assets. This concentration suggests that higher-capacity models identify more specific signals but also become more sensitive to noise, leading to over-specialized allocations and reduced out-of-sample performance.
Figure 18. Weights heatmap ()
Figure 19. Weights heatmap ()
Figure 20. Weights heatmap ()
Figure 21. Weights heatmap ()
Figure 22. Weights heatmap ()
Figure 23. Weights heatmap ()
Figure 24. Weights heatmap ()
Figure 25. Weights heatmap ()
Figure 26. Weights heatmap ()
Figure 27. Weights heatmap ()
Figure 28. Weights heatmap ()
Figure 29. Weights heatmap ()
Figure 30. Weights heatmap ()
Implicit Factor Modeling
Figure 31 illustrates the decomposition proposed by Chen et al. [3], where observed trajectories are separated into a low-dimensional linear subspace capturing systematic structure and an orthogonal component representing idiosyncratic variation. The projection onto the linear subspace can be interpreted as the evolution of factors, while the orthogonal space captures residual noise. Rather than explicitly specifying factors, score estimation learns this decomposition implicitly by modeling gradients of the data density along both directions. This perspective motivates implicit factor modeling, where diffusion models recover low-dimensional structure directly through score learning without requiring predefined factor exposures. Future studies should evaluate whether this approach can match the results following the factor dimension ablation in this work.

Figure 31. Image from Chen et al. [3]
References
- [3]Minshuo Chen, Kaixuan Huang, Tuo Zhao, and Mengdi Wang. Score approximation, estimation and distribution recovery of diffusion models on low-dimensional data, 2023. URL https://arxiv.org/abs/2302.07194.



























