Skip to content

[AAAI 2026] The official implementation of the paper "BayesAgent: Bayesian Agentic Reasoning Under Uncertainty via Verbalized Probabilistic Graphical Modeling".

License

Notifications You must be signed in to change notification settings

xingbpshen/agentic-reasoning-vpgm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BayesAgent: Bayesian Agentic Reasoning Under Uncertainty via Verbalized Probabilistic Graphical Modeling

arXiv Python Version PyTorch Version vLLM Version

This repository contains the official implementation of the paper:

BayesAgent: Bayesian Agentic Reasoning Under Uncertainty via Verbalized Probabilistic Graphical Modeling
Hengguan Huang*, Xing Shen*, Guang-Yuan Hao, Songtao Wang, Lingfa Meng, Dianbo Liu, David Alejandro Duchene, Hao Wang, Samir Bhatt
*Equal contribution
AAAI Conference on Artificial Intelligence, 2026
Paper (arXiv preprint)

The technical appendix can be found at here.

Overview

In this work, we explore for the first time how to bridge LLM agents with probabilistic graphical models (PGMs) to address agentic reasoning under uncertainty. To this end, we introduce Verbalized Probabilistic Graphical Modeling (vPGM), a Bayesian agentic framework that (i) guides LLM agents in following key principles of PGMs through natural language and (ii) refines the resulting posterior distributions via numerical Bayesian inference. Unlike many traditional probabilistic methods requiring substantial domain expertise, vPGM bypasses expert‐driven model design, making it well‐suited for scenarios with limited assumptions.

fig

1. Preparation

1.1 Installation

It is recommended to use a virtual environment (e.g., venv) to avoid package conflicts. Here we assume you are using venv as your virtual environment. If you are using conda, please adjust the commands accordingly.

git clone https://github.com/xingbpshen/agentic-reasoning-vpgm.git
cd agentic-reasoning-vpgm/
pip install -r requirements.txt

1.2 Preparing the Dataset

The downloaded dataset should be structured in the following format, the datasets/ directory should be placed at the root of the repository:

datasets/
└── my_scienceqa/
    ├── val_1005.json
    ├── test_2563.json
    └── DATASET_LICENSE

This dataset is a subset, and a processed (all tools' responses are included) version of the original ScienceQA dataset. For convenience, we provide a Google Drive link to download the processed dataset used in our experiments, note that the dataset is under CC BY-NC-SA 4.0 license.

1.3 Preparing the Large Language Model (LLM)

We recommend to download the open-source LLMs using huggingface-cli 🤗 (make sure you obtained relevant permissions/agreement to download the models from Hugging Face):

huggingface-cli login
huggingface-cli download {REPO_NAME} --local-dir {SAVE_FOLDER} --local-dir-use-symlinks False

For example, the {REPO_NAME} can be meta-llama/Meta-Llama-3-8B-Instruct and {SAVE_FOLDER} can be /usr/local/data/Meta-Llama-3-8B-Instruct. The downloaded model will be saved in the specified folder {SAVE_FOLDER}.

2. Running Inference

2.1 Modifying Arguments in auto_run.sh

Please modify the following arguments in auto_run.sh before running the script:

  • --llm_name: the name of the LLM used, e.g., Meta-Llama-3-8B-Instruct.
  • --model_path: the path to the downloaded LLM.
  • --xdg_cache_home: the path to the cache directory.

2.2 Running the Script

Please run the following command to run inference:

bash auto_run.sh

The inference results file will be saved in the specified path results/ under the project root.

Acknowledgments

S.B. acknowledges funding from the MRC Centre for Global Infectious Disease Analysis (reference MR/X020258/1), funded by the UK Medical Research Council (MRC). This UK funded award is carried out in the frame of the Global Health EDCTP3 Joint Undertaking. S.B. is funded by the National Institute for Health and Care Research (NIHR) Health Protection Research Unit in Modelling and Health Economics, a partnership between UK Health Security Agency, Imperial College London and LSHTM (grant code NIHR200908). H.W. is partially supported by Amazon Faculty Research Award, Microsoft AI & Society Fellowship, NSF CAREER Award IIS-2340125, NIH grant R01CA297832, and NSF grant IIS-2127918. We acknowledge support from OpenAI’s Researcher Access Program. Disclaimer: "The views expressed are those of the author(s) and not necessarily those of the NIHR, UK Health Security Agency or the Department of Health and Social Care." S.B. acknowledges support from the Novo Nordisk Foundation via The Novo Nordisk Young Investigator Award (NNF20OC0059309). S.B. acknowledges the Danish National Research Foundation (DNRF160) through the chair grant. S.B. acknowledges support from The Eric and Wendy Schmidt Fund For Strategic Innovation via the Schmidt Polymath Award (G-22-63345) which also supports H.H. and L.M.

Contact

Please raise a GitHub issue or email us at xing.shen@mail.mcgill.ca (with the email subject starting with "[vPGM]") if you have any question or encounter any issue.

About

[AAAI 2026] The official implementation of the paper "BayesAgent: Bayesian Agentic Reasoning Under Uncertainty via Verbalized Probabilistic Graphical Modeling".

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published