Skip to content

SmartSwitch: Advancing LLM Reasoning by Overcoming Underthinking via Promoting Deeper Thought Exploration

Notifications You must be signed in to change notification settings

dvlab-research/SmartSwitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartSwitch: Advancing LLM Reasoning by Overcoming Underthinking

Python Version License: Apache 2.0 ArXiv Paper

This is the official implementation of "SmartSwitch: Advancing LLM Reasoning by Overcoming Underthinking via Promoting Deeper Thought Exploration".

Paper: SmartSwitch: Advancing LLM Reasoning by Overcoming Underthinking via Promoting Deeper Thought Exploration

Overview of SmartSwitch:

SmartSwitch is a training-free, plug-and-play inference framework designed to address the "underthinking" problem in Large Language Models (LLMs). By dynamically monitoring, evaluating, and intervening in the model's reasoning process, SmartSwitch guides the LLM toward deeper exploration of promising thoughts, significantly boosting its performance and efficiency on complex reasoning tasks.

Contents

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/smartswitch.git
    cd smartswitch
  2. Create and activate a conda environment. We recommend Python 3.10.

    conda create -n smartswitch python=3.10
    conda activate smartswitch
  3. Install the required dependencies:

    # vLLM for high-throughput inference serving
    pip install vllm==0.7.3
    # symeval for robust mathematical answer verification
    pip install "git+https://github.com/tongyx361/symeval.git"

Run Inference and Evaluation

The entire process, from generating solutions to evaluating their accuracy, can be executed with a single script.

1. Launch Inference Servers (Prerequisite)

Before running the main script, ensure the vLLM servers for the base model are running.

mkdir logs
# Grant execute permissions
chmod +x setup.sh
# Launch the vLLM servers in the background
./setup.sh

2. Configure and Run the Combined Script

The main script is run_and_eval_combined.sh. Before executing, open the file and configure the following key parameters at the top:

  • MODEL_PATH: Set the path to your base LLM checkpoint.
  • data_type: Specify the dataset to use (e.g., AIME24).
  • CUDA_VISIBLE_DEVICES: Assign the GPU(s) to use for the script.
  • Other parameters like SEED and THRESHOLD can also be adjusted for experiments.

Once configured, execute the script:

# Grant execute permissions
chmod +x run_and_eval_combined.sh

# Run the entire pipeline
./run_and_eval_combined.sh

This script will automatically perform the following steps:

  1. Generation: Runs the inference process with SmartSwitch on the specified dataset.
  2. Evaluation: Once generation is complete, it immediately evaluates the outputs.
  3. Results: Prints the final pass@1 accuracy to the console and saves detailed logs and generated files in the results_test/ directory.

Citation

If you find this work useful in your research, please consider citing our paper:

@article{anonymous2025smartswitch,
  title={SmartSwitch: Advancing LLM Reasoning by Overcoming Underthinking via Promoting Deeper Thought Exploration},
  author={Xichen Zhang, Sitong Wu, Haoru Tan, Shaozuo Yu, Yinghao Zhu, Ziyi He, Jiaya Jia},
  journal={arXiv preprint arXiv:2510.19767},
  year={2025}
}

Acknowledgement

We would like to thank the following projects for their great work and inspiration:

  • vLLM for enabling efficient LLM inference.
  • The creators of the Universal-PRM for providing a powerful tool for process supervision.
  • The authors of symeval for the robust evaluation library.

About

SmartSwitch: Advancing LLM Reasoning by Overcoming Underthinking via Promoting Deeper Thought Exploration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published