STN-TGAT: A Graph Neural Network for Ranking S&P 500 Stocks and Building Portfolios
A new arXiv paper presents STN-TGAT, a model for building investment portfolios. It pairs a temporal Transformer (price dynamics) with a graph attention network (relationships between stocks) and adds a prior graph based on mutual information to suppress noisy correlations. The portfolio is built under realistic constraints: five stocks from the top 50 of the S&P 500, with explicit weight allocation and transaction costs factored in. In tests on real data, the model outperforms benchmarks on both forecast accuracy and returns.
AI-processed from arXiv cs.LG; edited by Hamidun News
In July 2026, researchers published STN-TGAT on arXiv. The neural network ranks stocks in the S&P 500 index and builds a portfolio of five securities by combining a temporal Transformer with a Graph Attention Network.
The full name is Soft-Threshold NMI-prior Transformer Graph Attention Network. The idea is to model two things at once that conventional models handle in separate stages: how each stock behaves over time, and how stocks relate to one another.
How STN-TGAT works
STN-TGAT is built from two blocks. The Transformer picks up long sequential patterns in price data, while the Graph Attention Network describes the dynamic relationships between stocks. On top of this sits a prior graph based on normalized mutual information (NMI), which tells the network which securities are genuinely connected.
- Architecture: temporal Transformer + Graph Attention Network
- The prior graph is built from normalized mutual information (NMI) between stocks
- A soft-threshold sparsification mechanism filters out noisy correlations while keeping meaningful links
- Training is decision-aligned, not just aimed at price prediction
- The portfolio holds the top 5 securities within the top 50 S&P 500 companies
The key technique is the "soft threshold" (soft-threshold sparsification). It removes random, noisy correlations from the graph, but instead of cutting useful links off sharply, it weakens them gradually. According to the authors, this makes the graph structure more robust to market noise.
Why this is closer to real trading
STN-TGAT is evaluated not on abstract forecast accuracy but under rules that approximate real trading. The model selects five stocks from the 50 largest S&P 500 companies, explicitly allocates weights among them, and builds in transaction costs, which typically eat into the returns of paper strategies.
This is an important difference from many academic stock-ranking models. They often report impressive prediction accuracy but ignore the fact that every portfolio rebalance costs money. Here, trading costs are built directly into the portfolio construction procedure, and the choice is restricted to liquid securities from the index's largest issuers.
Does the model beat the benchmarks?
According to the authors, STN-TGAT consistently outperforms the reference models on two axes at once: forecast accuracy and portfolio returns on real data. In other words, the gain is not only that the network predicts price movements more accurately, but also that a portfolio built from its signals earns more after costs.
"The combination of decision-aligned learning with adaptive relational
modeling provides a coherent and practically effective foundation for data-driven portfolio construction," the abstract of the arXiv paper states.
The number of verifiable claims here is limited. This is a preprint (announce type: new) that has not yet been peer-reviewed, and the authors present a comparison with benchmarks without disclosing exact return figures in the abstract.
What this means
STN-TGAT is part of a broader trend of graph neural networks moving into quantitative finance: the market is described not as a set of independent stocks but as a network of relationships that changes over time. Its practical value will become clear once the results are confirmed outside the preprint and over a long history, including falling markets.
Frequently asked questions
What is STN-TGAT?
STN-TGAT (Soft-Threshold NMI-prior Transformer Graph Attention Network) is a neural network model for ranking stocks and building an investment portfolio. It combines a temporal Transformer, a graph attention network, and a prior graph based on mutual information between stocks.
What data was the model tested on?
The model was tested on real S&P 500 stock data: the portfolio was built from the top 5 securities within the top 50 largest companies in the index, with weight allocation and transaction costs taken into account.
Access Frontier LLMs & Multimodal AI in One Workspace
Discover NomadNet AI (nomadnet.ai) — unified access to frontier language models, research synthesis, and multimodal workflows.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.