| # π AISHA RL Training Package - START HERE |
|
|
| Welcome! This is your entry point to the complete AISHA RL training package. |
|
|
| --- |
|
|
| ## β‘ Quick Decision Tree |
|
|
| ### I want to train in Google Colab (Recommended) |
| β **Go to**: [QUICK_START.md](QUICK_START.md) |
| β **Then use**: [AISHA_RL_Training_Colab.ipynb](AISHA_RL_Training_Colab.ipynb) |
| β **Time**: ~10 minutes |
|
|
| ### I want to train locally on my machine |
| β **Go to**: [QUICK_START.md](QUICK_START.md) |
| β **Then use**: [aisha_rl_training.py](aisha_rl_training.py) |
| β **Time**: ~15 minutes |
|
|
| ### I want to understand everything first |
| β **Go to**: [COLAB_TRAINING_README.md](COLAB_TRAINING_README.md) |
| β **Then read**: [TRAINING_PIPELINE.md](TRAINING_PIPELINE.md) |
| β **Time**: ~1 hour |
|
|
| ### I'm a visual learner |
| β **Go to**: [TRAINING_PIPELINE.md](TRAINING_PIPELINE.md) |
| β **Then read**: [QUICK_START.md](QUICK_START.md) |
| β **Time**: ~20 minutes |
|
|
| ### I need a complete overview |
| β **Go to**: [PACKAGE_SUMMARY.txt](PACKAGE_SUMMARY.txt) |
| β **Then read**: [TRAINING_PACKAGE_INDEX.md](TRAINING_PACKAGE_INDEX.md) |
| β **Time**: ~15 minutes |
|
|
| --- |
|
|
| ## π What's in This Package? |
|
|
| ### π― Main Files (Use These) |
| 1. **AISHA_RL_Training_Colab.ipynb** - Jupyter notebook for Google Colab |
| 2. **aisha_rl_training.py** - Standalone Python script for local training |
| |
| ### π Documentation (Read These) |
| 1. **QUICK_START.md** - 5-minute quick start guide |
| 2. **COLAB_TRAINING_README.md** - Comprehensive documentation |
| 3. **TRAINING_PIPELINE.md** - Visual diagrams and explanations |
| 4. **TRAINING_PACKAGE_INDEX.md** - Complete package index |
| 5. **PACKAGE_SUMMARY.txt** - Executive summary |
|
|
| ### π§ Supporting Files (Reference) |
| 1. **AISHA_TRAINING_NOTEBOOK.md** - Markdown source for notebook |
| 2. **convert_to_notebook.py** - Utility to convert markdown to Jupyter |
| 3. **MANIFEST.md** - Complete package manifest |
| 4. **FILES_GENERATED.txt** - List of all generated files |
| 5. **START_HERE.md** - This file |
|
|
| --- |
|
|
| ## β¨ What You'll Get |
|
|
| After running the training, you'll have: |
|
|
| 1. **reward_curve.png** - Shows your training progress |
| 2. **loss_curve.png** - Shows loss convergence |
| 3. **Console output** - Detailed metrics and summary |
|
|
| Expected improvement: **50-100%** over baseline |
|
|
| --- |
|
|
| ## π― The 3-Step Process |
|
|
| ### Step 1: Setup (2 minutes) |
| - Get HuggingFace token from https://huggingface.co/settings/tokens |
| - For Colab: Add token to Colab Secrets (π icon) |
| - For Local: Set environment variable |
|
|
| ### Step 2: Run (10-15 minutes) |
| - For Colab: Open notebook and run all cells (Ctrl+F9) |
| - For Local: Run `python aisha_rl_training.py` |
|
|
| ### Step 3: Analyze (5 minutes) |
| - Download PNG plots |
| - Review metrics |
| - Celebrate your trained agent! π |
|
|
| --- |
|
|
| ## π What Happens During Training |
|
|
| ``` |
| Training Loop (5 episodes): |
| ββ Episode 1: Agent learns basic actions |
| ββ Episode 2: Agent improves strategy |
| ββ Episode 3: Agent explores more |
| ββ Episode 4: Agent converges |
| ββ Episode 5: Agent stabilizes |
| |
| Evaluation: |
| ββ Baseline (random agent): 5 episodes |
| ββ Trained agent: 5 episodes |
| |
| Comparison: |
| ββ Shows improvement percentage |
| |
| Visualization: |
| ββ reward_curve.png (training progress) |
| ββ loss_curve.png (loss convergence) |
| ``` |
|
|
| --- |
|
|
| ## π Key Features |
|
|
| β
**Live Environment** - Connects to real HF Space |
| β
**Small Model** - Qwen1.5-1.8B (fits in Colab free tier) |
| β
**GRPO Training** - Group Relative Policy Optimization |
| β
**Easy Scenario** - 2 hosts, 3 vulnerabilities |
| β
**Baseline Comparison** - See your improvement |
| β
**Beautiful Plots** - PNG visualizations |
| β
**Comprehensive Docs** - Everything explained |
| β
**No Manual Steps** - Fully automated |
|
|
| --- |
|
|
| ## π Getting Started Now |
|
|
| ### For Google Colab Users: |
| 1. Click: [AISHA_RL_Training_Colab.ipynb](AISHA_RL_Training_Colab.ipynb) |
| 2. Upload to Google Colab |
| 3. Add HF_TOKEN to Colab Secrets |
| 4. Run all cells (Ctrl+F9) |
| 5. Download PNG plots |
| |
| ### For Local Python Users: |
| 1. Open terminal |
| 2. Set environment variables: |
| ```bash |
| export HF_TOKEN="your_token" |
| export API_BASE_URL="https://anshumanatrey-security-audit-env.hf.space" |
| ``` |
| 3. Run: `python aisha_rl_training.py` |
| 4. Check PNG plots in current directory |
| |
| --- |
| |
| ## β Common Questions |
| |
| **Q: Do I need a GPU?** |
| A: No, but it's faster. CPU works fine for this small model. |
| |
| **Q: How long does it take?** |
| A: ~10 minutes in Colab, ~15 minutes locally. |
| |
| **Q: What if I get an error?** |
| A: Check [QUICK_START.md](QUICK_START.md) troubleshooting section. |
| |
| **Q: Can I use a different model?** |
| A: Yes! Change `MODEL_NAME` in the notebook/script. |
|
|
| **Q: Can I train on harder scenarios?** |
| A: Yes! Change `scenario_id` to "medium" or "hard". |
|
|
| **Q: How do I understand the code?** |
| A: Read [COLAB_TRAINING_README.md](COLAB_TRAINING_README.md) for detailed explanations. |
|
|
| --- |
|
|
| ## π Documentation Map |
|
|
| ``` |
| START_HERE.md (You are here) |
| β |
| QUICK_START.md (5 min read) |
| ββ For Colab users β AISHA_RL_Training_Colab.ipynb |
| ββ For local users β aisha_rl_training.py |
| |
| For deeper understanding: |
| ββ COLAB_TRAINING_README.md (comprehensive guide) |
| ββ TRAINING_PIPELINE.md (visual explanations) |
| ββ TRAINING_PACKAGE_INDEX.md (package overview) |
| ββ PACKAGE_SUMMARY.txt (executive summary) |
| |
| For reference: |
| ββ MANIFEST.md (package manifest) |
| ββ FILES_GENERATED.txt (file listing) |
| ββ AISHA_TRAINING_NOTEBOOK.md (notebook source) |
| ``` |
|
|
| --- |
|
|
| ## π Learning Path |
|
|
| ### Beginner (Just want to run it) |
| 1. Read: QUICK_START.md (5 min) |
| 2. Run: Notebook or script (10 min) |
| 3. Done! β
|
| |
| ### Intermediate (Want to understand it) |
| 1. Read: QUICK_START.md (5 min) |
| 2. Read: COLAB_TRAINING_README.md (20 min) |
| 3. Run: Notebook or script (10 min) |
| 4. Experiment: Try different scenarios (10 min) |
| 5. Done! β
|
|
|
| ### Advanced (Want to customize it) |
| 1. Read: COLAB_TRAINING_README.md (20 min) |
| 2. Read: TRAINING_PIPELINE.md (15 min) |
| 3. Study: Notebook cells (30 min) |
| 4. Modify: Hyperparameters and model (20 min) |
| 5. Run: Custom training (10 min) |
| 6. Done! β
|
| |
| --- |
| |
| ## π― Expected Results |
| |
| ### Baseline (Random Agent) |
| - Average Score: ~0.20-0.30 |
| - Behavior: Random actions |
| |
| ### Trained Agent (After 5 Episodes) |
| - Average Score: ~0.35-0.50 |
| - Improvement: 50-100% |
| |
| ### Loss Convergence |
| - Initial: ~0.80-0.90 |
| - Final: ~0.30-0.50 |
| - Trend: Decreasing β |
| |
| --- |
| |
| ## π§ System Requirements |
| |
| ### For Google Colab |
| - β
Google account |
| - β
HuggingFace token (free) |
| - β
Internet connection |
| - β
~10 minutes |
| |
| ### For Local Machine |
| - β
Python 3.8+ |
| - β
pip or conda |
| - β
HuggingFace token (free) |
| - β
GPU recommended (CPU works) |
| - β
~15 minutes |
| |
| --- |
| |
| ## π‘ Pro Tips |
| |
| 1. **First time?** Start with QUICK_START.md |
| 2. **Visual learner?** Check TRAINING_PIPELINE.md |
| 3. **Want details?** Read COLAB_TRAINING_README.md |
| 4. **Need help?** See troubleshooting sections |
| 5. **Ready to code?** Open the notebook/script |
| |
| --- |
| |
| ## π Troubleshooting |
| |
| ### Connection Error |
| β Check HF Space status, wait 30 seconds, retry |
| |
| ### Out of Memory |
| β Use CPU instead of GPU |
| |
| ### Token Not Found |
| β Add HF_TOKEN to Colab Secrets (π icon) |
|
|
| ### Model Download Fails |
| β Check internet, verify token, retry |
|
|
| For more help: See [QUICK_START.md](QUICK_START.md) |
|
|
| --- |
|
|
| ## π Need Help? |
|
|
| 1. **Quick questions?** β Check [QUICK_START.md](QUICK_START.md) |
| 2. **Want details?** β Read [COLAB_TRAINING_README.md](COLAB_TRAINING_README.md) |
| 3. **Visual explanation?** β See [TRAINING_PIPELINE.md](TRAINING_PIPELINE.md) |
| 4. **Package overview?** β Check [PACKAGE_SUMMARY.txt](PACKAGE_SUMMARY.txt) |
|
|
| --- |
|
|
| ## β
Checklist Before Starting |
|
|
| - [ ] I have a HuggingFace token |
| - [ ] I chose Colab or Local |
| - [ ] I read QUICK_START.md |
| - [ ] I have internet connection |
| - [ ] I have ~10-15 minutes |
| |
| --- |
| |
| ## π Ready? |
| |
| ### Choose Your Path: |
| |
| **π Google Colab (Recommended)** |
| 1. Open [AISHA_RL_Training_Colab.ipynb](AISHA_RL_Training_Colab.ipynb) |
| 2. Upload to Colab |
| 3. Add HF_TOKEN to Secrets |
| 4. Run all cells |
| 5. Download plots |
|
|
| **π» Local Python** |
| 1. Set HF_TOKEN environment variable |
| 2. Run: `python aisha_rl_training.py` |
| 3. Check PNG plots |
| |
| **π Learn First** |
| 1. Read [QUICK_START.md](QUICK_START.md) |
| 2. Read [COLAB_TRAINING_README.md](COLAB_TRAINING_README.md) |
| 3. Then run the notebook/script |
| |
| --- |
| |
| ## π Let's Go! |
| |
| **Next Step**: Open [QUICK_START.md](QUICK_START.md) |
| |
| **Time to Results**: ~10-15 minutes |
| |
| **Expected Outcome**: Trained RL agent + 2 PNG plots |
| |
| --- |
| |
| **Happy training! π** |
| |
| *Questions? Check the documentation files above.* |
| *Ready? Start with QUICK_START.md!* |
|
|