SpectreBoard Models

Scoring models for SpectreBoard, a privacy-first Android keyboard (HeliBoard fork) with a three-tier autocorrect reranking pipeline. All inference runs fully offline on-device.

Files

File Size Description
spectre.blm 54 MB KenLM 4-gram trie binary โ€” Tier 2 scorer
gru_cifg.onnx 58 MB GRU-CIFG language model (ONNX opset 17) โ€” Tier 3 scorer
gru_vocab.txt 246 KB 30,000-word vocabulary (one word per line, line index = token ID)

Pipeline

SpectreBoard runs three reranking passes on HeliBoard's candidate suggestions:

  1. Tier 1 โ€” Spatial Gaussian (SpatialScorer.kt): proximity-weighted key-distance reranking, no model file needed
  2. Tier 2 โ€” KenLM 4-gram (KenLmScorer.kt): loads spectre.blm via JNI (libspectre_score.so); all candidates scored in one native call
  3. Tier 3 โ€” GRU-CIFG (GruScorer.kt): loads gru_cifg.onnx via ONNX Runtime for Android; one forward pass per rerank, candidates indexed from the 30k logit output

Training

  • Corpus: personal chat log (corpus_for_gru.txt, 83,550 lines / ~2.7M words)
  • KenLM: 4-gram with modified Kneser-Ney smoothing, trie structure, built with KenLM tools
  • GRU-CIFG: CIFG-LSTM trained for 10 epochs in PyTorch, exported to ONNX opset 17
    • Test perplexity: 175.6
    • Top-3 accuracy: 36.1%
    • Validation loss leveled off at epoch 7

On-Device Deployment

Push files to the app's private data directory:

adb -s <device> push spectre.blm /data/data/com.termux.spectreboard/files/spectre.blm
adb -s <device> push gru_cifg.onnx /data/data/com.termux.spectreboard/files/gru_cifg.onnx

gru_vocab.txt is bundled inside the APK as an asset and does not need to be pushed separately.

Source

  • Keyboard app: SpectreBoard
  • KenLM JNI scorer: scorer/cpp/ in the SpectreBoard repo (submodule at scorer/kenlm/)
  • GRU training code: separate training pipeline repo (link TBD)
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support