Hemmingway-1 × codex5.5_ToT — LoRA

A LoRA adapter that teaches Altworld/Hemmingway-1 (a 27B Qwen3.5 GDN model) to reason in the Tree-of-Thought "reasoning-steps → final justified answer" style of the codex5.5_ToT dataset.

base model   Altworld/Hemmingway-1        (Qwen3_5ForCausalLM, 27B, GDN)
dataset      AmelieSchreiber/codex5.5_ToT (3,890 reasoning-tree records)
adapter      this repo                    (435 MB, r=16)
merged       hotdogs/hemmingway_tot_merged (full 27B, 50 GiB)

Base model

  • Altworld/Hemmingway-1 — a 27B-parameter Qwen3_5ForCausalLM (Qwen3.5 / GDN architecture): 48 linear-attention layers + 16 full-attention layers, 64 layers total, plus an MTP (multi-token-prediction) head. BF16 ≈ 54.6 GB.
  • License: CC-BY-NC-4.0 (inherited by this adapter).

Dataset

  • AmelieSchreiber/codex5.5_ToT — 3,890 high-quality reasoning records across 10 domains (math, physics, CS/algorithms, chemistry, …). Each record is a [system, user, assistant] chat where the assistant response is a reasoning tree: it explores branches, compares alternatives, and ends with a final justified answer.
  • Split here: 3,692 train / 198 val (deterministic, seed 42).
  • The dataset's system prompt, which the model now follows by default:

    "Solve the problem step by step. Explore the reasoning branches, compare alternatives, and finish with a final justified answer."

What this adapter does

It reshapes the base model's output style toward the ToT format. The base model already reasons, but in a rambling "thinking" voice; after this LoRA it produces clean, structured:

Reasoning steps:
1. Split 38 as 40 - 2, so 17*38 = 17*40 - 34 = 680 - 34 = 646.
2. Reduce by multiples of 43: 43*15 = 645, so 646 leaves remainder 1.
3. The product is one more than a multiple of 43, so the residue is 1.
Final answer: 1

Training

Method QLoRA — 4-bit NF4 (double-quant), bf16 compute
LoRA r=16, alpha=32, dropout=0.05, bias=none
Target modules q_proj k_proj v_proj o_proj gate_proj up_proj down_proj + GDN in_proj_qkv out_proj in_proj_z
Trainable 108.8 M params (0.73 %)
Seq length 1024 (max sample = 542 tokens)
Masking loss on completion (assistant) tokens only
Epochs / steps 3 epochs → 690 steps
Batch 1 × 16 grad-accum (effective 16)
LR 2e-4 cosine, 3 % warmup, weight-decay 0.01
Precision bf16 (fp16 off), gradient checkpointing
Hardware 4× RTX 3060 12 GB + 1× RTX 4060 Ti 16 GB (64 GB), CUDA 13.0
Speed ~64 s/step → 12 h 28 m (with flash-linear-attention fast path)
Result train_loss 0.41 (final) · val_loss 1.05 (198 unseen samples)

Usage

This is a PEFT LoRA adapter — load it on top of the base model:

from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel

base = "Altworld/Hemmingway-1"
adapter = "hotdogs/hemmingway_tot_lora"

bnb = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype="bfloat16",
    bnb_4bit_use_double_quant=True,
)
model = AutoModelForCausalLM.from_pretrained(base, quantization_config=bnb, device_map="auto")
model = PeftModel.from_pretrained(model, adapter)
tokenizer = AutoTokenizer.from_pretrained(adapter)

msgs = [
    {"role": "system", "content": "Solve the problem step by step. Explore the reasoning branches, compare alternatives, and finish with a final justified answer."},
    {"role": "user",   "content": "What is 17 * 38 mod 43?"},
]
text = tokenizer.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
ids = tokenizer(text, return_tensors="pt").to(model.device)
out = model.generate(**ids, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(out[0][ids["input_ids"].shape[1]:], skip_special_tokens=True))

Or use the fully-merged 27B (no adapter needed): hotdogs/hemmingway_tot_merged.

Sample outputs (merged model)

What is 17 * 38 mod 43?

Reasoning steps:
1. Split 38 as 40 - 2, so 17*38 = 17*40 - 34 = 680 - 34 = 646.
2. Reduce by multiples of 43: 43*15 = 645, so 646 leaves remainder 1.
3. The product is one more than a multiple of 43, so the residue is 1.
Final answer: 1

A sealed rigid container has ideal gas at 300 K. If temperature doubles to 600 K, what happens to pressure?

Reasoning steps:
1. For fixed volume and amount, ideal gas pressure is proportional to absolute temperature.
2. Doubling absolute temperature from 300 K to 600 K doubles pressure.
3. Pressure doubles because volume and amount are fixed while absolute temperature doubles.
Final answer: Pressure doubles.

Notes / caveats

  • Style, not just facts. The base model often reaches the same answer; the adapter's value is the clean, structured reasoning-tree voice. Verified by A/B against the base on identical prompts.
  • Merged model drops the MTP head. On load, transformers ignores the mtp.* weights (config still says mtp_num_hidden_layers=1). Benign for normal generation — it only affects speculative-decoding next-token prediction.
  • Trained with plain transformers + peft + bitsandbytes (not Unsloth) using an explicit VRAM-proportional device map across the 5 GPUs.

Citation

Built with Hermes Agent · base: Altworld/Hemmingway-1 · data: AmelieSchreiber/codex5.5_ToT

Downloads last month
44
GGUF
Model size
0.1B params
Architecture
qwen35
Hardware compatibility
Log In to add your hardware

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for hotdogs/hemmingway_tot_lora

Base model

Qwen/Qwen3.8-27B
Adapter
(2)
this model

Dataset used to train hotdogs/hemmingway_tot_lora