Feleir commited on
Commit
4dbc794
·
verified ·
1 Parent(s): 6dc6f07

FunctionGemma home commands v7 (int8 LiteRT-LM, KV 1,024, prefill 32/64/128/256)

Browse files
Files changed (4) hide show
  1. NOTICE +1 -1
  2. README.md +50 -32
  3. SHA256SUMS +1 -1
  4. functiongemma-home_q8_ekv1024.litertlm +1 -1
NOTICE CHANGED
@@ -3,4 +3,4 @@ Gemma is provided under and subject to the Gemma Terms of Use found at gemma.ai/
3
  functiongemma-home_q8_ekv1024.litertlm is a modified version of Google's FunctionGemma 270M
4
  (google/functiongemma-270m-it): fine-tuned and converted to LiteRT-LM int8 by the PrivateAssistant project.
5
  Its use is subject to the use restrictions in section 3.2 of the Gemma Terms of Use (GEMMA_TERMS.txt) and the
6
- Gemma Prohibited Use Policy (gemma.ai/resources/prohibited_use_policy).
 
3
  functiongemma-home_q8_ekv1024.litertlm is a modified version of Google's FunctionGemma 270M
4
  (google/functiongemma-270m-it): fine-tuned and converted to LiteRT-LM int8 by the PrivateAssistant project.
5
  Its use is subject to the use restrictions in section 3.2 of the Gemma Terms of Use (GEMMA_TERMS.txt) and the
6
+ Gemma Prohibited Use Policy (gemma.ai/resources/prohibited-use/).
README.md CHANGED
@@ -19,7 +19,7 @@ tags:
19
  - android
20
  ---
21
 
22
- # PrivateAssistant FunctionGemma home commands (v6, int8 LiteRT-LM)
23
 
24
  **This is a modified version of Google's FunctionGemma 270M.** It was fully fine-tuned (the tied embedding stayed
25
  frozen) by the PrivateAssistant project to turn a spoken home request into short command lines for an Android
@@ -30,17 +30,17 @@ requests the small command model in front of it does not handle.
30
  > This model is a Model Derivative of Gemma. Using it means agreeing to the
31
  > [Gemma Terms of Use](https://gemma.ai/resources/terms/) (a copy is in this repository as `GEMMA_TERMS.txt`), and
32
  > it **must not be used for the restricted uses in the
33
- > [Gemma Prohibited Use Policy](https://gemma.ai/resources/prohibited_use_policy)** (section 3.2 of the terms), nor in
34
  > violation of applicable laws and regulations. Anyone who passes this model on must pass these restrictions on too.
35
 
36
  - **Source code, training scripts and evaluation:** https://github.com/feleir/privateassistant (Apache-2.0); `finetune/README.md` has every command.
37
- - **Round:** v6 (training data v6), 29 November 2026.
38
 
39
  ## Files
40
 
41
  | File | Bytes | SHA-256 | Notes |
42
  |---|---|---|---|
43
- | `functiongemma-home_q8_ekv1024.litertlm` | 300,822,656 | `ca91e6171e59b91891ca61cae94a1eb647ba3f3d85f95066a36e83cd7c1ac513` | int8, KV cache 1,024, prefill signatures 32/64/128/256. The file the app pins (`ModelCatalog.COMMAND`) |
44
  | `GEMMA_TERMS.txt`, `NOTICE` | | | the copy of the terms and the notice the Gemma Terms of Use require |
45
  | `SHA256SUMS` | | | the hashes above |
46
 
@@ -89,34 +89,40 @@ Answer: `control_lights target="Living Room" action=on<end_of_turn>`
89
  question) or `reply` (an acknowledgement such as "thanks").
90
  - Tools it was trained on: `control_lights`, `activate_scene`, `run_routine`, `control_tv`, `open_tv_app`, `timer`,
91
  `alarm`, `reminder`, `lists`, `home_status`, `get_weather`, `get_time`, `get_news`, `convert_units`,
92
- `cooking_time`, `food_safety`. Their schemas are in the source repository (`core/`); the parser and writer of the
 
93
  lines are `CompactCalls` and `CompactFormat`.
94
  - Earlier turns of a conversation come as an `Earlier in this conversation:` block before the request.
95
  - The app samples at temperature 0.3, at most 128 tokens an answer.
96
 
97
  ## Training data
98
 
99
- **Synthetic only.** 24,000 training and 1,500 dev requests generated by the project's own code
100
  (`llmeval/.../TrainingData.kt`, run by `finetune/generate_data.sh --format compact`, seeds 1 and 2) on randomly
101
  generated homes: random room, light, group, scene, app and routine names from word lists in the code, requests from
102
  phrase templates (`PhrasesEn.kt`), and targets written by the app's own `CompactFormat.write` (the inverse of the
103
  parser, round-trip tested over every tool). 68 kinds of request, among them lights on/off, levels, relative changes,
104
  "everything except", follow-ups, corrections, negations and remarks that ask for nothing, routines and bedtime or
105
  morning greetings, scenes, the TV and its apps, timers, alarms, reminders, lists, unit conversions, cooking times,
106
- food safety, missing names (a question back) and general questions (`chat`).
 
 
 
107
 
108
  - **Held out:** every built-in evaluation template (any generated request that matches one, with any names, is
109
- dropped: 2,368 dropped), all five blind sets and a TV-names set, both as requests and as earlier turns (114 more
110
- dropped). A check after generating found no request or earlier turn equal to a blind sentence.
111
  - **No personal data:** no recordings, no transcripts of real use, no real home's names or device lists, no
112
  household data of any kind. The data was generated on the developer's machine from code and word lists alone.
113
- - No text in the data was written by Gemma or any other model.
 
 
114
 
115
  ## Training procedure
116
 
117
  `finetune/train.py` (transformers 5.24, torch 2.10, MPS on an Apple M2): full fine-tune of the 100M non-embedding
118
  weights with the 262k-token tied embedding frozen; float32; AdamW, lr 3e-5, cosine schedule; batch 2 × gradient
119
- accumulation 16; one epoch, 750 steps (2 h 7 min); loss on the model turn only; eager attention; seed 1. Converted
120
  with `finetune/convert_functiongemma.py` (litert-torch 0.10.0, Google's FunctionGemma conversion: int8, KV cache
121
  1,024, four prefill signatures).
122
 
@@ -130,32 +136,40 @@ Scored with the project's `llmeval` harness on the Mac (LiteRT-LM, the same file
130
  is a call whose effect on the simulated home is not acceptable. "Whole stack" puts the project's command model
131
  (iteration 13) in front, as in the app; "model alone" sends every case to this model.
132
 
133
- | Right / wrong actions / rest | Previous file (v4) | **This file (v6 int8)** |
 
 
 
134
  |---|---|---|
135
- | Built-in cases (604), model alone | 537 / 4 / 63 | **554 / 1 / 49** |
136
- | Built-in cases (604), whole stack | 580 / 1 / 23 | **595 / 0 / 9** |
137
- | Blind set 5 (215), whole stack, first use | 156 / 23 / 36 | **177 / 18 / 20** |
138
- | Blind set 2 (154), whole stack | 134 / 6 / 14 | 138 / 6 / 10 |
139
- | Blind set 3 (197), whole stack | 162 / 6 / 29 | 160 / 6 / 31 |
140
- | Blind set 4 (208), whole stack | 161 / 11 / 36 | 179 / 9 / 20 |
141
- | Dev split v6 (1,500), exact match | 89.8% | 96.7% |
142
-
143
- - **Blind sets** are frozen case files with their own homes, written without seeing the prompts, the generator or
144
- the other sets; only totals are read. 36% of blind set 5's cases expect nothing to happen or a question back.
145
- - On blind set 5, 14 bedtime cases expect nothing although the scorer's home has a Goodnight routine; the project
146
- decided afterwards that a goodnight should run that routine, so some of the 18 "wrong actions" there are the wanted
147
- answer.
148
- - **Speed:** the previous file (same size and layout) took 0.5 s median per request on an MT8189 tablet (2× A78 +
 
 
 
 
 
 
149
  6× A55, CPU), load 0.5 s, process RSS about 1.9 GB with the rest of the app. This file's own tablet run is pending.
150
 
151
  ## Limitations
152
 
153
  - English only, and only the prompt format above. Other wordings of the developer turn were not trained.
154
- - Greetings in a home without a matching routine sometimes run another routine or invent one
155
- (`run_routine name=sleep`).
156
- - Refused wishes with a colour word ("she'd like the bedroom a warmer white but it's fine as it is") can be acted on.
157
- - "undo" with nothing before it was once answered with the TV's rewind key; some reminder and list wordings slip
158
- when the model is used alone.
159
  - Very large homes: the longest conversation measured needed 437 tokens; the KV cache is 1,024.
160
  - Sampling is on in the app, so one wrong action either way on a set is within a re-run's noise.
161
  - It has the base model's limitations and biases; it was not evaluated for anything beyond home commands.
@@ -164,9 +178,13 @@ is a call whose effect on the simulated home is not acceptable. "Whole stack" pu
164
 
165
  The weights are a Model Derivative of FunctionGemma and are distributed under the
166
  [Gemma Terms of Use](https://gemma.ai/resources/terms/) (`license: gemma`), including the use restrictions of its
167
- section 3.2 and the [Prohibited Use Policy](https://gemma.ai/resources/prohibited_use_policy). The project's code
168
  (training, conversion, evaluation, the app) is Apache-2.0 and is not part of this repository.
169
 
 
 
 
 
170
  ## Citation
171
 
172
  If you use this model, please cite FunctionGemma / Gemma 3 as Google asks on the
 
19
  - android
20
  ---
21
 
22
+ # PrivateAssistant FunctionGemma home commands (v7, int8 LiteRT-LM)
23
 
24
  **This is a modified version of Google's FunctionGemma 270M.** It was fully fine-tuned (the tied embedding stayed
25
  frozen) by the PrivateAssistant project to turn a spoken home request into short command lines for an Android
 
30
  > This model is a Model Derivative of Gemma. Using it means agreeing to the
31
  > [Gemma Terms of Use](https://gemma.ai/resources/terms/) (a copy is in this repository as `GEMMA_TERMS.txt`), and
32
  > it **must not be used for the restricted uses in the
33
+ > [Gemma Prohibited Use Policy](https://gemma.ai/resources/prohibited-use/)** (section 3.2 of the terms), nor in
34
  > violation of applicable laws and regulations. Anyone who passes this model on must pass these restrictions on too.
35
 
36
  - **Source code, training scripts and evaluation:** https://github.com/feleir/privateassistant (Apache-2.0); `finetune/README.md` has every command.
37
+ - **Round:** v7 (training data v7), 29 November 2026. It replaced v6 (`ca91e617…c513`), which the app shipped before.
38
 
39
  ## Files
40
 
41
  | File | Bytes | SHA-256 | Notes |
42
  |---|---|---|---|
43
+ | `functiongemma-home_q8_ekv1024.litertlm` | 300,822,656 | `3b6070a66ffc29e874968a55a71009bbb677895ee64e0b5cdd6bcd668c907e40` | int8, KV cache 1,024, prefill signatures 32/64/128/256. The file the app pins (`ModelCatalog.COMMAND_TIER`) |
44
  | `GEMMA_TERMS.txt`, `NOTICE` | | | the copy of the terms and the notice the Gemma Terms of Use require |
45
  | `SHA256SUMS` | | | the hashes above |
46
 
 
89
  question) or `reply` (an acknowledgement such as "thanks").
90
  - Tools it was trained on: `control_lights`, `activate_scene`, `run_routine`, `control_tv`, `open_tv_app`, `timer`,
91
  `alarm`, `reminder`, `lists`, `home_status`, `get_weather`, `get_time`, `get_news`, `convert_units`,
92
+ `cooking_time`, `food_safety`, and from v7 `search_tv` (search the TV, or one of its apps, for a title, person or
93
+ topic) and `tv_status` (say what the TV is doing; never a key press). Their schemas are in the source repository (`core/`); the parser and writer of the
94
  lines are `CompactCalls` and `CompactFormat`.
95
  - Earlier turns of a conversation come as an `Earlier in this conversation:` block before the request.
96
  - The app samples at temperature 0.3, at most 128 tokens an answer.
97
 
98
  ## Training data
99
 
100
+ **Synthetic only.** 24,000 training and 1,500 dev requests (data v7; v6 had the same sizes) generated by the project's own code
101
  (`llmeval/.../TrainingData.kt`, run by `finetune/generate_data.sh --format compact`, seeds 1 and 2) on randomly
102
  generated homes: random room, light, group, scene, app and routine names from word lists in the code, requests from
103
  phrase templates (`PhrasesEn.kt`), and targets written by the app's own `CompactFormat.write` (the inverse of the
104
  parser, round-trip tested over every tool). 68 kinds of request, among them lights on/off, levels, relative changes,
105
  "everything except", follow-ups, corrections, negations and remarks that ask for nothing, routines and bedtime or
106
  morning greetings, scenes, the TV and its apps, timers, alarms, reminders, lists, unit conversions, cooking times,
107
+ food safety, missing names (a question back) and general questions (`chat`). Data v7 added TV searches (448),
108
+ questions about what the TV is doing (306), follow-ups after them ("play it" is the OK key, 243), near misses such as
109
+ "what's on the shopping list" (118), greetings in a home without that routine (110), refused colour wishes (328) and
110
+ "undo" with nothing before it (93).
111
 
112
  - **Held out:** every built-in evaluation template (any generated request that matches one, with any names, is
113
+ dropped: 2,368 dropped), all six blind sets and a TV-names set, both as requests and as earlier turns (114 more
114
+ dropped). For v7, a check after generating found no request or earlier turn equal to a blind sentence.
115
  - **No personal data:** no recordings, no transcripts of real use, no real home's names or device lists, no
116
  household data of any kind. The data was generated on the developer's machine from code and word lists alone.
117
+ - **Who wrote it:** the generator's code, its phrase templates and its word lists were written by Claude Code (an AI
118
+ coding agent working on the project), not by people. No model produced the data itself when it was generated, and none
119
+ of it is Gemma or FunctionGemma output.
120
 
121
  ## Training procedure
122
 
123
  `finetune/train.py` (transformers 5.24, torch 2.10, MPS on an Apple M2): full fine-tune of the 100M non-embedding
124
  weights with the 262k-token tied embedding frozen; float32; AdamW, lr 3e-5, cosine schedule; batch 2 × gradient
125
+ accumulation 16; one epoch, 750 steps (2 h 8 min for v7); loss on the model turn only; eager attention; seed 1. Converted
126
  with `finetune/convert_functiongemma.py` (litert-torch 0.10.0, Google's FunctionGemma conversion: int8, KV cache
127
  1,024, four prefill signatures).
128
 
 
136
  is a call whose effect on the simulated home is not acceptable. "Whole stack" puts the project's command model
137
  (iteration 13) in front, as in the app; "model alone" sends every case to this model.
138
 
139
+ Whole stack, mean of three runs each (right / wrong actions), on 626 built-in cases (v7 added 22 for the new tools
140
+ before training):
141
+
142
+ | Right / wrong actions | Previous file (v6) | **This file (v7 int8)** |
143
  |---|---|---|
144
+ | Built-in cases (626) | 603.7 / 0.7 | **615.7 / 0.3** |
145
+ | Blind set 6 (259), first use | 204.0 / 8.7 | **230.0** / 9.3 |
146
+ | Blind set 6, TV searches (18) | 0 | **18** |
147
+ | Blind set 6, TV status questions (9) | 3 | **6** |
148
+ | Blind sets 2–5 together, wrong actions | 42.3 | 45.7 |
149
+ | … the same without blind set 5's 14 bedtime cases | 34.0 | 35.7 |
150
+
151
+ Dev splits (exact match): v7 at or above v6 on every data v7 kind, e.g. TV searches 87.6% (v6 1.6%), "undo" with
152
+ nothing before it 100% (9.1%).
153
+
154
+ - **Blind sets** are frozen case files with their own homes. They were written by separate Claude Code sessions that
155
+ did not open the prompts, the generator, the templates or the other sets' cases; only totals and per-category counts
156
+ are read. About a third of each set's cases expect nothing to happen or a question back.
157
+ - **Shipped by the project owner's decision against its own bar.** The bar, fixed before training, also asked for no
158
+ more wrong actions than v6 on the blind sets; v7 makes a few more there (above). The owner chose v7 for its many
159
+ more right answers and the new TV tools. On blind set 5, 14 bedtime cases expect nothing although the scorer's home
160
+ has a Goodnight routine, and the project later decided a goodnight should run that routine, so some of those wrong
161
+ actions are the wanted answer.
162
+ - **Previous file (v6)** on the round-6 scorer: built-in 595 / 0 of 604, blind set 5 177 / 18 (first use).
163
+ - **Speed:** v4 (same size and layout) took 0.5 s median per request on an MT8189 tablet (2× A78 +
164
  6× A55, CPU), load 0.5 s, process RSS about 1.9 GB with the rest of the app. This file's own tablet run is pending.
165
 
166
  ## Limitations
167
 
168
  - English only, and only the prompt format above. Other wordings of the developer turn were not trained.
169
+ - A few more wrong actions than v6 on the older blind sets (above); some reminder and list wordings slip when the
170
+ model is used alone.
171
+ - TV status questions: 6 of 9 right on blind set 6. In the app, "what's on the TV" is still taken by the command model
172
+ in front of it (as a list question) until that model is retrained.
 
173
  - Very large homes: the longest conversation measured needed 437 tokens; the KV cache is 1,024.
174
  - Sampling is on in the app, so one wrong action either way on a set is within a re-run's noise.
175
  - It has the base model's limitations and biases; it was not evaluated for anything beyond home commands.
 
178
 
179
  The weights are a Model Derivative of FunctionGemma and are distributed under the
180
  [Gemma Terms of Use](https://gemma.ai/resources/terms/) (`license: gemma`), including the use restrictions of its
181
+ section 3.2 and the [Prohibited Use Policy](https://gemma.ai/resources/prohibited-use/). The project's code
182
  (training, conversion, evaluation, the app) is Apache-2.0 and is not part of this repository.
183
 
184
+ This model and the PrivateAssistant project are not affiliated with or endorsed by Google. "Gemma" and
185
+ "FunctionGemma" are Google's trademarks, used only to say which model this one was made from (Gemma Terms of Use,
186
+ section 4.2).
187
+
188
  ## Citation
189
 
190
  If you use this model, please cite FunctionGemma / Gemma 3 as Google asks on the
SHA256SUMS CHANGED
@@ -1 +1 @@
1
- ca91e6171e59b91891ca61cae94a1eb647ba3f3d85f95066a36e83cd7c1ac513 functiongemma-home_q8_ekv1024.litertlm
 
1
+ 3b6070a66ffc29e874968a55a71009bbb677895ee64e0b5cdd6bcd668c907e40 functiongemma-home_q8_ekv1024.litertlm
functiongemma-home_q8_ekv1024.litertlm CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ca91e6171e59b91891ca61cae94a1eb647ba3f3d85f95066a36e83cd7c1ac513
3
  size 300822656
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3b6070a66ffc29e874968a55a71009bbb677895ee64e0b5cdd6bcd668c907e40
3
  size 300822656