# VocabX cuts inference cost by 77% for Portuguese essay grader

> Hugging Face shows that rebuilding a model's tokenizer with VocabX reduced token count and runtime for a Qwen3‑4B grader.

Oossa · 2026-10-21 · https://oossa.com/en/vocabx-cuts-inference-cost-by-77-for-portuguese-essay-grader

Hugging Face reported that a Portuguese essay‑grading service built on the 4‑billion‑parameter Qwen3‑4B model cut its average response from 350 tokens to 101 tokens after swapping the original tokenizer for a domain‑specific one called VocabX. The change lowered measured inference cost by 77% while improving grading quality. The method rebuilds the vocabulary to focus on token cost rather than frequency and merges repeated JSON structures into single macro tokens.

## The facts

- Cost dropped 77.0% on a test of 500 requests (RTX 5090 GPU, vLLM).
- Vocabulary size reduced from ~152,000 entries to ~65,000.

## Why it matters

For companies running small‑scale models in production, a cheaper tokenizer can halve latency and cloud bills without retraining the model.

## Sources & references

1. [How Specializing the Vocabulary of SLMs Can Cut Inference Cost by 77% in Real Applications](https://huggingface.co/blog/Dharma-AI/vocabx-vocabulary-specialization) – Hugging Face, 2026-10-21

Last updated: 2026-10-21
