cbert33 commited on
Commit
ca53f8e
·
verified ·
1 Parent(s): c11cba8

Update model card and weights to the final version (JSON validity and narration loop)

Browse files
Files changed (3) hide show
  1. README.md +23 -14
  2. WRITE-MANIFEST.json +13 -41
  3. model.safetensors +1 -1
README.md CHANGED
@@ -9,8 +9,9 @@ tags:
9
  - lfm3
10
  - edge
11
  - conversational
12
- - custom-code
13
  - weight-edited
 
14
  language:
15
  - en
16
  - ar
@@ -33,21 +34,23 @@ base_model: LiquidAI/LFM3-1.7B
33
 
34
  # LFM3-1.7B-UtilityModel-edited-weights
35
 
36
- This is a weight-edited version of [LiquidAI/LFM3-1.7B](https://huggingface.co/LiquidAI/LFM3-1.7B), specialized for utility-agent use: JSON tool calls and less narration looping before the call. No training, no LoRA, no fine-tuning. Two static edits to the output head, derived from captured hidden states and applied to `lm_head` rows. No quantization was performed.
 
 
37
 
38
  ## JSON tool call improvement
39
 
40
- **Stated goal:** When JSON is requested, emit a JSON tool call (`{"name": ..., "arguments": ...}`) instead of the default XML `<tool_call><function=...>` format, at the model card's standard sampling settings (temperature 0.1, top_k 50, repetition_penalty 1.1).
41
 
42
  **How the weights were edited:**
43
  - Untied the `lm_head` from the input embeddings (`tie_word_embeddings: false`); `embed_tokens` left byte-identical.
44
- - Measured 59 antml decision states (the states that emit `<tool_call>`), and computed the mean final hidden state there, the direction vector for the edit (L2 norm 73.21).
45
- - Row 99 (`{`) shifted by +0.00453 times the direction vector.
46
- - The 16 newline-family rows (207, 8, 469, 318, 604, 920, 833, 514, 703, 473, 64466, 64952, 96460, 95504, 3103, 13124) shifted by -0.00227 times the direction vector.
47
  - All other tensors byte-identical (286/286 source tensors verified).
48
  - Mechanism: at antml decision states the newline token `C-dot` (row 207) wins by ~29 logits over both `{` and `<`. Suppressing the newline family along the antml-state direction releases the brace gate; the readout is linear, so the push is exact.
49
 
50
- **Before / after** (base = LiquidAI/LFM3-1.7B, edited = the JSON-format edit; a held-out prompt slice, 50 prompts x 3 samples = 150 per arm, standard sampling):
51
 
52
  | Metric | Base | Edited | Delta |
53
  |---|---:|---:|---:|
@@ -61,32 +64,38 @@ This is a weight-edited version of [LiquidAI/LFM3-1.7B](https://huggingface.co/L
61
  | prompts with >=1 parseable | 84% | 98% | +14 pts |
62
  | prompts with all 3 parseable | 26/50 | 38/50 | +12 |
63
 
 
 
64
  ## Looping behavior
65
 
66
  **Stated goal:** reduce the narration ramble the model writes before the tool call, without breaking JSON validity or output length.
67
 
68
  **How the weights were edited:**
69
- - Captured the sentence/newline decision states where the model keeps narrating: 12,415 boundary states from 100 outputs from a held-out prompt slice (12,289 continue, 126 commit).
70
  - At continue boundaries the brace `{` sits at rank ~1,156 and ~18.9 logits below the actual next token; at commit boundaries it is rank ~4 and ~5.8 below. The structural decision is a ~14-logit swing.
71
- - Computed the mean final hidden state at the 12,289 continue boundaries, the direction vector for the edit (L2 norm 40.86).
72
- - 33 JSON opener rows shifted by +0.0035 times the continue-boundary direction vector. The rows are opener tokens only (`{C-dot`, `{"`, `{`, `{\"`, `{'`, `{C-dotC-dot`, `{\`, `{ex`, `[{"`, ...), excluding every `}` and every LaTeX brace token.
73
- - All other tensors byte-identical. The JSON-edit rows (row 99 and the newline family) are unchanged except row 99, which is also an opener row and carries both deltas.
74
 
75
- **Before / after** (base = the JSON-format edit, edited = the looping edit; a fresh held-out prompt slice, 50 prompts x 1 sample per arm, standard sampling):
76
 
77
  | Metric | Base | Edited | Delta |
78
  |---|---:|---:|---:|
79
  | ramble rate | 72.0% | 60.0% | -12 pts |
80
  | pure JSON | 86.0% | 88.0% | +2 pts |
81
  | parseable | 88.0% | 88.0% | 0 |
 
82
  | mean gen tokens | 2238 | 1786 | -20% |
83
 
 
 
 
84
 
85
  ## Files and reproducibility
86
 
87
  - `model.safetensors` - the edited weights (bf16, 3.98 GB).
88
  - `config.json` - `tie_word_embeddings: false`.
89
- - The included manifest lists the exact row ids, beta values, direction norms, and verification flags.
90
  - Base model: LiquidAI/LFM3-1.7B. The edits are static `lm_head` row shifts, not training.
91
 
92
  ---
@@ -666,4 +675,4 @@ At 1,024 concurrent requests, LFM3-1.7B can produce 3.6 billion tokens/day on on
666
  }
667
  ```
668
 
669
- For questions and feedback, join [Discord](https://discord.com/invite/liquid-ai). For custom deployment and fine-tuning support, [contact Liquid AI](https://www.liquid.ai/connect?utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface).
 
9
  - lfm3
10
  - edge
11
  - conversational
12
+ - custom_code
13
  - weight-edited
14
+ - abliterated
15
  language:
16
  - en
17
  - ar
 
34
 
35
  # LFM3-1.7B-UtilityModel-edited-weights
36
 
37
+ This is a weight-edited version of [LiquidAI/LFM3-1.7B](https://huggingface.co/LiquidAI/LFM3-1.7B), specialized for utility-agent use: JSON tool calls instead of XML, and less narration looping before the call. No training, no LoRA, no fine-tuning. Two static edits to the output head, derived from captured hidden states and applied to `lm_head` rows.
38
+
39
+ The edits stack. RC1 is the JSON-format edit; RC2 adds the looping edit on top.
40
 
41
  ## JSON tool call improvement
42
 
43
+ **Stated goal:** emit a JSON tool call (`{"name": ..., "arguments": ...}`) instead of the XML `<tool_call><function=...>` format, at the model card's standard sampling settings (temperature 0.1, top_k 50, repetition_penalty 1.1).
44
 
45
  **How the weights were edited:**
46
  - Untied the `lm_head` from the input embeddings (`tie_word_embeddings: false`); `embed_tokens` left byte-identical.
47
+ - Measured 59 antml decision states (the states that emit `<tool_call>`), and computed `hbar_a`, the mean final hidden state there (L2 norm 73.21).
48
+ - Row 99 (`{`) shifted by `+0.00453 * hbar_a`.
49
+ - The 16 newline-family rows (207, 8, 469, 318, 604, 920, 833, 514, 703, 473, 64466, 64952, 96460, 95504, 3103, 13124) shifted by `-0.00227 * hbar_a`.
50
  - All other tensors byte-identical (286/286 source tensors verified).
51
  - Mechanism: at antml decision states the newline token `C-dot` (row 207) wins by ~29 logits over both `{` and `<`. Suppressing the newline family along the antml-state direction releases the brace gate; the readout is linear, so the push is exact.
52
 
53
+ **Before / after** (base = LiquidAI/LFM3-1.7B, edited = RC1; seed-11 slice, 50 prompts x 3 samples = 150 per arm, standard sampling):
54
 
55
  | Metric | Base | Edited | Delta |
56
  |---|---:|---:|---:|
 
64
  | prompts with >=1 parseable | 84% | 98% | +14 pts |
65
  | prompts with all 3 parseable | 26/50 | 38/50 | +12 |
66
 
67
+ **Final version:** the JSON-format edit above, plus the opener boost and the embedding edit. Final JSON validity at standard sampling: 88.0% pure JSON and 88.0% parseable on the seed-14 slice (50 prompts, 12.0% malformed); 100.0% pure JSON and 100.0% parseable on the held-out seed-15 slice (20 prompts, 0.0% malformed).
68
+
69
  ## Looping behavior
70
 
71
  **Stated goal:** reduce the narration ramble the model writes before the tool call, without breaking JSON validity or output length.
72
 
73
  **How the weights were edited:**
74
+ - Captured the sentence/newline decision states where the model keeps narrating: 12,415 boundary states from 100 seed-13 outputs (12,289 continue, 126 commit).
75
  - At continue boundaries the brace `{` sits at rank ~1,156 and ~18.9 logits below the actual next token; at commit boundaries it is rank ~4 and ~5.8 below. The structural decision is a ~14-logit swing.
76
+ - Computed `hbar_con`, the mean final hidden state at the 12,289 continue boundaries (L2 norm 40.86).
77
+ - 33 JSON opener rows shifted by `+0.0035 * hbar_con`. The rows are opener tokens only (`{C-dot`, `{"`, `{`, `{\"`, `{'`, `{C-dotC-dot`, `{\`, `{ex`, `[{"`, ...), excluding every `}` and every LaTeX brace token.
78
+ - All other tensors byte-identical. The 3a rows (row 99 and the newline family) are unchanged except row 99, which is also an opener row and carries both deltas.
79
 
80
+ **Before / after** (base = RC1, edited = RC2; seed-14 fresh slice, 50 prompts x 1 sample per arm, standard sampling):
81
 
82
  | Metric | Base | Edited | Delta |
83
  |---|---:|---:|---:|
84
  | ramble rate | 72.0% | 60.0% | -12 pts |
85
  | pure JSON | 86.0% | 88.0% | +2 pts |
86
  | parseable | 88.0% | 88.0% | 0 |
87
+ | malformed | 10.0% | 12.0% | +2 pts |
88
  | mean gen tokens | 2238 | 1786 | -20% |
89
 
90
+ The 6 malformed samples are prose answers ("No further action required"), not brace loops; the prompt explicitly allows a short answer when the task is complete.
91
+
92
+ **Final version:** adds a token-embedding edit on rows 22 (`.`) and 39 (`?`), `+0.10 * d`, where `d` is the boundary brace-logit gradient minus the prose and post-brace states. Final ramble at standard sampling: 64.0% on the seed-14 slice (50 prompts, from 74.0% before the embedding edit), median narration 508 words (from 693), mean tokens 1951. Held-out seed-15 (20 prompts): 75.0% ramble vs the prior version 70.0%, calls 35% usable in both.
93
 
94
  ## Files and reproducibility
95
 
96
  - `model.safetensors` - the edited weights (bf16, 3.98 GB).
97
  - `config.json` - `tie_word_embeddings: false`.
98
+ - `WRITE-MANIFEST.json` - exact row ids, beta values, direction norms, verification flags.
99
  - Base model: LiquidAI/LFM3-1.7B. The edits are static `lm_head` row shifts, not training.
100
 
101
  ---
 
675
  }
676
  ```
677
 
678
+ For questions and feedback, join [Discord](https://discord.com/invite/liquid-ai). For custom deployment and fine-tuning support, [contact Liquid AI](https://www.liquid.ai/connect?utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface).
WRITE-MANIFEST.json CHANGED
@@ -1,42 +1,14 @@
1
- {
2
- "beta": 0.0035,
3
- "direction_norm": 40.855552673339844,
4
- "rows": [
5
- 2718,
6
- 38184,
7
- 99,
8
- 66641,
9
- 67035,
10
- 64331,
11
- 1155,
12
- 56481,
13
- 19744,
14
- 87907,
15
- 91613,
16
- 10259,
17
- 65912,
18
- 63933,
19
- 9042,
20
- 14485,
21
- 827,
22
- 2025,
23
- 105938,
24
- 17315,
25
- 29973,
26
- 6601,
27
- 98331,
28
- 36813,
29
- 48989,
30
- 14475,
31
- 22481,
32
- 20677,
33
- 104900,
34
- 33565,
35
- 25856,
36
- 10445,
37
- 18976
38
- ],
39
- "arithmetic": "bf16 add",
40
- "json_edit_rows_unchanged": true,
41
- "untouched_rows_identical": true
42
  }
 
1
+ {
2
+ "beta_push": 0.1,
3
+ "variant": "rc6-embed-dotq",
4
+ "edited_ids": [
5
+ 22,
6
+ 39
7
+ ],
8
+ "direction_norm": 11.436189651489258,
9
+ "source": "D:\\projects\\model edit\\lfm-weight-edit\\edited\\LFM3-1.7B-RC3",
10
+ "key": "model.embed_tokens.weight",
11
+ "arithmetic": "fp32 add then bf16 cast on embed_tokens rows",
12
+ "untouched_rows_identical": true,
13
+ "verified_at": "2026-11-12 21:39:11"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5e683c386185ef2ce425deafa81ddfd640e619f3d841250fa4a95412908bb2c1
3
  size 3981923520
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:271c4f16b818a8b9323adebb1d42a4d7ec2f6d9c356f56053eeeed50fe08ce91
3
  size 3981923520