RohitChandramouli6618 commited on
Commit
3e4a196
·
1 Parent(s): 0092607

Cut easy rollouts 3→2 to stay under 20min; update GRPO scores; fill config/tasks.yaml

Browse files
baseline/evaluator.py CHANGED
@@ -12,7 +12,7 @@ from core.policy_update import compute_advantage, update_memory
12
  import requests as http_requests
13
 
14
  N_ROLLOUTS = {
15
- "easy": 3,
16
  "medium": 4,
17
  "hard": 4,
18
  }
 
12
  import requests as http_requests
13
 
14
  N_ROLLOUTS = {
15
+ "easy": 2,
16
  "medium": 4,
17
  "hard": 4,
18
  }
config/tasks.yaml CHANGED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # config/tasks.yaml
2
+ # Task configuration reference for Cascade Containment.
3
+ # These values are the source of truth used in server/constants.py TASK_CONFIG.
4
+ # If you change a value here, update constants.py to match.
5
+
6
+ tasks:
7
+
8
+ easy:
9
+ num_districts: 2
10
+ max_steps: 10
11
+ resource_pool: 10
12
+ data_lag_days: 0
13
+ seed_infections: [0.06, 0.50]
14
+ description: >
15
+ Single outbreak. D1 starts in the danger zone, D0 is clean.
16
+ Agents that ignore infection data and always target D0 score ~43%
17
+ with a 60% hospital breach rate — the task requires basic observation.
18
+
19
+ medium:
20
+ num_districts: 4
21
+ max_steps: 15
22
+ resource_pool: 8
23
+ data_lag_days: 0
24
+ seed_infections: [0.42, 0.10, 0.38, 0.10]
25
+ description: >
26
+ Two simultaneous outbreaks in D0 and D2. D1 and D3 start low but
27
+ grow into the danger zone within 4-6 steps via spillover.
28
+ 8 resources across 4 districts over 15 steps requires real triage —
29
+ the agent cannot cover all districts at once.
30
+
31
+ hard:
32
+ num_districts: 6
33
+ max_steps: 15
34
+ resource_pool: 7
35
+ data_lag_days: 3
36
+ seed_infections: [0.20, 0.14, 0.23, 0.11, 0.26, 0.17]
37
+ description: >
38
+ Six growing outbreaks with a 3-day reporting lag. The agent sees
39
+ infection rates from 3 days ago; true infection is already higher.
40
+ Growth hints provide a noisy estimate of current trajectory.
41
+ 7 resources for 6 districts under structural uncertainty is the
42
+ hardest triage scenario in the benchmark.
43
+
44
+ # Spread model parameters
45
+ spread:
46
+ rate_min: 0.03 # minimum spread rate per district per day
47
+ rate_max: 0.08 # maximum spread rate per district per day
48
+ natural_recovery: 0.01 # passive case resolution per day (no intervention)
49
+ treatment_reduction: 0.05 # allocate reduces existing infection by this
50
+ allocate_reduction: 0.10 # allocate suppresses future spread rate this step
51
+ restrict_reduction: 0.05 # restrict reduces spread rate while active
52
+ spillover_rate: 0.01 # infection bleed to adjacent districts each step
53
+ growth_hint_noise: 0.03 # noise added to spread rate in agent observation
54
+
55
+ # Threshold values
56
+ thresholds:
57
+ infection_danger: 0.40 # above this a district is in the danger zone
58
+ infection_safe: 0.20 # below this a district is considered contained
59
+ hospital_breach: 0.10 # at or below this triggers episode failure
60
+
61
+ # Reward terms
62
+ rewards:
63
+ infection_penalty: -0.50 # per district above infection_danger, weighted by density
64
+ hospital_breach: -1.00 # per district at or below hospital_breach threshold
65
+ early_containment: +0.50 # per district below infection_safe (decays over time)
66
+ unnecessary_restriction: -0.20 # restricting a district already below infection_safe
67
+ correct_prioritisation: +0.30 # allocating to the highest-infected district
68
+
69
+ # Grader weights (must sum to 1.0)
70
+ grader:
71
+ containment: 0.30
72
+ hospital: 0.45
73
+ efficiency: 0.15
74
+ speed: 0.10
75
+
76
+ # Baseline benchmark results (update after each full evaluation run)
77
+ benchmark:
78
+ rollouts:
79
+ easy: 2
80
+ medium: 4
81
+ hard: 4
82
+ greedy_d0:
83
+ easy: {score: 0.428, breach_rate: 0.60}
84
+ medium: {score: 0.427, breach_rate: 0.80}
85
+ hard: {score: 0.330, breach_rate: 1.00}
86
+ llm_grpo:
87
+ easy: {score: 0.885, model: llama-3.1-8b-instant}
88
+ medium: {score: 0.754, model: llama-3.1-8b-instant}
89
+ hard: {score: 0.631, model: llama-3.1-8b-instant}
90
+ average: 0.757
91
+ runtime_seconds: 1229
inference.py CHANGED
@@ -20,7 +20,7 @@ ENV_BASE_URL = os.getenv("ENV_BASE_URL", "http://localhost:7860")
20
  BENCHMARK = "cascade-containment"
21
 
22
  N_ROLLOUTS = {
23
- "easy": 3,
24
  "medium": 4,
25
  "hard": 4,
26
  }
 
20
  BENCHMARK = "cascade-containment"
21
 
22
  N_ROLLOUTS = {
23
+ "easy": 2,
24
  "medium": 4,
25
  "hard": 4,
26
  }
scripts/test_local.py CHANGED
@@ -10,9 +10,9 @@ from server.grader import grade_trajectory
10
 
11
  # LLM+GRPO reference scores — update this dict after each baseline/run.py session.
12
  GRPO_SCORES = {
13
- "easy": {"score": 0.9083, "containment": 1.000, "hospital": 0.999, "efficiency": 0.857},
14
- "medium": {"score": 0.7161, "containment": 0.423, "hospital": 0.976, "efficiency": 1.000},
15
- "hard": {"score": 0.6608, "containment": 0.513, "hospital": 0.971, "efficiency": 0.467},
16
  }
17
 
18
 
 
10
 
11
  # LLM+GRPO reference scores — update this dict after each baseline/run.py session.
12
  GRPO_SCORES = {
13
+ "easy": {"score": 0.8848, "containment": 1.000, "hospital": 0.996, "efficiency": 0.900},
14
+ "medium": {"score": 0.7539, "containment": 0.469, "hospital": 0.978, "efficiency": 0.987},
15
+ "hard": {"score": 0.6311, "containment": 0.462, "hospital": 0.952, "efficiency": 0.533},
16
  }
17
 
18