Views
No views yet
Write the LaTeX representation for this image. Outputs are typically returned as raw LaTeX, often wrapped in$$...$$delimiters.
mlx-vlm's OpenAI-compatible API| Stage | Details |
|---|---|
| Base model | unsloth/Qwen3.5-2B |
| Fine-tuning | LoRA (rank 16, alpha 16) with Unsloth + TRL SFT |
| Training data | 007superher/quant-and-serve-vlm-train-data — 7,000 augmented image–LaTeX pairs from formatted + handwritten sources |
| Instruction | Write the LaTeX representation for this image. |
| Optimizer | AdamW, lr 2e-4, linear schedule |
| Steps | 200 (effective batch size 8) |
| Merged weights | 007superher/unsloth_finetune |
| MLX conversion | mlx_vlm convert with --q-bits 4 (blockwise int4) |
$...$ vs $$...$$, spacing, macro variants).
A human preference study was run on a held-out set of 100 images (50 formatted, 50 handwritten), comparing this fine-tuned model against the unfinetuned base mlx-community/Qwen3.5-2B-MLX-4bit:| Preference | Count | Share |
|---|---|---|
| Finetuned preferred | 20 | 20% |
| Tie | 67 | 67% |
| Base preferred | 4 | 4% |
| Both bad | 9 | 9% |
| By source: | ||
| Source | Finetuned | Tie |
| -------- | ----------: | ----: |
| Formatted (50) | 6 | 41 |
| Handwritten (50) | 14 | 26 |
| The fine-tune shows the largest gains on handwritten inputs. On clean formatted math, outputs are often tied with the base model. Average latency on Apple Silicon was ~1.3 s per image (finetuned vs base, comparable). |
mlx-vlm ≥ 0.6.3
Approximate memory: fits comfortably within ~3–6 GB unified memory for the 2B 4-bit model.