Table of Contents
Fetching ...

ContextEvolve: Multi-Agent Context Compression for Systems Code Optimization

Hongyuan Su, Yu Zheng, Yong Li

TL;DR

ContextEvolve introduces a three-agent context compression pipeline for systems-code optimization under API-only access, achieving RL-like search efficiency in a textual latent space. The Summarizer, Navigator, and Sampler collaboratively condense long optimization histories into a semantic state, directional guidance, and curated exemplars, guiding a generator to produce better candidates without parameter updates. The approach establishes a functional isomorphism with reinforcement learning—state representation, policy gradient, and experience replay—yielding high sample efficiency in a training-free setting. On the ADRS benchmark, ContextEvolve outperforms baselines in aggregate scores and reduces token usage, with substantial gains in Load Balancing, demonstrating practical potential for performance-driven systems optimization under restricted access conditions.

Abstract

Large language models are transforming systems research by automating the discovery of performance-critical algorithms for computer systems. Despite plausible codes generated by LLMs, producing solutions that meet the stringent correctness and performance requirements of systems demands iterative optimization. Test-time reinforcement learning offers high search efficiency but requires parameter updates infeasible under API-only access, while existing training-free evolutionary methods suffer from inefficient context utilization and undirected search. We introduce ContextEvolve, a multi-agent framework that achieves RL-level search efficiency under strict parameter-blind constraints by decomposing optimization context into three orthogonal dimensions: a Summarizer Agent condenses semantic state via code-to-language abstraction, a Navigator Agent distills optimization direction from trajectory analysis, and a Sampler Agent curates experience distribution through prioritized exemplar retrieval. This orchestration forms a functional isomorphism with RL-mapping to state representation, policy gradient, and experience replay-enabling principled optimization in a textual latent space. On the ADRS benchmark, ContextEvolve outperforms state-of-the-art baselines by 33.3% while reducing token consumption by 29.0%. Codes for our work are released at https://anonymous.4open.science/r/ContextEvolve-ACC

ContextEvolve: Multi-Agent Context Compression for Systems Code Optimization

TL;DR

ContextEvolve introduces a three-agent context compression pipeline for systems-code optimization under API-only access, achieving RL-like search efficiency in a textual latent space. The Summarizer, Navigator, and Sampler collaboratively condense long optimization histories into a semantic state, directional guidance, and curated exemplars, guiding a generator to produce better candidates without parameter updates. The approach establishes a functional isomorphism with reinforcement learning—state representation, policy gradient, and experience replay—yielding high sample efficiency in a training-free setting. On the ADRS benchmark, ContextEvolve outperforms baselines in aggregate scores and reduces token usage, with substantial gains in Load Balancing, demonstrating practical potential for performance-driven systems optimization under restricted access conditions.

Abstract

Large language models are transforming systems research by automating the discovery of performance-critical algorithms for computer systems. Despite plausible codes generated by LLMs, producing solutions that meet the stringent correctness and performance requirements of systems demands iterative optimization. Test-time reinforcement learning offers high search efficiency but requires parameter updates infeasible under API-only access, while existing training-free evolutionary methods suffer from inefficient context utilization and undirected search. We introduce ContextEvolve, a multi-agent framework that achieves RL-level search efficiency under strict parameter-blind constraints by decomposing optimization context into three orthogonal dimensions: a Summarizer Agent condenses semantic state via code-to-language abstraction, a Navigator Agent distills optimization direction from trajectory analysis, and a Sampler Agent curates experience distribution through prioritized exemplar retrieval. This orchestration forms a functional isomorphism with RL-mapping to state representation, policy gradient, and experience replay-enabling principled optimization in a textual latent space. On the ADRS benchmark, ContextEvolve outperforms state-of-the-art baselines by 33.3% while reducing token consumption by 29.0%. Codes for our work are released at https://anonymous.4open.science/r/ContextEvolve-ACC
Paper Structure (18 sections, 9 equations, 5 figures, 1 table, 1 algorithm)

This paper contains 18 sections, 9 equations, 5 figures, 1 table, 1 algorithm.

Figures (5)

  • Figure 1: The pipeline comparison of ContextEvolve and OpenEvolve. OpenEvolve (red) directly concentrates the few original codes in limited context window, leading to low information density and inefficient evolutionary search. ContextEvolve (green) leverages specialized context distillation agents to compress the lengthy context, enriching the limited window with numerous valuable information.
  • Figure 2: Efficiency analysis and ablation studies of ContextEvolve. (a) Best-so-far performance trajectories over evolutionary iterations in the LB task. (b) Cumulative token usage across five ADRS tasks. (c) Relative performance of ablated variants.
  • Figure 3: (a) The initial solution adopts greedy replication and linear-scan packing, achieving moderate balance but limited speed. (b) A vectorized snake round-robin assignment improves runtime while preserving balance. (c) Largest-remainder proportional apportionment yields balance gains at the cost of reduced speed. (d) The final solution recovers speed without sacrificing balance.
  • Figure 4: Takeaways from prompt perturbations. (a) Preserving ancestral traits is as critical as capturing innovation. (b) Directional ambiguity guidance outperforms implementation specificity. (c) Sampling should prioritize informative semantics, not only high scores.
  • Figure 5: Code evolution in the Load Balancing task. (a) The initial baseline uses inefficient iterative loops for both packing and replication. (b) The best code evolved by ContextEvolve introduces Vectorized Snake Round-Robin (Green Highlights) to maximize speed and Proportional Apportionment (Blue Highlights) to maximize load balance. These algorithmic breakthroughs resulted in a 33.3% improvement in the combined score.