Downloads · 30 days
22
5% of all-time downloads
kreasof-ai/Liquid-Thinking-Preview
Liquid-Thinking-Preview is a text generation model from kreasof-ai. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
<center <div style="text-align: center;" <img src="https://cdn-uploads.huggingface.co/production/uploads/63b6f2e752c02ae8acbaa4d8/Qn87jdxhfCaqQUiAqD60.png" alt="Liquid with Thinking" style="width: 100%; max-width: 66%…
Downloads · 30 days
22
5% of all-time downloads
All-time downloads
462
Public
Parameters
1.2B
2.3 GB on disk
Likes
6
Public
Click a slice to open those files.
.safetensors2.3 GB · 100%
From the Hugging Face model README
This repository contains a full-parameter fine-tuned version of LiquidAI/LFM2-1.2B on the HelpingAI/Intermediate-Thinking-130k dataset. The goal of this fine-tune is to enhance the model's ability to perform step-by-step reasoning and solve problems that require intermediate thought processes.
This model was trained with high efficiency using the Unsloth library.
You can easily run this model for fast inference using the unsloth library.
First, install the necessary packages:
pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
pip install --no-deps git+https://github.com/huggingface/transformers.git
pip install --no-deps causal-conv1d==1.5.0.post8
Next, use the following Python code to load the model and generate text:
from unsloth import FastModel
import torch
from transformers import TextStreamer
model_repo_id = "kreasof-ai/Liquid-Thinking-Preview"
model, tokenizer = FastModel.from_pretrained(
model_name = model_repo_id,
dtype = None, # None for auto detection
load_in_4bit = True, # Use 4bit quantization for faster inference
)
# Define the conversation
messages = [{
"role": "user",
"content": "Explain the step-by-step process of photosynthesis in simple terms.",
}]
# Apply the chat template
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt = True, # Must add for generation
return_tensors = "pt",
).to("cuda")
# Set up the streamer for real-time output
streamer = TextStreamer(tokenizer, skip_prompt = True)
# Generate the response
_ = model.generate(
**inputs,
max_new_tokens = 4096,
# Recommended generation parameters from LiquidAI
temperature = 0.3,
min_p = 0.15,
repetition_penalty = 1.05,
use_cache = True,
streamer = streamer,
)
The HelpingAI/Intermediate-Thinking-130k dataset, consisting of instruction and output pairs, was formatted into a conversational format using the LFM2's chat template. The template follows this structure:
<|im_start|>user
{instruction}<|im_end|>
<|im_start|>assistant
{output}<|im_end|>
The training loss was calculated only on the assistant's responses (train_on_responses_only), encouraging the model to learn the desired output format and reasoning style without being penalized for the user's prompt.
The model was trained with the following hyperparameters using trl.SFTTrainer:
| Hyperparameter | Value |
|---|---|
per_device_train_batch_size | 8 |
gradient_accumulation_steps | 4 |
Effective Batch Size | 32 |
num_train_epochs | 3 |
learning_rate | 4e-5 |
lr_scheduler_type | cosine |
warmup_ratio | 0.1 |
optim | adamw_torch |
weight_decay | 0.01 |
max_seq_length | 8192 |
seed | 3407 |
The training loss curve showed a steady decrease, indicating successful learning.

This model is intended for research and experimentation in multi-step reasoning, complex problem-solving, and chain-of-thought generation.