Skip to content

Demo code for the paper "Reversal of Thought: Enhancing Large Language Models with Preference-Guided Reverse Reasoning Warm-up."

License

Notifications You must be signed in to change notification settings

Jiahao-Yuan/Reversal-of-Thought

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b6a5a57 Β· Dec 23, 2024

History

2 Commits
Dec 23, 2024
Dec 23, 2024
Nov 9, 2024
Dec 23, 2024
Dec 23, 2024

Repository files navigation

Reversal of Thought: Enhancing Large Language Models with Preference-Guided Reverse Reasoning Warm-up

RoT improves reasoning accuracy and efficiency while minimizing computational costs, leveraging Preference-Guided Reverse Reasoning and a Cognitive Preference Manager to optimally explore LLM reasoning with cognitive preferences.

Model Architecture

Demo for Preference-Guided Reverse Reasoning

πŸŽ‰πŸŽ‰πŸŽ‰ reversal_demo.py

from utils.llm_utils import *
from utils.prompt import *
pipeline=Pipeline(model_id=model_id, base_url=base_url, api_key=api_key, prob=True)
demos = "Input:... Output:..." #Suggest 2-shot Demos
llm_taste=rot_pipeline( pipeline, reversal_of_thought, demos=demos, warmup=5)

What might reversal_demo.py be used for?

  • Enhance LLM-Preferred Prompts for Task Solutions
    Refines prompts to align with LLM-preferred strategies, optimizing task-solving efficiency.

  • Potential for Creating Diverse QA Datasets
    Generates varied question-answer pairs to improve dataset diversity.

Citation

If you find our work useful for your research, please kindly cite our paper as follows:

@article{yuan2024reversal,
  title={Reversal of Thought: Enhancing Large Language Models with Preference-Guided Reverse Reasoning Warm-up},
  author={Yuan, Jiahao and Du, Dehui and Zhang, Hao and Di, Zixiang and Naseem, Usman},
  journal={arXiv preprint arXiv:2410.12323},
  year={2024}
}

About

Demo code for the paper "Reversal of Thought: Enhancing Large Language Models with Preference-Guided Reverse Reasoning Warm-up."

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages