To enhance the reasoning capabilities of smaller-sized language models, employ a system of thinking that incorporates mental models, structured Chain-of-Thought processes, and thoughtful reflection before responding to user queries.
588 Pulls Updated 3 months ago
Updated 3 months ago
3 months ago
d7ef8c9ccfb7 · 4.9GB
Readme
Intuitive Thinker
Problem: smaller-sized transformer models exhibit inferior reasoning capabilities compared to their larger counterparts, whose advanced reasoning abilities stem from broader connection networks that facilitate cross-domain inference.
Solution: Two-Step Approach:
- Finetuning: Commence by fine-tuning the Llama 3.1, a smaller-sized transformer model with 8 billion parameters, on an enhanced reasoning dataset to bolster its cognitive capabilities.
- Revelation of Internal Processes: Subsequently, leverage a system of thinking model guidance techniques (Think, Plan, Reasoning and Reflection) to unveil the model’s internal thought processes and the rationales underlying its processing mechanisms.
Features
Finetuned Llama 3.1 8B model to improve small LLM model reasoning API for static or dynamic thinking guidance of system of thinking Support Ollama for local usage
Available System Thinking Models
Understand,, Think, Plan, Reasoning and Reflection
- Chain-of-Thoughts
- Thinking Fast and Slow
- Critical Thinking
- Iceberg Mental Model
- Second Order Thinking
Usage Directly
1. Chain-of-Thoughs
ollama run mychen76/llama3.1-intuitive-thinker:chain-of-thoughts.q5
2. Thinking Fast and Slow
ollama run mychen76/llama3.1-intuitive-thinker:thinking-fast-n-slow.q5
3. Critical Thinking
ollama run mychen76/llama3.1-intuitive-thinker:critical-thinking.q5
4. Iceberg Mental Model
ollama run mychen76/llama3.1-intuitive-thinker:iceberg-mental-model.q5
5. Second Order Thinking
ollama run mychen76/llama3.1-intuitive-thinker:second-order-thinking.q5
**Sample: Second Order Thinking **
=========== user question ===================
Patel family who is planning a road trip from Toronto to Vancouver, covering a total distance of 4,400 km. They want to divide the drive into equal parts over 5 days, with each
... day's drive being 15 km longer than the previous day. If they drive x km on the first day, what is the value of x that will allow them to complete the trip in 5 days?
=========== model Response ===================
<thinking>
1. Analyze the question and outline the approach:
The Patel family needs to divide a 4,400 km road trip into equal parts over 5 days, with each day's drive being 15
km longer than the previous day.
2. Present a clear plan of steps to solve the problem:
Step 1: Calculate the total daily increase in distance.
The total daily increase in distance is given as 15 km.
Step 2: Determine the total distance covered on the last day.
Since each day's drive is 15 km longer than the previous day, we can set up an arithmetic sequence to find the
distance covered on each day.
Let x be the distance covered on the first day.
The distances covered on each of the subsequent days will be:
(x + 15), (x + 30), (x + 45), and (x + 60).
Step 3: Calculate the total distance covered over the 5-day period.
We can add up the distances to get the total distance:
x + (x + 15) + (x + 30) + (x + 45) + (x + 60) = 4,400
Combine like terms:
5x + 150 = 4,400
Step 4: Solve for x.
Subtract 150 from both sides:
5x = 4,250
Divide by 5:
x = 850
Therefore, the Patel family should drive 850 km on the first day.
<reflection>
1. Review reasoning:
We used an arithmetic sequence to model the daily increase in distance and solved for x using algebraic
manipulations.
2. Check past decisions and outcomes:
This approach has been successfully applied to similar problems involving evenly spaced distances over multiple
days.
3. Consider potential errors or oversights:
- Ensure that we correctly accounted for each day's increase in distance.
- Confirm that our solution is feasible given the constraints of a standard 24-hour clock.
4. Refine initial decision if necessary:
After careful consideration, our initial decision to solve for x appears sound and should result in an accurate
answer.
5. Adjust conclusion if needed:
No adjustments are required at this time.
<second_order_thinking>
Let's break down the second-order consequences of our decision:
1. Immediate outcome: The Patel family will complete their road trip within the 5-day period.
2. First-order consequence: They will have to drive increasing distances each day, with the longest drive on the
fifth day (x + 60).
3. Second-order consequence: This daily increase may impact their rest times and potential sightseeing stops along
the way.
4. Third-order consequence: The family's tiredness levels could be affected due to the varying distances each day,
possibly influencing their ability to appreciate scenic routes or handle unexpected delays.
We should also consider how different parts of a system (e.g., people, processes, resources) might interact as a
result of our decision:
- Individual fatigue may affect driving performance.
- Group discussions about rest stops and sightseeing could impact overall trip satisfaction.
Let's assess the likelihood and potential impact of these consequences. The daily increase is designed to be
manageable for most drivers, but it does pose some challenges:
1. Higher chance of driver fatigue (3/5)
2. Moderate chance of missed scenic opportunities (2/5)
3. Low chance of severe traffic accidents due to daily increases (0/5)
To better understand the perspectives and reactions of others, let's put ourselves in their shoes:
- A cautious friend might advise against driving further on the fifth day.
- An enthusiastic family member could suggest exploring additional routes or attractions.
Considering past decisions, similar road trips with varying distance constraints have resulted in mixed outcomes.
Some groups successfully adapted to daily increases while others encountered difficulties due to underestimating
fatigue levels.
Worst-case scenario: Unforeseen traffic congestion forces the family to spend an extra night on the road.
Best-case scenario: The family adapts well to increasing distances and completes their trip with memorable
experiences.
Direct benefits of our chosen approach include a more dynamic driving schedule, potentially offering opportunities
for scenic detours. Direct drawbacks may involve increased stress levels due to variable daily distances.
After careful consideration, we believe our decision to calculate the value of x that will allow the Patel family
to complete the trip in 5 days is sound.
<reflection closed>
</thinking>
Given these considerations and calculations, the Patel family should drive 850 km on the first day.
Usage API:
**Sample: Chain Of Thoughts **
import ollama
client = ollama.Client(host='http://192.168.0.47:11434')
response = client.chat(
model="mychen76/llama3.1-intuitive-thinker:chain-of-thoughts.q5",
messages= [{'role': 'user','content': "apply second_order_thinking to query: Patel family who is planning a road trip from Toronto to Vancouver, covering a total distance of 4,400 km. They want to divide the drive into equal parts over 5 days, with each day's drive being 15 km longer than the previous day. If they drive x km on the first day, what is the value of x that will allow them to complete the trip in 5 days?"}]
)
print(response['message']['content'])
Result
<thinking>
a) Brief analysis: The problem requires finding the value of x (distance driven on the first day) such that the
total distance covered over 5 days equals 4,400 km. Each day's drive must be 15 km longer than the previous day.
b) Approach:
1. Calculate the total additional distance driven over the 5 days.
2. Subtract this from the total distance to find the distance driven on each of the 5 days.
3. Use algebra to solve for x (distance driven on the first day).
c) Chain of Thought:
1. The family drives a total of 4,400 km over 5 days.
The extra distance driven on each subsequent day is 15 km.
2. Let's denote the distance driven on each day as:
Day 1: x
Day 2: x + 15
Day 3: x + 30
Day 4: x + 45
Day 5: x + 60
3. The total extra distance is the sum of the additional distances on each day:
Extra distance = (x+15) - x + (x+30) - x + (x+45) - x + (x+60) - x
= 15 + 30 + 45 + 60
= 150 km
4. The total distance driven is the sum of the distances on each day:
Total distance = x + (x+15) + (x+30) + (x+45) + (x+60)
= 5x + 150
5. We want this to equal 4,400 km.
So, 5x + 150 = 4,400
6. Subtracting 150 from both sides:
5x = 4,250
7. Dividing by 5:
x = 850
<reflection>
1. We've found that the distance driven on the first day is 850 km.
2. Let's check if this solution allows them to complete the trip in 5 days with each day's drive being 15 km longer
than the previous day:
Day 1: 850 km
Day 2: 865 km (850 + 15)
Day 3: 880 km (865 + 15)
Day 4: 895 km (880 + 15)
Day 5: 910 km (895 + 15)
3. The total distance driven over the 5 days is indeed:
850 + 865 + 880 + 895 + 910 = 4,400 km
4. This confirms that our solution is correct.
<reflection> closed
</thinking>
<output>
The Patel family should drive 850 km on the first day of their road trip to ensure they complete the total distance
of 4,400 km over the course of 5 days.
</output>
parsed output
def parse_output(full_response):
# Removing closing TAGS because sometimes skipped by GEMMA2
text = full_response.replace('</thinking>','')
text = text.replace('</output>','')
text = text.replace('</reflection>','')
thinking = text.split('<thinking>')[-1].split('<reflection>')[0]
reflection = text.split('<reflection>')[-1].split('<output>')[0]
think_answer = text.split('<output>')[-1] #full_response.split('<o
return think_answer
parse_output(response['message']['content'])
Final answer:
The Patel family should drive 850 km on the first day of their road trip to ensure they complete the total distance of 4,400 km over the course of 5 days.\n'
Sample: Non-Linear Thinking
Ollama API Call:
import ollama
client = ollama.Client(host='http://192.168.0.47:11434')
response = client.chat(
model="mychen76/llama3.1-intuitive-thinker:chain-of-thoughts.q5",
messages= [{'role': 'user','content': "apply nonlinear thinking to query: Patel family who is planning a road trip from Toronto to Vancouver, covering a total distance of 4,400 km. They want to divide the drive into equal parts over 5 days, with each day's drive being 15 km longer than the previous day. If they drive x km on the first day, what is the value of x that will allow them to complete the trip in 5 days?"}]
)
print(response['message']['content'])
Results:
<thinking>
To solve this problem, we'll use nonlinear thinking by analyzing the given conditions and breaking down the problem
into manageable parts.
1. Define variables:
Let x be the distance driven on the first day.
The total distance is 4,400 km.
Each day's drive is 15 km longer than the previous day.
2. Calculate the distances for each of the five days:
Day 1: x
Day 2: x + 15
Day 3: (x + 15) + 15 = x + 30
Day 4: (x + 30) + 15 = x + 45
Day 5: (x + 45) + 15 = x + 60
3. The sum of the distances for all five days should equal the total distance:
x + (x + 15) + (x + 30) + (x + 45) + (x + 60) = 4,400 km
Combine like terms:
5x + 150 = 4,400
4. Subtract 150 from both sides to isolate the term with x:
5x = 4,250
5. Divide by 5 to solve for x:
x = 850
Therefore, the Patel family should drive 850 km on the first day.
<reflection>
Is the assumption that each day's drive is exactly 15 km longer than the previous valid?
Yes, it's a straightforward calculation and doesn't contradict any given information.
</reflection>
<reflection>
Does this solution meet all conditions of the problem?
Yes, x = 850 will indeed result in equal parts over 5 days, with each part being 15 km longer than the last.
The total distance driven will be 4,400 km, as required.
</reflection>
</thinking>
<output>
The value of x that will allow the Patel family to complete the trip in 5 days is 850 km.
This solution ensures that the first day's drive (850 km) is followed by drives of increasing distances: 865 km,
880 km, 895 km, and 910 km. The total distance covered over these five days adds up to 4,400 km, meeting the trip's
requirements.
Related concepts you might find interesting:
1. Geometric progression in real-world applications
2. Optimization problems in logistics
Do you need any clarification on this solution or would you like to explore related topics further?