pillardash's picture
Upload README.md with huggingface_hub
18d9bfa verified
|
Raw History Blame Contribute Delete
4.12 kB
# Milogs Action Engine 2.0
A LoRA fine-tune of [Cactus-Compute/needle3](https://huggingface.co/Cactus-Compute/needle3)
that turns a spoken transcript into structured Milogs actions: journal entries,
finance transactions, plans, reminders and search.
This is the model the Flotxt action router loads on device. It runs on the
`libneedle` engine published with Needle 3, and it replaces the earlier
`NeedleForCausalLM` Milogs Transformer.
## The weights
| file | role | size | sha256 |
| --- | --- | --- | --- |
| `needle3-tuned.cact` | the model. Base checkpoint with the trained adapter merged in and the confidence head preserved. | 63,474,900 | `4dcd641d8086762da35e8921844207fca5f7a263167ab4f4bda2c7cf276d60b5` |
| `whistle.cact` | speech to text, 7 languages. Same engine, different archive. | 16,919,407 | `b6e02f048568ac5d01a2042556c658061e699acbc0aa2a1439f52f3d461dffeb` |
| `adapter.safetensors` | the rank-16 LoRA adapter. Continue training from this file, not from the merged archive. | 7,906,680 | `714c7df454e25e250ab44f43ea0d5f285939c50c462c8dfbe0239bbf7f9498b1` |
`needle3-tuned.cact` and `whistle.cact` are both loaded by one engine. A process
loads the text model and the speech model, and `needle_complete` then transcribes
a clip and answers against your tools in a single call.
## Base and architecture
- Base: `Cactus-Compute/needle3` at revision `93e88ede867e4311c39151285e74df513e4b835b`
- Architecture: `NeedleForToolCalling`, 20 layers, 121,021,910 parameters
- Attention: GQA with causal conv taps, sliding window 1024
- MLP: Monarch Hadamard, with engram n-gram memory and multi-lane hyper-connections
- Format: `.cact`, Cactus Quants
- License: Apache 2.0, following the base model
## Fine-tuning
- Method: LoRA on the frozen base at the full 20 layers
- Rank 16, alpha 32
- Learning rate 4e-5, batch size 2, sequence length 2048
- 471 steps, resumed from the step-300 checkpoint of an earlier run, about 4 hours
- Training set: 1,046 examples, 34 percent of them refusal negatives
- Held-out validation loss: 0.2901
The training contract defines the tool schemas the model was taught. A Milogs
release that consumes this model must validate arguments against the same schema,
because the model emits exactly the field names it was trained on.
## The confidence head
Refusal is not in the language weights. For a negative the model still proposes a
call, but at a confidence near 0.005, and the engine suppresses anything below the
threshold. The confidence head is the entire gate.
`needle build --lora` deletes `confidence_head` before export, because local
tuning never trains it, so an archive built that way reports `confidence: null`
and ships every proposed call. This archive is built by merging the adapter into
the checkpoint by hand and exporting the merged checkpoint directly, so the head
survives and real confidence values are reported.
## Measured behaviour
43 hand-written cases, graded on an exact match of the full call list, on the
same runtime the app loads.
| metric | Milogs Action Engine 2.0 | untuned needle3 |
| --- | --- | --- |
| exact match | 12/43 | 13/43 |
| right tool set | 31/43 | 29/43 |
| false fires on non-commands | 8 | 5 |
| real commands that fired | 4/25 | 2/25 |
| negatives correctly refused | 5/8 | 7/8 |
Read this plainly. The adapter is a modest step. On exact match it is level with
the untuned base, it routes to the right tool a little more often and fires on
twice as many real commands, and it fires wrongly more often. It is not a solved
model, and it should be evaluated against the release it replaces rather than
assumed better.
## Engine
The engine is published per platform in `Cactus-Compute/needle3`. On Android the
app links `android-arm64/libneedle.a`; on iOS, `ios-arm64/libneedle.a`. Nothing in
this repository needs to be paired with a specific engine build beyond what
Needle 3 itself requires.
## Citation
```bibtex
@software{cactus_needle,
title = {Needle: small language models for tool calling on device},
author = {Cactus Compute},
url = {https://github.com/cactus-compute/needle}
}
```