Text Generation
Safetensors
English
qwen2
dyck
reasoning
brackets
fine-tuning
lora
unsloth
conversational
Instructions to use akashdutta1030/DeepSeek-R1-Qwen-1.5B-Dyck-Task with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- Unsloth Studio
How to use akashdutta1030/DeepSeek-R1-Qwen-1.5B-Dyck-Task with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for akashdutta1030/DeepSeek-R1-Qwen-1.5B-Dyck-Task to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for akashdutta1030/DeepSeek-R1-Qwen-1.5B-Dyck-Task to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for akashdutta1030/DeepSeek-R1-Qwen-1.5B-Dyck-Task to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="akashdutta1030/DeepSeek-R1-Qwen-1.5B-Dyck-Task", max_seq_length=2048, )
Dyck Completion Model (Reasoning)
This model is fine-tuned to complete Dyck sequences (balanced bracket sequences) with step-by-step reasoning. Given a prefix of opening brackets, it outputs the minimal closing brackets so the full sequence is a valid Dyck word.
Task
- Input: A prefix of opening brackets (e.g.
[ < (). - Output: Step-by-step reasoning, then the complete valid Dyck sequence (e.g.
) > ]appended). - Bracket pairs:
(),[],{},<>,⟨⟩,⟦⟧,⦃⦄,⦅⦆
Base Model
- Architecture: DeepSeek-R1-Distill-Qwen-1.5B (Unsloth)
- Fine-tuning: LoRA (r=64, alpha=128, dropout=0.05) on q/k/v/o and MLP projections
- Training: Causal LM; loss on assistant tokens only; format:
{reasoning}\n\nFINAL ANSWER: {full_sequence}
Intended Use
- Research and education on formal language (Dyck) and chain-of-thought reasoning.
- Benchmarking reasoning models on bracket completion.
How to Use
With merged model (this repo, if uploaded as merged)
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "YOUR_USERNAME/YOUR_REPO" # e.g. akashdutta1030/dyck-deepseek-r1-lora
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True)
prompt = """Complete the following Dyck language sequence by adding the minimal necessary closing brackets.
Sequence: [ < (
Rules:
- Add only the closing brackets needed to match all unmatched opening brackets
- Output format: Use reasoning, then write exactly "FINAL ANSWER: " followed by the complete Dyck sequence."""
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256, do_sample=True, temperature=0.05)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
# Parse "FINAL ANSWER: ..." from response for the completed sequence
With LoRA adapter (load base + adapter)
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="unsloth/DeepSeek-R1-Distill-Qwen-1.5B",
max_seq_length=768,
)
model, tokenizer = FastLanguageModel.from_pretrained(
"YOUR_USERNAME/YOUR_REPO", # adapter repo
max_seq_length=768,
)
# Then generate as above
Training Details
- Data: JSONL conversations (user question → assistant reasoning + final answer).
- Split: ~95% train, ~5% eval.
- Sequence length: 768 tokens.
- Optimization: AdamW, cosine LR, warmup 10%.
Limitations
- Trained on synthetic Dyck data; may not generalize to arbitrary bracket-like tasks.
- Performance depends on prefix length and bracket vocabulary.
Citation
If you use this model, please cite the base model (DeepSeek-R1-Distill-Qwen) and this fine-tuning setup as appropriate.
- Downloads last month
- -
Model tree for akashdutta1030/DeepSeek-R1-Qwen-1.5B-Dyck-Task
Base model
deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B Finetuned
unsloth/DeepSeek-R1-Distill-Qwen-1.5B