Spaces:
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
Files changed (1) hide show
  1. README.md +55 -35
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: MIT](https://img.shields.io/badge/License-MIT-yellow)](LICENSE)
20
  [![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?logo=docker)](Dockerfile)
21
 
 
 
22
  </div>
23
 
24
  ---
25
 
26
- ## ⚑ The Problem
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
- When interacting with scheduling or task agents, users often give ambiguous instructions like *"Schedule a meeting ASAP with the team."* The AI usually faces two bad options:
29
- - **Guess** missing fields (time/participants) and execute incorrectly.
30
- - **Ask everything** and waste the user's time.
31
 
32
- Most AI agents do one or the other. **This environment trains them to do neither.**
 
 
 
33
 
34
  ---
35
 
@@ -44,30 +65,18 @@ It rewards **efficiency**, not just correctness.
44
 
45
  ---
46
 
47
- ## πŸ… Why This Stands Out
48
 
49
- > Most hackathon environments only reward **final correctness**. This environment evaluates **smart behavior throughout the episode**.
50
 
51
- - πŸ” **Ambiguity Handling**: Dynamically identifies missing inputs (time, participants, location).
52
- - πŸ›‘οΈ **Anti-Exploit Reward Design**: Spamming extra questions is strictly penalized (`-0.2`). Skipping necessary questions is heavily penalized (`-0.5`).
53
- - πŸ”„ **Multi-Step Reasoning**: Agents must iteratively build context using conversational memory across multiple steps.
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
- ### Action Space
68
- The model outputs strict JSON for one of two actions:
69
- - **`ask`**: `{ "type": "ask", "question": "..." }`
70
- - **`execute`**: `{ "type": "execute", "proposed_time": "...", "proposed_participants": ["..."] }`
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 completely stateless behind a high-performance **FastAPI server** driven inside a **Docker** container.
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 (*used exclusively for grading/debugging*). |
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: MIT](https://img.shields.io/badge/License-MIT-yellow)](LICENSE)
20
  [![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?logo=docker)](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