Skip to content

Hunch 0.2.1

Latest

Choose a tag to compare

@Mpdreamz Mpdreamz released this 28 Oct 15:40
b7ccb35

Hunch 0.2.1 adds on-device head training: fine-tune a checkpoint's decision head on your own labelled examples, judge it on examples it never saw, and keep it only if it helps.

.package(url: "https://github.com/heed-build/hunch", from: "0.2.1")

Added

  • DecisionModel.evaluate(_:): accuracy and mean loss of the head in use on labelled examples
  • DecisionModel.trainHead(on:options:progress:): fine-tunes the decision head (two layers, the question type embedding, the option scorer) with AdamW; the encoder and the action head stay frozen; cancelling restores the starting head
  • saveHead(to:metadata:), loadHead(from:), Options(head:), resetHead(): a head is a safetensors file (about 50 MiB for the English checkpoint) that only loads on the checkpoint it was trained from
  • TrainingExample, TrainingOptions, TrainingProgress, TrainingReport, Evaluation, HunchError.invalidTraining

Inference output is unchanged. Measured on an Apple silicon Mac with the English checkpoint: 81 examples, 3 epochs, 5.2 s.

Build notes

  • Swift before 6.4 must build with --build-system swiftbuild; the older native build system does not compile MLX's Metal shaders. The README's "Shipping the Metal shaders" covers apps, tests and CI.

License

Apache-2.0; see NOTICE and THIRD_PARTY_NOTICES.md. Model weights are not included.