Towards more Contextual Agents: An extractor-Generator Optimization Framework
On the map: LLM agents and tool use → General LLM agent frameworks and benchmarks
Abstract (arXiv)
Large Language Model (LLM)-based agents have demonstrated remarkable success in solving complex tasks across a wide range of general-purpose applications. However, their performance often degrades in context-specific scenarios, such as specialized industries or research domains, where the absence of domain-relevant knowledge leads to imprecise or suboptimal outcomes. To address this challenge, our work introduces a systematic approach to enhance the contextual adaptability of LLM-based agents by optimizing their underlying prompts-critical components that govern agent behavior, roles, and interactions. Manually crafting optimized prompts for context-specific tasks is labor-intensive, error-prone, and lacks scalability. In this work, we introduce an Extractor-Generator framework designed to automate the optimization of contextual LLM-based agents. Our method operates through two key stages: (i) feature extraction from a dataset of gold-standard input-output examples, and (ii) prompt generation via a high-level optimization strategy that iteratively identifies underperforming cases and applies self-improvement techniques. This framework substantially improves prompt adaptability by enabling more precise generalization across diverse inputs, particularly in context-specific tasks where maintaining semantic consistency and minimizing error propagation are critical for reliable performance. Although developed with single-stage workflows in mind, the approach naturally extends to multi-stage workflows, offering broad applicability across various agent-based systems. Empirical evaluations demonstrate that our framework significantly enhances the performance of prompt-optimized agents, providing a structured and efficient approach to contextual LLM-based agents.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Placed in General LLM agent frameworks and benchmarks, one of 16 directions in LLM agents and tool use. Builds on 13 of its 15 references that are in the map. First posted on arXiv 18 Feb 2025.
Builds on
13 of 15 references.
Closest ancestors · 2
Same direction, newest first
- 2024On the Brittle Foundations of ReAct Prompting for Agentic Large Language Models22 May
- 2023A Survey on Large Language Model based Autonomous Agents22 Aug
Other references · 11
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,057
- 2022Demonstrate-Search-Predict: Composing retrieval and language models for knowledge-intensive NLPcited by 316
- 2024Optimizing Instructions and Demonstrations for Multi-Stage Language Model Programscited by 270
- 2021AI Chains: Transparent and Controllable Human-AI Interaction by Chaining Large Language Model Promptscited by 265
- 2023PaperQA: Retrieval-Augmented Generative Agent for Scientific Researchcited by 143
- 2024A Comprehensive Survey of Scientific Large Language Models and Their Applications in Scientific Discoverycited by 96
- 2024Teach Better or Show Smarter? On Instructions and Exemplars in Automatic Prompt Optimizationcited by 28
- 2025From Few to Many: Self-Improving Many-Shot Reasoners Through Iterative Optimization and Generationcited by 20
- 2023Large Language Model Programscited by 11
- 2024GRAD-SUM: Leveraging Gradient Summarization for Optimal Prompt Engineeringcited by 7
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2025Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models
- 2025Generalizability of Large Language Model-Based Agents: A Comprehensive Survey
- 2025Large Language Model Agent: A Survey on Methodology, Applications and Challenges
- 2024AgentGym: Evolving Large Language Model-based Agents across Diverse Environments
- 2025Gala: Global LLM Agents for Text-to-Model Translation
- 2024Designing Algorithms Empowered by Language Models: An Analytical Framework, Case Studies, and Insights
- 2025A Survey of Context Engineering for Large Language Models
- 2025A Survey on the Optimization of Large Language Model-based Agents