Complete Experiment Management and Automation System - MeZO Optimization
Research on the impact of synthetic data on MeZO (Memory-Efficient Zero-Order Optimizer) training effectiveness.
System Status: β Full Functionality Implemented | v2.1 (2026-01-01) - All P0-level Bugs Fixed
prompt_engineering, temperature_study, model_comparison, etc.# 1. Install dependencies
pip install pyyaml openai tqdm datasets transformers torch
# 2. Configure API key
export OPENAI_API_KEY="your-key-here"
# 3. Verify configuration
python automation/config.py
# For detailed configuration instructions: automation/SETUP_GUIDE.md
# Complete functionality summary and usage guide
cat COMPLETE_SYSTEM_SUMMARY.md
# 1. Generate scripts from test configuration
python automation/stage1_generation/generator.py \
automation/configs/examples/stage1_full_example_copa.yaml
# 2. View generated directory structure
tree Data_v2/synthetic/prompt_engineering/copa_mezo_v1/
# 3. Generate data (requires API key)
export OPENAI_API_KEY="your-key"
cd Data_v2/synthetic/prompt_engineering/copa_mezo_v1/scripts/
python rephrase_all.py
python validate.py
# 4. Use directly for MeZO training
cd /home/ubuntu/LLM-inference/jikai-project/Synthetic_Data_for_ZO/
python PromptZO/MeZO/large_models/run.py \
--task Data_v2/synthetic/prompt_engineering/copa_mezo_v1/Copa \
--model meta-llama/Llama-3.2-1B
| Document | Description |
|---|---|
automation/SETUP_GUIDE.md | π§ Environment Setup Guide (Required reading for first-time users) |
automation/USER_GUIDE.md | π User Manual (Recommended starting point) |
automation/COMPLETE_PIPELINE_SIMULATION.md | π Complete Pipeline Examples (Detailed steps) |
automation/BATCH_GUIDE.md | Batch Solution 3++ Complete Guide |
automation/TOOLS_REFERENCE.md | All Tools Reference Manual |
automation/stage2_training/RESULTS_MANAGEMENT.md | Stage 2: Training Results Management |
automation/BUG_FIXES_SUMMARY.md | Bug Fix Summary (v2.1) |
| File | Description |
|---|---|
automation/configs/examples/stage1_full_example_copa.yaml | Complete Stage 1 configuration example |
automation/configs/examples/stage2_example_training.yaml | Stage 2 training configuration example |
Synthetic_Data_for_ZO/
βββ README.md # π This file
βββ COMPLETE_SYSTEM_SUMMARY.md # π Complete usage guide
β
βββ automation/ # Automation tools
β βββ stage1_generation/ # Stage 1: Data generation
β β βββ generator.py # Script generator
β β βββ experiment_manager.py # Experiment management
β β βββ create_experiment.py # Parameter tuning experiment tool
β β βββ archive_validated_config.py # Configuration archival tool
β β βββ list_experiments.py # Experiment listing tool
β β βββ tools/ # Manual review tools
β β βββ review_top20.py
β β
β βββ stage2_training/ # Stage 2: Model training
β β βββ trainer.py
β β
β βββ configs/ # Configuration files
β βββ examples/ # Configuration examples
β βββ stage1/
β βββ templates/ # Validated prompt templates
β βββ experiments/ # Parameter tuning experiment configs
β βββ drafts/ # Pending validation configs
β
βββ Data_v2/ # π New data management
β βββ original/ # Original datasets
β βββ synthetic/ # Synthetic data
β βββ {experiment_purpose}/ # Experiment purpose (top-level classification)
β βββ {experiment_id}/ # Experiment ID (parameter isolation)
β βββ {DatasetName}/ # MeZO dataset directory
β β βββ {task}_train.jsonl
β β βββ {task}_validation.jsonl
β β βββ {task}_test.jsonl
β βββ scripts/
β βββ generation_config.yaml
β βββ experiment_metadata.json
β βββ README.md
β
βββ Results_v2/ # π New results directory
β βββ {experiment_purpose}/
β βββ {Model}/
β βββ {Task}_{Method}_{DataType}_{LR}/
β βββ {Timestamp}/
β
βββ PromptZO/MeZO/ # MeZO training code
β
βββ Data/ # Old data directory (preserved)
βββ results/ # Old results directory (preserved)
βββ Pending_Manual_Classification/ # Data pending manual classification
Data_v2/synthetic/
βββ prompt_engineering/ # π Tier 1: Experiment purpose classification
β βββ copa_mezo_v1/ # π Tier 2: Experiment ID (parameter isolation)
β β βββ Copa/ # π Tier 3: MeZO dataset directory
β β βββ copa_train.jsonl
β β βββ copa_validation.jsonl
β β βββ copa_test.jsonl
β βββ copa_mezo_v2/
β
βββ temperature_study/ # π Different experiment purpose
β βββ copa_mezo_temp05/
β βββ copa_mezo_temp07/
β βββ copa_mezo_temp09/
β
βββ model_comparison/ # π Different experiment purpose
βββ copa_mezo_gpt4o/
βββ copa_mezo_gpt4omini/
Top-level directories isolate different experiment types to avoid data confusion:
experiment:
purpose: "temperature_study" # Experiment purpose
Automatically calculates parameter hash; same parameters can be overwritten, different parameters automatically isolated:
Automatically generates dataset structure expected by MeZO training scripts:
{experiment_id}/
βββ Copa/ # Directory name expected by MeZO
βββ copa_train.jsonl # Filename expected by MeZO
βββ copa_validation.jsonl
βββ copa_test.jsonl
MeZO training command:
python PromptZO/MeZO/large_models/run.py \
--task Data_v2/synthetic/{purpose}/{exp_id}/Copa
templates/ - Validated prompts for reuseexperiments/ - Parameter tuning experiment configsImportant: Stage 1 and Stage 2 experiment purposes are independent!
Data: Data_v2/synthetic/prompt_engineering/... β Data generation purpose
Training: Results_v2/hyperparameter_tuning/... β Training purpose (can be different)
# 1. Generate scripts
python automation/stage1_generation/generator.py <config.yaml>
# 2. View all batches
python automation/stage1_generation/batch_tools/list_batches.py --verbose
# 3. Find data paths (for training config) β New
python automation/stage1_generation/batch_tools/list_data_paths.py --dataset Copa --format yaml
# Automatic training (results classified by experiment purpose)
python automation/stage2_training/trainer.py <config.yaml>
# Preview (without actual execution)
python automation/stage2_training/trainer.py <config.yaml> --dry-run
# View training results summary
python automation/stage2_training/list_results.py
# View detailed results for specific experiment purpose
python automation/stage2_training/list_results.py --detail --purpose prompt_engineering
# Python 3.8+
pip install pyyaml openai tqdm datasets transformers torch
# API Key (required for Stage 1)
export OPENAI_API_KEY="your-api-key"
# Project path (auto-detected, can also be set manually)
export SYNTHETIC_DATA_PROJECT_ROOT="/path/to/project" # Optional
Detailed configuration instructions: See automation/SETUP_GUIDE.md
A: The Batch solution automatically recognizes identical configurations through parameter fingerprinting, automatically reusing data instead of overwriting.
A: Use the newly added list_data_paths.py tool:
python automation/stage1_generation/batch_tools/list_data_paths.py --dataset Copa --format yaml
A: Yes! trainer.py can directly use Data_v2/ paths without needing to publish:
# Training configuration
data:
path: "Data_v2/synthetic/batch_20241229_temperature/Copa/temp07_topp10_gpt4o/Copa"
A: β
Yes! v2.1 has fixed all LoRA-related bugs (script names, environment variables). See automation/BUG_FIXES_SUMMARY.md for details
View complete documentation: COMPLETE_SYSTEM_SUMMARY.md
View old system migration instructions: Pending_Manual_Classification/README.md
Start your first experiment! π
69 commits
Python
70.3%
Shell
19.5%
Jupyter Notebook
9.3%
Complete Experiment Management and Automation System - MeZO Optimization
Research on the impact of synthetic data on MeZO (Memory-Efficient Zero-Order Optimizer) training effectiveness.
System Status: β Full Functionality Implemented | v2.1 (2026-01-01) - All P0-level Bugs Fixed
prompt_engineering, temperature_study, model_comparison, etc.# 1. Install dependencies
pip install pyyaml openai tqdm datasets transformers torch
# 2. Configure API key
export OPENAI_API_KEY="your-key-here"
# 3. Verify configuration
python automation/config.py
# For detailed configuration instructions: automation/SETUP_GUIDE.md
# Complete functionality summary and usage guide
cat COMPLETE_SYSTEM_SUMMARY.md
# 1. Generate scripts from test configuration
python automation/stage1_generation/generator.py \
automation/configs/examples/stage1_full_example_copa.yaml
# 2. View generated directory structure
tree Data_v2/synthetic/prompt_engineering/copa_mezo_v1/
# 3. Generate data (requires API key)
export OPENAI_API_KEY="your-key"
cd Data_v2/synthetic/prompt_engineering/copa_mezo_v1/scripts/
python rephrase_all.py
python validate.py
# 4. Use directly for MeZO training
cd /home/ubuntu/LLM-inference/jikai-project/Synthetic_Data_for_ZO/
python PromptZO/MeZO/large_models/run.py \
--task Data_v2/synthetic/prompt_engineering/copa_mezo_v1/Copa \
--model meta-llama/Llama-3.2-1B
| Document | Description |
|---|---|
automation/SETUP_GUIDE.md | π§ Environment Setup Guide (Required reading for first-time users) |
automation/USER_GUIDE.md | π User Manual (Recommended starting point) |
automation/COMPLETE_PIPELINE_SIMULATION.md | π Complete Pipeline Examples (Detailed steps) |
automation/BATCH_GUIDE.md | Batch Solution 3++ Complete Guide |
automation/TOOLS_REFERENCE.md | All Tools Reference Manual |
automation/stage2_training/RESULTS_MANAGEMENT.md | Stage 2: Training Results Management |
automation/BUG_FIXES_SUMMARY.md | Bug Fix Summary (v2.1) |
| File | Description |
|---|---|
automation/configs/examples/stage1_full_example_copa.yaml | Complete Stage 1 configuration example |
automation/configs/examples/stage2_example_training.yaml | Stage 2 training configuration example |
Synthetic_Data_for_ZO/
βββ README.md # π This file
βββ COMPLETE_SYSTEM_SUMMARY.md # π Complete usage guide
β
βββ automation/ # Automation tools
β βββ stage1_generation/ # Stage 1: Data generation
β β βββ generator.py # Script generator
β β βββ experiment_manager.py # Experiment management
β β βββ create_experiment.py # Parameter tuning experiment tool
β β βββ archive_validated_config.py # Configuration archival tool
β β βββ list_experiments.py # Experiment listing tool
β β βββ tools/ # Manual review tools
β β βββ review_top20.py
β β
β βββ stage2_training/ # Stage 2: Model training
β β βββ trainer.py
β β
β βββ configs/ # Configuration files
β βββ examples/ # Configuration examples
β βββ stage1/
β βββ templates/ # Validated prompt templates
β βββ experiments/ # Parameter tuning experiment configs
β βββ drafts/ # Pending validation configs
β
βββ Data_v2/ # π New data management
β βββ original/ # Original datasets
β βββ synthetic/ # Synthetic data
β βββ {experiment_purpose}/ # Experiment purpose (top-level classification)
β βββ {experiment_id}/ # Experiment ID (parameter isolation)
β βββ {DatasetName}/ # MeZO dataset directory
β β βββ {task}_train.jsonl
β β βββ {task}_validation.jsonl
β β βββ {task}_test.jsonl
β βββ scripts/
β βββ generation_config.yaml
β βββ experiment_metadata.json
β βββ README.md
β
βββ Results_v2/ # π New results directory
β βββ {experiment_purpose}/
β βββ {Model}/
β βββ {Task}_{Method}_{DataType}_{LR}/
β βββ {Timestamp}/
β
βββ PromptZO/MeZO/ # MeZO training code
β
βββ Data/ # Old data directory (preserved)
βββ results/ # Old results directory (preserved)
βββ Pending_Manual_Classification/ # Data pending manual classification
Data_v2/synthetic/
βββ prompt_engineering/ # π Tier 1: Experiment purpose classification
β βββ copa_mezo_v1/ # π Tier 2: Experiment ID (parameter isolation)
β β βββ Copa/ # π Tier 3: MeZO dataset directory
β β βββ copa_train.jsonl
β β βββ copa_validation.jsonl
β β βββ copa_test.jsonl
β βββ copa_mezo_v2/
β
βββ temperature_study/ # π Different experiment purpose
β βββ copa_mezo_temp05/
β βββ copa_mezo_temp07/
β βββ copa_mezo_temp09/
β
βββ model_comparison/ # π Different experiment purpose
βββ copa_mezo_gpt4o/
βββ copa_mezo_gpt4omini/
Top-level directories isolate different experiment types to avoid data confusion:
experiment:
purpose: "temperature_study" # Experiment purpose
Automatically calculates parameter hash; same parameters can be overwritten, different parameters automatically isolated:
Automatically generates dataset structure expected by MeZO training scripts:
{experiment_id}/
βββ Copa/ # Directory name expected by MeZO
βββ copa_train.jsonl # Filename expected by MeZO
βββ copa_validation.jsonl
βββ copa_test.jsonl
MeZO training command:
python PromptZO/MeZO/large_models/run.py \
--task Data_v2/synthetic/{purpose}/{exp_id}/Copa
templates/ - Validated prompts for reuseexperiments/ - Parameter tuning experiment configsImportant: Stage 1 and Stage 2 experiment purposes are independent!
Data: Data_v2/synthetic/prompt_engineering/... β Data generation purpose
Training: Results_v2/hyperparameter_tuning/... β Training purpose (can be different)
# 1. Generate scripts
python automation/stage1_generation/generator.py <config.yaml>
# 2. View all batches
python automation/stage1_generation/batch_tools/list_batches.py --verbose
# 3. Find data paths (for training config) β New
python automation/stage1_generation/batch_tools/list_data_paths.py --dataset Copa --format yaml
# Automatic training (results classified by experiment purpose)
python automation/stage2_training/trainer.py <config.yaml>
# Preview (without actual execution)
python automation/stage2_training/trainer.py <config.yaml> --dry-run
# View training results summary
python automation/stage2_training/list_results.py
# View detailed results for specific experiment purpose
python automation/stage2_training/list_results.py --detail --purpose prompt_engineering
# Python 3.8+
pip install pyyaml openai tqdm datasets transformers torch
# API Key (required for Stage 1)
export OPENAI_API_KEY="your-api-key"
# Project path (auto-detected, can also be set manually)
export SYNTHETIC_DATA_PROJECT_ROOT="/path/to/project" # Optional
Detailed configuration instructions: See automation/SETUP_GUIDE.md
A: The Batch solution automatically recognizes identical configurations through parameter fingerprinting, automatically reusing data instead of overwriting.
A: Use the newly added list_data_paths.py tool:
python automation/stage1_generation/batch_tools/list_data_paths.py --dataset Copa --format yaml
A: Yes! trainer.py can directly use Data_v2/ paths without needing to publish:
# Training configuration
data:
path: "Data_v2/synthetic/batch_20241229_temperature/Copa/temp07_topp10_gpt4o/Copa"
A: β
Yes! v2.1 has fixed all LoRA-related bugs (script names, environment variables). See automation/BUG_FIXES_SUMMARY.md for details
View complete documentation: COMPLETE_SYSTEM_SUMMARY.md
View old system migration instructions: Pending_Manual_Classification/README.md
Start your first experiment! π
69 commits
Python
70.3%
Shell
19.5%
Jupyter Notebook
9.3%