Skip to content

Wangmerlyn/MCTS-GSM8k-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCTS-GSM8k-Demo

This is a repo for showcasing using Monte Carlo Search Tree(MCTS) with LLMs to solve gsm8k problems.

This is just a demo project that goes with my MCTS lecture video, so the implementation and code style can be a little bit rough, feel free to leave any issues or open PRs to contribute.

Shoutout

  • 🥳 A huge shoutout to @euyis1019, this demo now supports both openai and deepseek api calling, along with token usage statistics.

MCTS code template

The MCTS implementation template is from minimal MCTS.

Explaination

Watch how I implemented this Monte Carlo Search Tree on Bilibili(Chinese)

Installation

pip install -r requirements.txt

Run

Command Line Arguments

The project supports the following command line arguments:

  • --provider: Select model provider, options: openai (default) or deepseek
  • --model: Specify model name, defaults to provider-specific model if not specified
  • --api-key: Directly provide API key, reads from environment variables if not specified
  • --base-url: Specify API base URL, defaults to provider-specific URL if not specified
  • --iterations: Specify number of MCTS iterations, default is 4

Example:

export OPENAI_API_KEY="Your API Key"
python main.py

or

python main.py --provider deepseek --model deepseek-chat --iterations 4 --api-key "Your DeepSeek API Key"

About

This is a repo for showcasing using MCTS with LLMs to solve gsm8k problems

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages