Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

19 Commits

Folders and files

Repository files navigation

🧠 SteadyThought: Mitigating LLM Under-Thinking
via Thought-Level Preference Optimization

Reducing unnecessary thought switching with thought-level preference optimization.

SteadyThought: identification of thought switch points, trajectory synthesis at switching points, and fine-grained preference optimization

NeurIPS 2026 Code: SteadyThought

简体中文


📚 Overview

SteadyThought mitigates under-thinking through three stages: Identification of Thought Switching Points, Trajectory Synthesis at Switching Points, and Fine-Grained Preference Optimization. By detecting thought switch points with linguistic and entropy signals, synthesizing persistent continuations through logit control, and learning preferences under a shared question-thought context, it encourages commitment to promising reasoning directions while preserving the flexibility to explore alternatives.

Installation

Run commands from the repository root:

conda create -n steadythought python=3.10 -y
conda activate steadythought
python -m pip install -r requirements.txt

Construct STPO data

Edit the model path, dataset path and GPU IDs in scripts/01_*.sh–03_*.sh before running. Keep model and dataset settings consistent. Defaults use DeepSeek-R1-Distill-Qwen-1.5B and Omni-MATH levels 2/3/7.

# 1. Identification of Thought Switching Points.
bash scripts/01_identify_thoughts.sh

# 2. Trajectory Synthesis at Switching Points.
bash scripts/02_synthesize_trajectories.sh

# 3. Prepare pairs for Fine-Grained Preference Optimization.
bash scripts/03_build_stpo_dataset.sh

Or run all stages with bash scripts/run_all.sh.

Final output: outputs/<model>/<dataset>/<model>-<dataset>-stpo.jsonl.

Training

The output can be used directly as an Alpaca-format preference dataset in LLaMA-Factory, without data conversion. Following its dataset guide, register the file as stpo in dataset_info.json, set ranking: true, and map prompt to instruction, chosen to chosen, and rejected to rejected.

Install LLaMA-Factory separately and add these key settings to your complete training configuration (training arguments):

stage: dpo
pref_loss: simpo
dataset: stpo
template: empty
cutoff_len: 6144

Use template: empty because instruction already contains the formatted prompt and thought prefix; chosen and rejected are continuations. Do not wrap the prefix in another chat template. The scripts above construct data only; training runs in LLaMA-Factory.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages