Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- README.md +4 -1
- server/rewards.py +5 -3
README.md
CHANGED
|
@@ -39,7 +39,7 @@ step(violation_report) β Correct? +1.0 | False positive? -0.3 | Duplicate? -0.
|
|
| 39 |
step(DONE) β Episode ends with completeness bonus
|
| 40 |
```
|
| 41 |
|
| 42 |
-
## Tasks (
|
| 43 |
|
| 44 |
| Task | Difficulty | Violations | Max Steps | What the Agent Must Find |
|
| 45 |
|------|-----------|------------|-----------|--------------------------|
|
|
@@ -47,6 +47,7 @@ step(DONE) β Episode ends with completeness bonus
|
|
| 47 |
| `validate_nested_objects` | Medium | 7 | 15 | Violations inside nested objects and arrays β requires traversing deep structures |
|
| 48 |
| `detect_breaking_changes` | Hard | 9 | 20 | Breaking changes between two API spec versions β type changes, removed fields, narrowed enums, new requirements |
|
| 49 |
| `validate_response_schema` | Expert | 10 | 25 | Subtle format errors in an API response: invalid date formats, pattern mismatches, out-of-range numerics, and bad enum values scattered across nested objects and arrays |
|
|
|
|
| 50 |
|
| 51 |
### Randomised Episode Generation
|
| 52 |
|
|
@@ -149,6 +150,8 @@ openenv validate
|
|
| 149 |
| `find_type_mismatches` | Qwen2.5-72B-Instruct | ~0.75 | 5β7 |
|
| 150 |
| `validate_nested_objects` | Qwen2.5-72B-Instruct | ~0.57 | 8β12 |
|
| 151 |
| `detect_breaking_changes` | Qwen2.5-72B-Instruct | ~0.44 | 12β18 |
|
|
|
|
|
|
|
| 152 |
|
| 153 |
*Scores are approximate and may vary with temperature/sampling.*
|
| 154 |
|
|
|
|
| 39 |
step(DONE) β Episode ends with completeness bonus
|
| 40 |
```
|
| 41 |
|
| 42 |
+
## Tasks (5 difficulty levels)
|
| 43 |
|
| 44 |
| Task | Difficulty | Violations | Max Steps | What the Agent Must Find |
|
| 45 |
|------|-----------|------------|-----------|--------------------------|
|
|
|
|
| 47 |
| `validate_nested_objects` | Medium | 7 | 15 | Violations inside nested objects and arrays β requires traversing deep structures |
|
| 48 |
| `detect_breaking_changes` | Hard | 9 | 20 | Breaking changes between two API spec versions β type changes, removed fields, narrowed enums, new requirements |
|
| 49 |
| `validate_response_schema` | Expert | 10 | 25 | Subtle format errors in an API response: invalid date formats, pattern mismatches, out-of-range numerics, and bad enum values scattered across nested objects and arrays |
|
| 50 |
+
| `validate_cross_field_constraints` | Expert | 7 | 18 | Cross-field arithmetic and date ordering constraints on Invoice API β due_date must be after invoice_date, line totals, subtotal sum, tax calculation, discount rules for trial accounts |
|
| 51 |
|
| 52 |
### Randomised Episode Generation
|
| 53 |
|
|
|
|
| 150 |
| `find_type_mismatches` | Qwen2.5-72B-Instruct | ~0.75 | 5β7 |
|
| 151 |
| `validate_nested_objects` | Qwen2.5-72B-Instruct | ~0.57 | 8β12 |
|
| 152 |
| `detect_breaking_changes` | Qwen2.5-72B-Instruct | ~0.44 | 12β18 |
|
| 153 |
+
| `validate_response_schema` | Qwen2.5-72B-Instruct | ~0.40 | 15β22 |
|
| 154 |
+
| `validate_cross_field_constraints` | Qwen2.5-72B-Instruct | ~0.43 | 10β16 |
|
| 155 |
|
| 156 |
*Scores are approximate and may vary with temperature/sampling.*
|
| 157 |
|
server/rewards.py
CHANGED
|
@@ -161,8 +161,10 @@ def compute_step_reward(
|
|
| 161 |
def compute_episode_score(correct_count: int, total_violations: int) -> float:
|
| 162 |
"""Compute the final normalised score for the episode.
|
| 163 |
|
| 164 |
-
Returns a float in ``
|
|
|
|
| 165 |
"""
|
| 166 |
if total_violations == 0:
|
| 167 |
-
return
|
| 168 |
-
|
|
|
|
|
|
| 161 |
def compute_episode_score(correct_count: int, total_violations: int) -> float:
|
| 162 |
"""Compute the final normalised score for the episode.
|
| 163 |
|
| 164 |
+
Returns a float strictly in ``(0.0, 1.0)`` β endpoints excluded β as
|
| 165 |
+
required by the OpenEnv evaluation pipeline.
|
| 166 |
"""
|
| 167 |
if total_violations == 0:
|
| 168 |
+
return 0.5
|
| 169 |
+
raw = correct_count / total_violations
|
| 170 |
+
return round(max(0.0001, min(0.9999, raw)), 4)
|