{"slug": "tokencast-forecasting-token-consumption-during-llm-agent-execution", "title": "TokenCast: Forecasting Token Consumption During LLM Agent Execution", "summary": "Researchers submitted TokenCast, a method that learns a composable cost representation for each execution segment of an LLM agent run, forecasting token consumption before and during execution without additional LLM calls. On SWE-bench Verified the method incurs a mean cumulative prediction time of 32.8 ms per run, and across 4 task suites and 6 agent models it reduces mean absolute error by an average of 14.5% versus the strongest comparator 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, with code released on GitHub.", "body_md": "# Computer Science > Machine Learning\n\n  [Submitted on 28 Sep 2026]\n\n# Title:TokenCast: Forecasting Token Consumption During LLM Agent Execution\n\n[View PDF](http://arxiv.org/pdf/2609.35760v1)\n\n[HTML (experimental)](https://arxiv.org/html/2609.35760v1)\n\nAbstract: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 [this https URL](https://github.com/DEFENSE-SEU/TokenCast).\n    \n\n### Current browse context:\n\ncs.LG\n\n### References & Citations\n\nLoading...\n\n# Bibliographic and Citation Tools\n\nBibliographic Explorer \n\n*(*[What is the Explorer?](https://info.arxiv.org/labs/showcase.html#arxiv-bibliographic-explorer))\nConnected Papers \n\n*(*[What is Connected Papers?](https://www.connectedpapers.com/about))\nLitmaps \n\n*(*[What is Litmaps?](https://www.litmaps.co/))\nscite Smart Citations \n\n*(*[What are Smart Citations?](https://www.scite.ai/))\n# Code, Data and Media Associated with this Article\n\nalphaXiv \n\n*(*[What is alphaXiv?](https://alphaxiv.org/))\nCatalyzeX Code Finder for Papers \n\n*(*[What is CatalyzeX?](https://www.catalyzex.com))\nDagsHub \n\n*(*[What is DagsHub?](https://dagshub.com/))\nGotit.pub \n\n*(*[What is GotitPub?](http://gotit.pub/faq))\nHugging Face \n\n*(*[What is Huggingface?](https://huggingface.co/huggingface))\nScienceCast \n\n*(*[What is ScienceCast?](https://sciencecast.org/welcome))\n# Demos\n\n# Recommenders and Search Tools\n\nInfluence Flower \n\n*(*[What are Influence Flowers?](https://influencemap.cmlab.dev/))\nCORE Recommender \n\n*(*[What is CORE?](https://core.ac.uk/services/recommender))\nIArxiv Recommender\n\n*(*[What is IArxiv?](https://iarxiv.org/about))\n# arXivLabs: experimental projects with community collaborators\n\narXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.\n\nBoth individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.\n\nHave an idea for a project that will add value for arXiv's community? [**Learn more about arXivLabs**](https://info.arxiv.org/labs/index.html).", "url": "https://wpnews.pro/news/tokencast-forecasting-token-consumption-during-llm-agent-execution", "canonical_source": "http://arxiv.org/abs/2609.35760v1", "published_at": "2026-09-29 17:04:28+00:00", "updated_at": "2026-09-29 17:20:40.978366+00:00", "lang": "en", "topics": ["large-language-models", "ai-agents", "machine-learning", "ai-research", "mlops"], "entities": ["TokenCast", "SWE-bench Verified", "arXiv", "GitHub", "DEFENSE-SEU"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/tokencast-forecasting-token-consumption-during-llm-agent-execution", "markdown": "https://wpnews.pro/news/tokencast-forecasting-token-consumption-during-llm-agent-execution.md", "text": "https://wpnews.pro/news/tokencast-forecasting-token-consumption-during-llm-agent-execution.txt", "jsonld": "https://wpnews.pro/news/tokencast-forecasting-token-consumption-during-llm-agent-execution.jsonld"}}