In this paper, we propose a conditional asset pricing transformer (CAP-T) that captures nonlinear interactions among firms through attention to forecast excess returns. In the first stage, a transformer estimates conditional expected returns, and kernel-weighted principal component analysis of its residuals estimates the local factor loading space. Projecting the conditional mean onto this space separates factor risk compensation from conditional mispricing. Then, in the second stage, separate transformers learn these two components, whose predictions are combined to forecast returns. As a result, the proposed framework decomposes returns into conditional mispricing, factor risk compensation, a centered factor component, and an unpredictable innovation. We establish approximation and generalization bounds and characterize how first-stage prediction errors propagate through local factor estimation and component learning, providing statistical guaranties for conditional mispricing, factor loadings, and factor risk premia. Finally, simulations and empirical studies demonstrate the predictive and interpretive benefits of the proposed method.
Figures & tables
RMSE ( ×103 )
R2 (%)
Model
Layers
Returns
Mispricing
Risk
Labels
dproj
Total
In sample
CAP-T (ReLU)
1
35.9126
1.0044
1.9866
1.6872
0.0973
5.8683
2
35.8735
0.9328
2.4123
1.7793
0.1019
6.0729
3
35.8493
0.8918
2.7917
1.7758
0.1014
6.1993
CAP-T (Softmax)
1
35.9200
0.9995
1.9133
1.7012
0.0983
5.8291
Table 1: Recovery and prediction with five factors
Figure 1: Tracking and recovery of the loading space. In the left three columns, lines show ϕj,t=(180/π)arccos{σj(U∗⊤Ut)} and hollow diamonds show mean estimated counterparts, where U∗ is the true basis at the first date of each row. The right three columns show (180/π)θj,t ; smaller values indicate better recovery. The upper and lower rows show the estimation and out-of-sample periods.
Minimum R2 (%)
Maximum R2 (%)
Model
Layers
M
Total
Risk
Mispricing
Total
Risk
Mispricing
CAP-T (ReLU)
1–3
1
1.5215
0.9622
0.7784
1.6309
1.2820
1.1289
3
1.5438
0.9651
0.8034
1.6611
1.2839
1.1618
6
1.5680
0.9689
0.8176
1.6815
1.2964
1.1866
CAP-T (Softmax)
1–3
1
1.5756
0.9685
0.7899
1.6710
1.3017
1.1399
3
1.6001
1.0093
0.8256
1.6942
1.3123
1.1791
Table 2: Predictive performance across updating schedules
Number of factors, K
Model
Layers
1
2
3
4
5
6
7
Panel A. Total return forecast
CAP-T (ReLU)
1
1.6815
1.6240
1.6142
1.6316
1.6284
1.6334
1.6400
2
1.6034
1.5933
1.5821
1.5680
1.5693
1.5775
1.5916
3
1.6434
1.6576
1.6411
1.6408
1.6289
1.6235
1.6215
CAP-T (Softmax)
1
1.6785
1.6865
1.6421
1.6345
1.6297
1.6202
1.6140
Table 3: Predictive accuracy by attention mechanism, depth, and factor dimension
Number of factors, K
Model
Layers
1
2
3
4
5
6
7
CAP-T (ReLU)
1
1.1382
1.1245
1.1101
1.1094
1.1122
1.1089
1.1091
2
1.0756
1.0829
1.0759
1.0865
1.0817
1.0847
1.0807
3
1.1117
1.1284
1.1322
1.1372
1.1364
1.1402
1.1361
CAP-T (Softmax)
1
1.1146
1.1241
1.1128
1.1139
1.1094
1.1087
1.0978
2
1.0861
1.1014
1.0981
1.1039
1.1070
1.1026
1.0930
Table 4: Forecast-based mean–variance portfolios: net Sharpe ratios
Number of factors, K
Model
Layers
1
2
3
4
5
6
7
CAP-T (ReLU)
1
0.7457
0.7890
0.8300
0.7951
0.8538
0.8268
0.8041
2
0.7122
0.7528
0.8289
0.8316
0.8361
0.8534
0.8362
3
0.7925
0.8211
0.8022
0.8339
0.8483
0.8576
0.8710
CAP-T (Softmax)
1
0.7721
0.8169
0.8279
0.8551
0.8518
0.8375
0.8184
2
0.7570
0.7469
0.7478
0.7381
0.7244
0.7425
0.7272
Table 5: Top-decile conditional-alpha portfolios: net Sharpe ratios
Model
Layers
SR
AR
Vol.
MDD
TO
Cost
CR
(%)
(%)
(%)
(%)
(%)
Panel A. Forecast-based mean–variance portfolios
CAP-T (ReLU)
1
1.112
12.344
11.099
18.338
3.314
0.663
268.254
2
1.082
12.188
11.264
18.804
3.036
0.607
261.628
3
1.136
12.391
10.904
17.154
2.812
0.562
271.111
CAP-T (Softmax)
1
1.109
12.598
11.356
18.377
4.204
0.841
277.672
Table 6: Financial performance with five factors
Figure 2: Cross-firm attention networks and their economic profiles
First stage
Risk
Alpha
Documented links
128
124
102
Characteristic similarity
142
157
134
Unresolved
132
128
137
Total pairs
402
409
373
Share with supporting evidence (%)
67.2
68.7
63.3
Table 7: Economic interpretation of firm associations
Firm pair
Documentary evidence
Network
Boeing / Curtiss-Wright
Boeing is a principal customer of Curtiss-Wright’s commercial-aircraft business. [1]
F
Boeing / Lockheed Martin
Partners in the United Launch Alliance joint venture. [1]
F
HP / Xerox
Xerox is a named competitor in HP’s printing business. [1]
F
Harris / Northrop Grumman
Northrop Grumman is among Harris’s principal competitors. [1]
F
Disney / Wells Fargo
Wells Fargo Bank serves as an indenture trustee for Disney. [1]
F
GE / Raytheon Technologies
GE and Pratt & Whitney participate in an engine and aftermarket joint venture. [1]
R
Table 8: Selected firm associations and documentary evidence
Figure 3: Leading characteristics of total return prediction and its components
Figure 4: Economic composition of characteristic importance
Figure 5: Tests of zero mean alpha and residuals
Figure 6: Cross-sectional alpha structure in out-of-sample forecasts
Quantitative finance uses mathematical models, statistics, and machine learning to value assets, measure risk, and guide trading and portfolio decisions.