You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpenEvolve uses a sophisticated prompt engineering approach that separates different types of program examples to optimize LLM learning:
343
+
344
+
#### Program Selection Strategy
345
+
346
+
The system distinguishes between three types of program examples shown to the LLM:
347
+
348
+
1. **Previous Attempts** (`num_top_programs`): Shows only the best performing programs to demonstrate high-quality approaches
349
+
- Used for the "Previous Attempts" section in prompts
350
+
- Focused on proven successful patterns
351
+
- Helps LLM understand what constitutes good performance
352
+
353
+
2. **Top Programs** (`num_top_programs + num_diverse_programs`): Broader selection including both top performers and diverse approaches
354
+
- Used for the "Top Performing Programs" section
355
+
- Includes diverse programs to prevent local optima
356
+
- Balances exploitation of known good solutions with exploration of novel approaches
357
+
358
+
3. **Inspirations** (`num_top_programs`): Cross-island program samples for creative inspiration
359
+
- Derived from other evolution islands to maintain diversity
360
+
- Count automatically configures based on `num_top_programs` setting
361
+
- Prevents convergence by exposing LLM to different evolutionary trajectories
362
+
363
+
#### Design Rationale
364
+
365
+
This separation is intentional and serves multiple purposes:
366
+
367
+
- **Focused Learning**: Previous attempts show only the best patterns, helping LLM understand quality standards
368
+
- **Diversity Maintenance**: Top programs include diverse solutions to encourage exploration beyond local optima
369
+
- **Cross-Pollination**: Inspirations from other islands introduce novel approaches and prevent stagnation
370
+
- **Configurable Balance**: Adjust `num_top_programs` and `num_diverse_programs` to control exploration vs exploitation
371
+
372
+
The inspiration count automatically scales with `num_top_programs` to maintain consistency across different configuration sizes, eliminating the need for a separate configuration parameter.
373
+
340
374
### Template Customization
341
375
342
376
OpenEvolve supports advanced prompt template customization to increase diversity in code evolution:
0 commit comments