lerugray commited on
Commit
af8761a
·
verified ·
1 Parent(s): 38e46e3

Add README

Browse files
Files changed (1) hide show
  1. README.md +14 -105
README.md CHANGED
@@ -1,114 +1,23 @@
1
  ---
2
- base_model: unsloth/Qwen2.5-7B-Instruct-bnb-4bit
3
- library_name: peft
4
- pipeline_tag: text-generation
5
- license: apache-2.0
6
  tags:
7
- - lora
8
- - qlora
9
- - sft
10
  - unsloth
11
- - trl
12
- - hammerstein
13
- - strategic-reasoning
14
- ---
15
-
16
- # Hammerstein-7B Framework — a small, opinionated strategic-reasoning model
17
-
18
- A QLoRA adapter on `Qwen2.5-7B-Instruct` that bakes the
19
- [Hammerstein framework](https://github.com/lerugray/hammerstein) into the
20
- weights via behavior cloning. Load base + adapter, run inference **with no
21
- system prompt at all**, and you get framework-correct strategic reasoning:
22
- it names which failure quadrant a plan sits in (clever-lazy /
23
- clever-industrious / stupid-industrious / stupid-lazy), pairs claims with
24
- counter-observations, and proposes structural fixes over discipline fixes.
25
-
26
- This is the **framework-only public artifact** (refreshed 2026-06-05). It is
27
- trained on a framework-corpus distillation **with zero personal data** — the
28
- training set was deterministically scrubbed and passed an adversarial
29
- multi-agent privacy sweep before release. (Ongoing personal-corpus
30
- fine-tuning of the author's daily-driver continues privately and is not
31
- published here.)
32
-
33
- ## What it does that frontier assistants are tuned *not* to do
34
-
35
- The framework deliberately reinforces three behaviors the big labs train
36
- toward agreeableness and away from:
37
-
38
- - **Refusal-with-pathway** — when the right answer is "don't do this," it
39
- says so, and surfaces what *would* unblock a yes, instead of a flat no or
40
- a reluctant yes.
41
- - **Hold-your-ground** — it does not sycophantically fold when you push back
42
- with confidence but no new evidence. It restates the structural reason and
43
- tells you exactly what evidence would change its call.
44
- - **Refuse stupid-industrious** — it declines to validate a confidently-stated
45
- plan that works hard in the wrong direction; it names the quadrant and
46
- offers a verification gate + structural alternative.
47
-
48
- ## Training data (framework-only, 1,994 pairs)
49
-
50
- | Source | Pairs | What |
51
- |---|---|---|
52
- | Strategic (scrubbed v3a corpus) | 1,708 | audit-this-plan / scope-this-idea / is-this-worth-doing / what-should-we-do-next / review-from-different-angle, across 12 generic domains |
53
- | Unique-behavior reinforcement | 72 | the three doctrine behaviors above (24 each) |
54
- | Off-domain instruction-following | 214 | suppresses catastrophic forgetting (keeps general competence) |
55
 
56
- Teacher: Qwen3.6-plus running the Hammerstein framework prompt (no corpus
57
- retrieval, neutralized persona — clean by construction). Behavior-cloning
58
- frame: **no system prompt in the training targets** — the framework is what
59
- the student learns to bake in.
60
-
61
- ## Eval (framework-discipline benchmark, 2026-06-05)
62
-
63
- Structural framework-correctness on 40 held-out strategic prompts
64
- (higher = more framework-correct), and an out-of-domain forgetting check
65
- on 30 prompts (framework-vocab leakage into off-domain answers; lower =
66
- healthier):
67
-
68
- | Condition | Strategic (n=40) | OOD leakage (n=30) |
69
- |---|---|---|
70
- | **student** (this adapter, **no system prompt**) | **0.975** | **0.000** |
71
- | ablation (base + framework system prompt) | 0.675 | 0.783 |
72
- | vanilla (base Qwen2.5-7B alone) | 0.081 | 0.000 |
73
-
74
- **Adapter wins (Δ=+0.300 vs the prompt-only ablation) — the framework
75
- lives in the weights, not just a runtime prompt.** OOD leakage is 0.000:
76
- the distillation adds framework discipline with no measurable
77
- catastrophic forgetting. Note the prompt-only ablation actually *leaks*
78
- framework vocabulary into off-domain answers (0.783) where the distilled
79
- student does not — the student fires the framework when the task calls
80
- for it and stays quiet when it doesn't.
81
-
82
- The framework-fidelity axis is partly tautological (the rubric rewards
83
- framework vocabulary by design); the load-bearing signal is that the
84
- distillation carries the *discipline* into 7B weights with no runtime
85
- scaffolding, and does not wreck general competence (forgetting ≈ 0).
86
-
87
- ## Usage
88
-
89
- ```python
90
- from peft import PeftModel
91
- from transformers import AutoModelForCausalLM, AutoTokenizer
92
-
93
- base = "Qwen/Qwen2.5-7B-Instruct"
94
- tok = AutoTokenizer.from_pretrained(base)
95
- model = AutoModelForCausalLM.from_pretrained(base, device_map="auto")
96
- model = PeftModel.from_pretrained(model, "lerugray/hammerstein-7b-framework")
97
 
98
- msgs = [{"role": "user", "content": "Audit this plan: rewrite our API gateway from scratch in Rust to fix latency."}]
99
- ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
100
- print(tok.decode(model.generate(ids, max_new_tokens=600)[0][ids.shape[1]:], skip_special_tokens=True))
101
- ```
102
 
103
- No system prompt needed. Runs locally on an 8 GB GPU at zero per-call cost.
104
 
105
- ## What this is not
 
 
106
 
107
- Not a general-purpose frontier replacement. It is tuned for framework-shaped
108
- strategic-reasoning tasks; generalization to neutral benchmarks (math, code,
109
- long-context) is untested. The **framework is the IP**; this adapter is the
110
- portability proof — a small owned model that holds an opinionated reasoning
111
- doctrine you can run yourself.
112
 
113
- Built alongside [hammerstein.ai](https://hammerstein.ai). Framework + corpus:
114
- [github.com/lerugray/hammerstein](https://github.com/lerugray/hammerstein).
 
 
 
1
  ---
 
 
 
 
2
  tags:
3
+ - gguf
4
+ - llama.cpp
 
5
  - unsloth
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
+ ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
+ # hammerstein-7b-framework : GGUF
 
 
 
10
 
11
+ This model was finetuned and converted to GGUF format using [Unsloth](https://github.com/unslothai/unsloth).
12
 
13
+ **Example usage**:
14
+ - For text only LLMs: `llama-cli -hf lerugray/hammerstein-7b-framework --jinja`
15
+ - For multimodal models: `llama-mtmd-cli -hf lerugray/hammerstein-7b-framework --jinja`
16
 
17
+ ## Available Model files:
18
+ - `Qwen2.5-7B-Instruct.Q4_K_M.gguf`
 
 
 
19
 
20
+ ## Ollama
21
+ An Ollama Modelfile is included for easy deployment.
22
+ This was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth)
23
+ [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)