Spaces:
Sleeping
Sleeping
Yaser77 commited on
Commit Β·
5cc6cb5
1
Parent(s): e9670be
docs: final polish with 30s demo, hook line, real-world utility, and anti-exploit details
Browse files
README.md
CHANGED
|
@@ -10,7 +10,7 @@ license: mit
|
|
| 10 |
|
| 11 |
<div align="center">
|
| 12 |
|
| 13 |
-
# π§ Ambiguity Resolution Environment
|
| 14 |
|
| 15 |
### *Teaching AI agents to ask the right question β not every question.*
|
| 16 |
|
|
@@ -19,17 +19,38 @@ license: mit
|
|
| 19 |
[](LICENSE)
|
| 20 |
[](Dockerfile)
|
| 21 |
|
|
|
|
|
|
|
| 22 |
</div>
|
| 23 |
|
| 24 |
---
|
| 25 |
|
| 26 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
-
|
| 29 |
-
- **Guess** missing fields (time/participants) and execute incorrectly.
|
| 30 |
-
- **Ask everything** and waste the user's time.
|
| 31 |
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
---
|
| 35 |
|
|
@@ -44,30 +65,18 @@ It rewards **efficiency**, not just correctness.
|
|
| 44 |
|
| 45 |
---
|
| 46 |
|
| 47 |
-
##
|
| 48 |
|
| 49 |
-
|
| 50 |
|
| 51 |
-
-
|
| 52 |
-
-
|
| 53 |
-
-
|
| 54 |
-
- π **Deterministic Grading**: 100% reproducible baseline. Same input always maps to the exact same score without randomness.
|
| 55 |
-
|
| 56 |
-
---
|
| 57 |
-
|
| 58 |
-
## π§© Spaces
|
| 59 |
-
|
| 60 |
-
### Observation Space
|
| 61 |
-
At each step, the model observes its operational context:
|
| 62 |
-
- `instruction`: Original user task (e.g., *"Schedule a meeting..."*).
|
| 63 |
-
- `known_info`: Dictionary of collected facts so far (e.g., `{"time": "10 AM"}`).
|
| 64 |
-
- `conversation_history`: List of prior interactions to maintain contextual memory.
|
| 65 |
-
- `last_response`: Outcome of the previous clarification request.
|
| 66 |
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
-
|
| 70 |
-
-
|
| 71 |
|
| 72 |
---
|
| 73 |
|
|
@@ -75,12 +84,7 @@ The model outputs strict JSON for one of two actions:
|
|
| 75 |
|
| 76 |
The baseline agent achieves an average score of **0.53** across tasks.
|
| 77 |
|
| 78 |
-
This reflects the inherent difficulty of ambiguity resolution, where agents must
|
| 79 |
-
- identify missing information
|
| 80 |
-
- ask relevant clarifying questions
|
| 81 |
-
- avoid unnecessary actions
|
| 82 |
-
|
| 83 |
-
Higher performance requires multi-step reasoning and efficient information gathering.
|
| 84 |
|
| 85 |
### Per-Task Breakdown (Clear Difficulty Progression π)
|
| 86 |
|
|
@@ -95,6 +99,22 @@ Higher performance requires multi-step reasoning and efficient information gathe
|
|
| 95 |
|
| 96 |
---
|
| 97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
## π€ Model & Architecture
|
| 99 |
|
| 100 |
This project natively utilizes an **OpenAI-compatible client routed via Hugging Face Inference Endpoints.**
|
|
@@ -102,7 +122,7 @@ This project natively utilizes an **OpenAI-compatible client routed via Hugging
|
|
| 102 |
- **Model Used**: `Qwen/Qwen2.5-72B-Instruct`
|
| 103 |
- **Routing**: Passed through `https://router.huggingface.co/v1` for fast iterations.
|
| 104 |
- **Determinism**: Enforced `temperature=0.0`. Graceful JSON parsing fallbacks actively prevent pipeline crashes.
|
| 105 |
-
- **Containerized**: Wrapped and
|
| 106 |
|
| 107 |
---
|
| 108 |
|
|
@@ -114,7 +134,7 @@ This project natively utilizes an **OpenAI-compatible client routed via Hugging
|
|
| 114 |
|----------|--------|-------------|
|
| 115 |
| `/reset` | `POST` | Initialize the environment & state logic for a target task. |
|
| 116 |
| `/step` | `POST` | Submit an `ask` or `execute` action. Returns observation and reward. |
|
| 117 |
-
| `/state` | `GET` | Retrieve hidden ground truth contexts (*
|
| 118 |
|
| 119 |
### Quick Test
|
| 120 |
```bash
|
|
|
|
| 10 |
|
| 11 |
<div align="center">
|
| 12 |
|
| 13 |
+
# π§ Ambiguity Resolution Environment for Agentic Systems
|
| 14 |
|
| 15 |
### *Teaching AI agents to ask the right question β not every question.*
|
| 16 |
|
|
|
|
| 19 |
[](LICENSE)
|
| 20 |
[](Dockerfile)
|
| 21 |
|
| 22 |
+
> *Most AI systems fail not because they lack knowledge β but because they act on incomplete information.*
|
| 23 |
+
|
| 24 |
</div>
|
| 25 |
|
| 26 |
---
|
| 27 |
|
| 28 |
+
## π Quick Demo (30s)
|
| 29 |
+
|
| 30 |
+
**Instruction:** `"Schedule meeting ASAP with the team"`
|
| 31 |
+
|
| 32 |
+
- **Step 1** β Agent asks: `"What time should I schedule?"`
|
| 33 |
+
- **Step 2** β Environment responds: `"10 AM"`
|
| 34 |
+
|
| 35 |
+
- **Step 3** β Agent asks: `"Who are the participants?"`
|
| 36 |
+
- **Step 4** β Environment responds: `"Team A"`
|
| 37 |
+
|
| 38 |
+
- **Step 5** β Agent executes scheduling (`time="10 AM", participants=["Team A"]`)
|
| 39 |
+
|
| 40 |
+
β
**Final Score:** `1.00`
|
| 41 |
+
|
| 42 |
+
> *This demonstrates ambiguity detection, multi-step reasoning, and efficient information gathering.*
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
## π Why This Matters
|
| 47 |
|
| 48 |
+
Real-world AI systems frequently operate under incomplete or ambiguous instructions (e.g. *"Email the report"* β which report? to who?).
|
|
|
|
|
|
|
| 49 |
|
| 50 |
+
This environment isolates and evaluates agents on their ability to resolve ambiguity, enabling:
|
| 51 |
+
- safer AI decision-making
|
| 52 |
+
- better human-AI collaboration
|
| 53 |
+
- precise evaluation of reasoning under uncertainty
|
| 54 |
|
| 55 |
---
|
| 56 |
|
|
|
|
| 65 |
|
| 66 |
---
|
| 67 |
|
| 68 |
+
## π‘οΈ Robust Evaluation Design
|
| 69 |
|
| 70 |
+
Most hackathon environments only evaluate final correctness. This environment's design evaluates smart behavior and prevents common agent exploits:
|
| 71 |
|
| 72 |
+
- β **Reward farming** via repeated questions
|
| 73 |
+
- β **Guessing** without clarification
|
| 74 |
+
- β **Infinite loops**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
+
β
**Enforced via:**
|
| 77 |
+
- strict question limits (`MAX_QUESTIONS = 3`)
|
| 78 |
+
- penalty-based reward shaping (`-0.5` for blind guessing, `-0.2` for over-asking)
|
| 79 |
+
- 100% deterministic grading
|
| 80 |
|
| 81 |
---
|
| 82 |
|
|
|
|
| 84 |
|
| 85 |
The baseline agent achieves an average score of **0.53** across tasks.
|
| 86 |
|
| 87 |
+
This reflects the inherent difficulty of ambiguity resolution, where agents must identify missing information, ask relevant questions, and entirely avoid unnecessary actions. Higher performance requires robust multi-step reasoning.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
### Per-Task Breakdown (Clear Difficulty Progression π)
|
| 90 |
|
|
|
|
| 99 |
|
| 100 |
---
|
| 101 |
|
| 102 |
+
## π§© Spaces
|
| 103 |
+
|
| 104 |
+
### Observation Space
|
| 105 |
+
At each step, the model observes its operational context:
|
| 106 |
+
- `instruction`: Original user task.
|
| 107 |
+
- `known_info`: Dictionary of collected facts so far (e.g., `{"time": "10 AM"}`).
|
| 108 |
+
- `conversation_history`: List of prior interactions to maintain contextual memory.
|
| 109 |
+
- `last_response`: Outcome of the previous clarification request.
|
| 110 |
+
|
| 111 |
+
### Action Space
|
| 112 |
+
The model outputs strict JSON for one of two actions:
|
| 113 |
+
- **`ask`**: `{ "type": "ask", "question": "..." }`
|
| 114 |
+
- **`execute`**: `{ "type": "execute", "proposed_time": "...", "proposed_participants": ["..."] }`
|
| 115 |
+
|
| 116 |
+
---
|
| 117 |
+
|
| 118 |
## π€ Model & Architecture
|
| 119 |
|
| 120 |
This project natively utilizes an **OpenAI-compatible client routed via Hugging Face Inference Endpoints.**
|
|
|
|
| 122 |
- **Model Used**: `Qwen/Qwen2.5-72B-Instruct`
|
| 123 |
- **Routing**: Passed through `https://router.huggingface.co/v1` for fast iterations.
|
| 124 |
- **Determinism**: Enforced `temperature=0.0`. Graceful JSON parsing fallbacks actively prevent pipeline crashes.
|
| 125 |
+
- **Containerized**: Wrapped and stateless behind a high-performance **FastAPI server** driven inside a **Docker** container.
|
| 126 |
|
| 127 |
---
|
| 128 |
|
|
|
|
| 134 |
|----------|--------|-------------|
|
| 135 |
| `/reset` | `POST` | Initialize the environment & state logic for a target task. |
|
| 136 |
| `/step` | `POST` | Submit an `ask` or `execute` action. Returns observation and reward. |
|
| 137 |
+
| `/state` | `GET` | Retrieve hidden ground truth contexts (*for grading/debugging*). |
|
| 138 |
|
| 139 |
### Quick Test
|
| 140 |
```bash
|