Search arXiv⌕ Search

arXiv · 2612.02484

Search-Based Context Engineering for AI Agents: Optimizing Token Usage and Task Performance

Abstract

LLM-based agents rely on tools to retrieve the information needed to solve complex tasks. However, every retrieved token enlarges the context, increasing cost and energy consumption. Context engineering addresses this trade-off, yet its design space is too large to explore manually, and existing search-based approaches optimize only isolated aspects of an agent rather than its entire context. To fill this gap, we approach context engineering as a multi-objective search problem and use NSGA-II with accuracy and token usage as objectives to simultaneously optimize an agent's system prompt, its tool-call budget, and the parameters controlling how much content its tools return. We evaluate our approach with two open-weight LLMs on fact verification and question-answering benchmarks against the baseline configuration. On fact verification, NSGA-II finds configurations that reduce token usage by 8%-27% without any significant loss in accuracy. On question answering, token usage is reduced by up to 23%, and in most cases NSGA-II again finds configurations that reduce token usage without sacrificing accuracy. These results show that search-based optimization is an effective approach to design agents that are both accurate and efficient.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Alina Geiger, Lukas Twist, Giusy Annunziata, Ruizhen Gu, Franz Rothlauf, Dominik Sobania. 2026-11-25. Search-Based Context Engineering for AI Agents: Optimizing Token Usage and Task Performance. https://searcharxiv.org/abs/2612.02484

Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite Search arXiv by Indiciae: BibTeX · RIS.

KEEP EXPLORING

Related papers

SGNNBench: A Holistic Evaluation of Spiking Graph Neural Network on Large-scale Graphs

Graph Neural Networks (GNNs), as representative deep models designed for graph data, effectively learn graph topological information and push the performance boundaries across various graph tasks. However, the computational and memory burden of GNNs poses significant challenges for scaling to large real-world graphs. Spiking Graph Neural Networks (SGNNs), which integrate biologically plausible learning via unique spike-based neurons, have emerged as a promising energy-efficient alternative. Different layers communicate with sparse and binary spikes, which facilitates computation and storage of intermediate graph representations. Despite the proliferation of SGNNs proposed in recent years, there is no systematic benchmark to explore the basic design principles of these brain-inspired networks on graph data. To bridge this gap, we present SGNNBench to quantify progress in the field of SGNNs. Specifically, we thoroughly investigate the design space of SGNNs to facilitate the development of a general SGNN paradigm. Regarding efficiency, we empirically compare these baselines w.r.t. model size, memory usage and theoretical energy consumption to reveal previously overlooked energy bottlenecks. Finally, SGNNBench establishes a unified and reliable benchmark to comprehensively evaluate 10 state-of-the-art SGNNs across 24 datasets covering diverse graph settings and tasks.

cs.NE↗

Revisiting Autoregressive GCNs for Vehicle Routing Problems

Autoregressive (AR) Attention Models have become the dominant paradigm in neural solvers for vehicle routing problems (VRPs), while GCNs are almost exclusively paired with non-autoregressive (NAR) decoding and post-search algorithms. In this work, we revisit the role of decoding strategies and model properties in neural VRP solvers, and challenge the conventional pairing of NAR decoding with GCNs. We propose AR-GCN, an efficient and generalizable architecture for both Symmetric and Asymmetric VRPs (SVRPs and AVRPs). Extensive benchmarks across multiple tasks show that AR-GCN achieves advanced generalization performance, particularly on AVRPs (e.g., achieving an optimality gap of 1.64% on ATSP-1K and -5.29% on ACVRP-1K). In particular, AR-GCN requires only 0.628M learnable parameters and 3-epoch training, providing new insights into the design of AR solvers for general VRPs. Our code and data are publicly available at https://github.com/HamJewel/AR-GCN-VRP.

cs.NE↗

An Adaptive Proximal Federated LSTM Framework for Intrusion Detection in IoT Wireless Sensor Networks

Wireless Sensor Networks and the Internet of Things are increasingly vulnerable to routing attacks. Federated Learning (FL) enables collaborative training of intrusion detection models without sharing raw data; however, non-independent and non-identically distributed (Non-IID) data across edge devices can lead to weight divergence (client drift), degrading global convergence. This paper presents an FL-based intrusion detection system that integrates FL-LSTM with an adaptive proximal penalty coefficient mechanism (Adaptive-mu). This Adaptive-mu mechanism dynamically adjusts the regularization strength according to client weight divergence. In addition, local SMOTE is applied at each edge node to address class imbalance while preserving data privacy. Experimental results on the WSN-DS dataset demonstrate that the Adaptive-mu FL-LSTM framework achieves the highest F1-Score among the evaluated FL baselines while maintaining stable performance across independent runs under extreme Non-IID conditions (alpha=0.1), reaching an F1-Score of 74.10% under K=10 and maintaining 58.09% under the more challenging K=50 setting.

cs.NE↗