SignatureInformedTransformer<T>
Models & Types · AiDotNet.Finance.Portfolio
SIT: a decision-focused asset allocator that reads path signatures and outputs portfolio weights directly, trained on portfolio CVaR (Hwang and Zohren, arXiv:2510.03129).
Inheritance: NeuralNetworkBase<T> → FinancialModelBase<T> → PortfolioOptimizerBase<T> → SignatureInformedTransformer<T>
For Beginners
Give it recent price history for a basket of assets and it returns the fraction of your money to put in each. It is trained to keep the worst outcomes shallow, rather than to predict prices well and hope good predictions imply a good portfolio.
How It Works
The paper’s central claim is that predict-then-optimize is the wrong decomposition. Minimizing a forecasting error is not a proxy for allocation quality: a downstream optimizer amplifies small prediction inaccuracies into fragile portfolios, which is why the paper’s forecasting baselines show high variance across runs and often fail to beat an equally weighted portfolio. SIT collapses feature extraction and decision-making into ONE policy trained on the financial objective itself.
Three pieces, each independently testable:
Signatures (truncated path signatures and the pairwise signed area that measures
lead-lag), Attention (a query-conditioned, softplus-gated bias that injects that
lead-lag evidence INSIDE attention rather than as an input feature), and
Objective (CVaR over realized portfolio losses, with long-only fully-invested
weights from a tempered softmax).
CVaR is the only training signal. The paper states explicitly that no auxiliary prediction losses are used. Adding an MSE or expected-return term would reintroduce precisely the objective mismatch this architecture exists to remove, so none is present and none should be added.
Example
var priceWindow = Tensor<double>.CreateRandom(2, 4);
var model = new SignatureInformedTransformer<double>(
new SignatureInformedTransformerOptions<double> { NumAssets = 30 });
Vector<double> weights = model.OptimizePortfolio(priceWindow); // long-only, sums to 1
Constructors
| Constructor | Summary |
|---|---|
SignatureInformedTransformer() |
Creates a SIT allocator with the paper’s defaults. |
SignatureInformedTransformer(SignatureInformedTransformerOptions<T> options, NeuralNetworkArchitecture<T> architecture, ILossFunction<T> lossFunction) |
Creates a SIT allocator. |
Properties
| Property | Summary |
|---|---|
CVaRPortfolioObjective<T> Objective { get; } |
Gets the CVaR objective and the weight parameterization. |
PathSignatureTransform<T> Signatures { get; } |
Gets the path-signature transform, including the pairwise signed-area (lead-lag) measure. |
SignatureAugmentedAttention<T> Attention { get; } |
Gets the signature-augmented attention bias. |
Methods
| Method | Summary |
|---|---|
T PortfolioCVaR(Vector<T> weights, Tensor<T> realizedReturns) |
The CVaR of realized per-step losses for a fixed allocation over a horizon: the quantity training minimizes. |
Tensor<T> LeadLagMatrix(Tensor<T> marketData) |
Pairwise signed areas over the price window: entry (j, l) is positive when asset j tends to lead asset l. |
Vector<T> OptimizePortfolio(Tensor<T> marketData) |
Produces long-only, fully invested portfolio weights for a price window. |