MetaFORGE: A Meta-Learning Framework for Harness Optimization in Automated Code Generation for Parallel Computing
Organizations: Department of Computer Science, University of Central Florida, Orlando, FL, USA
Abstract
Large language models (LLMs) can generate parallel programs, but their correctness and performance depend strongly on the instructions that guide generation. We present MetaFORGE, an execution-grounded meta-learning framework that iteratively optimizes persistent natural-language skill specifications for MPI C code generation. MetaFORGE combines correctness testing, compiler diagnostics, static-analysis findings, runtime measurements, and rank-level load-imbalance profiles into a scalar reward that drives textual-gradient refinement, while an external memory distills and retrieves reward-supported optimization knowledge across runs. Across six MPI tasks and three workload sizes, MetaFORGE improves static-analysis quality, runtime, and load balance relative to zero-shot generation and generally exceeds the evaluated TextGrad iterative baseline. A model-matched refinement ablation shows that the MetaFORGE advantage persists when its refinement model is reduced to gpt-4o. An expanded retrieval ablation across all 18 task--workload configurations shows consistent runtime benefit and broad static-analysis and load-balance benefit from retrieved context. Leakage-controlled held-out and zero-update experiments further provide evidence that optimization knowledge persists in both the transferred skill and external memory under the evaluated protocol.
Figures & tables
| MetaFORGE | TextGrad | |||||||
| Task | Static | Runtime | Balance | Tokens | Static | Runtime | Balance | Tokens |
| calculation | 100.00 | 16.45 | 96.41 | 8232 | 8.89 | 7.30 | 35.38 | 12409 |
| Dot Product | 100.00 | 27.00 | 50.74 | 9106 | 5.18 | 14.84 | 23.59 | 14362 |
| Matrix Multiplication | 57.16 | 87.99 | 47.04 | 15641 | -13.14 | 55.46 | 16.91 | 18032 |
| Mandelbrot Set | 78.47 | 9.32 | 25.29 | 17435 | 6.30 | -0.19 | 0.15 | 16604 |
| Heat Transfer | 63.08 | 82.46 | 51.41 | 21350 | 10.38 | 14.87 | 22.94 | 19375 |
| Comparison | rank | Exact | Holm |
| Strong vs. Weak | -1.533 | 0.054 | 0.054 |
| Weak vs. TextGrad | -2.933 | ||
| Strong vs. TextGrad | -3.867 |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Task | Dominant parallel structure | Communication pattern | Limiting factor | Distinctive challenge |
| estimation | Naturally parallel integration | Single terminal reduction | Floating-point throughput | Accuracy to under partitioned summation |
| Dot Product | Data-parallel reduction over distributed operands | Single terminal reduction | Memory bandwidth | Distributed initialization without full-vector broadcast |
| Dense Matrix Multiplication | Dense linear algebra, | Operand distribution and result reduction | Cache locality / loop order | Non-divisible dimensions; BLAS prohibited |
| Mandelbrot Set | Irregular, data-dependent workload | Terminal gather of image tiles | Load imbalance | Per-pixel cost varies substantially; static decomposition is ineffective |
| Heat Transfer (Jacobi) | Iterative stencil relaxation | Nearest-neighbor halo exchange every iteration | Communication latency | Ghost-cell correctness and communication/computation behavior over 30,000 iterations |
| Distributed PCA | Multi-phase iterative linear algebra | Repeated collectives nested within power iterations | Collective frequency | Multi-phase pipeline; samples; eigenvector stability |
| Held-Out Task | Skill | Compiler Warnings | Static Warnings | Runtime (s) | Imbalance | Reward | Wilcoxon |
| Calculate | Initial | 1.000 | 6 | 0.102 | 0.0441 | -7.27 | |
| Transferred | 1.000 | 0 | 0.090 | 0.0375 | -1.24 | 0.0039 | |
| Matrix Multiplication | Initial | 1.000 | 21 | 30.133 | 0.1500 | -82.49 | |
| Transferred | 1.000 | 9 | 24.705 | 0.0500 | -59.49 | 0.0078 | |
| Mandelbrot Sets | Initial | 1.000 | 22 | 8.330 | 0.2000 | -39.96 | |
| Transferred | 1.000 | 5 | 6.248 | 0.0800 | -18.62 | 0.0039 |
| Task | Method | Static warnings | Runtime (s) | Load imbalance | Best reward | Total tokens |
| MetaFORGE-Strong | ||||||
| MetaFORGE-Weak | ||||||
| TextGrad-Native | ||||||
| Dot Product | MetaFORGE-Strong | |||||
| Dot Product | MetaFORGE-Weak | |||||
| Dot Product | TextGrad-Native |
Code Generation
Code generation studies methods for turning natural-language, visual, or formal specifications into executable programs and code edits.
See all 357 papers