# Reproducing the accepted Scriber LFM2.5 350M recipe This document records what produced the accepted local Scriber model. It is a recipe, not a claim that every CUDA stack will reproduce byte-identical model weights. Candidate selection must use the runtime regression, not training loss alone. ## 1. Fixed inputs - Base: `LiquidAI/LFM2.5-350M-Base` - Base revision: `9960764e30892e01f29a6dc23df2533fcd8bd5ae` - Original data: all 2,000 rows in this repository - Dataset split seed: `3502026` - Training/augmentation seed: `17029` - Maximum sequence length: 896 tokens - Precision for SFT teacher work: BF16 - Training orchestrator: PRAXIST, with the required attribution `Praxist by Sapient Intelligence` The training serialization was: ```text Aufgabe: Glätte das folgende deutsche Speech-to-Text-Transkript sprachlich, typografisch und strukturell. Bewahre Inhalt, Reihenfolge, Zahlen, Namen und Bedeutung. Füge nichts hinzu, beantworte keine Fragen und gib ausschließlich die bereinigte Fassung zurück. Transkript: ${output} Bereinigte Fassung: ``` Its SHA-256 is `372f879803334a68e310fe2e658c11678600baf0f4ef72834e4acd409f747dd6`. Only completion tokens contribute to the language-model loss. Tokens covering numbers, dates, units, legal references, and other protected values receive a loss weight of 4.0. ## 2. Stage A: all-2,000 LoRA SFT Start from the untouched base revision. Recombine train, validation, and test in that order and verify the three hashes from the dataset card. Shuffle the 2,000 unique rows with seed `17029` and train each once. - LoRA rank 16, alpha 32, dropout 0.05, no bias - Target modules: `q_proj`, `k_proj`, `v_proj`, `in_proj`, `out_proj`, `w1`, `w2`, `w3` - AdamW, learning rate `2e-4`, weight decay `0.01` - Cosine schedule, warmup ratio `0.05` - Effective batch 16, one epoch, 125 optimizer steps - 5,996,544 trainable parameters The accepted stage started from the untouched base and produced the exact LoRA directory later reused as the parent of Stage B. Do not substitute an adapter, checkpoint, optimizer state, or corpus from an older run. ## 3. Stage B: mixed continuation Load the exact Stage-A adapter, but create a fresh AdamW optimizer. Build one deterministic 8,000-example schedule from the 2,000 targets: - 4,000 long occurrences: two passes over the original pairs - 2,000 identity children: already-clean target as both input and output - 2,000 noisy children: one deterministic filler, repetition, or spoken-format perturbation per target Every consecutive 16-example learning window contains 8 long, 4 identity, and 4 noisy examples. Use seed `17029`. - AdamW, learning rate `5e-5`, weight decay `0.01` - Cosine schedule, 25 warmup steps - 8,000 examples, effective batch 16, 500 optimizer steps - LoRA rank 16, alpha 32, dropout 0.05 - Critical-token loss weight 4.0, maximum length 896 On an H200, the capacity-equivalent execution profile is physical batch 16, accumulation 1, and no gradient checkpointing. It must preserve the same 16-example windows and equal per-example weighting. Merge the resulting adapter into a fresh copy of the pinned base. Freeze this merged BF16 model as the QAD teacher; it is transient and is not a second published product artifact. ## 4. Stage C: QAD-only student Create a fresh student from the newly merged teacher. Build exactly 6,000 unique, seed-shuffled rows: 2,000 original, 2,000 identity, and 2,000 noisy. Train with the Liquid QAD method implemented through PRAXIST: - frozen BF16 teacher, trainable FP32-master student - completion-only forward KL, temperature 1.0 - Q4_0 fake quantization with straight-through estimation - Adafactor, learning rate `1e-6`, no relative step, no warmup, no weight decay - effective batch 16, 6,000 examples, 375 optimizer steps - deterministic algorithms, `CUBLAS_WORKSPACE_CONFIG=:4096:8`, TF32 disabled The intended tensor contract is 92 Q4_0 tensors, 1 Q6_K embedding/head tensor, and 55 F32 tensors, 148 total. Do not create PTQ, Q8, BF16, or another quantized product alternative. ## 5. Export and acceptance Serialize only QAD-Q4_0 with llama.cpp b10158 at revision `f87067841bac583bc089a225382248d857791ca8`. Run one persistent llama-server with greedy decoding and a 384-token output cap. The accepted artifact is: - `Scriber-LFM2.5-350M-Production-QAD-Q4_0.gguf` - 218,328,640 bytes - SHA-256 `e1ca3391d896db64df91c5ed5a02e16f5b6bbec5de81667ec99535eb7b1c0486` Acceptance required exact reproduction of 200 long and 400 short regression cases: 600/600, with no safety rejection, protected-value mutation, loop, prompt-marker leak, or token-limit hit. A later full-capacity H200 rerun reached 599/600 and changed one protected amount, so it was rejected rather than replacing this model. At product runtime, the host must still reject unsafe output and fall back to the original transcript. The 600 cases measure fidelity on the frozen recipe family, not unbiased generalization. ## 6. Environment used - Python 3.12 - PyTorch 2.11.0 with CUDA 12.8 wheels - Transformers 5.16.1 - PEFT 0.20.0 - Safetensors 0.8.0 - Hugging Face Hub 1.29.0 - python-docx 1.2.0 - RapidFuzz 3.14.6 The expensive stages ran on one Mithril H200 spot instance. Credentials were kept outside the work directory and are not part of this repository.