Abstract
Portfolio optimization remains a challenging task due to the difficulty of reward engineering, the complexity of market interdependencies, and the gap between AI models and traditional financial heuristics. This paper presents a novel framework that integrates Inverse Reinforcement Learning (IRL) with Heterogeneous Graph Attention Networks (HGAT). By leveraging financial heuristics to generate synthetic expert strategies, the model learns a multi-objective reward function that balances returns, diversification, and risk. Experimental results across major global indices demonstrate that the proposed approach significantly outperforms state-of-the-art deep learning and LLM-based baselines.
Introduction
Portfolio optimization—the strategic allocation of assets to maximize returns while minimizing risk—is a fundamental problem in finance. Despite the success of Reinforcement Learning (RL) in various domains, its application to financial markets is hindered by three primary factors. First, manually designing a reward function that adapts to shifting market regimes is notoriously difficult. Second, standard neural architectures often fail to capture the relational structure between assets, such as sector-specific correlations. Finally, many black-box AI models ignore established financial wisdom, such as sector diversification.
To address these challenges, we propose a framework that employs Inverse Reinforcement Learning to "reverse-engineer" the underlying intent of a disciplined expert strategy. By incorporating domain-specific heuristics and graph-based modeling, the system bridges the gap between traditional financial theory and modern machine learning.
Methodology
The proposed system is built upon three innovative pillars designed to enhance decision-making in volatile markets.
1. Heuristic-Guided Expert Generation
To overcome the scarcity of high-quality human trading data, we utilize a greedy algorithm governed by financial heuristics. These rules include sector exposure caps and correlation thresholds. This process generates "synthetic expert" trajectories that serve as a high-quality roadmap for the RL agent, ensuring the model starts with a foundation of sound financial principles.
2. Maximum Entropy IRL with Multi-Objective Rewards
The framework uses Maximum Entropy IRL to derive a reward function from the expert data. Unlike simple profit-seeking functions, this learned reward is a weighted sum of four distinct objectives: return maximization, sector diversification, momentum alignment, and correlation penalization. These weights are dynamically adjusted using Lagrangian duality to adapt to changing market conditions.
3. Heterogeneous Graph Attention Network (HGAT)
To model the market's microstructure, the policy network represents stocks as nodes in a heterogeneous graph. Edges are defined by shared industry sectors or statistical correlations. A hierarchical attention mechanism allows the model to prioritize information from related stocks, leading to more informed and stable allocation decisions.
Experimental Setup
The model was rigorously evaluated using daily OHLCV (Open, High, Low, Close, Volume) data from four major financial indices between January 2018 and December 2024:
- Chinese Markets: CSI 300 and CSI 500.
- US Markets: NASDAQ 100 and S&P 500.
The data was split into training (2018-2022), validation (2023), and testing (2024) periods to ensure robust performance assessment.
Results and Discussion
The framework consistently outperformed a wide array of baselines, including advanced Transformers (PatchTST, iTransformer), RL models (DeepTrader), and time-series LLMs (GPT4TS).
Performance Metrics
In the CSI 300 index, the model achieved an Annualized Return Rate (ARR) of 0.491, a 32% improvement over the best baseline (iTransformer). In the CSI 500, it delivered a remarkable 0.710 ARR. Beyond returns, the model demonstrated superior risk management; on the S&P 500, it achieved the lowest Annualized Volatility (0.117) among all tested methods.
Ablation Study
A key finding from our ablation analysis is the critical role of the Reward Network (RN). Removing the RN resulted in a 38.9% drop in ARR, confirming that learning the "expert intent" through IRL is the most vital component of the framework. Furthermore, the use of "negative" incentives—penalizing correlations with high-momentum assets—proved to be a sophisticated hedging mechanism that stabilized performance during market downturns.
Conclusion
This research demonstrates that combining Inverse Reinforcement Learning with graph-based policy networks and financial heuristics provides a powerful solution for portfolio optimization. While the model shows exceptional promise, future work will focus on refining performance in extremely high-volatility environments and incorporating real-world trading frictions such as transaction costs and liquidity constraints.
Summary updated