LogicCoder-7B

LogicCoder-7B is a 7B-parameter language model fine-tuned for code generation tasks. It is based on the DeepSeek-R1-Distill-Qwen-7B model and trained on a Python subset of the open-r1/codeforces-cots dataset.

This model was fine-tuned on pruned CoTs examples derived via our ASAP method(Anchor-guided, Surprisal-polished Pruning), focusing on highly compressed yet semantically informative reasoning traces.

🧠 Reasoning Mode

We recommend explicitly activating reasoning mode by inserting <think> in the prompt.

🔧 Usage

from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("azzzacs/LogicCoder-7B", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("azzzacs/LogicCoder-7B", device_map="auto", trust_remote_code=True).eval()

message = [{"role": "user", "content": "Please write a Python quick sort algorithm.\n"}]
prompt = tokenizer.apply_chat_template(message, add_generation_prompt=True, tokenize=False) + "<|Assistant|><think>\n"

model_inputs = tokenizer([prompt], return_tensors="pt").to(model.device)

outputs = model.generate(
    model_inputs.input_ids,
    max_new_tokens=4096,
    do_sample=False,
    eos_token_id=tokenizer.eos_token_id
)

print(tokenizer.decode(outputs[0][len(model_inputs.input_ids[0]):], skip_special_tokens=False))
Downloads last month
25
Safetensors
Model size
7.62B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for azzzacs/LogicCoder-7B

Finetuned
(180)
this model
Quantizations
2 models

Dataset used to train azzzacs/LogicCoder-7B