- AEMO SDP-Teacher Decision Transformer (planner-distilled, physics-v2)
- Files in this repo
- Results (physics-v2 shipped model,
aemo_dt_sdp_jtsoc_v2cal.pt,rtg_mode="auto") - Provenance: what changed in physics-v2
- Architecture
- Training data
- Conditioning signal: value-conditioned, not return-conditioned
- Usage
- Inference prerequisites (what else you need)
- Intended use
- Citation
- Related
- Files in this repo
AEMO SDP-Teacher Decision Transformer (planner-distilled, physics-v2)
The shipped planner-distilled model of the energydecision benchmark. A standalone Decision Transformer distilled from an honest (non-clairvoyant), degradation-aware SDP-planning teacher β no solver in the per-decision control loop (the J_t(soc) prompt is precomputed). Against three newly trained 4M-step PPO seeds it remains competitive, but the ranking is seed-sensitive: the corrected identity-surface seed-mean ratios are 1.70Γ, 1.20Γ, 1.69Γ and 1.60Γ, and the dispatch CI includes zero.
2026-09 update (physics-v2): this model was retrained on the corrected degradation/efficiency physics (round-trip efficiency 0.80, calendar aging, corrected rainflow C-rate units) and a wear-calibrated teacher (
--deg-calibration 0.12, aligning the planner's per-step wear with the environment's realized per-cycle wear). See Provenance below. It supersedes the earlieraemo_dt_sdp_jtsoc_fullcorpus.pt.
Files in this repo
| File | Model | Status |
|---|---|---|
aemo_dt_sdp_jtsoc_v2cal.pt (+ .pt.meta.json) |
Physics-v2 Stage C β J_t(soc) RTG, wear-calibrated SDP teacher (320 eps) | β Shipped β use this one |
aemo_dt_sdp_jtsoc_fullcorpus.pt (+ .pt.meta.json) |
Stage C v1 β J_t(soc) RTG, combined corpus (640 eps), pre-physics-fix | Historical (superseded; kept for the v1 comparison) |
(Removed 2026-09: the behaviour-cloning-era files aemo_dt_fcas_model.pt and aemo_dt_fcas_best_checkpoint.pt.)
Results (physics-v2 shipped model, aemo_dt_sdp_jtsoc_v2cal.pt, rtg_mode="auto")
| Surface | This model | Tuned 4M PPO, 3-seed mean | Ratio | Paired 95% CI on Ξ | n |
|---|---|---|---|---|---|
| Standard 2024 (5 regions Γ 6 periods) | $16,501/ep | $9,708 | 1.70Γ | [$4,996, $8,695] | 30 |
| Dispatch-matched (SA1 full-year) | $33,791/ep | $28,070 | 1.20Γ | [β$1,769, $10,999] | 12 |
| Expanded broad-2024 | $29,124/ep | $17,214 | 1.69Γ | [$6,787, $20,435] | 30 |
| 2025 OOD | $30,791/ep | $19,212 | 1.60Γ | [$3,776, $24,888] | 6 |
| Market impact (piecewise) | 8/9 seed-mean cell wins | $133,056 | 1.60Γ | Ξ $79,736 [$29,842, $132,933] | 9 |
The seed-mean advantage is positive on the four identity means, but dispatch's CI includes zero and one PPO seed has higher surface mean on dispatch, expanded and 2025 OOD. Impact seed-specific ratios are 2.26Γ, 0.91Γ and 2.96Γ. Methodology and baseline audit: the PPO retraining report.
Provenance: what changed in physics-v2
| Fix | Effect |
|---|---|
A3/A4 β rainflow inferred current was %SoC/hour instead of a C-rate (~100Γ too large, then clamped); reset() dropped the C-rate cap |
corrected cycle-aging magnitude globally |
| A5 β planner degradation estimator always returned 0 (a 3-point rainflow sequence can never close a cycle) | planners are now wear-aware and state-dependent |
| A6 / B4 β the planner's per-step wear over-counted the env's per-closed-cycle wear by 8.4Γ on identical actions | added an explicit deg_calibration factor; the teacher corpus was regenerated with --deg-calibration 0.12 |
B1/B8 β impact-aware J_t(soc) dispatch-sign bug and a return_scale sidecar bug in the impact-eval runner |
evaluation correctness (the previous "explicit j_t_soc collapses under impact" claim was an artifact) |
The model card's numbers above are from the corrected pipeline. Prior household and AEMO numbers produced before these fixes are historical.
Architecture
| Parameter | Value |
|---|---|
| Blocks / hidden dim | 8 / 768 |
| Attention | GQA (12 Q / 6 KV), QK-Norm |
| RoPE | enabled (rope_max_position=630, max_timestep=2016) |
| FFN | SwiGLU, dropout 0.15 |
| Weight tying | Enabled |
| State / action dim | 18 / 9 (full_fcas) |
| Action head | Mixed (Tanh energy, Sigmoid FCAS) |
return_scale |
23,284.83 β auto-calibrated at training time (the p90(|J_t|)/10 heuristic), checkpoint-specific; must be applied at inference |
Note on
return_scale: 23,284.83 is the correct value to use at inference, but it does not reproduce exactly asp90(|J_t|)/10of the released corpus (recomputed β21,067). The checkpoint sidecar is authoritative; the discrepancy is documented in the paper's provenance appendix.
Action space: dim 0 energy dispatch in [-1, 1]; dims 1β8 FCAS bids in [0, 1] (RAISEREG, LOWERREG, RAISE6SEC, LOWER6SEC, RAISE60SEC, LOWER60SEC, RAISE5MIN, LOWER5MIN). State space: 18-dim normalized market observations (time features, RRP, demand, 8 FCAS prices, generation mix, SOC).
Training data
- Paper corpus:
dt_trajectories_jtsoc_v2cal_conservative.parquetβ 320 episodes, 3.13M rows, from the wear-calibrated teacher with per-episodeJ_t(soc)prompts. This is the exact shipped corpus. The supersededdt_trajectories_jtsoc_v2_conservative.parquetwas removed from the public dataset. - Generated by
scripts/generate_sdp_dt_trajectories.py(--deg-calibration 0.12,--rtg-mode j_t_soc); method in report.md Β§4.3/Β§5.4. - Corpus-generation dependency (not an inference dependency): the hierarchical teacher uses a separate SOC-waypoint DT (mrvictoru/energydecision-waypoint-dt) to propose SOC targets; its label generator is
scripts/generate_soc_waypoint_targets.pyin the GitHub repo. The shipped policy does not need this model at inference.
Conditioning signal: value-conditioned, not return-conditioned
The model follows the Decision Transformer architecture but not its return-conditioning recipe, and this is worth knowing before you prompt it.
- Chen et al. (2021) build the return-to-go token at step
tas the sum of the rewards that followed in the logged episode, and at inference the user sets a target return which is decremented by each observed reward. Return conditioning is also how that model is steered toward better-than-data behaviour. - This model uses
RTG = βJ_t(soc) / return_scale, read from a free-terminal cost-to-go table computed from a seasonal price forecast. The table is precomputed (one backward-induction pass per episode, then cached), so there is no solver in the control loop.
Consequences:
- The
rewardcolumn is not consumed in this mode. When the corpus has anrtg_valuecolumn, the training loader uses it as the return signal and does not derive returns-to-go fromreward(src/transformer_training.py). The auxiliary return-prediction loss (weight1e-4) is also regressed againstβJ_t(soc), not against realised reward. Action learning is unaffected: it is supervised from the teacher's actions (weight0.999). - The prompt is state-determined, not user-set. Raising the scalar does not
request more profit;
rtg_mode="auto"resolves to the state-dependent prompt on price-taking surfaces and to a constant fallback under a market-impact model. - It is closer to value-conditioned sequence modelling (QDT; Trajectory Transformer) than to return-conditioned DT. The paper states this explicitly in Β§4.3 and lists it as a limitation (Β§7).
Open ablation. Training the same architecture on the same corpus with
returns-to-go derived from the logged reward column would separate the
contribution of planner imitation from that of the value prompt. It has not been
run; it is tracked in docs/FUTURE_PLAN.md Β§3.5.
Usage
import json
import torch
from huggingface_hub import hf_hub_download
from decision_transformer import DecisionTransformer
from decision import AEMOAgent
repo = "mrvictoru/energydecision-dt-v2-sdp"
ckpt = hf_hub_download(repo, "aemo_dt_sdp_jtsoc_v2cal.pt")
meta = json.loads(hf_hub_download(repo, "aemo_dt_sdp_jtsoc_v2cal.pt.meta.json"))
model_kwargs = dict(
state_dim=meta["model"]["state_dim"], act_dim=meta["model"]["act_dim"],
h_dim=meta["model"]["h_dim"], context_len=meta["model"]["context_len"],
n_block=8, n_heads=12, n_kv_heads=6, drop_p=0.15,
max_timestep=2016, rope_enabled=True, qk_norm=True, tie_weights=True,
action_head_mode="mixed",
)
model = DecisionTransformer(**model_kwargs)
model.load_from_checkpoint(ckpt) # raw state_dict
model.return_scale = meta["return_scale"] # 23284.83
model.eval()
agent = AEMOAgent(env, algorithm="dt", model=model, rtg_mode="auto")
rtg_mode="auto" resolves to state-dependent j_t_soc prompting on price-taking (identity) surfaces and a conservative constant-RTG fallback under a market-impact model.
Inference prerequisites (what else you need)
- Source code. The
DecisionTransformermodel,AEMOAgent, and theAEMOBatteryTradingEnvlive in the energydecision repo, not in this model repo. - Seasonal RRP profiles (bundled here). For
rtg_mode="j_t_soc"/"auto"on identity surfaces, the agent builds a J_t(soc) cost-to-go table from a seasonal price forecast, cached todata/aemo_sdp/seasonal_rrp_<REGION>.json. The five profiles are included in this repo underdata/aemo_sdp/β copy them todata/aemo_sdp/in the repo checkout (otherwise thej_t_socpath has to rebuild them from raw AEMO parquets, which the simulation environment fetches separately). Building the table runs one backward-induction pass per episode (not per step); because it depends only on the seasonal forecast and the SOC grid, it can be precomputed or cached, after which each step is a constant-time lookup. - Alternative without profiles.
rtg_mode="constant"(with a prompt value) needs no seasonal profile, but it is not the shipped setting for identity surfaces. The converse comparison on the headline price-taking tests was not run for this checkpoint.
Intended use
Research into offline RL / sequence modeling for energy markets; simulation of multi-market BESS dispatch in Australia's NEM; baseline for planner-distilled offline RL. Not intended for live trading without further validation (sim-to-real is open), risk management, and regulatory compliance.
Citation
@misc{energydecision-dt-v2-sdp,
title = {AEMO SDP-Teacher Decision Transformer (planner-distilled, physics-v2)},
author = {mrvictoru},
year = {2026},
url = {https://huggingface.co/mrvictoru/energydecision-dt-v2-sdp}
}
Related
- Dataset: mrvictoru/AEMO_simulated_trade_sdp
- Modern v2 (behaviour-cloning era, superseded): energydecision-dt-v2
- Impact-aware variant: energydecision-dt-v2-impact
- Source repo: mrvictoru/energydecision