Table of Contents
Fetching ...

Non-Convex Portfolio Optimization via Energy-Based Models: A Comparative Analysis Using the Thermodynamic HypergRaphical Model Library (THRML) for Index Tracking

Javier Mancilla, Theodoros D. Bouloumis, Frederic Goguikian

TL;DR

This paper tackles index tracking under cardinality constraints by reframing the problem as probabilistic inference over an Ising Hamiltonian and solving it with THRML’s GPU-accelerated block Gibbs sampling. The method encodes asset quality as external biases and diversification as antiferromagnetic couplings, with a dynamic coupling that adapts to market volatility via the VIX. Empirical results on a 100-stock S&P 500 universe (2023–2025) show a tracking error of 4.31% and a total return of 128.63% (vs 79.61% for the index), with Diebold-Mariano tests indicating strong statistical significance ($p<0.0001$). These findings suggest energy-based models can robustly balance tracking performance and diversification, offering a scalable, probabilistic alternative to deterministic convex or heuristic portfolio optimizers and providing groundwork for real-time exploration on future probabilistic hardware.

Abstract

Portfolio optimization under cardinality constraints transforms the classical Markowitz mean-variance problem from a convex quadratic problem into an NP-hard combinatorial optimization problem. This paper introduces a novel approach using THRML (Thermodynamic HypergRaphical Model Library), a JAX-based library for building and sampling probabilistic graphical models that reformulates index tracking as probabilistic inference on an Ising Hamiltonian. Unlike traditional methods that seek a single optimal solution, THRML samples from the Boltzmann distribution of high-quality portfolios using GPU-accelerated block Gibbs sampling, providing natural regularization against overfitting. We implement three key innovations: (1) dynamic coupling strength that scales inversely with market volatility (VIX), adapting diversification pressure to market regimes; (2) rebalanced bias weights prioritizing tracking quality over momentum for index replication; and (3) sector-aware post-processing ensuring institutional-grade diversification. Backtesting on a 100-stock S and P 500 universe from 2023 to 2025 demonstrates that THRML achieves 4.31 percent annualized tracking error versus 5.66 to 6.30 percent for baselines, while simultaneously generating 128.63 percent total return against the index total return of 79.61 percent. The Diebold-Mariano test confirms statistical significance with p less than 0.0001 across all comparisons. These results position energy-based models as a promising paradigm for portfolio construction, bridging statistical mechanics and quantitative finance.

Non-Convex Portfolio Optimization via Energy-Based Models: A Comparative Analysis Using the Thermodynamic HypergRaphical Model Library (THRML) for Index Tracking

TL;DR

This paper tackles index tracking under cardinality constraints by reframing the problem as probabilistic inference over an Ising Hamiltonian and solving it with THRML’s GPU-accelerated block Gibbs sampling. The method encodes asset quality as external biases and diversification as antiferromagnetic couplings, with a dynamic coupling that adapts to market volatility via the VIX. Empirical results on a 100-stock S&P 500 universe (2023–2025) show a tracking error of 4.31% and a total return of 128.63% (vs 79.61% for the index), with Diebold-Mariano tests indicating strong statistical significance (). These findings suggest energy-based models can robustly balance tracking performance and diversification, offering a scalable, probabilistic alternative to deterministic convex or heuristic portfolio optimizers and providing groundwork for real-time exploration on future probabilistic hardware.

Abstract

Portfolio optimization under cardinality constraints transforms the classical Markowitz mean-variance problem from a convex quadratic problem into an NP-hard combinatorial optimization problem. This paper introduces a novel approach using THRML (Thermodynamic HypergRaphical Model Library), a JAX-based library for building and sampling probabilistic graphical models that reformulates index tracking as probabilistic inference on an Ising Hamiltonian. Unlike traditional methods that seek a single optimal solution, THRML samples from the Boltzmann distribution of high-quality portfolios using GPU-accelerated block Gibbs sampling, providing natural regularization against overfitting. We implement three key innovations: (1) dynamic coupling strength that scales inversely with market volatility (VIX), adapting diversification pressure to market regimes; (2) rebalanced bias weights prioritizing tracking quality over momentum for index replication; and (3) sector-aware post-processing ensuring institutional-grade diversification. Backtesting on a 100-stock S and P 500 universe from 2023 to 2025 demonstrates that THRML achieves 4.31 percent annualized tracking error versus 5.66 to 6.30 percent for baselines, while simultaneously generating 128.63 percent total return against the index total return of 79.61 percent. The Diebold-Mariano test confirms statistical significance with p less than 0.0001 across all comparisons. These results position energy-based models as a promising paradigm for portfolio construction, bridging statistical mechanics and quantitative finance.
Paper Structure (48 sections, 16 equations, 5 figures, 6 tables, 1 algorithm)

This paper contains 48 sections, 16 equations, 5 figures, 6 tables, 1 algorithm.

Figures (5)

  • Figure 1: Dynamic coupling strength as a function of VIX level. The coupling decreases during high-volatility regimes (VIX $>$ 30), reducing forced diversification when correlations approach unity. The red dot indicates the training period average VIX (18.5), corresponding to coupling strength 0.52.
  • Figure 2: Cumulative returns comparison (2023--2025). THRML (green dashed) closely tracks while outperforming the S&P 500 index (black solid), achieving 128.63% total return versus the index's 79.61%. Greedy (red dotted) and MIP (blue dash-dot) exhibit larger deviations.
  • Figure 3: Cumulative tracking difference versus index. THRML (green) maintains consistent positive alpha throughout the period. Shaded regions indicate cumulative over/under-performance.
  • Figure 4: Sector distribution by method. THRML achieves balanced allocation across 8 sectors (7-7-7-5 distribution in Technology, Healthcare, Financials, Consumer), while Greedy concentrates in Financials (13) and Technology (11).
  • Figure 5: Performance metrics comparison. THRML (green) dominates across Tracking Error (lower is better), Correlation (higher is better), Sharpe Ratio, and Information Ratio.