IDEAS home Printed from https://ideas.repec.org/p/arx/papers/2606.08998.html

The Token Not Taken: Sampling, State, and the Stochasticity of AI Agents

Author

Listed:
  • Muhammad Zia Hydari
  • Raja Iqbal

Abstract

Agentic AI systems can behave differently across runs: the same request may produce a different plan, a different tool call, a different code edit, or a different final answer. Such variability arises from several layers that are often conflated. At the core of many current agents is a foundation model, a large pretrained model adaptable to many downstream tasks, embedded in an orchestration loop that plans, calls tools, observes results, and updates state. One explicit intrinsic source of variability in such systems is token generation: the model computes scores over possible next tokens, the scores are converted into probabilities, and a decoder may sample tokens using a pseudo-random number generator. A small sampled token difference can then cascade downstream into a different tool call, code path, search query, or agent state. Other sources of variability are extrinsic to token sampling, including changing environments, live data, serving infrastructure, batch effects, and numerical details. By separating these layers, this tutorial clarifies what it means to call agentic AI systems stochastic, when such variability can be reproduced under matched conditions, and why deterministic execution need not imply identical behavior in deployed settings.

Suggested Citation

  • Muhammad Zia Hydari & Raja Iqbal, 2026. "The Token Not Taken: Sampling, State, and the Stochasticity of AI Agents," Papers 2606.08998, arXiv.org, revised Jul 2026.
  • Handle: RePEc:arx:papers:2606.08998
    as

    Download full text from publisher

    File URL: https://arxiv.org/pdf/2606.08998
    File Function: Latest version
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Train,Kenneth E., 2009. "Discrete Choice Methods with Simulation," Cambridge Books, Cambridge University Press, number 9780521766555.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Cheng, Leilei & Yin, Changbin & Chien, Hsiaoping, 2015. "Demand for milk quantity and safety in urban China: evidence from Beijing and Harbin," Australian Journal of Agricultural and Resource Economics, Australian Agricultural and Resource Economics Society, vol. 59(2), April.
    2. Wen, Chieh-Hua & Huang, Chia-Jung & Fu, Chiang, 2020. "Incorporating continuous representation of preferences for flight departure times into stated itinerary choice modeling," Transport Policy, Elsevier, vol. 98(C), pages 10-20.
    3. Johannes Buggle & Thierry Mayer & Seyhun Orcan Sakalli & Mathias Thoenig, 2023. "The Refugee’s Dilemma: Evidence from Jewish Migration out of Nazi Germany," The Quarterly Journal of Economics, President and Fellows of Harvard College, vol. 138(2), pages 1273-1345.
    4. Christelis, Dimitris & Dobrescu, Loretti I. & Motta, Alberto, 2020. "Early life conditions and financial risk-taking in older age," The Journal of the Economics of Ageing, Elsevier, vol. 17(C).
    5. Ortega, David L. & Wang, H. Holly & Wu, Laping & Hong, Soo Jeong, 2015. "Retail channel and consumer demand for food quality in China," China Economic Review, Elsevier, vol. 36(C), pages 359-366.
    6. Tina Birgitte Hansen & Jes Sanddal Lindholt & Axel Diederichsen & Rikke Søgaard, 2019. "Do Non-participants at Screening have a Different Threshold for an Acceptable Benefit–Harm Ratio than Participants? Results of a Discrete Choice Experiment," The Patient: Patient-Centered Outcomes Research, Springer;International Academy of Health Preference Research, vol. 12(5), pages 491-501, October.
    7. Doyle, Orla & Fidrmuc, Jan, 2006. "Who favors enlargement?: Determinants of support for EU membership in the candidate countries' referenda," European Journal of Political Economy, Elsevier, vol. 22(2), pages 520-543, June.
    8. Tovar, Jorge, 2012. "Consumers’ Welfare and Trade Liberalization: Evidence from the Car Industry in Colombia," World Development, Elsevier, vol. 40(4), pages 808-820.
    9. Dumbrell, Nikki P. & Kragt, Marit E. & Gibson, Fiona L., 2016. "What carbon farming activities are farmers likely to adopt? A best–worst scaling survey," Land Use Policy, Elsevier, vol. 54(C), pages 29-37.
    10. Yamada, Katsunori & Sato, Masayuki, 2013. "Another avenue for anatomy of income comparisons: Evidence from hypothetical choice experiments," Journal of Economic Behavior & Organization, Elsevier, vol. 89(C), pages 35-57.
    11. Potoglou, Dimitris & Palacios, Juan & Feijoo, Claudio & Gómez Barroso, Jose-Luis, 2015. "The supply of personal information: A study on the determinants of information provision in e-commerce scenarios," 26th European Regional ITS Conference, Madrid 2015 127174, International Telecommunications Society (ITS).
    12. Sant'Anna, Ana Claudia & Bergtold, Jason & Shanoyan, Aleksan & Caldas, Marcellus & Granco, Gabriel, 2021. "Deal or No Deal? Analysis of Bioenergy Feedstock Contract Choice with Multiple Opt-out Options and Contract Attribute Substitutability," 2021 Conference, August 17-31, 2021, Virtual 315289, International Association of Agricultural Economists.
    13. Mark Morrison & Craig Nalder, 2009. "Willingness to Pay for Improved Quality of Electricity Supply Across Business Type and Location," The Energy Journal, , vol. 30(2), pages 117-134, April.
    14. Mtimet, Nadhem & Ujiie, Kiyokazu & Kashiwagi, Kenichi & Zaibet, Lokman & Nagaki, Masakazu, "undated". "The effects of Information and Country of Origin on Japanese Olive Oil Consumer Selection," 2011 International Congress, August 30-September 2, 2011, Zurich, Switzerland 114642, European Association of Agricultural Economists.
    15. Chavez, Daniel E. & Palma, Marco A. & Nayga, Rodolfo M. & Mjelde, James W., 2020. "Product availability in discrete choice experiments with private goods," Journal of choice modelling, Elsevier, vol. 36(C).
    16. Dohmen, Thomas & Meyer, Frauke & Walkowitz, Gari, 2026. "Basic Needs Satisfaction as a Fundamental Distributive Principle: Evidence from the Lab and the Field," IZA Discussion Papers 18409, IZA Network @ LISER.
    17. Boyce, Christopher & Czajkowski, Mikołaj & Hanley, Nick, 2019. "Personality and economic choices," Journal of Environmental Economics and Management, Elsevier, vol. 94(C), pages 82-100.
    18. Choi, Andy S., 2013. "Nonmarket values of major resources in the Korean DMZ areas: A test of distance decay," Ecological Economics, Elsevier, vol. 88(C), pages 97-107.
    19. Doherty, Edel & Campbell, Danny, 2011. "Demand for improved food safety and quality: a cross-regional comparison," 85th Annual Conference, April 18-20, 2011, Warwick University, Coventry, UK 108791, Agricultural Economics Society.
    20. Schleich, Joachim & Faure, Corinne & Guetlein, Marie-Charlotte & Tu, Gengyang, 2020. "Conveyance, envy, and homeowner choice of appliances," Energy Economics, Elsevier, vol. 89(C).

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:arx:papers:2606.08998. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: arXiv administrators (email available below). General contact details of provider: https://arxiv.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.