Tutorials¶
Welcome to the EvoToolkit tutorials! These step-by-step guides will help you master evolutionary optimization with LLMs.
Getting Started¶
New to EvoToolkit? Start here:
- Installation - Set up your environment
- Getting Started - Run your first optimization in 5 minutes
- Scientific Regression Tutorial - Deep dive into a complete example
Tutorial Categories¶
Built-in Tasks¶
Learn how to use EvoToolkit's pre-built optimization tasks:
- Scientific Regression - Discover mathematical equations from data
- Prompt Engineering - Optimize LLM prompts for better performance
- Adversarial Attack - Generate adversarial examples
- CUDA Tasks - Optimize GPU kernels for performance
Customization¶
Extend EvoToolkit for your specific needs:
- Custom Tasks - Create your own optimization problems
- Customizing Evolution - Modify prompts and algorithms
Advanced¶
Master the low-level APIs:
- Advanced Usage - Fine-grained control and debugging
Tutorial Overview¶
| Tutorial | Level | Time | Topics Covered |
|---|---|---|---|
| Scientific Regression | Beginner | 20 min | High-level API, real datasets, equation evolution |
| Prompt Engineering | Beginner-Intermediate | 20 min | LLM prompt optimization, task performance |
| Adversarial Attack | Intermediate | 25 min | Evolving adversarial examples, attack algorithms |
| CUDA Tasks | Advanced | 30 min | GPU optimization, CUDA kernels, performance |
| Custom Tasks | Intermediate | 20 min | Creating tasks, evaluation, custom fitness |
| Customizing Evolution | Intermediate-Advanced | 30 min | Prompt engineering, custom algorithms, Interface development |
| Advanced Usage | Advanced | 25 min | Low-level API, custom configs, debugging |
Quick Reference¶
Common Workflow Patterns¶
Pattern 1: Basic Optimization¶
import evotoolkit
from evotoolkit.task.python_task import EvoEngineerPythonInterface
interface = EvoEngineerPythonInterface(task)
result = evotoolkit.solve(interface, './results', llm_api)
Pattern 2: Algorithm Comparison¶
algorithms = [
('EoH', EoHPythonInterface(task)),
('EvoEngineer', EvoEngineerPythonInterface(task)),
('FunSearch', FunSearchPythonInterface(task))
]
for name, interface in algorithms:
result = evotoolkit.solve(interface, f'./results/{name}', llm_api)
Pattern 3: Custom Configuration¶
from evotoolkit.evo_method.evoengineer import EvoEngineer, EvoEngineerConfig
config = EvoEngineerConfig(
interface=interface,
output_path='./results',
running_llm=llm_api,
max_generations=20,
pop_size=10
)
algorithm = EvoEngineer(config)
algorithm.run()
Downloadable Examples¶
All tutorial code is available as standalone Python scripts in the examples/ directory:
examples/scientific_regression/- Scientific equation discoveryexamples/custom_task/my_custom_task.py- Custom task implementationexamples/cuda_task/kernel_optimization.py- CUDA kernel optimizationexamples/advanced/low_level_api.py- Low-level API usage
Clone the repository to get started:
Need Help?¶
Documentation & Resources¶
- API Reference - Detailed API documentation
- Development Guide - Contributing guidelines
- Advanced Examples - Complex use case references
Community Support¶
- GitHub Discussions - Ask questions and share projects
- GitHub Issues - Report bugs and request features
- Example Gallery - Community-contributed examples
- Blog - Articles and case studies
Direct Contact¶
- Email: pguo6680@gmail.com
Video Tutorials¶
Coming soon! Subscribe to our YouTube channel for video tutorials.