TL;DR
EvoCoCo (Evolutionary Code Conversion) is a novel multi-agent framework that automatically transforms legacy, CPU-bound sequential Multiobjective Evolutionary Algorithms (MOEAs) into highly parallel, GPU-accelerated tensor programs. By focusing on preserving algorithmic semantics rather than literal line-by-line translation, it achieves median GPU speedups of up to $80.2\times$ while maintaining high optimization fidelity across a massive benchmark of 48 algorithms.
What Problem Does This Paper Address?
Multiobjective Evolutionary Algorithms (MOEAs) are widely used to solve complex engineering and scientific optimization problems with conflicting objectives. Because they operate on a population of candidate solutions, they possess inherent, massive parallelism.
However, mature and widely used MOEA codebases (such as MATLAB's PlatEMO) were designed for CPUs. They are riddled with sequential program structures: individual-level loops, dynamic containers, and conditional branches. To run these algorithms efficiently on modern hardware like GPUs, the code must be tensorized—meaning data representations, control structures, and state updates must be completely reorganized into batched tensor operations (e.g., using PyTorch).
Directly using Large Language Models (LLMs) for one-shot code translation fails here. Line-by-line translation cannot handle the structural restructuring required to turn a sequential loop into a parallelized tensor operation without breaking the underlying optimization mechanics.
Methods
The authors introduce EvoCoCo, a multi-agent framework that treats automatic tensorization as a semantics-guided computational restructuring problem. Instead of translating code syntax, it extracts the core algorithmic math and reconstructs it for a tensor-computing environment.
The framework divides this complex task among specialized LLM-based agents across three main phases:
- Understanding & Planning:
- The Source Analysis Agent extracts the algorithm's core semantics (states, lifetimes, operators, and update logic) from the source code.
- The Rule Retrieval role pulls context-specific tensorization guidelines and framework constraints.
- The Blueprint Agent synthesizes these into a unified tensorization blueprint that defines target tensor shapes, data types, and lifecycle methods.
- Diversified Restructuring:
- Multiple Tensorization Agents run in parallel, each exploring a different computational strategy (e.g., broadcasting, masked operations, or
einsumoptimization) under the constraints of the shared blueprint. - Validation & Selection:
- The generated code is executed in a target environment (EvoX/PyTorch). If it fails, a Repair Agent uses runtime execution feedback (error traces) to iteratively debug and fix the code.
- Finally, a Selection Agent evaluates the successful candidates based on optimization fidelity and computational efficiency to output the best tensorized code.
Datasets and Benchmarks
The framework was evaluated using a comprehensive, heterogeneous benchmark:
- Source Algorithms: 48 distinct MOEAs curated from the PlatEMO platform, spanning dominance-based, decomposition-based, indicator-based, and large-scale optimization paradigms.
- Problem Suites: The translated algorithms were tested against standard benchmark problem suites including DTLZ, WFG, LSMOP, and MaF, totaling 1,920 unique algorithm-problem combinations.
- External Transfer Set: 10 external, legacy MATLAB/Octave MOEA implementations from independent repositories were used to test the framework's ability to generalize beyond PlatEMO conventions.
Key Insights and Ideas
- Separation of "What" from "How": The core breakthrough is separating what the algorithm must preserve (its mathematical optimization mechanism) from how it is computationally realized (the tensor layout).
- The Failure of One-Shot Translation: Complex code migration cannot rely on a single generation step. LLMs frequently suffer from output truncation or API misuse when translating long, structurally dense files.
- Execution Feedback is Mandatory: Static analysis cannot reliably predict tensor shape mismatches or device placement errors on a GPU. Closed-loop runtime validation and iterative repair are essential to achieving executable code.
- The Memory-Runtime Trade-off: Tensorization accelerates computation by batching operations, but techniques like broadcasting create large intermediate tensors. This shifts the performance bottleneck from CPU runtime to GPU memory pressure (OOM risks).
Key Results
1. Migration Reliability
EvoCoCo significantly outperformed direct one-shot LLM translation. Using Gemini 3 Flash as the backend, one-shot translation achieved a convergence pass rate of only 26.67%, whereas EvoCoCo boosted the success rate to 78.75%, successfully generating working implementations for all 48 benchmark algorithms.
2. Optimization Fidelity
Because evolutionary algorithms are stochastic, exact code equivalence is impossible. Instead, the authors measured optimization fidelity across repeated benchmark runs. 88.2% of the valid comparisons satisfied the strict predefined fidelity criteria, proving that EvoCoCo preserves the algorithm's actual optimization capability.
3. GPU Acceleration
The tensorized PyTorch code achieved massive speedups over the CPU-based MATLAB baseline as the problem scale increased:
- Population Scaling: A median measured speedup of $22.6\times$ (scaling up to $77.5\times$ at a population size of 16,384).
- Decision-Dimension Scaling: A median measured speedup of $80.2\times$ (scaling up to $194.8\times$ at 65,536 dimensions).
- Extreme cases, such as
MOEA/D-DE, achieved peak speedups exceeding $37,000\times$.
Limitations and Future Work
While highly successful, the authors note a few limitations:
- Environment Specificity: The current implementation is tailored specifically for migrating from MATLAB (PlatEMO) to PyTorch (
EvoX). Extending this to other languages (like C++ or JAX) remains future work. - Memory Overhead: At extreme population sizes or dimensions, some tensorized algorithms encountered GPU Out-Of-Memory (OOM) errors due to aggressive broadcasting. Future iterations will focus on developing more memory-efficient restructuring strategies.
Summary updated