nglebm19 commited on
Commit
0bf5137
Β·
unverified Β·
1 Parent(s): b27d4a6

Enhance README with detailed agent roles and installation

Browse files
Files changed (1) hide show
  1. README.md +25 -23
README.md CHANGED
@@ -6,26 +6,27 @@ A demonstration web application that shows how multiple AI agents can overcome d
6
 
7
  This demo showcases a three-agent system designed to simulate and overcome common diagnostic biases:
8
 
9
- 1. **Agent 1 (Diagnostician)**: Provides initial diagnosis (intentionally biased)
10
- 2. **Agent 2 (Devil's Advocate)**: Critiques and identifies bias
11
- 3. **Agent 3 (Synthesizer)**: Creates improved final diagnosis
12
 
13
  ## πŸš€ Key Features
14
 
15
  - **Multi-Agent Architecture**: Three specialized AI agents working in sequence
16
- - **Bias Simulation**: Hardcoded bias patterns for educational demonstration
 
17
  - **Interactive Web Interface**: Clean, intuitive Gradio-based UI
18
  - **Sample Medical Cases**: Pre-built cases demonstrating different bias types
19
  - **Custom Case Input**: Support for user-defined medical scenarios
20
- - **Educational Content**: Built-in learning points and bias analysis
21
 
22
  ## πŸ—οΈ Architecture
23
 
24
  ```
25
  User Input β†’ Agent 1 (Diagnostician) β†’ Agent 2 (Devil's Advocate) β†’ Agent 3 (Synthesizer) β†’ Final Output
26
  ↓ ↓ ↓
27
- Initial Diagnosis Bias Identification Balanced Synthesis
28
- (May be biased) (Challenges assumptions) (Improved diagnosis)
29
  ```
30
 
31
  ## πŸ“‹ Prerequisites
@@ -38,7 +39,7 @@ User Input β†’ Agent 1 (Diagnostician) β†’ Agent 2 (Devil's Advocate) β†’ Agent
38
 
39
  1. **Clone the repository:**
40
  ```bash
41
- git clone <repository-url>
42
  cd debias-llm
43
  ```
44
 
@@ -68,7 +69,7 @@ User Input β†’ Agent 1 (Diagnostician) β†’ Agent 2 (Devil's Advocate) β†’ Agent
68
 
69
  4. **Click "Run Analysis"** to see the three-agent process in action
70
 
71
- 5. **Review the results** to see how bias is identified and addressed
72
 
73
  ### Sample Cases
74
 
@@ -106,9 +107,9 @@ self.generator = pipeline(
106
  "text-generation",
107
  model=self.model,
108
  tokenizer=self.tokenizer,
109
- max_length=200, # Adjust for longer/shorter outputs
110
  do_sample=True,
111
- temperature=0.7, # Lower = more focused, Higher = more creative
112
  pad_token_id=self.tokenizer.eos_token_id
113
  )
114
  ```
@@ -144,20 +145,21 @@ The application can be deployed on:
144
 
145
  ## πŸ“Š Understanding the Output
146
 
147
- ### Agent 1: Initial Diagnosis
148
- - **Purpose**: Simulates a biased initial assessment
149
- - **Common Biases**: Anchoring, confirmation bias, overconfidence
150
- - **Output**: Initial diagnosis that may overlook important factors
151
 
152
- ### Agent 2: Devil's Advocate Critique
153
- - **Purpose**: Identifies and challenges biases
154
- - **Focus**: Assumption testing, alternative explanations
155
- - **Output**: Critical analysis highlighting potential errors
 
156
 
157
  ### Agent 3: Final Synthesis
158
- - **Purpose**: Creates balanced, improved diagnosis
159
- - **Approach**: Evidence-based synthesis
160
- - **Output**: Final diagnosis addressing identified biases
161
 
162
  ## 🧠 Bias Types Demonstrated
163
 
@@ -182,7 +184,7 @@ The application can be deployed on:
182
 
183
  3. **Performance Issues**
184
  - Use smaller models for faster inference
185
- - Reduce max_length parameter
186
  - Consider GPU acceleration if available
187
 
188
  ### Error Handling
 
6
 
7
  This demo showcases a three-agent system designed to simulate and overcome common diagnostic biases:
8
 
9
+ 1. **Agent 1 (Diagnostician)**: Provides initial diagnosis using all available information (HPI + PMH + Physical Exam)
10
+ 2. **Agent 2 (Independent Devil's Advocate)**: Diagnoses from symptoms and physical exam only, then evaluates overlap with past medical history
11
+ 3. **Agent 3 (Synthesizer)**: Combines both perspectives to create improved final diagnosis with impact analysis
12
 
13
  ## πŸš€ Key Features
14
 
15
  - **Multi-Agent Architecture**: Three specialized AI agents working in sequence
16
+ - **Bias Detection**: Agent 2 independently evaluates symptoms vs. past medical history
17
+ - **Overlap Scoring**: Qualitative assessment (High/Medium/Low) of current symptoms vs. past conditions
18
  - **Interactive Web Interface**: Clean, intuitive Gradio-based UI
19
  - **Sample Medical Cases**: Pre-built cases demonstrating different bias types
20
  - **Custom Case Input**: Support for user-defined medical scenarios
21
+ - **Real LLM Outputs**: All agents generate concrete diagnostic content using Hugging Face models
22
 
23
  ## πŸ—οΈ Architecture
24
 
25
  ```
26
  User Input β†’ Agent 1 (Diagnostician) β†’ Agent 2 (Devil's Advocate) β†’ Agent 3 (Synthesizer) β†’ Final Output
27
  ↓ ↓ ↓
28
+ Full-case Diagnosis Symptoms+Exam Dx + Balanced Synthesis +
29
+ (HPI + PMH + Exam) Overlap Score Impact Analysis
30
  ```
31
 
32
  ## πŸ“‹ Prerequisites
 
39
 
40
  1. **Clone the repository:**
41
  ```bash
42
+ git clone https://github.com/nglebm19/debias-llm.git
43
  cd debias-llm
44
  ```
45
 
 
69
 
70
  4. **Click "Run Analysis"** to see the three-agent process in action
71
 
72
+ 5. **Review the results** to see how each agent contributes to the final diagnosis
73
 
74
  ### Sample Cases
75
 
 
107
  "text-generation",
108
  model=self.model,
109
  tokenizer=self.tokenizer,
110
+ max_new_tokens=200, # Adjust for longer/shorter outputs
111
  do_sample=True,
112
+ temperature=0.7, # Lower = more focused, Higher = more creative
113
  pad_token_id=self.tokenizer.eos_token_id
114
  )
115
  ```
 
145
 
146
  ## πŸ“Š Understanding the Output
147
 
148
+ ### Agent 1: Full-Case Diagnosis
149
+ - **Purpose**: Comprehensive initial assessment using all available information
150
+ - **Input**: History of Present Illness + Past Medical History + Physical Examination
151
+ - **Output**: Initial diagnosis with clinical reasoning
152
 
153
+ ### Agent 2: Independent Devil's Advocate
154
+ - **Purpose**: Independent evaluation and overlap assessment
155
+ - **Phase 1**: Diagnosis based only on current symptoms and physical exam
156
+ - **Phase 2**: Overlap score (High/Medium/Low) with past medical history
157
+ - **Output**: Independent diagnosis + overlap score + rationale
158
 
159
  ### Agent 3: Final Synthesis
160
+ - **Purpose**: Combines both perspectives for balanced final assessment
161
+ - **Approach**: Evidence-based synthesis with impact analysis
162
+ - **Output**: Final diagnosis + differential + impact of past disease + next steps
163
 
164
  ## 🧠 Bias Types Demonstrated
165
 
 
184
 
185
  3. **Performance Issues**
186
  - Use smaller models for faster inference
187
+ - Reduce max_new_tokens parameter
188
  - Consider GPU acceleration if available
189
 
190
  ### Error Handling