Add ACFT short-window variants (5s/10s/30s, int8 drq) converted from futo-org/acft-whisper-base

#2
by leuconoe - opened
LiteRT Community (FKA TFLite) org

This PR adds ACFT short-window variants of whisper-base: fixed 5 s / 10 s / 30 s window TFLite graphs converted from the audio-context fine-tuned checkpoint futo-org/acft-whisper-base (Apache-2.0), using the same encode/decode-split graph interface as the existing exports in this repo.

Why short windows

Whisper always encodes a 30 s window; for sub-5 s voice commands most encoder work is spent on padding. The encoder conv stack is length-agnostic and the encoder positional table is a fixed sinusoid, so slicing the first N rows of embed_positions yields a shorter window β€” exactly what whisper.cpp's audio_ctx parameter does at runtime. Stock Whisper decoders destabilize when the window shrinks (repetition loops: stock whisper-base at a 5 s window collapsed to CER 10.4 on a sentence clip in our evaluation); the futo-org ACFT (audio-context fine-tuning) checkpoints are fine-tuned via self-distillation (L2 on hidden states) to tolerate exactly this. Method and training: futo-org/whisper-acft β€” full credit to FUTO for the checkpoints; this PR only converts them (no retraining).

Files

Conversion: transformers TFWhisperForConditionalGeneration β†’ two-signature graph (same pipeline as the 30 s exports in this repo), converter-time dynamic-range quantization (int8 weights, fp32 activations, tf.lite.Optimize.DEFAULT).

File Window Encode input
acft_whisper_base_5s_drq.tflite 5 s [1, 80, 500]
acft_whisper_base_10s_drq.tflite 10 s [1, 80, 1000]
acft_whisper_base_30s_drq.tflite 30 s [1, 80, 3000]

Tokenizer/vocab unchanged (51865) β€” the stock whisper-base tokenizer.json works as-is.

REQUIRED integration note

These are fixed short-window graphs. The encode signature input is [1, 80, frames] with frames = 500 / 1000 / 3000. The runtime must size the mel window from the encode signature's input shape (compute/pad the log-mel to exactly that frame count) instead of assuming 3000 frames. The decode signature input order of these exports is (mask, audio, tokens) β€” opposite of the stock export in this repo β€” so bind decode tensors by shape/name rather than position. Reference implementation: the JNI bridge in LiteRT-LM-Unity, which auto-detects 500/1000/3000-frame windows from the signature on one code path.

Validation

Desktop evaluation (LiteRT interpreter, XNNPACK CPU, greedy decode, 7 Korean/English clips, CER vs punctuation-normalized references):

  • The ACFT 5 s f32 graph reproduces the stock 30 s export's transcripts clip-for-clip (identical CER per clip) at ~8x encoder speedup (0.076–0.084 s vs 0.62–0.65 s per encode).
  • The drq (int8) tier pushes encode to 0.03 s (20x vs stock 30 s f32) with unchanged transcripts on the probe set.
  • Stock whisper-base at the same 5 s window (no ACFT) collapses on sentence-length clips (repetition loop, CER 10.4 on one clip) β€” the failure mode ACFT fixes.

Desktop probe of these drq files:

Window Clip Transcript CER Encode s Decode s (steps)
5s 2025λ…„ 3μ›” 5일 μ „μˆ ν‰κ°€ κ²°κ³Ό 보고 (3.98 s, ko) 2025λ…„ 3μ›” 5일 μ „μˆ  평가 κ²°κ³Ό 보고 0.000 0.039 0.62 (12)
5s The current weather in Seoul is cloudy (2.9 s, en) The current weather and soul is cloudy. 0.094 0.045 0.44 (8)
5s μ†Œλ¦¬ ν‚€μ›Œμ€˜ (1.32 s, ko command) μ†Œλ¦¬ ν‚€μ›Œμ€˜ 0.000 0.031 0.23 (4)
5s μŒλŸ‰ 증가 (1.15 s, ko command) μŒλŸ‰ 증가 0.000 0.036 0.27 (5)
10s 2025λ…„ 3μ›” 5일 μ „μˆ ν‰κ°€ κ²°κ³Ό 보고 2025λ…„ 3μ›” 5일 μ „μˆ  평가 κ²°κ³Ό 보고 0.000 0.092 0.72 (12)
10s The current weather in Seoul is cloudy The current weather and soul is cloudy. 0.094 0.080 0.53 (8)
10s μ†Œλ¦¬ ν‚€μ›Œμ€˜ μ†Œλ¦¬ ν‚€μ›Œμ€˜ 0.000 0.086 0.30 (4)
10s μŒλŸ‰ 증가 μŒλŸ‰ 증가 0.000 0.090 0.33 (5)
30s 2025λ…„ 3μ›” 5일 μ „μˆ ν‰κ°€ κ²°κ³Ό 보고 2025λ…„ 3μ›” 5일 μ „μˆ  평가 κ²°κ³Ό 보고 0.000 0.422 1.20 (12)
30s The current weather in Seoul is cloudy The current weather in Seoul is cloudy. 0.000 0.428 0.85 (8)
30s μ†Œλ¦¬ ν‚€μ›Œμ€˜ μ†Œλ¦¬ ν‚€μ›Œμ€˜ 0.000 0.436 0.47 (4)
30s μŒλŸ‰ 증가 μŒλŸ‰ 증가 0.000 0.449 0.60 (5)

(The single 5 s/10 s miss β€” "and soul" on the English clip β€” is the stock whisper-base 30 s f32 export's own transcript for that clip; the 5 s window is ~12x faster per encode than the 30 s window.)

On device (Snapdragon 865, arm64 CPU, LiteRT, fresh process incl. compile): the 5 s drq graph reads a 3.8 s Korean report sentence exact in 1.33 s total and short commands in ~0.76 s total (encode 0.047–0.06 s β€” ~12x the deployed stock base-30s encoder on the same device; ~3.5x faster end-to-end).

Caveats

  • The 5 s/10 s graphs hard-truncate longer audio β€” pick the window that matches your audio length; keep a 30 s graph for dictation.
  • Very quiet sub-second clips remain sensitive (capture-side AGC/loudness normalization recommended) β€” a base-model capacity trait, unchanged by ACFT.

License: Apache-2.0 (this repo's license; the source ACFT checkpoint is also Apache-2.0).

Converted by the LiteRT-LM-Unity project (https://github.com/Leuconoe/LiteRT-LM-Unity).

LiteRT Community (FKA TFLite) org

Withdrawing this PR β€” we consolidated all six ACFT short-window conversions (tiny/base/small Γ— multilingual/.en, 5s/10s/30s each) into a single dedicated repo instead of adding files piecemeal to the per-model repos: litert-community/whisper-acft.

The same files (identical content) plus the full integration notes and per-model validation tables live there. Sorry for the noise, and thanks for hosting the stock exports these graphs interface-match!

leuconoe changed pull request status to closed

Hi, could you please convert these https://huggingface.co/ivrit-ai files into .tflite or .litertlm models? I'm having trouble converting them. thx

Sign up or log in to comment