Quintus-1.7B is a compact English-focused assistant built from
Qwen/Qwen3-1.7B-Base. The project uses online full-vocabulary knowledge
distillation from a Qwen/Qwen3-8B teacher, followed by a targeted SFT stage
for assistant behavior, identity grounding, and generation stability.
Public benchmark controls: raw/chat prompt format, metric extraction,
generation budget, and artifact hygiene are documented explicitly.
Training Summary
The release training path is a two-stage pipeline:
Online KD: train the 1.7B base student against live teacher logits from a
Qwen3-8B teacher.
Targeted SFT: tune the distilled checkpoint for assistant-style
interaction, persona consistency, and repetition control.
Reuse As A KD Framework
Quintus is released as a trained 1.7B assistant, but the repository is also a
reusable reference pipeline for compact-model distillation. The same structure
can be adapted to other teacher/student pairs with changes to the model IDs,
tokenizer, dataset source, local paths, sequence length, batch schedule, and
hardware-specific memory settings in configs/config.yaml.
The reusable pieces are split across the codebase: assistant-only masking,
sequence packing, online full-vocabulary KD loss, checkpoint/resume metadata,
validation, provenance checks, SFT, and evaluation. The final pattern is:
Distill a smaller base student from a stronger teacher with online KD.
Apply targeted SFT to recover assistant behavior, formatting, identity, and
generation stability.
[!NOTE]
FlashAttention-2, Liger kernels, and fused AdamW are acceleration paths. Keep
the baseline load path compatible with standard Transformers and vLLM APIs
before publishing checkpoints. torch.compile stayed disabled because this
KD shape showed high Inductor memory overhead, dynamic-shape graph breaks,
recompile overhead, and checkpoint portability risk from _orig_mod. state
dict prefixes when compiled modules are not unwrapped before saving.
[!TIP]
The B200-oriented defaults are conservative for the 8B teacher to 1.7B
student workload. Smaller teacher/student pairs may tolerate larger
micro-batches, but full-vocabulary KD scales sharply with vocabulary width.
The editable run configuration lives in configs/config.yaml.
Paths and Hub destinations are left as placeholders so each runner can set local
directories and repository names directly.
Why Online KD Replaced Offline Top-K KD
Earlier experiments cached only the teacher's top-k logits. That made storage
smaller, but with a Qwen vocabulary around 151K tokens, $k = 8$ exposes only:
of the vocabulary support at each position. The sparse signal could perturb the
student, but it did not consistently transfer deeper reasoning behavior.
The final online path keeps the teacher and student in memory together and
computes KL divergence against the teacher's full-vocabulary distribution. Token
chunking keeps that dense objective feasible without materializing a single
large KL workspace.
Benchmark Scoreboard
The final public scoreboard compares Qwen/Qwen3-1.7B-Base,
Qwen/Qwen3-1.7B-Instruct, and Quintus-1.7B.
Model Evaluation Scoreboard
The strongest signal is the reasoning crossover: Quintus beats both the base
and official 1.7B instruct model on GSM8K, ARC-Challenge, and WinoGrande while
remaining at the same parameter scale.
Evaluation uses a mixture of EvalPlus and lm-evaluation-harness/vLLM style
benchmarks. The repository keeps evaluation methodology separate because prompt
format can change the result:
Raw completion comparisons are used for base capability.
Chat-template comparisons are used for assistant-format behavior.
Log-likelihood tasks such as ARC-Challenge and PIQA should usually stay raw.
GSM8K can differ between strict #### parsing and flexible number
extraction.
Metric extraction must ignore stderr, aliases, and wrong filter keys.
Runtime versions, checkpoint identity, generation budget, and stale output
cleanup are part of the evaluation contract.
The active benchmark runner is sft/evaluate.py. It covers
EvalPlus code tasks and lm-evaluation-harness/vLLM tasks, including GSM8K
10-shot evaluation with an extended generation budget.
Repository Map
text
1configs/ Public run profile and DeepSpeed Zero-2 template.
2src/ Data prep, online KD, losses, packing, checkpoints, provenance.
3sft/ Post-KD SFT, local chat, and consolidated evaluation runner.
4docs/ Public architecture, training, evaluation, and release notes.
5weight_audit/ Checkpoint structure and weight-divergence audit material.
Key files:
src/train.py: SFT, offline KD compatibility, and final
online_kd training entry point.
src/download.py: model setup, dataset loading, schema
normalization, tokenization, and assistant-only loss masks.
src/losses.py: CE/KD objective, including online full-vocab
KD token chunking.
Run the final KD path after editing configs/config.yaml
for local paths and hardware:
python -m src.train --phase online_kd
Hub checkpoint uploads are off by default for local runs. Pass
--upload_last_checkpoint or the step/epoch upload flags only after setting the
target repository and HF_TOKEN.
Run the consolidated benchmark suite:
python sft/evaluate.py
Start local chat with a downloaded or local checkpoint: