✨ Key Features
- Progressive Multi-Step Reasoning: Supports breaking complex problems into smaller, sequential reasoning steps, particularly for mathematical and scientific tasks.
- Mathematical and Scientific Problem-Solving: Designed for tasks that require logical analysis, intermediate deductions, and multi-stage problem-solving.
- Reasoning Before Tool Selection: Supports generating a reasoning process before deciding which tools may be useful, making it suitable for tool-augmented LLM applications.
- Dynamic Agentic Workflows: Can support agents that need to analyze a task, determine their next action, and select appropriate tools as part of an iterative workflow.
- Context-Aware Decision-Making: Can consider the user's query and available context before determining an appropriate response or action.
🎯 Intended Use Cases
Progressive Thinking is intended for applications that require more than direct, single-step responses.
Table with columns: Use case, Description| Use case | Description |
|---|
| Mathematical reasoning | Solving problems involving multiple calculations or logical steps. |
| Scientific reasoning | Analyzing scientific questions that require intermediate deductions. |
| Tool-augmented agents | Reasoning about which tool to use before invoking it. |
| Complex task solving | Decomposing tasks into manageable subproblems. |
| Conversational systems | Supporting context-sensitive reasoning across multiple turns. |
🚀 Getting Started
The following example demonstrates how to load and run the model using Hugging Face Transformers.
Installation
pip install -U transformers torch
Loading the Model
Replace YOUR_USERNAME/progressive-thinking with your actual Hugging Face model repository ID.
import torchfrom transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer model_name = "YOUR_USERNAME/progressive-thinking" tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForCausalLM.from_pretrained( model_name, torch_dtype="auto", device_map="auto",) model.eval()
Example 1: Progressive Thinking for a Scientific Task
In this example, the model considers a scenario involving Motivational Interviewing (MI), where the therapist needs to respond to client sustain talk.
system_prompt = """You are a helpful assistant. You need to analyze and think step by step and respond to the users query.""" messages = [ { "role": "system", "content": system_prompt, }, { "role": "user", "content": ( "When a therapist is trying to engage with a client, " "the conversation may progress from Engaging to Focusing. " "However, if the client expresses sustain talk, " "what should the therapist do to continue the conversation?" ), },] text = tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True, enable_thinking=True,) inputs = tokenizer( text, return_tensors="pt",).to(model.device) streamer = TextStreamer( tokenizer, skip_prompt=True,) with torch.no_grad(): _ = model.generate( **inputs, max_new_tokens=4096, temperature=0.5, top_p=0.99, top_k=64, do_sample=True, streamer=streamer, )
Expected behavior: The model can reason about the interaction context, consider the significance of sustain talk, and formulate an appropriate response. In Motivational Interviewing, this may involve reflective listening, exploring the client's concerns, and avoiding premature movement toward planning or confrontation.
The actual output depends on the model's learned capabilities, the prompt, and the generation settings.
📝 Prompting Guidelines for Multi-Step Thinking
To get the best results from Progressive Thinking, users should provide a clear scenario, a hypothesis or initial assumption when applicable, and explicit instructions about the reasoning task. Additional questions, constraints, and relevant information can help the model develop a more structured and context-aware response.
Recommended Prompt Structure
A good prompt should include the following components:
- Scenario: Describe the problem, context, or situation the model needs to analyze.
- Hypothesis or Initial Assumption: Provide a hypothesis, proposed explanation, or starting point to investigate, if applicable.
- Clear Instructions: Explain what the model should do, such as analyzing alternatives, evaluating evidence, solving a problem step by step, or identifying the next appropriate action.
- Questions: Specify the key questions that the model needs to answer.
- Additional Information: Include relevant data, constraints, background knowledge, or requirements that may influence the reasoning process.
Not every task requires all five components. For mathematical problems, for example, the scenario and a clear question may be sufficient. For scientific analysis or complex agentic tasks, providing a hypothesis, constraints, and additional context can be particularly useful.
Example: Enabling Multi-Step Thinking
system_prompt = """You are a helpful assistant powered by Progressive Thinking. Analyze the provided scenario progressively.Break complex problems into intermediate reasoning steps,consider relevant hypotheses and alternative explanations,and use the available information to address the questions. Before selecting a tool, assess the task requirementsand determine whether external information or computationis necessary. Provide a clear, structured final answer with themain conclusions and supporting rationale.""" messages = [ { "role": "system", "content": system_prompt, }, { "role": "user", "content": """ Scenario: A therapist is conducting a Motivational Interviewing session. The conversation has progressed through the Engaging stage, and the therapist is beginning Focusing. Hypothesis: When the client expresses sustain talk, immediately moving toward planning may be counterproductive. Instructions: Analyze the scenario using Motivational Interviewing principles. Consider alternative therapist responses and determine the most appropriate next conversational step. Questions: 1. How should the therapist respond to sustain talk? 2. Should the therapist continue Focusing or return to Engaging? 3. What risks arise from moving prematurely to Planning? Additional information: Consider reflective listening, client autonomy, ambivalence, and the importance of maintaining therapeutic engagement. """, },]
Best Practices
- Be specific: Clearly define the problem and the expected outcome.
- Provide context: Include the relevant scenario and background information.
- State hypotheses explicitly: When testing a hypothesis, distinguish it from established facts.
- Ask focused questions: Use targeted questions to guide the analysis.
- Include constraints: Specify assumptions, available resources, and limitations.
- Allow progressive analysis: For complex tasks, instruct the model to evaluate intermediate conclusions before producing its final answer.
- For agentic tasks: Describe the available tools and their purposes if tool selection is required. Actual tool execution must be handled by the surrounding application.
Key principle: The quality and structure of the prompt influence the usefulness of the model's reasoning. A well-defined scenario, explicit instructions, and relevant supporting information help Progressive Thinking approach complex tasks in a more organized and systematic way.
⚙️ Generation Configuration
The examples use the following generation settings:
Table with columns: Parameter, Value, Purpose| Parameter | Value | Purpose |
|---|
max_new_tokens | 4096 | Allows longer reasoning and responses. |
temperature | 0.5 | Controls sampling randomness. |
top_p | 0.99 | Applies nucleus sampling. |
top_k | 64 | Restricts sampling to the top-k candidate tokens. |
do_sample | True | Enables sampling-based generation. |
enable_thinking | True | Enables the thinking mode supported by the model's chat template. |
These are example settings rather than universally optimal values. You may need to adjust them depending on the task, latency requirements, and desired output length.
Note: enable_thinking=True must be supported by the tokenizer's chat template. The precise behavior of the thinking mode depends on the model's training and template configuration.
🧠 How It Fits into an AI System
Progressive Thinking is designed to support a workflow in which reasoning precedes action:
User Query → Progressive Reasoning → Action or Tool Selection → Observation → Final Response
For mathematical and scientific tasks, this workflow can help organize multi-step problem-solving. For agentic applications, it can support decisions about what to do next, while an external execution layer handles tool calls and observations.
The model should be evaluated on the target application to determine whether its reasoning improves task completion, correctness, and tool-selection quality.
⚠️ Limitations
- Generated reasoning is not a guarantee of factual correctness or mathematical validity.
- Longer reasoning outputs may increase inference latency and token consumption.
- Tool selection and execution require an external tool-calling or agent framework.
- Compatibility with
enable_thinking=True depends on the model's tokenizer and chat template.
- Performance may vary across domains, task complexity, prompts, and decoding configurations.
📄 Citation
If you use Progressive Thinking in your research or applications, please cite this repository:
@misc{progressive_thinking, title = {Progressive Thinking}, author = {Ali}, year = {2026}, howpublished = {Hugging Face Model Hub}, url = {https://huggingface.co/YOUR_USERNAME/progressive-thinking}}
🤝 Contributing and Feedback
Feedback, evaluation results, and suggestions for improving progressive reasoning and agentic capabilities are welcome. Please use the repository's discussion or issue features to share your findings.