[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116975":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":10,"trendingCount":16,"starSnapshotCount":16,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},116975,"SADL","zju3dv\u002FSADL","zju3dv","Official SADL GitHub repository for the paper \"SADL: On the Demand-Supply Geometry of Representation Collapse\". PyTorch code for Supply And Demand Loss in JEPA world models.","https:\u002F\u002Fzju3dv.github.io\u002FSADL\u002F",null,"Python",86,3,55,1,0,5,31,26,1.81,"MIT License",false,"main",true,[26,27,28,29,30],"jepa","representation-collapse","representation-learning","self-supervised-learning","world-models","2026-11-25 02:05:52","\u003Cdiv align=\"center\">\n  \u003Cimg src=\"assets\u002Fsadl-glyph.svg\" width=\"640\" alt=\"SADL drawn by real latents of an SADL-trained four-task model\">\n\n  \u003Ch1>SADL: On the Demand-Supply Geometry of Representation Collapse\u003C\u002Fh1>\n\n  \u003Cp>Official PyTorch implementation of \u003Cstrong>Supply And Demand Loss (SADL)\u003C\u002Fstrong>, with code to train and evaluate LeWM and INTACT world models.\u003C\u002Fp>\n\n  \u003Ch3>No architecture changes &nbsp;&middot;&nbsp; No extra trainable parameters &nbsp;&middot;&nbsp; One hyperparameter\u003C\u002Fh3>\n  \u003Ch3>High robustness &nbsp;&middot;&nbsp; High stability &nbsp;&middot;&nbsp; High success rate\u003C\u002Fh3>\n\n  \u003Cp>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FDavidSunok\">Junhan Sun\u003C\u002Fa>\u003Csup>1\u003C\u002Fsup>\n    &nbsp;&middot;&nbsp; Yigui Feng\u003Csup>2\u003C\u002Fsup>\n    &nbsp;&middot;&nbsp; Mingzhe Liu\u003Csup>2\u003C\u002Fsup>\n    &nbsp;&middot;&nbsp; Haoyan Xu\u003Csup>2\u003C\u002Fsup>\n    &nbsp;&middot;&nbsp; Lei Ye\u003Csup>2\u003C\u002Fsup>\n    &nbsp;&middot;&nbsp; Ziqi Han\u003Csup>2\u003C\u002Fsup>\n    &nbsp;&middot;&nbsp; Hanru Bai\u003Csup>3\u003C\u002Fsup>\n    &nbsp;&middot;&nbsp; Yanzhao Zhang\u003Csup>3\u003C\u002Fsup>\u003Cbr>\n    Hao Zhao\u003Csup>2,4,&dagger;\u003C\u002Fsup>\n    &nbsp;&middot;&nbsp; Guofeng Zhang\u003Csup>1,5,&dagger;\u003C\u002Fsup>\n  \u003C\u002Fp>\n  \u003Cp>\n    \u003Csup>1\u003C\u002Fsup>State Key Laboratory of CAD&amp;CG, Zhejiang University &nbsp;&middot;&nbsp; \u003Csup>2\u003C\u002Fsup>RoboParty Lab &nbsp;&middot;&nbsp; \u003Csup>3\u003C\u002Fsup>Alibaba Group\u003Cbr>\n    \u003Csup>4\u003C\u002Fsup>AIR, Tsinghua University &nbsp;&middot;&nbsp; \u003Csup>5\u003C\u002Fsup>InSpatio &nbsp;&middot;&nbsp; \u003Csup>&dagger;\u003C\u002Fsup>Corresponding authors\n  \u003C\u002Fp>\n\n  \u003Cp>\n    \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.21596\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPaper-arXiv%3A2611.21596-B31B1B?style=flat-square\" alt=\"Paper on arXiv\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fzju3dv.github.io\u002FSADL\u002F\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FProject_Page-Live-4F8FD1?style=flat-square\" alt=\"Live project page\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002FDavidSunok\u002FSADL\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FHugging_Face-Checkpoints_and_Data-FFD21E?style=flat-square\" alt=\"Hugging Face checkpoints and data\">\u003C\u002Fa>\n    \u003Ca href=\"#code\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCode-Available-287745?style=flat-square\" alt=\"World-model code\">\u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fzju3dv.github.io\u002FSADL\u002F#film\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVideo-3_min-D4735F?style=flat-square\" alt=\"Project video\">\u003C\u002Fa>\n  \u003C\u002Fp>\n  \u003Cp>\n    \u003Ca href=\"#quick-start\">Quick start\u003C\u002Fa> &nbsp;&middot;&nbsp;\n    \u003Ca href=\"#why-sadl\">Why SADL?\u003C\u002Fa> &nbsp;&middot;&nbsp;\n    \u003Ca href=\"#method\">Method\u003C\u002Fa> &nbsp;&middot;&nbsp;\n    \u003Ca href=\"#results\">Results\u003C\u002Fa> &nbsp;&middot;&nbsp;\n    \u003Ca href=\"#citation\">Citation\u003C\u002Fa>\n  \u003C\u002Fp>\n\u003C\u002Fdiv>\n\n## News\n\n- **[2026-11-19]** Released the [project page](https:\u002F\u002Fzju3dv.github.io\u002FSADL\u002F) and project video.\n- **[2026-11-16]** Released the [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.21596) on arXiv.\n- Released the [INTACT and LeWM training and evaluation code](#code) and the [Hugging Face repository](https:\u002F\u002Fhuggingface.co\u002FDavidSunok\u002FSADL).\n\n## Overview\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fsadl-pipeline.svg\" width=\"100%\" alt=\"SADL pipeline: the Demand Regularizer acts on Z; SADL reads the detached demand q from Z and applies the Supply Regularizer to H only when its supply k falls short\">\n\u003C\u002Fp>\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fzju3dv.github.io\u002FSADL\u002F#film\">Watch the 3-minute project video\u003C\u002Fa> &nbsp;&middot;&nbsp; \u003Ca href=\"https:\u002F\u002Fzju3dv.github.io\u002FSADL\u002F\">Open the interactive project page\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Ca id=\"code\">\u003C\u002Fa>\n\n## Quick start\n\n### Install\n\nStart with Python 3.10 and a CUDA-enabled PyTorch installation.\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fzju3dv\u002FSADL.git\ncd SADL\npython -m pip install -r requirements.txt\n```\n\nFor the optional fast encoder kernels on Hopper or Blackwell GPUs, run `python -m pip install -r requirements-fast.txt`.\n\n### Evaluate a published checkpoint\n\nThis example runs the four-task INTACT model on Reacher using the Direct planner. It downloads the Reacher checkpoint and dataset, then runs a 10-episode check on one GPU.\n\n```bash\nhf download DavidSunok\u002FSADL --include \"checkpoints\u002Fintact\u002Ffour_task\u002Fseed3072\u002Freacher\u002F*\" --local-dir hf\nhf download DavidSunok\u002FSADL datasets\u002Freacher.h5 --local-dir hf\npython evaluate.py --checkpoint hf\u002Fcheckpoints\u002Fintact\u002Ffour_task\u002Fseed3072\u002Freacher \\\n    --task reacher --data-dir hf\u002Fdatasets --planner direct --seeds 0 --episodes 10\n```\n\nOmit `--seeds 0 --episodes 10` to run the published evaluation protocol of 100 episodes for each of seeds 0, 1, and 42.\n\n### Train from scratch\n\nOn single-node RTX 5090 or 5090 D systems that report `illegal memory access` at the first NCCL collective, run `export NCCL_SAFE=1` before either training command below.\n\nThe training entry point uses four GPUs and a dataset manifest covering all four tasks. Download the HDF5 files once, then choose either training command.\n\n```bash\nhf download DavidSunok\u002FSADL --include \"datasets\u002F*.h5\" --local-dir hf\npython tools\u002Fprepare_datasets.py --root hf\u002Fdatasets --output datasets.json\n\n# INTACT trained jointly on PushT, Cube, Reacher, and TwoRoom\npython train.py --cell INTACT_4T_S3072 --gpus 0,1,2,3 --datasets datasets.json\n\n# LeWM trained on PushT\npython train.py --cell LEWM_PUSHT_S3072 --gpus 0,1,2,3 --datasets datasets.json\n```\n\nAfter training, pass the exported task directory to the evaluator.\n\n```bash\npython evaluate.py --checkpoint runs\u002FINTACT_4T_S3072\u002Fexports\u002Freacher \\\n    --task reacher --data-dir hf\u002Fdatasets --planner direct\n```\n\nSee the [training guide](docs\u002FTRAINING.md) for all model and task combinations, hyperparameters, output files, and how to resume training.\n\n## Why SADL?\n\nIn Joint-Embedding Predictive Architectures, **a well-regularized projector output does not by itself prevent representation collapse.**\n\n- From initialization, the encoder representation $H$ is dominated by a component shared by all inputs: sample variation carries about 0.01% of its energy.\n- A batch-normalized projector subtracts the batch mean. Moving all of $H$ along that shared direction leaves the endpoint $Z$ unchanged, so the Demand Regularizer and the task loss, both computed from $Z$, get zero gradient there.\n- The remaining differences shrink until the representation collapses, while $Z$ can still look well-constrained.\n\nSADL keeps the original objective and adds a **one-sided Supply Regularizer** on the encoder. It introduces no auxiliary networks, no trainable parameters and no architecture changes, and it works with any Demand Regularizer.\n\n\u003Cp align=\"center\">\n  \u003Cstrong>50% &rarr; 0%\u003C\u002Fstrong> collapse rate over ten seeds &nbsp;&middot;&nbsp;\n  \u003Cstrong>3.4&ndash;6.4&times;\u003C\u002Fstrong> encoder effective rank at epoch 1 &nbsp;&middot;&nbsp;\n  \u003Cstrong>&gt;95%\u003C\u002Fstrong> search-free control\n\u003C\u002Fp>\n\n## Method\n\nSADL reads a detached **demand capacity** $q$ from the endpoint, measures the **supply capacity** $k$ of the encoder, and corrects the encoder only when $k \u003C q$:\n\n$$\nq=\\sqrt{q_{\\mathrm{reg}}\\,q_{\\mathrm{exc}}},\\qquad\nk=\\min\\{k_{\\mathrm{exc}},\\,k_{\\mathrm{tr}}\\},\\qquad\n\\mathcal S=\\big[\\log(q+\\epsilon)-\\log(k+\\epsilon)\\big]_+^2 .\n$$\n\n$$\n\\mathcal L=\\mathcal L_{\\mathrm{task}}+\\lambda_D\\,\\mathcal D(Z)+\\lambda_S\\,\\mathcal S\\big(H,\\mathrm{sg}(Z)\\big)\n$$\n\n$q_{\\mathrm{reg}}$ rises as the Demand Regularizer is satisfied and $q_{\\mathrm{exc}}$ measures sample variation in $Z$. $k_{\\mathrm{exc}}$ scores the energy and spread of sample differences in $H$, and $k_{\\mathrm{tr}}$ measures how much of them reaches $Z$ through regularized canonical correlations. The stop-gradient makes the correction act directly on $H$; the penalty is exactly zero once supply meets demand.\n\n## World-model implementation\n\nTraining and evaluation code for JEPA world models trained on one or more control tasks with **one BatchNorm\npopulation that does not depend on the GPU or the task**, for two objectives:\n\n- **INTACT**: latent prediction and goal-conditioned action, evaluated with Direct and Guarded A planning;\n- **LeWM**: latent prediction only, evaluated with CEM planning.\n\nBoth objectives use SIGReg on the projected embeddings and the SADL regularizer between encoder and projector\nembeddings. Tasks: PushT, Cube, Reacher, TwoRoom.\n\n### BatchNorm\n\n- Every optimizer step uses a global batch of 256 windows of 8 frames. Windows are assigned to the BatchNorm\n  population by their position in the global batch before they are split across GPUs; the projector and the\n  prediction projector use one synchronized BatchNorm population over that batch. Multi-task batches are\n  task-balanced (64 windows per task) and shuffled, so every normalization call sees all tasks.\n- At inference all tasks use the same saved running statistics: no task-specific normalization, no statistics\n  re-estimation and no task input. The task only selects the action dimension and the action scaling.\n- One action encoder, predictor, prediction projector and (INTACT) actor are shared by all tasks.\n\n### Repository\n\n```\ntrain.py            train one cell (4 GPUs)\nevaluate.py         evaluate an exported checkpoint\ndocs\u002FTRAINING.md    single-task and four-task training guide\ntools\u002F              dataset list\nsrc\u002F                training code; src\u002Fmodel: model, data, planners and configs; src\u002Fkernels: GPU operators\neval\u002F               evaluation protocol: episode sampling, causal action history, planner settings\n```\n\n### Evaluation protocol\n\n`--planner direct` or `guarded_a` for INTACT checkpoints, `cem` for LeWM checkpoints. Start states and goals are\nsampled from dataset episodes with the goal 25 steps ahead; the agent has at most 50 actions, plans 5 action blocks\nahead and replans every 5 actions; INTACT receives the causal history of the previous 5 actions; the model runs in\nFP32 with solver batch size 1. By default `evaluate.py` runs seeds 0, 1 and 42 with 100 episodes each. Reported\nresults were computed on an NVIDIA RTX 4090.\n\n| Planner | Candidates |\n|---|---|\n| `direct` | none: the actor's action plan |\n| `guarded_a` | 128 samples x 3 iterations around the Direct plan, top 16, initial std 0.25 |\n| `cem` | 300 samples x 30 iterations, top 30, initial std 1.0 |\n\n### Checkpoints and datasets\n\nCheckpoints for the [shared BatchNorm results](#shared-batchnorm-results) and the four HDF5 datasets are available from [DavidSunok\u002FSADL on Hugging Face](https:\u002F\u002Fhuggingface.co\u002FDavidSunok\u002FSADL) under\n`checkpoints\u002F\u003Cintact|lewm>\u002F\u003Cfour_task|single_task>\u002Fseed\u003Cseed>\u002F\u003Ctask>\u002F` (`weights_epoch_1.pt`, `config.yaml`,\n`action_stats.json`, `training_config.json`) and `datasets\u002F`. Pass a task folder to `evaluate.py` as `--checkpoint`\nand the dataset folder as `--data-dir`. The four task folders of a four-task model share all weights and\nnormalization statistics.\n\n## Results\n\n### Epoch 1: every Demand Regularizer lifts together\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fsadl-epoch1-regularizers.svg\" width=\"100%\" alt=\"Epoch-1 control success with and without SADL: LeWM with eight Demand Regularizers and INTACT with three\">\n\u003C\u002Fp>\n\nGaussian or not, the encoder keeps up with what is demanded: with SADL, LeWM reaches 62.8&ndash;75.3% after one epoch under all eight Demand Regularizers (from 23.8&ndash;47.7%), and INTACT reaches 95.4&ndash;95.6% search-free success (from 28.2&ndash;54.4%). Mean over three training seeds.\n\n### Repairing collapsed encoders\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fsadl-rescue.svg\" width=\"85%\" alt=\"Control success after resuming near-collapsed checkpoints with and without SADL\">\n\u003C\u002Fp>\n\nSADL can also reopen an encoder that has already collapsed. Resuming from fixed near-collapsed checkpoints with SADL at its default weight $\\lambda_S=0.01$, INTACT recovers from 18.9% to 68.3% within one more epoch.\n\n### Mainstream SSL\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fsadl-ssl-aggressive.svg\" width=\"85%\" alt=\"Online linear accuracy of VICReg, BYOL, MoCo v3 and SimCLR with and without SADL under an aggressive recipe\">\n\u003C\u002Fp>\n\nSADL is a drop-in addition to standard self-supervised objectives. On ImageNet-100 with ViT-S\u002F16, under a learning rate &times;4 and no warmup, it lifts VICReg by 8.4 points and BYOL by 4.9 points of online linear accuracy, with no other change to the recipe.\n\n### Image classification\n\nOn ImageNet-LT, Galaxy10, CIFAR-10 and Imagenette, SADL improves early learning; on Imagenette it reaches the baseline's final accuracy with 23% fewer updates. Interactive curves are on the [project page](https:\u002F\u002Fzju3dv.github.io\u002FSADL\u002F#images).\n\n### Shared BatchNorm results\n\nSuccess rate (%), mean +- SD over training seeds 3072 \u002F 3073 \u002F 3074 (each seed: 300 episodes).\n\n| Model | Training | Planner | PushT | Cube | Reacher | TwoRoom | Mean |\n|---|---|---|---|---|---|---|---|\n| INTACT | four tasks | Direct | 85.7 +- 0.9 | 100.0 +- 0.0 | 93.4 +- 1.7 | 100.0 +- 0.0 | 94.8 +- 0.4 |\n| INTACT | four tasks | Guarded A | 88.1 +- 0.8 | 99.6 +- 0.4 | 93.1 +- 0.7 | 99.8 +- 0.4 | 95.1 +- 0.3 |\n| INTACT | single task | Direct | 85.1 +- 0.4 | 100.0 +- 0.0 | 94.9 +- 2.0 | 99.7 +- 0.6 | 94.9 +- 0.5 |\n| INTACT | single task | Guarded A | 89.8 +- 0.2 | 99.6 +- 0.2 | 93.7 +- 3.2 | 99.3 +- 0.9 | 95.6 +- 0.9 |\n| LeWM | four tasks | CEM | 64.7 +- 18.5 | 59.6 +- 1.3 | 46.7 +- 26.1 | 94.4 +- 1.0 | 66.3 +- 9.2 |\n| LeWM | single task | CEM | 83.1 +- 1.6 | 58.9 +- 1.4 | 81.0 +- 4.3 | 91.3 +- 1.5 | 78.6 +- 1.9 |\n\nPer-seed values are in [RESULTS.md](RESULTS.md).\n\n## License\n\nMIT, see [LICENSE](LICENSE). Parts of `src\u002Fmodel` derive from LeWM; see [NOTICE.md](NOTICE.md).\n\n## Citation\n\n```bibtex\n@article{sun2026sadl,\n  title   = {{SADL}: On the Demand-Supply Geometry of Representation Collapse},\n  author  = {Sun, Junhan and Feng, Yigui and Liu, Mingzhe and Xu, Haoyan and\n             Ye, Lei and Han, Ziqi and Bai, Hanru and Zhang, Yanzhao and\n             Zhao, Hao and Zhang, Guofeng},\n  journal = {arXiv preprint arXiv:2611.21596},\n  year    = {2026}\n}\n```\n",2,"2026-11-24 04:54:44","CREATED_QUERY"]