tensorlink-dev commited on
Commit
33ea44e
Β·
verified Β·
1 Parent(s): 581bbc0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +262 -3
README.md CHANGED
@@ -1,3 +1,262 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: mit
4
+ library_name: open-synth-miner
5
+ tags:
6
+ - time-series
7
+ - probabilistic-forecasting
8
+ - monte-carlo
9
+ - bittensor
10
+ - sn50
11
+ - synth
12
+ - crps
13
+ - price-forecasting
14
+ - hybrid-architecture
15
+ - pytorch
16
+ datasets:
17
+ - tensorlink-dev/open-synth-training-data
18
+ pipeline_tag: time-series-forecasting
19
+ ---
20
+
21
+ # PAG β€” Hybrid SN50 Probabilistic Price Forecaster
22
+
23
+ **PAG** is a hybrid probabilistic price forecasting model built for [Bittensor Subnet 50 (Synth)](https://bittensor.com/). It generates Monte Carlo price path simulations scored by **CRPS** (Continuous Ranked Probability Score) β€” a metric that rewards well-calibrated probability distributions, not just point accuracy.
24
+
25
+ Built with [open-synth-miner](https://github.com/tensorlink-dev/open-synth-miner) and trained/published via [synth-city](https://github.com/tensorlink-dev/synth-city).
26
+
27
+ ## Model Description
28
+
29
+ PAG uses a **hybrid backbone architecture** β€” stacking multiple neural network paradigms (e.g. attention + recurrence, convolution + frequency analysis) into a single composable pipeline. All backbone blocks share a uniform tensor interface:
30
+
31
+ ```
32
+ (batch, seq, d_model) β†’ (batch, seq, d_model)
33
+ ```
34
+
35
+ This lets blocks be freely combined and swapped. The hybrid approach captures different aspects of price dynamics β€” long-range dependencies via attention, sequential momentum via recurrence, local patterns via convolution β€” and fuses them into a single learned representation before the prediction head generates full probabilistic forecasts.
36
+
37
+ ### Architecture
38
+
39
+ | Component | Description |
40
+ |-----------|-------------|
41
+ | **Framework** | [open-synth-miner](https://github.com/tensorlink-dev/open-synth-miner) β€” composable PyTorch framework |
42
+ | **Backbone** | Hybrid multi-block (stacked heterogeneous blocks with uniform tensor interface) |
43
+ | **Prediction Head** | Generates drift (ΞΌ) and volatility (Οƒ) parameters for Monte Carlo simulation |
44
+ | **Normalization** | RevIN (Reversible Instance Normalization) as first block |
45
+ | **Output** | 1,000 Monte Carlo price paths per asset per timeframe |
46
+
47
+ ### Supported Blocks
48
+
49
+ The open-synth-miner framework provides 15 backbone blocks that can be composed in any order:
50
+
51
+ | Block | Cost | Best For |
52
+ |-------|------|----------|
53
+ | RevIN | Very low | Input normalization (must be first) |
54
+ | LayerNormBlock | Very low | Inter-block normalization |
55
+ | DLinearBlock | Very low | Decomposition baseline |
56
+ | RNNBlock | Low | Minimal recurrence |
57
+ | ResConvBlock | Low | Local feature extraction |
58
+ | BiTCNBlock | Low | Dilated temporal convolution |
59
+ | SDEEvolutionBlock | Low | Stochastic differential equation residual |
60
+ | GRUBlock | Low-Med | Gated recurrent (lighter LSTM alternative) |
61
+ | LSTMBlock | Medium | Sequential and momentum patterns |
62
+ | FourierBlock | Medium | Periodic/frequency-domain patterns |
63
+ | TransformerBlock | Medium | Long-range self-attention |
64
+ | TimeMixerBlock | Medium | Multi-scale temporal mixing |
65
+ | Unet1DBlock | Medium | Multi-resolution features |
66
+ | TransformerEncoder | High | Deep multi-head attention |
67
+ | TimesNetBlock | High | Period-aware 2D convolution |
68
+
69
+ ### Prediction Heads
70
+
71
+ | Head | Expressiveness | Description |
72
+ |------|---------------|-------------|
73
+ | GBMHead | Low | Geometric Brownian Motion β€” constant ΞΌ, Οƒ |
74
+ | SDEHead | Medium | Deeper ΞΌ, Οƒ networks |
75
+ | SimpleHorizonHead | Medium | Per-step prediction via pooling |
76
+ | HorizonHead | High | Per-step via cross-attention |
77
+ | NeuralBridgeHead | High | Macro + micro hierarchy |
78
+ | NeuralSDEHead | Very High | Full neural SDE |
79
+
80
+ ## Intended Use
81
+
82
+ This model is designed for **Bittensor Subnet 50 (Synth)** β€” a decentralized competition where miners submit probabilistic price forecasts and are scored on CRPS.
83
+
84
+ ### Prediction Targets
85
+
86
+ The model forecasts price paths for **9 assets** across **two timeframes**:
87
+
88
+ **Standard (24h)** β€” 288 steps at 5-minute intervals
89
+
90
+ **HFT (1h)** β€” 60 steps at 1-minute intervals
91
+
92
+ | Asset | Scoring Weight | Description |
93
+ |-------|---------------|-------------|
94
+ | BTC | 1.00 | Bitcoin |
95
+ | ETH | 0.67 | Ethereum |
96
+ | SOL | 0.59 | Solana |
97
+ | XAU | 2.26 | Gold |
98
+ | SPYX | 2.99 | S&P 500 |
99
+ | NVDAX | 1.39 | NVIDIA |
100
+ | TSLAX | 1.42 | Tesla |
101
+ | AAPLX | 1.86 | Apple |
102
+ | GOOGLX | 1.43 | Alphabet/Google |
103
+
104
+ Higher-weighted assets (SPYX, XAU, AAPLX) have more impact on overall miner ranking.
105
+
106
+ ### Output Format
107
+
108
+ Each prediction produces a tensor of shape:
109
+
110
+ ```
111
+ (n_paths, horizon_steps) = (1000, 288) for standard timeframe
112
+ (n_paths, horizon_steps) = (1000, 60) for HFT timeframe
113
+ ```
114
+
115
+ Each value represents a simulated future price at that time step along one Monte Carlo path.
116
+
117
+ ## Evaluation
118
+
119
+ ### CRPS (Continuous Ranked Probability Score)
120
+
121
+ Models are scored using CRPS β€” **lower is better**:
122
+
123
+ ```
124
+ CRPS = (1/N) Γ— Ξ£|yβ‚™ - x| - (1/2NΒ²) Γ— Ξ£β‚™ Ξ£β‚˜ |yβ‚™ - yβ‚˜|
125
+ ```
126
+
127
+ Where:
128
+ - `yβ‚™` = forecast values (one per Monte Carlo path)
129
+ - `x` = realized/observed price
130
+ - **Term 1**: Mean absolute error between ensemble and observation
131
+ - **Term 2**: Mean pairwise absolute difference (rewards calibration and diversity)
132
+
133
+ CRPS is evaluated at multiple time horizons: **5, 10, 15, 30, 60, 180, 360, 720, and 1440 minutes**.
134
+
135
+ ### Why CRPS?
136
+
137
+ Unlike simple point forecast metrics (MAE, RMSE), CRPS evaluates the **entire predicted distribution**. A model can't game CRPS by just predicting the mean β€” it must produce Monte Carlo paths that genuinely capture the range and shape of possible future prices. This rewards:
138
+
139
+ - **Calibration** β€” predicted uncertainty matches realized uncertainty
140
+ - **Sharpness** β€” distributions are as tight as possible while remaining calibrated
141
+ - **Tail coverage** β€” extreme moves are represented in the ensemble
142
+
143
+ ## Training
144
+
145
+ ### Data
146
+
147
+ Training data sourced from [tensorlink-dev/open-synth-training-data](https://huggingface.co/datasets/tensorlink-dev/open-synth-training-data) on Hugging Face β€” historical OHLCV price data for all 9 SN50 assets.
148
+
149
+ | Parameter | Value |
150
+ |-----------|-------|
151
+ | **Input features** | 4 (OHLCV) |
152
+ | **Sequence length (5m)** | 288 (24h lookback at 5-min intervals) |
153
+ | **Prediction horizon (5m)** | 288 (24h forecast at 5-min intervals) |
154
+ | **Sequence length (1m)** | 60 (1h lookback at 1-min intervals) |
155
+ | **Prediction horizon (1m)** | 60 (1h forecast at 1-min intervals) |
156
+ | **Monte Carlo paths** | 1,000 (production) |
157
+ | **Feature engineering** | ZScore normalization |
158
+
159
+ ### Compute
160
+
161
+ Training runs on decentralized GPU infrastructure via **Basilica (Bittensor SN39)** β€” a GPU compute marketplace providing Tesla V100, RTX-A4000, and RTX-A6000 GPUs.
162
+
163
+ ### Pipeline
164
+
165
+ The model was discovered, trained, validated, and published by [synth-city](https://github.com/tensorlink-dev/synth-city)'s autonomous agent pipeline:
166
+
167
+ 1. **Planner** β€” surveyed available blocks/heads and past experiment history to design the architecture
168
+ 2. **Trainer** β€” executed the experiment on decentralized GPUs
169
+ 3. **CodeChecker** β€” validated the configuration and output tensors against SN50 requirements
170
+ 4. **Debugger** β€” diagnosed and fixed any training failures
171
+ 5. **Publisher** β€” published to Hugging Face Hub after confirming CRPS improvement over prior models
172
+
173
+ ## How to Use
174
+
175
+ ### With open-synth-miner
176
+
177
+ ```python
178
+ from osa.models.factory import create_model
179
+ from osa.models.registry import discover_components
180
+ from omegaconf import OmegaConf
181
+
182
+ # Discover all registered components
183
+ discover_components("src/models/components")
184
+
185
+ # Load experiment config (adjust blocks/head to match your published model)
186
+ config = OmegaConf.create({
187
+ "model": {
188
+ "backbone": {
189
+ "blocks": ["RevIN", "TransformerBlock", "LSTMBlock"],
190
+ "d_model": 32,
191
+ "feature_dim": 4,
192
+ "seq_len": 288,
193
+ },
194
+ "head": {
195
+ "_target_": "GBMHead"
196
+ }
197
+ },
198
+ "training": {
199
+ "horizon": 288,
200
+ "n_paths": 1000,
201
+ }
202
+ })
203
+
204
+ model = create_model(config)
205
+ ```
206
+
207
+ ### With synth-city CLI
208
+
209
+ ```bash
210
+ # Run a quick experiment with a hybrid architecture
211
+ synth-city experiment --blocks TransformerBlock,LSTMBlock --head GBMHead --epochs 5
212
+
213
+ # Or let the autonomous pipeline find the best hybrid architecture
214
+ synth-city pipeline --publish
215
+ ```
216
+
217
+ ### Loading from Hugging Face Hub
218
+
219
+ ```python
220
+ from osa.tracking.hub_manager import HubManager
221
+
222
+ # Load published model weights
223
+ manager = HubManager(repo_id="tensorlink-dev/pag-hybrid-sn50")
224
+ model = manager.load_model()
225
+ ```
226
+
227
+ ## Technical Details
228
+
229
+ ### Tensor Interface
230
+
231
+ Every backbone block in open-synth-miner adheres to a strict uniform interface:
232
+
233
+ ```
234
+ Input: (batch_size, sequence_length, d_model)
235
+ Output: (batch_size, sequence_length, d_model)
236
+ ```
237
+
238
+ This enables arbitrary block composition β€” any block can follow any other block. The hybrid approach exploits this by stacking blocks from different architectural families (attention, recurrence, convolution, frequency analysis) to capture complementary patterns in price data.
239
+
240
+ ### Monte Carlo Simulation
241
+
242
+ The prediction head outputs drift (ΞΌ) and volatility (Οƒ) parameters at each time step. These parameterize a stochastic process from which 1,000 Monte Carlo paths are sampled, producing a full probabilistic forecast rather than a single point estimate.
243
+
244
+ ### SN50 Validation
245
+
246
+ Before submission, outputs are validated against Subnet 50 requirements:
247
+ - Correct number of paths (1,000)
248
+ - Correct horizon lengths (288 for 5m, 60 for 1m)
249
+ - Finite, positive price values
250
+ - Valid tensor shapes
251
+
252
+ ## Citation
253
+
254
+ If you use this model or the underlying framework, please reference:
255
+
256
+ - [open-synth-miner](https://github.com/tensorlink-dev/open-synth-miner) β€” composable PyTorch framework for probabilistic forecasting
257
+ - [synth-city](https://github.com/tensorlink-dev/synth-city) β€” agentic R&D and MLOps engine for Bittensor mining
258
+ - [Bittensor Subnet 50 (Synth)](https://bittensor.com/) β€” decentralized price forecasting competition
259
+
260
+ ## License
261
+
262
+ MIT