tashfene commited on
Commit
ad81099
·
verified ·
1 Parent(s): 67cac0a

Professional model card: model-index, runtime guides, download table

Browse files
Files changed (1) hide show
  1. README.md +103 -23
README.md CHANGED
@@ -1,58 +1,138 @@
1
  ---
2
  license: apache-2.0
 
3
  base_model: Qwen/Qwen3.5-4B
 
 
 
4
  library_name: peft
5
  pipeline_tag: text-generation
 
6
  tags:
7
  - lora
 
8
  - information-extraction
9
  - memory
 
10
  - qwen3
11
  - small-models
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  ---
13
 
14
  # scallopmemory-1
15
 
16
- A 4B model that reads an assistant conversation and writes down what is worth remembering. It pulls durable facts (who the user is, decisions they made, project state) out of a transcript and emits them as structured memory entries, or returns nothing when a turn is just chatter.
17
 
18
- Base is Qwen3.5-4B. I fine-tuned a LoRA adapter (rank 32, alpha 64, two epochs) on extraction examples from my own assistant's traces, with a larger model writing the labels. This repo holds a q5_k_m GGUF and the adapter weights.
19
 
20
- ## What it does
 
 
 
 
 
 
 
21
 
22
- The assistant runs this after a conversation to decide what to persist. Two failure modes hurt: writing down noise, and missing a real fact. Most turns produce nothing, so the harder half of the job is staying quiet without going silent on the turns that matter.
23
 
24
- ## Benchmarks
25
-
26
- Held-out set of 33 extraction cases, none in training, same harness for every model, thinking off.
27
-
28
- | Model | Teacher agreement | Parse success | Median latency |
29
  |---|---|---|---|
30
- | Qwen3.6-35B MoE | 0.877 | 57.6% | 41.1s |
31
- | Qwen3.6-Plus (the teacher) | 0.748 | 100% | 31.1s |
32
- | **scallopmemory-1** | **0.725** | **100%** | **4.2s** |
33
- | stock Qwen3.5-4B | 0.695 | 100% | 8.8s |
34
-
35
- Read this as a parity result, not a win. The 4B lands close to the hosted model that taught it, at a fraction of the latency and on local hardware. The 35B scores higher on agreement but parses cleanly only 57.6% of the time, so it drops two out of five outputs on the floor and cannot sit in a pipeline as is. Among the models that actually return valid structure every time, the 4B edges the teacher and beats the stock base it came from.
36
 
37
- Extraction quality is where model capacity shows. An 8B base is the obvious next step if you want to clear the teacher rather than match it.
38
 
39
- ## Serving
40
 
41
- Thinking off, same as its sibling. Chain-of-thought hurt this task at 4B.
42
 
43
  ```bash
44
  llama-server -m scallopmemory-1.q5_k_m.gguf \
45
  --chat-template-kwargs '{"enable_thinking":false}'
46
  ```
47
 
48
- ## Training data
49
 
50
- Same anonymization as the tools model: a deterministic pass swaps real names, emails, phones, handles, and project ids for stable fakes and refuses to write a file if any known real token survives. Anonymized and real-name held-out sets scored within 0.002 of each other, so the swap costs nothing measurable.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
- One detail mattered more than the rest. An early run collapsed because most of the freshly distilled examples were empty extractions from background chatter, which taught the model to write down nothing. Capping empty examples per session fixed it and moved agreement from 0.70 to 0.725. If you train your own extractor, watch the share of empty targets.
53
 
54
- ## Limits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  - One user's data, one memory schema. Your facts and format will differ.
57
  - 0.725 agreement means it disagrees with the teacher on roughly a quarter of cases. Check its output before trusting it as ground truth.
58
- - Capacity-bound. A bigger base would likely extract better; 4B is the floor for this task, not the ceiling.
 
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ license_link: https://huggingface.co/Qwen/Qwen3.5-4B/blob/main/LICENSE
4
  base_model: Qwen/Qwen3.5-4B
5
+ base_model_relation: finetune
6
+ language:
7
+ - en
8
  library_name: peft
9
  pipeline_tag: text-generation
10
+ quantized_by: tashfene
11
  tags:
12
  - lora
13
+ - gguf
14
  - information-extraction
15
  - memory
16
+ - agent
17
  - qwen3
18
  - small-models
19
+ model-index:
20
+ - name: scallopmemory-1
21
+ results:
22
+ - task:
23
+ type: text-generation
24
+ name: Memory extraction
25
+ dataset:
26
+ name: ScallopBot held-out traces (33 cases)
27
+ type: private
28
+ metrics:
29
+ - name: Teacher agreement
30
+ type: agreement
31
+ value: 0.725
32
+ - name: Parse success
33
+ type: parse-rate
34
+ value: 100.0
35
+ - name: Struct valid
36
+ type: validity
37
+ value: 100.0
38
  ---
39
 
40
  # scallopmemory-1
41
 
42
+ > A 4B extraction specialist for local assistants. It reads a conversation and writes down the durable facts worth remembering, or returns nothing when a turn is just chatter.
43
 
44
+ `scallopmemory-1` is a LoRA fine-tune of [Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B), distilled from one assistant's production traces with a larger model writing the labels. The student never trained on its own generations. The repo ships a q5_k_m GGUF for local serving and the raw adapter for reproduction.
45
 
46
+ | | |
47
+ |---|---|
48
+ | **Base model** | Qwen3.5-4B |
49
+ | **Adapter** | LoRA, rank 32, alpha 64, 2 epochs |
50
+ | **Quant** | q5_k_m GGUF (3.16 GB) |
51
+ | **Context** | inherits Qwen3.5-4B |
52
+ | **Serving** | thinking **off** (chain-of-thought hurts this task at 4B) |
53
+ | **Output** | structured memory entries (durable facts), or empty |
54
 
55
+ ## Files
56
 
57
+ | File | Format | Size | Notes |
 
 
 
 
58
  |---|---|---|---|
59
+ | `scallopmemory-1.q5_k_m.gguf` | GGUF Q5_K_M | 3.16 GB | Recommended for llama.cpp / Ollama / LM Studio |
60
+ | `adapter/` | PEFT LoRA | 170 MB | Apply on top of `Qwen/Qwen3.5-4B` with transformers + PEFT |
 
 
 
 
61
 
62
+ ## How to run
63
 
64
+ Serve with thinking disabled. The model is trained and benchmarked in the no-think path.
65
 
66
+ **llama.cpp**
67
 
68
  ```bash
69
  llama-server -m scallopmemory-1.q5_k_m.gguf \
70
  --chat-template-kwargs '{"enable_thinking":false}'
71
  ```
72
 
73
+ **Ollama**
74
 
75
+ ```bash
76
+ ollama run hf.co/tashfene/scallopmemory-1:Q5_K_M
77
+ ```
78
+
79
+ **Python (llama-cpp-python)**
80
+
81
+ ```python
82
+ from llama_cpp import Llama
83
+
84
+ llm = Llama.from_pretrained(
85
+ repo_id="tashfene/scallopmemory-1",
86
+ filename="scallopmemory-1.q5_k_m.gguf",
87
+ )
88
+ out = llm.create_chat_completion(
89
+ messages=[{"role": "user", "content": "<conversation to extract facts from>"}],
90
+ )
91
+ ```
92
+
93
+ **Adapter on the base model (transformers + PEFT)**
94
+
95
+ ```python
96
+ from peft import PeftModel
97
+ from transformers import AutoModelForCausalLM, AutoTokenizer
98
+
99
+ base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-4B")
100
+ model = PeftModel.from_pretrained(base, "tashfene/scallopmemory-1", subfolder="adapter")
101
+ tok = AutoTokenizer.from_pretrained("tashfene/scallopmemory-1", subfolder="adapter")
102
+ ```
103
 
104
+ ## Intended use
105
 
106
+ An assistant runs this after a conversation to decide what to persist to long-term memory. Two failure modes hurt: writing down noise, and missing a real fact. Most turns produce nothing, so the harder half of the job is staying quiet without going silent on the turns that matter.
107
+
108
+ ## Evaluation
109
+
110
+ 33 extraction cases held out from real sessions, none seen in training. Same harness for every model, thinking off.
111
+
112
+ | Model | Teacher agreement | Parse success | Median latency |
113
+ |---|---|---|---|
114
+ | Qwen3.6-35B MoE | 0.877 | 57.6% | 41.1s |
115
+ | Qwen3.6-Plus (the teacher) | 0.748 | 100% | 31.1s |
116
+ | **scallopmemory-1** | **0.725** | **100%** | **4.2s** |
117
+ | Qwen3.5-4B (stock) | 0.695 | 100% | 8.8s |
118
+
119
+ Read this as parity, not a win. The 4B lands close to the hosted model that taught it, at a tenth of the latency and on local hardware. The 35B scores higher on agreement but parses cleanly only 57.6% of the time, so it drops two of every five outputs and cannot sit in a pipeline as is. Among models that return valid structure every time, the 4B edges the teacher and beats the stock base it came from.
120
+
121
+ Extraction quality is where model capacity shows. An 8B base is the obvious next step to clear the teacher rather than match it.
122
+
123
+ ## Training
124
+
125
+ Traces from one person's assistant, so the distribution is narrow and personal. The same deterministic anonymizer as the tools model swaps real names, emails, phones, handles, and project ids for stable fakes and refuses to write a file if any known real token survives. Anonymized and real-name held-out sets scored within 0.002 of each other.
126
+
127
+ One detail mattered more than the rest. An early run collapsed because most freshly distilled examples were empty extractions from background chatter, which taught the model to write down nothing. Capping empty examples per session moved agreement from 0.70 to 0.725. If you train your own extractor, watch the share of empty targets.
128
+
129
+ ## Limitations and bias
130
 
131
  - One user's data, one memory schema. Your facts and format will differ.
132
  - 0.725 agreement means it disagrees with the teacher on roughly a quarter of cases. Check its output before trusting it as ground truth.
133
+ - Capacity-bound. A larger base would likely extract better; 4B is the floor for this task, not the ceiling.
134
+ - Trained on a single individual's data, so it inherits that person's notion of what counts as memorable.
135
+
136
+ ## License
137
+
138
+ Apache-2.0, inherited from the Qwen3.5-4B base.