- Overview
- Key Features
- Installation
- Configuration
- Quick Start
- Experiments and Benchmarking
- Project Structure
- Citing EvoCoCo
- Community and Support
- License
EvoCoCo is a multi-agent framework for automatically tensorizing evolutionary multiobjective optimization (EMO) software. Rather than treating tensorization as syntax-to-syntax translation, EvoCoCo formulates it as semantics-guided computational restructuring: the concrete MATLAB implementation is the transformation object, while the underlying optimization mechanism is the semantic constraint that the generated program must preserve.
Built on EvoX, EvoCoCo coordinates semantic analysis, contextual rule retrieval, transformation planning, diversified tensor restructuring, static and runtime repair, and candidate selection through shared intermediate representations and closed-loop execution feedback.
The system can be used through a browser interface or as a batch experiment runner. This repository includes 48 EvoCoCo-generated tensorized algorithms used in the accompanying experiments. The same algorithms are also integrated into EvoMO.
- Treats the source implementation as the transformation object and the underlying optimization mechanism as the semantic constraint.
- Reconstructs algorithm states, operators, dependencies, and control flow before tensorization.
- Coordinates semantic analysis, contextual rule retrieval, transformation planning, restructuring, repair, and selection through shared intermediate representations.
- Explores six blueprint-guided computational restructuring strategies under the same semantic constraints.
- Produces GPU-oriented PyTorch/EvoX implementations using broadcasting,
einsum, masked operations, advanced tensor operators, and JIT-oriented restructuring. - Achieves speedups of up to 10,000Γ for generated tensorized algorithms in the reported experiments.
- Combines Ruff checks, runtime execution, optimization feedback, repair, and candidate selection.
- Includes 48 MOEAs for evaluating migration reliability, optimization fidelity, and computational scalability.
Clone the repository and install its Python dependencies:
git clone https://github.com/EMI-Group/evococo.git
cd evococo
python -m pip install -r requirements.txtA CUDA-capable GPU is recommended for generated-algorithm evaluation. The single-run DTLZ evaluator can also select CPU automatically, although GPU execution is the primary target of the tensorized implementations.
Copy the example configuration before starting EvoCoCo:
cp .env.example .envThe following example uses Gemini:
ACTIVE_LLM_PROVIDER=gemini
GEMINI_API_KEY=your_gemini_api_key_hereAvailable provider names are zhipu, deepseek-v4-pro, deepseek-v4-flash, gemini, and
custom. Optional base URL and model overrides are documented in
.env.example.
Important
Never commit .env or expose provider API keys in generated artifacts and logs.
EvoCoCo can generate algorithms through either the browser interface or the command line.
Start the backend from the project root:
python -m uvicorn backend.main:app --reload --reload-dir backend --port 8000The backend health endpoint will be available at http://localhost:8000.
Open frontend/index.html in a browser. The frontend connects to the local
backend over WebSocket. Paste the MATLAB source code into the input panel and click Run. The
interface displays every pipeline stage and returns the selected Python implementation when the
tournament finishes.
Tip
Keep the backend terminal open while using the browser interface so progress and error messages remain visible.
The command-line workflow does not require the Web backend. Create experiments/single_input/ and
place one MATLAB .m file (or one directory of related .m/.txt files) inside it. Then run the
full EvoCoCo pipeline once:
python experiments/batch_translate.py \
--input_dir experiments/single_input \
--output_dir experiments/single_output \
--repeats 1 \
--repeat-concurrency 1The generated algorithm is written to experiments/single_output/<algorithm>_run1.py, with run
statistics in the adjacent <algorithm>_run1_stats.json. Detailed intermediate artifacts are
retained under run_history/.
The command-line workflow above also supports batch generation. Place multiple .m/.txt files
in the input directory; each file is treated as one algorithm. A subdirectory containing related
source files is also treated as one algorithm. Use --repeats for repeated generations and
--repeat-concurrency to control how many repeats run concurrently.
Validate syntax, execution, and convergence of the 48 selected implementations:
python evaluation/run_migration_reliability_benchmark.py \
--dir experiments/generated_algorithms \
--workers 1Run the optimization-fidelity benchmark on a selected suite:
python evaluation/run_optimization_fidelity_benchmark.py \
--algorithm-dir experiments/generated_algorithms \
--suite DTLZ \
--runs 21 \
--gpu 0Run computational scaling with torch.compile:
python evaluation/run_computational_scalability_benchmark.py \
--algorithm-dir experiments/generated_algorithms \
--scaling population \
--gpu 0All benchmark runs are resumable. PlatEMO reference generation, the DTLZ/WFG/LSMOP/MaF options,
dimension scaling, speedup calculation, output fields, and smoke tests are documented in
evaluation/README.md.
evococo/
βββ backend/ # API and multi-agent generation pipeline
β βββ main.py # FastAPI and WebSocket entry point
β βββ engine.py # Multi-agent generation pipeline
β βββ config.py # Provider and pipeline configuration
β βββ generator.py # LLM requests and structured responses
β βββ executor.py # Static checks and runtime validation
β βββ database/ # RAG rules
β βββ prompts/ # Agent prompts and generation rules
βββ frontend/
β βββ index.html # Browser interface
βββ experiments/
β βββ batch_translate.py # Command-line generation entry point
β βββ generated_algorithms/ # 48 generated EvoX algorithms
βββ evaluation/ # Reliability, fidelity, and scalability benchmarks
βββ .env.example # Configuration template
βββ requirements.txt
βββ LICENSE
βββ README.md
If you use EvoCoCo in your research, please cite the arXiv preprint:
@article{evococo,
title = {Semantics-Guided Automatic Tensorization for Evolutionary Multiobjective Optimization: A Multi-Agent Framework},
author = {Liang, Zhenyu and Huang, Beichen and Zheng, Bowen and Cheng, Ran},
journal = {arXiv preprint arXiv:2609.02387},
year = {2026}
}Questions, bug reports, and feature requests are welcome through GitHub Issues. For EvoX framework questions, see the EvoX repository.
EvoCoCo is released under the GNU General Public License v3.0.
