AIMS2025 commited on
Commit
cec248d
·
verified ·
1 Parent(s): 966c12b

Update README for DeepSignal_CyclePlan-4B usage

Browse files
Files changed (1) hide show
  1. README.md +67 -43
README.md CHANGED
@@ -7,62 +7,64 @@ tags:
7
  - llama.cpp
8
  - lmstudio
9
  - traffic-signal-control
 
10
  - simulation
11
  license: cc-by-nc-4.0
12
  ---
13
 
14
  # DeepSignal (GGUF)
15
 
16
- This repository provides GGUF model files for local inference (e.g., `llama.cpp` / LM Studio). It contains two models for traffic-signal-control tasks.
17
- For details, check our repository at [`AIMSLaboratory/DeepSignal`](https://github.com/AIMSLaboratory/DeepSignal).
18
 
19
  ## Models
20
 
21
- This repository contains two models:
22
 
23
- - **DeepSignal-Phase-4B-V1** next signal-phase prediction (predicts which phase to activate next and for how long)
24
- - **DeepSignal-CyclePlan-4B-V1** — signal-cycle timing optimization (outputs green-time allocations for every phase in the upcoming cycle)
25
 
26
  ## Model Files
27
 
28
- | Filename | Model | Quantization | Size | Description |
29
- |:---|:---:|:---:|:---:|:---|
30
- | `DeepSignal-Phase-4B_V1.F16.gguf` | Phase | F16 (full precision) | ~8 GB | Phase model, full precision |
31
- | `DeepSignal-CyclePlan-4B_V1.F16.gguf` | CyclePlan | F16 (full precision) | ~8 GB | CyclePlan model, full precision |
32
- | `DeepSignal-CyclePlan-4B_V1.Q4_K_M.gguf` | CyclePlan | Q4_K_M (4-bit quantized) | ~2.5 GB | CyclePlan model, quantized (recommended for local inference) |
 
33
 
34
- ## DeepSignal-Phase-4B-V1
35
-
36
- DeepSignal-Phase-4B-V1 is designed for **next signal-phase prediction**. Given the current traffic scene and state at an intersection, it predicts which signal phase to activate next and for how long.
37
-
38
- **Quickstart (llama.cpp):**
39
-
40
- ```bash
41
- llama-cli -m DeepSignal-Phase-4B_V1.F16.gguf -p "You are a traffic management expert. You can use your traffic knowledge to solve the traffic signal control task.
42
- Based on the given traffic scene and state, predict the next signal phase and its duration.
43
- You must answer directly, the format must be: next signal phase: {number}, duration: {seconds} seconds
44
- where the number is the phase index (starting from 0) and the seconds is the duration (usually between 20-90 seconds)."
45
- ```
46
-
47
- *You need to input the scene (total number of phases, which phases control which lanes/directions, and current phase ID/number, etc.) and state (number of queuing vehicles per lane, throughput vehicles per lane during the current phase, etc.)*
48
 
49
- ## DeepSignal-CyclePlan-4B-V1
50
 
51
- DeepSignal-CyclePlan-4B-V1 is designed for **signal-cycle timing optimization**. It takes predicted traffic state data for the upcoming cycle as input and outputs green-time allocations for every phase.
52
 
53
- **System Prompt:**
54
 
55
- ```
56
  You are a traffic signal timing optimization expert.
57
  Please carefully analyze the predicted traffic states for each phase in the next cycle, provide the timing plan for the next cycle, and give your reasoning process.
58
  Place the reasoning process between <start_working_out> and <end_working_out>.
59
  Then, place your final plan between <SOLUTION> and </SOLUTION>.
60
  ```
61
 
62
- **Quickstart (llama.cpp, Q4_K_M recommended for local inference):**
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
  ```bash
65
- llama-cli -m DeepSignal-CyclePlan-4B_V1.Q4_K_M.gguf \
 
 
66
  -p 'You are a traffic signal timing optimization expert.
67
  Please carefully analyze the predicted traffic states for each phase in the next cycle, provide the timing plan for the next cycle, and give your reasoning process.
68
  Place the reasoning process between <start_working_out> and <end_working_out>.
@@ -72,19 +74,45 @@ Then, place your final plan between <SOLUTION> and </SOLUTION>.
72
  "prediction": {
73
  "as_of": "2026-02-22T10:00:00",
74
  "phase_waits": [
75
- {"phase_id": 0, "pred_saturation": 0.8, "min_green": 20, "max_green": 60, "capacity": 100},
76
- {"phase_id": 1, "pred_saturation": 0.5, "min_green": 15, "max_green": 45, "capacity": 80}
 
77
  ]
78
  }
79
  }【/cycle_predict_input_json】
80
 
81
  Task (must complete):
82
- Mainly based on prediction.phase_waits pred_saturation (already calculated), output the final green light time for each phase in the next cycle (unit: seconds), while satisfying hard constraints.'
 
 
 
 
 
 
 
 
 
 
 
 
83
  ```
84
 
85
- **Input format**: JSON wrapped in `【cycle_predict_input_json】...【/cycle_predict_input_json】` tags, containing `prediction.phase_waits` — an array of per-phase objects with `phase_id`, `pred_saturation`, `min_green`, `max_green`, and `capacity`. Here `pred_saturation = pred_wait / capacity`, where `pred_wait` is the predicted number of waiting vehicles for this phase in the next cycle, which can be computed using forecasting models (e.g., LSTM, TCN) based on historical traffic data.
 
 
 
 
 
 
 
 
86
 
87
- **Output format**: A JSON array of objects `[{"phase_id": <int>, "final": <int>}, ...]`, where `final` is the allocated green time in integer seconds for each phase.
 
 
 
 
 
88
 
89
  ## Evaluation (Traffic Simulation)
90
 
@@ -99,19 +127,17 @@ Mainly based on prediction.phase_waits pred_saturation (already calculated), out
99
  | Max Pressure | 0.465 | 23.022 | 77.236 | ** |
100
  | [`LightGPT-8B-Llama3`](https://huggingface.co/lightgpt/LightGPT-8B-Llama3) | 0.523 | 54.384 | 75.512 | 3.025*** |
101
 
102
- `*`: Each simulation scenario runs for 60 minutes. We discard the first **5 minutes** as warm-up, then compute metrics over the next **20 minutes** (minute 5 to 25). We cap the evaluation window because, when an LLM controls signal timing for only a single intersection, spillback from neighboring intersections may occur after ~20+ minutes and destabilize the scenario. All evaluations are conducted on a **Mac Studio M3 Ultra**.
103
- `**`: Max Pressure is a fixed signal-timing optimization algorithm (not an LLM), so we omit its Avg Response Time; this metric is only defined for LLM-based signal-timing optimization.
104
  `***`: For LightGPT-8B-Llama3, Avg Response Time is computed using only the successful responses.
105
 
106
- **Conclusion**: Among thinking-enabled models, **DeepSignal-Phase-4B** achieves the highest throughput (79.883 veh/5min) with a response time of only 2.131s. GPT-OSS-20B achieves the best saturation (0.380) but with higher response latency (6.768s).
107
-
108
  ### Performance Metrics Comparison by Model (CyclePlan) *
109
 
110
  | Model | Format Success Rate (%) | Avg Queue Vehicles | Avg Delay per Vehicle (s) | Throughput (veh/min) | Avg Response Time (s) |
111
  |:---:|:---:|:---:|:---:|:---:|:---:|
112
- | **DeepSignal-CyclePlan-4B-V1 F16 (thinking, Ours)** | **100.0** | **3.504** | **27.747** | **8.611** | 4.351 |
113
  | [`GLM-4.7-Flash (thinking)`](https://huggingface.co/zai-org/glm-4.7-flash) | 100.0 | 7.323 | 29.422 | 8.567 | 36.388 |
114
- | DeepSignal-CyclePlan-4B-V1 Q4_K_M (thinking, Ours) | 98.1 | 4.783 | 29.891 | 7.722 | 1.674 |
115
  | [`Qwen3-30B-A3B`](https://huggingface.co/Qwen/Qwen3-30B-A3B-2507) | 97.1 | 6.938 | 31.135 | 7.578 | 7.885 |
116
  | [`LightGPT-8B-Llama3`](https://huggingface.co/lightgpt/LightGPT-8B-Llama3) | 68.0 | 5.026 | 31.266 | 7.380 | 167.373 |
117
  | [`GPT-OSS-20B (thinking)`](https://huggingface.co/openai/gpt-oss-20b) | 65.4 | 6.289 | 31.947 | 7.247 | 4.919 |
@@ -119,8 +145,6 @@ Mainly based on prediction.phase_waits pred_saturation (already calculated), out
119
 
120
  `*`: Each simulation scenario runs for 60 minutes. We discard the first **5 minutes** as warm-up, then compute metrics over the next **20 minutes** (minute 5 to 25). All evaluations are conducted on a **Mac Studio M3 Ultra**.
121
 
122
- **Conclusion**: DeepSignal-CyclePlan-4B-V1 (F16) achieves a 100% format success rate, the lowest average queue vehicles (3.504), and the highest throughput (8.611 veh/min) among all evaluated models. The Q4_K_M quantized version maintains strong performance with 98.1% format success rate while offering the fastest response time (1.674s).
123
-
124
  ## License
125
 
126
  This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0).
 
7
  - llama.cpp
8
  - lmstudio
9
  - traffic-signal-control
10
+ - traffic-optimization
11
  - simulation
12
  license: cc-by-nc-4.0
13
  ---
14
 
15
  # DeepSignal (GGUF)
16
 
17
+ This repository provides GGUF checkpoints for local inference with traffic-signal-control models from [`AIMSLaboratory/DeepSignal`](https://github.com/AIMSLaboratory/DeepSignal).
 
18
 
19
  ## Models
20
 
21
+ This repository currently contains:
22
 
23
+ - **DeepSignal-Phase-4B-V1**: next signal-phase prediction
24
+ - **DeepSignal_CyclePlan-4B**: cycle-level green-time allocation for all phases in the upcoming signal cycle
25
 
26
  ## Model Files
27
 
28
+ | Filename | Task | Quantization | Size | Notes |
29
+ |:---|:---|:---:|:---:|:---|
30
+ | `DeepSignal-Phase-4B_V1.F16.gguf` | Phase prediction | F16 | ~8 GB | Existing phase model |
31
+ | `DeepSignal_CyclePlan-4B-F16.gguf` | Cycle planning | F16 | ~7.5 GB | Highest-fidelity CyclePlan checkpoint |
32
+ | `DeepSignal_CyclePlan-4B-Q8_0.gguf` | Cycle planning | Q8_0 | ~4.0 GB | Balanced quality / speed |
33
+ | `DeepSignal_CyclePlan-4B-Q4_K_M.gguf` | Cycle planning | Q4_K_M | ~2.4 GB | Recommended for local inference |
34
 
35
+ ## DeepSignal_CyclePlan-4B
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
+ `DeepSignal_CyclePlan-4B` is a traffic signal **cycle planning** model. It takes the predicted traffic state for the next cycle and outputs the green-time allocation for each phase while respecting phase-specific minimum and maximum green constraints.
38
 
39
+ ### Recommended Prompt Format
40
 
41
+ **System prompt**
42
 
43
+ ```text
44
  You are a traffic signal timing optimization expert.
45
  Please carefully analyze the predicted traffic states for each phase in the next cycle, provide the timing plan for the next cycle, and give your reasoning process.
46
  Place the reasoning process between <start_working_out> and <end_working_out>.
47
  Then, place your final plan between <SOLUTION> and </SOLUTION>.
48
  ```
49
 
50
+ **Input JSON format**
51
+
52
+ Wrap the input with `【cycle_predict_input_json】...【/cycle_predict_input_json】` tags. The core field is `prediction.phase_waits`, an array of per-phase objects:
53
+
54
+ - `phase_id`: phase index
55
+ - `pred_saturation`: predicted saturation for the next cycle
56
+ - `min_green`: minimum allowed green time in seconds
57
+ - `max_green`: maximum allowed green time in seconds
58
+ - `capacity`: reference capacity used to compute `pred_saturation`
59
+
60
+ ### Quickstart with llama.cpp
61
+
62
+ `Q4_K_M` is the recommended local default:
63
 
64
  ```bash
65
+ llama-cli -m DeepSignal_CyclePlan-4B-Q4_K_M.gguf \
66
+ --ctx-size 8192 \
67
+ --temp 0.2 \
68
  -p 'You are a traffic signal timing optimization expert.
69
  Please carefully analyze the predicted traffic states for each phase in the next cycle, provide the timing plan for the next cycle, and give your reasoning process.
70
  Place the reasoning process between <start_working_out> and <end_working_out>.
 
74
  "prediction": {
75
  "as_of": "2026-02-22T10:00:00",
76
  "phase_waits": [
77
+ {"phase_id": 0, "pred_saturation": 0.80, "min_green": 20, "max_green": 60, "capacity": 100},
78
+ {"phase_id": 1, "pred_saturation": 0.55, "min_green": 15, "max_green": 45, "capacity": 80},
79
+ {"phase_id": 2, "pred_saturation": 0.42, "min_green": 15, "max_green": 35, "capacity": 70}
80
  ]
81
  }
82
  }【/cycle_predict_input_json】
83
 
84
  Task (must complete):
85
+ Mainly based on prediction.phase_waits pred_saturation, output the final green-light time for each phase in the next cycle (unit: seconds) while satisfying all hard constraints.'
86
+ ```
87
+
88
+ ### Expected Output
89
+
90
+ The final answer should contain a machine-readable plan inside `<SOLUTION>...</SOLUTION>`, for example:
91
+
92
+ ```json
93
+ [
94
+ {"phase_id": 0, "final": 31},
95
+ {"phase_id": 1, "final": 24},
96
+ {"phase_id": 2, "final": 18}
97
+ ]
98
  ```
99
 
100
+ ### Download Example
101
+
102
+ ```bash
103
+ huggingface-cli download AIMS2025/DeepSignal DeepSignal_CyclePlan-4B-Q4_K_M.gguf --local-dir .
104
+ ```
105
+
106
+ ## DeepSignal-Phase-4B-V1
107
+
108
+ DeepSignal-Phase-4B-V1 is designed for **next signal-phase prediction**. Given the current traffic scene and state at an intersection, it predicts which signal phase to activate next and for how long.
109
 
110
+ ```bash
111
+ llama-cli -m DeepSignal-Phase-4B_V1.F16.gguf -p "You are a traffic management expert. You can use your traffic knowledge to solve the traffic signal control task.
112
+ Based on the given traffic scene and state, predict the next signal phase and its duration.
113
+ You must answer directly, the format must be: next signal phase: {number}, duration: {seconds} seconds
114
+ where the number is the phase index (starting from 0) and the seconds is the duration (usually between 20-90 seconds)."
115
+ ```
116
 
117
  ## Evaluation (Traffic Simulation)
118
 
 
127
  | Max Pressure | 0.465 | 23.022 | 77.236 | ** |
128
  | [`LightGPT-8B-Llama3`](https://huggingface.co/lightgpt/LightGPT-8B-Llama3) | 0.523 | 54.384 | 75.512 | 3.025*** |
129
 
130
+ `*`: Each simulation scenario runs for 60 minutes. We discard the first **5 minutes** as warm-up, then compute metrics over the next **20 minutes** (minute 5 to 25). We cap the evaluation window because, when an LLM controls signal timing for only a single intersection, spillback from neighboring intersections may occur after ~20+ minutes and destabilize the scenario. All evaluations are conducted on a **Mac Studio M3 Ultra**.
131
+ `**`: Max Pressure is a fixed signal-timing optimization algorithm (not an LLM), so we omit its Avg Response Time; this metric is only defined for LLM-based signal-timing optimization.
132
  `***`: For LightGPT-8B-Llama3, Avg Response Time is computed using only the successful responses.
133
 
 
 
134
  ### Performance Metrics Comparison by Model (CyclePlan) *
135
 
136
  | Model | Format Success Rate (%) | Avg Queue Vehicles | Avg Delay per Vehicle (s) | Throughput (veh/min) | Avg Response Time (s) |
137
  |:---:|:---:|:---:|:---:|:---:|:---:|
138
+ | **DeepSignal_CyclePlan-4B F16 (thinking, Ours)** | **100.0** | **3.504** | **27.747** | **8.611** | 4.351 |
139
  | [`GLM-4.7-Flash (thinking)`](https://huggingface.co/zai-org/glm-4.7-flash) | 100.0 | 7.323 | 29.422 | 8.567 | 36.388 |
140
+ | DeepSignal_CyclePlan-4B Q4_K_M (thinking, Ours) | 98.1 | 4.783 | 29.891 | 7.722 | 1.674 |
141
  | [`Qwen3-30B-A3B`](https://huggingface.co/Qwen/Qwen3-30B-A3B-2507) | 97.1 | 6.938 | 31.135 | 7.578 | 7.885 |
142
  | [`LightGPT-8B-Llama3`](https://huggingface.co/lightgpt/LightGPT-8B-Llama3) | 68.0 | 5.026 | 31.266 | 7.380 | 167.373 |
143
  | [`GPT-OSS-20B (thinking)`](https://huggingface.co/openai/gpt-oss-20b) | 65.4 | 6.289 | 31.947 | 7.247 | 4.919 |
 
145
 
146
  `*`: Each simulation scenario runs for 60 minutes. We discard the first **5 minutes** as warm-up, then compute metrics over the next **20 minutes** (minute 5 to 25). All evaluations are conducted on a **Mac Studio M3 Ultra**.
147
 
 
 
148
  ## License
149
 
150
  This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0).