diff --git a/Cargo.lock b/Cargo.lock index 8ad3e16..ca096f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -481,7 +481,7 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "switchify-prediction" -version = "0.2.1" +version = "0.2.2" dependencies = [ "clap", "rusqlite", diff --git a/Cargo.toml b/Cargo.toml index 979af45..9126b0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "switchify-prediction" -version = "0.2.1" +version = "0.2.2" edition = "2024" rust-version = "1.97.1" license = "MIT" diff --git a/docs/releases/v0.2.2.md b/docs/releases/v0.2.2.md new file mode 100644 index 0000000..02372fb --- /dev/null +++ b/docs/releases/v0.2.2.md @@ -0,0 +1,56 @@ +# v0.2.2 + +Faster whole-word generation, natural generation context, and personal learning +that is fast, effective and bounded. Worker protocol 2, the model, the tokenizer, +the bundle manifest and the SQLite formats are unchanged, so existing personal +databases keep working. The matching v0.2.2 workers carry the faster search. + +## Generation (#25) + +- **Batched search.** Beam extensions at each depth now run as one batched + forward pass. Search stops as soon as further search cannot change the ranked + words. For the same context, the words are identical to v0.2.1's on all 1,760 + frozen queries. +- **Speed.** Median generation went from 581 ms to 121 ms with the AVX2 worker + and from 1,257 ms to 424 ms with the portable worker on a Windows test machine. + On macOS ARM CI, with the portable worker, it went from 690 ms to 151 ms in + single runs, whose timing varies; one generation in that run failed, which + the report does not explain. +- **Natural context.** Generation now sees the current sentence as typed, with + its case and punctuation. On the frozen workload, six-slot top six rose from + 72.4% to 73.2%. Reranking and statistical prediction still use the + normalized context. +- **Measuring natural context.** `scripts/generation_evaluate.py` gains + `--natural-context`. + +## Personal learning (#27, #29) + +- **Incremental learning.** `Predictor::learn` and `import` add only the new + counts unless another connection has changed the personal database. On the + production baseline a sentence takes about 8 ms instead of about 190 ms with + little learned, rising to about 20 ms after 2,000 learned words. +- **Weighting.** Learned counts are kept apart from the baseline and combined + when predicting. One learned occurrence counts as up to 500 baseline + occurrences, less as more is learned, so learned words approach a bounded + share instead of outgrowing the baseline. +- **New and rare words.** A word the baseline lacks, or has seen fewer than + three times, counts once it has been learned twice. A single misspelling the + baseline lacks or rarely sees is therefore not suggested. +- **Results.** On a synthetic person, learned words reached the six slots for + 46.2% of the 78 queries on personal words instead of 1.3%, and top six over + all 445 queries rose from 50.3% to 60.4%, with no misspelling suggested. + General English accuracy was unchanged with that learning present. These + were measured with v0.2.1 generation. See + `docs/personal-learning.md` and `scripts/personal_evaluate.py`. +- **Memory.** The baseline is no longer copied, so peak predictor memory falls + from 362 MiB to 134 MiB with or without learning. +- **Behaviour change for existing users.** Learned counts now weigh much more + than the previous 5×, so learned words appear far more often. A word learned + only once that the baseline lacks or rarely sees no longer counts until it is + used again. + +These are regression measurements on synthetic and frozen fixtures, not +evidence of real users' accuracy. Prepared CI bundles are unsigned; platform +applications sign their embedded workers through their own packaging +workflows. Publishing this release, and updating Switchify PC's worker assets +and library pin to it, need separate approval. diff --git a/neural/Cargo.lock b/neural/Cargo.lock index 68c758a..58c0e35 100644 --- a/neural/Cargo.lock +++ b/neural/Cargo.lock @@ -1401,7 +1401,7 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "switchify-prediction" -version = "0.2.1" +version = "0.2.2" dependencies = [ "clap", "rusqlite", @@ -1416,7 +1416,7 @@ dependencies = [ [[package]] name = "switchify-prediction-neural" -version = "0.2.1" +version = "0.2.2" dependencies = [ "clap", "serde", @@ -1429,7 +1429,7 @@ dependencies = [ [[package]] name = "switchify-smol-worker" -version = "0.2.1" +version = "0.2.2" dependencies = [ "anyhow", "candle-core", diff --git a/neural/Cargo.toml b/neural/Cargo.toml index ef0cd84..8a8fcb2 100644 --- a/neural/Cargo.toml +++ b/neural/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "switchify-prediction-neural" -version = "0.2.1" +version = "0.2.2" edition = "2024" rust-version = "1.97.1" license = "MIT" diff --git a/neural/worker/Cargo.toml b/neural/worker/Cargo.toml index 89edded..2009af8 100644 --- a/neural/worker/Cargo.toml +++ b/neural/worker/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "switchify-smol-worker" -version = "0.2.1" +version = "0.2.2" edition = "2024" rust-version = "1.97.1" license = "MIT"