Views
No views yet
| Field | Value |
|---|---|
| Base model | LiquidAI/LFM2-24B-A2B |
| Architecture | LFM2 MoE (Mixture of Experts), 24B total / ~2.3B active params per token |
| Fine-tune method | LoRA (rank 16, alpha 16) via Unsloth |
| Training data | shuff57/ogre-phase1-synth — 13,201 synthetic reasoning examples |
| Training steps | 1,568 steps (1 epoch) |
| Hardware | Google Colab A100 40GB + High-RAM (80GB system RAM) |
| Export format | Merged 16-bit safetensors |
| Phase | Phase 1 of 2 — reasoning pre-training before OGRE grading fine-tune |
1# LoRA config
2LORA_RANK = 16
3LORA_ALPHA = 16
4LORA_DROPOUT = 0.0
5LORA_TARGET_MODULES = [
6 "q_proj", "k_proj", "v_proj",
7 "out_proj", "in_proj", # LFM2 attention projections
8 "w1", "w2", "w3", # MoE expert MLP layers
9]
10
11# SFTConfig
12per_device_train_batch_size = 1
13gradient_accumulation_steps = 8 # effective batch size = 8
14num_train_epochs = 1
15learning_rate = 2e-5
16lr_scheduler_type = "cosine"
17warmup_ratio = 0.1
18optim = "adamw_8bit"
19bf16 = True
20packing = False # disabled for MoE routing stabilitytrain_on_responses_only1pip install unsloth_zoo unsloth
2pip install transformers==5.3.0 # >=5.0.0 required for lfm2_moe arch
3pip install trl==0.22.2 datasets==4.3.0device_map="cpu" required during loading to avoid VRAM OOM during MoE expert weight conversion. Use a runtime with ≥50GB system RAM.1from unsloth import FastLanguageModel
2import torch
3
4model, tokenizer = FastLanguageModel.from_pretrained(
5 model_name = "shuff57/lfm2-24b-phase1-reasoning",
6 max_seq_length = 8192,
7 load_in_4bit = True,
8 dtype = torch.bfloat16,
9 device_map = "cpu",
10)
11
12FastLanguageModel.for_inference(model)
13
14messages = [
15 {"role": "system", "content": "You are a careful analytical reasoner."},
16 {"role": "user", "content": "Your question here."},
17]
18
19inputs = tokenizer.apply_chat_template(
20 messages,
21 tokenize=True,
22 add_generation_prompt=True,
23 return_tensors="pt",
24).to(model.device)
25
26outputs = model.generate(
27 input_ids = inputs,
28 max_new_tokens = 1024,
29 temperature = 0.1,
30 top_k = 50,
31 repetition_penalty = 1.05,
32)
33print(tokenizer.decode(outputs[0], skip_special_tokens=True))| Phase | Model | Dataset | Purpose |
|---|---|---|---|
| Phase 1 | This model | 13,201 synthetic reasoning examples | Reasoning capability |
| Phase 2 | shuff57/lfm2-24b-grader (coming soon) | 239 OGRE grading examples | Domain-specific grading |
lfm2-stat-grader.