Views
No views yet

/think (deliberate chain-of-thought) and /nothink (concise answers)—while running on a single consumer GPU.| Feature | Detail |
|---|---|
| Reasoning-trace transfer | Instead of copying just final probabilities, we align full logit trajectories, yielding more faithful reasoning. |
| Total-Variation-Distance loss | To better match the teacher’s confidence distribution and smooth the loss landscape. |
| Tokenizer replacement | The original Mistral tokenizer was swapped for Qwen3's tokenizer. |
| Dual interaction modes | Use /think when you want transparent step-by-step reasoning (good for analysis & debugging). Use /nothink for terse, production-ready answers. Most reliable in the system role field. |
| Benchmark | Score |
|---|---|
| GPQADiamond (average of 3) | 57.1% |
| mmlu | 67.5% |
1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3model_id = "arcee-ai/Homunculus"
4tokenizer = AutoTokenizer.from_pretrained(model_id)
5model = AutoModelForCausalLM.from_pretrained(
6 model_id,
7 torch_dtype="auto",
8 device_map="auto"
9)
10
11# /think mode - Chain-of-thought reasoning
12messages = [
13 {"role": "system", "content": "You are a helpful assistant. /think"},
14 {"role": "user", "content": "Why is the sky blue?"},
15]
16output = model.generate(
17 tokenizer.apply_chat_template(messages, tokenize=True, return_tensors="pt"),
18 max_new_tokens=512,
19 temperature=0.7
20)
21print(tokenizer.decode(output[0], skip_special_tokens=True))
22
23# /nothink mode - Direct answers
24messages = [
25 {"role": "system", "content": "You are a helpful assistant. /nothink"},
26 {"role": "user", "content": "Summarize the plot of Hamlet in two sentences."},
27]
28output = model.generate(
29 tokenizer.apply_chat_template(messages, tokenize=True, return_tensors="pt"),
30 max_new_tokens=128,
31 temperature=0.7
32)
33print(tokenizer.decode(output[0], skip_special_tokens=True))