Time2Vec Transformers for Equity Return Forecasting
Summary
The document introduces attention and Transformer components, then adapts them to forecast stock returns from factor sequences. Its proposed architecture adds Time2Vec features to factor inputs, applies self-attention and encoder layers, and uses a regression head to predict returns. Time2Vec combines linear and periodic representations, with sinusoidal functions described as the most stable choice among those discussed. The article also outlines preprocessing, rolling windows, training, and a portfolio backtest that ranks stocks and allocates more capital to higher-ranked predictions.
The example uses Chinese A-share data and describes training on an earlier period before evaluating later performance. It reports prior research on attention but gives no numerical performance results for the example strategy itself. Its setup details are not fully consistent: the workflow mentions seven factors, while the listed model input uses two. The results therefore cannot establish that this architecture outperforms simpler models, and the historical backtest may not reflect future performance or implementation costs.
Key ideas
- Attention weights let a model focus on relevant parts of an input sequence.
- Time2Vec represents time with both linear and periodic components.
- The stock model combines time embeddings and factor sequences before applying self-attention.
- The example predicts returns and ranks stocks for portfolio allocation.
- The described backtest does not provide numerical strategy results and has inconsistent factor counts.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.