Researchers have introduced MetaFORGE, a novel meta-learning framework designed to improve the automated generation of parallel C code for high-performance computing. The framework focuses on optimizing the natural-language instructions, or "skill specifications," that guide large language models (LLMs) in creating such code. MetaFORGE iteratively refines these specifications by grounding them in execution results, aiming to boost both the correctness and performance of the generated programs.

The MetaFORGE system integrates several evaluation metrics into a single scalar reward signal. This signal drives a textual-gradient refinement process. The metrics include outcomes from correctness testing, compiler diagnostics, static-analysis findings, runtime measurements, and profiles of load imbalance across different processing ranks. By combining these diverse feedback sources, MetaFORGE provides a comprehensive assessment of the generated code's quality.

Furthermore, MetaFORGE incorporates an external memory component. This memory serves to distill and retrieve optimization knowledge acquired across different generation runs. This allows the framework to build upon past successes and apply learned optimization strategies to new code generation tasks.

In evaluations across six Message Passing Interface (MPI) tasks and three different workload sizes, MetaFORGE demonstrated significant improvements. The framework enhanced static-analysis quality, reduced runtime, and improved load balance when compared to zero-shot generation. It also generally outperformed the evaluated TextGrad iterative baseline.

Ablation studies further validated MetaFORGE's effectiveness. When the refinement model within MetaFORGE was reduced to a GPT-4o model, the framework's advantages persisted. An expanded retrieval ablation across 18 task-workload configurations showed consistent runtime benefits and broad improvements in static analysis and load balance derived from retrieved context. Experiments designed to control for leakage also provided evidence that optimization knowledge is retained in both the transferred skills and the external memory.

The development of MetaFORGE addresses a key challenge in automated code generation: the sensitivity of LLM performance to the quality of input prompts. By systematically optimizing these prompts through a meta-learning approach grounded in actual code execution, MetaFORGE offers a promising direction for advancing automated parallel code generation.