TokenCast: Forecasting Token Consumption During LLM Agent Execution
2mo
- Published
- Collected
When a large language model (LLM) agent executes the same task, token consumption can vary by over an order of magnitude across runs. The agent chooses its next steps based on tool feedback and intermediate results, while the growing context steadily inflates the input size of every subsequent call. The total consumption of a task is therefore hard to predict before execution and the prediction must be revised as the run unfolds. In this paper, we propose TokenCast, which learns a composable cost representation for each execution segment, recording its own consumption and the context growth it introduces. Composing adjacent segments yields a cumulative estimate that captures the extra input cost incurred when context from earlier segments is re-read by every later call. As execution unfolds, newly observed evidence refreshes the forecast, requiring no additional LLM calls and incurring a mean cumulative prediction time of 32.8 ms per run on SWE-bench Verified. Across 4 task suites and 6 agent models, TokenCast's mean absolute error reduction against the strongest comparator averages 14.5% over 96 evaluated combinations. In offline budget-control replay, TokenCast uses 21.3% fewer tokens on average than a fixed-budget policy at matched trace completion. The code is available at https://github.com/DEFENSE-SEU/TokenCast.
Authors
Chaoqian Ouyang, Ling Yue, Libin Zheng, Huanghui Guo, Shengxiang Xu, YiShu Wang, Ran Li, Jian Yin and 2 others
Categories
overfeed.news indexes and links. We publish a short excerpt — the full article stays at arXiv AI Papers.
More from arXiv AI Papers
Log in to follow this sourceEgoCo: From Egocentric Perception to Object-Centric Collaborative Carrying
Two humanoids carrying a long object through unfamiliar rooms must navigate narrow passages, coordinate their motions, and maintain stable support. Existing methods typically rely on external tracking or prescribed motion guidance. We propose EgoCo, a hierarchical framework that organizes navigation and coordination around the shared object using onboard LiDAR, proprioception, and inter-robot communication. A situation-centric planner selects object waypoints from egocentric perception through privileged imitation and reinforcement learning, without requiring a prior map or route. For coordination, Kinematic-Consensus RL combines object-motion proposals and uses rigid-body kinematics to derive compatible robot commands, with learned corrections for slippage and tracking errors. A low-level controller trained for carrying executes these commands while maintaining balance and steady load support. Experiments on 2,000 simulated routes across ten multi-room layouts, together with real-world deployment on two Unitree G1 humanoids, demonstrate the effectiveness of EgoCo without external tracking.
Grounded Policy Learning for Computer Use Agents
Multi-modal large language models have given rise to computer use agents (CUAs) that perceive screenshots and operate real desktop applications over long horizons. However, these agents frequently take actions that are plausible for the task at hand but not grounded in the given screen. We attribute this behavior to imitation learning on human demonstrations, in which nearly every action has its intended effect. The agent can therefore predict the next action from the instruction and its previous actions without reading the current screen. To address this, we introduce Grounded Policy Learning (GPL), a simple, yet effective reinforcement learning framework that rewards a CUA for actions that match the current screen rather than for actions that are merely plausible for the given task. Specifically, to prevent the agent from earning this reward without reading the screen, GPL first constructs counterfactual state pairs and then trains the agent using the pairs. Each pair keeps the instruction and previous actions the same and contrasts a screenshot and the screen description that the agent writes before acting with a realistic variant. The variant replaces either one sentence of the description with a sentence that describes the previous or next screen, or one interface element in the screenshot with a similar element from another screenshot. We also introduce a new benchmark called CUASense, whose screen sensitivity index measures how much the actions of a CUA change when only the current screenshot is edited. With only 1K AgentNet demonstrations, GPL improves the OSWorld-Verified success rate from 37.6% to 48.0% on Qwen3.5-9B and from 63.6% to 68.3% on UI-Venus-2-9B, while increasing screen sensitivity index from 54.7 to 63.0 on Qwen3.5-9B.
FLIP: Fast and Accurate Global Lipschitz Estimation for Large Feedforward Networks
The Lipschitz constant of neural networks is widely used in robustness, control, generalization bounds, and training stability. As modern neural networks continue to scale, existing methods for Lipschitz estimation are either very time-consuming or overly loose. In this work, we focus on both fast and accurate Lipschitz estimation for large feedforward neural networks. We first reformulate the well-known semidefinite program (SDP) framework into an explicit recursive form, and introduce a key theoretical result, bound backpropagation: the SDP objective has upper and lower bounds that can be propagated backward along the recursive computation graph and depend only on partial variables. Leveraging this property, we decompose the original SDP into a sequence of small subproblems, each minimizing a combination of upper and lower bounds over partial variables. We prove that each subproblem is one-dimensional and convex, enabling fast solution via the secant method. Finally, we present the full FLIP algorithm and its complexity, yielding fast and tight Lipschitz estimation for large feedforward networks. Experiments on both randomly generated and trained networks show that FLIP improves speed and tightness by several orders of magnitude over prior methods, giving the tightest Lipschitz estimates for 100M-parameter networks in seconds. Our code is available at: https://github.com/hongboc616/FLIP.
Double Conditioning Architecture: A Hybrid Neural Approach for Refining Multi-Horizon Demand Forecasts
Multi-horizon demand forecasting presents challenges related to temporal accuracy and cumulative demand volume estimation, even when forecasts are already available. This study proposes Double Conditioning Architecture (DCA), a hybrid and modular neural architecture designed to refine existing forecasts through double conditioning, volumetric adjustment, and deviation control relative to an external predictive signal. The evaluation involved nine heterogeneous datasets, three temporal partitions, and a twelve-period forecasting horizon, considering three neural configurations: DNN- LSTM-DCA, TCN-Transformer-DCA, and TSMixer-TimeXer-DCA. The initial predictive signal was obtained using Overall Weighted Average (OWA) selection. Performance was assessed using Global Relative Accuracy (GRA), an indicator of agreement between cumulative forecasted and observed demand volumes, together with WAPE and sMAPE. The results showed consolidated descriptive improvements in GRA and statistically significant aggregate reductions in WAPE and sMAPE, although performance varied across demand characteristics. These findings support the potential of DCA as an extensible architecture for refining multi-horizon forecasts. Its design allows predictive signals generated by different forecasting methods to be incorporated through conditioned neural mechanisms and controlled volumetric corrections.