Challenges and Optimizations for Long-Horizon Agentic Workloads
Long-horizon agentic workloads face challenges in handling extended interactions efficiently, requiring optimized architectures and memory management strategies to maintain performance and scalability.
Challenges with Long-Horizon Agentic Workloads
Making open models work for long-horizon agentic workloads presents unique challenges, particularly in handling extended interactions efficiently. According to research from Together AI, coding agents often exhibit an unusual traffic pattern characterized by large input sequence lengths (ISL) and small output sequence lengths (OSL), which is typical of most agentic workloads. This pattern can lead to inefficiencies when processing long sessions, as noted by the authors. If the GPU were required to reprocess the entire transcript from scratch on every turn, performance would degrade significantly over time, resulting in slower response times and increased computational costs. These findings highlight the need for optimized architectures and memory management strategies to support sustained, complex agent interactions without compromising efficiency or scalability.
Efficient Token Processing with Caching
Efficient token processing with caching is a critical optimization for long-horizon agentic workloads. As noted in Ollama, during the decoding phase, models generate tokens sequentially, requiring repeated attention to prior tokens, which can be computationally expensive. Caching mitigates this by storing intermediate key-value pairs from earlier tokens, as described in Ollama. This allows the engine to reuse prior computations, reducing redundant processing. In practice, this means that for subsequent turns in an agent session—such as turn 7, which builds on turn 6—the engine only needs to compute the new portion, as stated in Ollama. This approach significantly improves efficiency without sacrificing the model’s ability to maintain context across extended interactions.
Integration of Open Models with Existing Workflows
Integration of open models with existing workflows is becoming increasingly feasible, as demonstrated by recent developments. According to Ollama, platforms such as Claude Code, Codex, and Pi can be connected with open models like DeepSeek-V4.1-Flash and GLM-5.3, allowing users to maintain their current workflows without significant disruption. This compatibility is further supported by the ability of these models to perform specific tasks, such as searching for keywords and retrieving relevant lines of code, as noted in Ollama. Additionally, Ollama highlights that models like Kimi K3 and GLM-5.3-Flash are now capable of breaking down complex tasks and delegating subtasks to subagents, enhancing their utility in long-horizon agentic workloads. These capabilities suggest that open models are becoming more adaptable to real-world applications, though their effectiveness may depend on the specific implementation and integration strategies employed.
Optimizing GPU Usage and Cache Management
Optimizing GPU usage and cache management is critical for long-horizon agentic workloads. According to Ollama, a single GPU can cost around $50k per year to rent, emphasizing the need for efficient utilization. Ideally, a GPU should never sit idle and should serve hundreds of users simultaneously, each at different stages of their request. Keeping the cache alive between turns, as noted in Ollama, is essential for maintaining performance and reducing latency. Routing only helps if there’s still a cache to route to, highlighting the interdependence of these components. Ollama suggests that sending a brief containing only the necessary files and instructions for a subagent can help streamline operations and reduce unnecessary overhead. These strategies collectively aim to ensure that computational resources are used effectively, supporting the complex demands of agentic systems without compromising performance or cost efficiency.
Dynamic Memory Allocation and PagedAttention
Dynamic memory allocation, specifically through mechanisms like PagedAttention, addresses the challenge of unpredictable response lengths in long-horizon agentic workloads. As noted in Ollama, rather than reserving memory for the maximum possible context length, cache memory is allocated in small blocks as needed, similar to how an operating system manages RAM. This approach prevents unnecessary memory waste and ensures efficient resource utilization. Ollama highlights that this method avoids performance bottlenecks caused by long agent prompts, ensuring that token streaming remains smooth for all users. By dynamically managing memory, systems can handle varying workloads without compromising responsiveness or scalability.
Sources and reporting notes
Based on published source material. No independent hands-on testing is claimed.