Ben commited on
Commit
9e53521
·
1 Parent(s): 967bf28

Update v2 release assets

Browse files
Files changed (2) hide show
  1. README.md +24 -26
  2. requirements.txt +0 -5
README.md CHANGED
@@ -12,36 +12,40 @@ license: cc-by-4.0
12
  library_name: pytorch
13
  ---
14
 
15
- # Representation over Routing: Overcoming Surrogate Hacking in Multi-Timescale PPO
16
 
17
  [![arXiv](https://img.shields.io/badge/arXiv-2604.13517-b31b1b.svg)](https://arxiv.org/abs/2604.13517)
18
  [![GitHub](https://img.shields.io/badge/GitHub-Codebase-blue?logo=github)](https://github.com/ben-dlwlrma/Representation-Over-Routing)
19
  [![Demo](https://img.shields.io/badge/Hugging%20Face-Space-yellow?logo=huggingface)](https://huggingface.co/spaces/ben-dlwlrma/Representation-Over-Routing-Demo)
20
 
21
- This repository hosts the **pre-trained PyTorch model weights** for the 4-stage ablation study presented in the paper: *"Representation over Routing: Overcoming Surrogate Hacking in Multi-Timescale PPO"*.
22
 
23
- Our work identifies severe optimization pathologies in multi-timescale RL (**Surrogate Objective Hacking** and **the Paradox of Temporal Uncertainty**) and introduces **Target Decoupling** to align agents with true long-term objectives without collapsing into short-term behavioral traps.
 
 
24
 
25
  ## Related Links
26
 
27
- * **Paper:** https://arxiv.org/abs/2604.13517
28
- * **Interactive Demo Space:** https://huggingface.co/spaces/ben-dlwlrma/Representation-Over-Routing-Demo
29
- * **Official GitHub Repository:** https://github.com/ben-dlwlrma/Representation-Over-Routing
30
 
31
  ## Model Weights Overview
32
 
33
- We provide four standalone `.pth` weight files, corresponding to the isolated stages of our ablation study on the `LunarLander-v2` environment:
 
 
 
 
 
34
 
35
- * **`1_baseline.pth` (Baseline)**: Suffers from hovering local optima, wasting fuel to hoard small centering rewards due to a fear of crashing.
36
- * **`2_surrogate_hacking_attention.pth` (Surrogate Hacking)**: Demonstrates multi-timescale collapse. The policy artificially minimizes the surrogate loss by manipulating attention weights instead of improving physical control.
37
- * **`3_temporal_paradox_variance.pth` (Temporal Paradox)**: Exhibits aimless wandering caused by the inability to confidently attribute credit over long horizons.
38
- * **`4_target_decoupling_final.pth` (Target Decoupling)**: **Our proposed solution.** The agent uncovers true intelligence, executing a highly fuel-efficient and safe landing by understanding the ultimate long-term goal ($\gamma = 0.999$).
39
 
40
- ## Usage & Inference
41
 
42
- To fully reproduce the training process or run the visual evaluations (GIFs), please refer to the [official GitHub repository](https://github.com/ben-dlwlrma/Representation-Over-Routing).
43
 
44
- Because the published weights only contain the parameters for the Actor networks, inference is exceptionally lightweight. You do not need to import the full training architecture. You can directly load the weights into a standard PyTorch `nn.Sequential` module using the following minimal snippet:
45
 
46
  ```python
47
  import torch
@@ -50,13 +54,11 @@ import numpy as np
50
  import gymnasium as gym
51
  from huggingface_hub import hf_hub_download
52
 
53
- # 1. Download a specific stage's weight from Hugging Face
54
  weight_path = hf_hub_download(
55
- repo_id="ben-dlwlrma/Representation-Over-Routing",
56
- filename="4_target_decoupling_final.pth"
57
  )
58
 
59
- # 2. Define the exact Actor network architecture
60
  def layer_init(layer, std=np.sqrt(2), bias_const=0.0):
61
  nn.init.orthogonal_(layer.weight, std)
62
  nn.init.constant_(layer.bias, bias_const)
@@ -70,11 +72,9 @@ actor = nn.Sequential(
70
  layer_init(nn.Linear(64, 4), std=0.01),
71
  )
72
 
73
- # 3. Load weights
74
  actor.load_state_dict(torch.load(weight_path, weights_only=True))
75
  actor.eval()
76
 
77
- # 4. Run Inference in environment
78
  env = gym.make("LunarLander-v2")
79
  state, _ = env.reset()
80
  done = False
@@ -84,20 +84,18 @@ while not done:
84
  with torch.no_grad():
85
  logits = actor(state_tensor)
86
  action = torch.argmax(logits, dim=1).item()
87
-
88
  state, reward, terminated, truncated, _ = env.step(action)
89
  done = terminated or truncated
90
  ```
91
 
92
- The paper experiments were conducted on `LunarLander-v2`. The hosted Space may use `LunarLander-v3` for compatibility with current Gymnasium releases, while keeping the same actor architecture and pretrained weights.
93
 
94
  ## Citation
95
 
96
- If you find this code or our insights useful in your research, please consider citing our work:
97
-
98
  ```bibtex
99
- @misc{sunRepresentationRoutingOvercoming2026b,
100
- title = {Representation over {{Routing}}: {{Overcoming Surrogate Hacking}} in {{Multi-Timescale PPO}}},
101
  shorttitle = {Representation over {{Routing}}},
102
  author = {Sun, Jing},
103
  year = 2026,
 
12
  library_name: pytorch
13
  ---
14
 
15
+ # Representation over Routing: Diagnosing Temporal Routing Pathologies in Multi-Timescale PPO
16
 
17
  [![arXiv](https://img.shields.io/badge/arXiv-2604.13517-b31b1b.svg)](https://arxiv.org/abs/2604.13517)
18
  [![GitHub](https://img.shields.io/badge/GitHub-Codebase-blue?logo=github)](https://github.com/ben-dlwlrma/Representation-Over-Routing)
19
  [![Demo](https://img.shields.io/badge/Hugging%20Face-Space-yellow?logo=huggingface)](https://huggingface.co/spaces/ben-dlwlrma/Representation-Over-Routing-Demo)
20
 
21
+ This model repository hosts pretrained PyTorch actor weights for the diagnostic study **"Representation over Routing: Diagnosing Temporal Routing Pathologies in Multi-Timescale PPO"**.
22
 
23
+ The weights correspond to controlled PPO experiments on `LunarLander-v2`. They are provided to reproduce the qualitative behaviors discussed in the paper: a single-horizon baseline, differentiable temporal routing, error-based temporal routing, and Target Decoupling.
24
+
25
+ This model repository is a weight distribution package. Training scripts and selected generated figures live in the GitHub code repository; paper text and source files are distributed through arXiv.
26
 
27
  ## Related Links
28
 
29
+ - **Paper:** https://arxiv.org/abs/2604.13517
30
+ - **Interactive Demo Space:** https://huggingface.co/spaces/ben-dlwlrma/Representation-Over-Routing-Demo
31
+ - **GitHub Repository:** https://github.com/ben-dlwlrma/Representation-Over-Routing
32
 
33
  ## Model Weights Overview
34
 
35
+ The repository provides four standalone `.pth` actor weight files:
36
+
37
+ - **`1_baseline.pth` (Baseline PPO):** single-horizon PPO reference policy.
38
+ - **`2_surrogate_hacking_attention.pth` (Differentiable Routing):** policy from the actor-side attention routing diagnostic.
39
+ - **`3_temporal_paradox_variance.pth` (Error-Based Routing):** policy from the gradient-free error-based routing diagnostic.
40
+ - **`4_target_decoupling_final.pth` (Target Decoupling):** policy trained with structural separation between the actor objective and temporal routing. The actor uses the long-horizon advantage, while auxiliary critic heads remain as regularizers during training.
41
 
42
+ Target Decoupling is described in the paper as a structural isolation principle in the `LunarLander-v2` PPO setting. The reported evidence concerns removal of the actor-side routing pathway and improved observed worst-seed return in the tested run set, not broad benchmark superiority.
 
 
 
43
 
44
+ ## Usage
45
 
46
+ For training scripts and selected diagnostic plots, see the [GitHub repository](https://github.com/ben-dlwlrma/Representation-Over-Routing). The manuscript itself is distributed through arXiv rather than duplicated as source files in the code or model repositories.
47
 
48
+ The published weights contain actor parameters and can be loaded into the same MLP actor architecture used by the training scripts:
49
 
50
  ```python
51
  import torch
 
54
  import gymnasium as gym
55
  from huggingface_hub import hf_hub_download
56
 
 
57
  weight_path = hf_hub_download(
58
+ repo_id="ben-dlwlrma/Representation-Over-Routing",
59
+ filename="4_target_decoupling_final.pth",
60
  )
61
 
 
62
  def layer_init(layer, std=np.sqrt(2), bias_const=0.0):
63
  nn.init.orthogonal_(layer.weight, std)
64
  nn.init.constant_(layer.bias, bias_const)
 
72
  layer_init(nn.Linear(64, 4), std=0.01),
73
  )
74
 
 
75
  actor.load_state_dict(torch.load(weight_path, weights_only=True))
76
  actor.eval()
77
 
 
78
  env = gym.make("LunarLander-v2")
79
  state, _ = env.reset()
80
  done = False
 
84
  with torch.no_grad():
85
  logits = actor(state_tensor)
86
  action = torch.argmax(logits, dim=1).item()
87
+
88
  state, reward, terminated, truncated, _ = env.step(action)
89
  done = terminated or truncated
90
  ```
91
 
92
+ The paper experiments were conducted on `LunarLander-v2`. The hosted demo may use `LunarLander-v3` for compatibility with current Gymnasium releases while preserving the same actor architecture and weight format.
93
 
94
  ## Citation
95
 
 
 
96
  ```bibtex
97
+ @misc{sunRepresentationRoutingDiagnosing2026,
98
+ title = {Representation over {{Routing}}: {{Diagnosing Temporal Routing Pathologies}} in {{Multi-Timescale PPO}}},
99
  shorttitle = {Representation over {{Routing}}},
100
  author = {Sun, Jing},
101
  year = 2026,
requirements.txt DELETED
@@ -1,5 +0,0 @@
1
- torch>=2.0.0
2
- numpy
3
- gymnasium[box2d]
4
- imageio
5
- tensorboard