Paper by Jayakumar Gopalan, Zhagaram Labs Preprint

Adding Tamil to a Pretrained Hybrid-Attention Model

Subword initialization, differential step scaling, and compute confounds

2.69× fewer Tamil tokens per word on held-out web text (4.13 down to 1.53), leaving English and romanized Tamil untouched

−1.3% lower bits per byte on fresh.web at 1B tokens with pieces init and 10× new-row scaling (0.3391 vs. 0.3435), after leading by −3.5% at 200M

+43% wall-clock slowdown from an odd unaligned vocabulary size (280,077) on Hopper GPUs for only +4.3% FLOPs, fixed by 128-multiple padding

Abstract

Extending Qwen3.5 with 32,000 Tamil merges cuts Tamil tokens by 2.69×—and reveals four confounds that decide whether vocabulary extension actually wins.

Even mark-aware multilingual tokenizers over-fragment Tamil: Qwen3.5 requires 4.13 tokens per word (0.1687 tokens per UTF-8 byte) on held-out Tamil web text. Extending Qwen3.5's vocabulary with 32,000 Tamil BPE merges cuts Tamil token counts by 2.69× to 1.53 tokens per word (0.0627 tokens per byte) while leaving English and romanized Tamil untouched. We test whether this vocabulary extension pays off in continued pretraining of Qwen3.5-0.8B-Base—a hybrid GatedDeltaNet and full-attention model—from 0 to 1B training tokens, evaluating in tokenizer-invariant bits per byte (bpb) across seven slices.

Three findings stand out. First, initialization matters immediately: initializing each added token as the mean of its constituent stock-Qwen subwords starts at step-0 loss 8.20 versus 10.53 for global-mean initialization, which remains worse than the untrained base model (0.7473 vs. 0.6080 bpb) after 26M tokens. Second, at uniform learning rate (1×), the extended model trails the stock control at both 26M (0.5910 vs. 0.4749) and 200M tokens (0.3988 vs. 0.3846); scaling added-row updates by 10× closes the gap at 26M (0.4747), beats stock by 3.5% at 200M (0.3712 vs. 0.3846), and narrows to a 1.3% lead at 1B tokens (0.3391 vs. 0.3435) while retaining the permanent 2.69× inference and context compression.

Third, we document four confounds and systems pitfalls that distort vocabulary-extension comparisons: (i) at equal training tokens, 2.69× compression exposes the extended arm to 1.76× more unique text, explaining why identically tokenized English (−1.5%) and code (−2.3%) improve at least as much as Tamil (−1.3%) at 1B; (ii) resizing embeddings to an unaligned odd size (280,077) drops Hopper Tensor Core efficiency by 43% (24.4 s vs. 17.1 s per step for only +4.3% FLOPs), fixed by 128-multiple padding with logit slicing; (iii) post-step delta scaling amplifies AdamW decoupled weight decay on unseen tail tokens unless embeddings use zero weight decay; and (iv) cosine decay starting at step 0 clips short-warmup trials below peak learning rate. We release the cleaned v2 tokenizer (qwen3.5-ta-32k) and all code and logs under Apache 2.0.

1 Tokenizer extension and setup

2.69× fewer Tamil tokens per word, zero change to English or romanized Tamil, and 47 crawl artifacts stripped in v2.

In our companion 19-tokenizer audit (Where open tokenizers break Tamil), Qwen3.5 already fixed the \p{L}+ combining-mark bug, yet still requires 4.28 tokens per word on D4.web (4.13 on FineWeb-2 Tamil), compared with 1.5–1.7 for a Tamil-specialized vocabulary.

1.1 Extending Qwen3.5's tokenizer

Stock Qwen3.5-0.8B-Base has 248,077 active tokens padded to 248,320 (3,880 × 64) in its weight matrix, and uses a mark-aware regex pre-tokenizer ([\p{L}\p{M}]+). Because BPE applies existing merges before appended ones, we train 32,000 Tamil merges on top of Qwen3.5's base vocabulary on Sangraha verified Tamil shard data-0, yielding qwen3.5-ta-32k (280,077 tokens in v1). On held-out FineWeb-2 Tamil (fresh.web), tokens per word drop from 4.13 to 1.53 (2.69× compression; 0.1687 to 0.0627 tokens per byte), and mid-letter cuts fall from 63.2% to 7.8%. On D4.web and D4.literature, tokens per word drop from 4.28 to 1.67 and from 4.34 to 1.93. English (0.225 tok/byte) and romanized Tamil (0.375 tok/byte) tokenize identically to stock across all 2,000 test passages each.

1.2 Post-hoc vocabulary hygiene (v2)

Auditing the 32,000 added v1 tokens revealed 47 defective entries: 41 mixed Latin–Tamil crawl artifacts from literal \n escapes (e.g., nஅ, nஇந்த, Delhi), 2 partial-UTF-8 byte tokens, and 4 dependent merges. Furthermore, 1,810 added tokens begin with a Tamil vowel sign or pulli (ியில், ்கள்), showing that the remaining 7.8% letter-cut rate arises from both stock-Qwen base merges and learned suffix merges rather than fallback alone. Our cleaned v2 release on Hugging Face strips all 47 defective entries (31,953 clean Tamil additions, 280,030 total) while preserving 1.67 tokens per word on D4.web and 100% round-trip fidelity across all 10,357 held-out passages.

1.3 Training corpus and evaluation

Training stream (24 GB)

18 verified Tamil Sangraha shards (data-0–data-18, skipping data-5 and holding out data-52), Tamil Wikipedia, and Project Madurai (78.8% Tamil), plus English (15.8%), Python code (3.8%), and romanized Tamil (1.7%). Context 4,096, batch size 128 sequences (524,288 tokens/step), AdamW at peak LR 10−4 with cosine decay, grad clip 1.0, on single preemptible Nebius H100/H200 GPUs (total study spend ≈$50–$80).

Held-out evaluation

Bits per byte (summed cross-entropy divided by UTF-8 bytes × ln 2) on seven slices: fresh.web (2,000 FineWeb-2 Tamil passages deduplicated by 8-gram overlap), D4.web, D4.literature, Thirukkural verse, romanized Tamil, English, and code, plus Tamil likelihood accuracy on Belebele (n = 900), XCOPA (n = 600), and Global PIQA (n = 203).

2 Initialization and differential step scaling

Subword-piece init is mandatory, uniform 1× LR trails stock through 200M tokens, and 10× new-row scaling flips the comparison.

2.1 All 11 runs from 0 to 1B tokens

Tokens (steps) Tokenizer Init New-row step Step-0 loss Bits per byte (↓) FLOPs (1018) Step (s)
fresh.web D4.web lit. English
0 (base)Stock (248k)——— 0.60800.60440.73500.95940—
26M (50)Stock (248k)—1×1.86 0.47490.48740.64150.95340.1218.1
26M (50)+32k Tamilmean1×10.53 0.74730.78470.94080.95650.1224.1
26M (50)+32k Tamilpieces1×8.20 0.59100.61340.77870.95640.1226.6
26M (50)+32k Tamilpieces3×8.20 0.53220.55430.72440.95530.1223.7
26M (50)+32k Tamilpieces10×8.20 0.47470.49530.67130.95400.1223.7
200M (382)Stock (248k)—1×1.86 0.38460.39400.54360.95570.9018.7
200M (382)+32k Tamilpieces1×8.20 0.39880.41210.57030.94900.9425.4
200M (382)+32k Tamilpieces10×8.20 0.37120.38300.53560.94720.9424.5
1B (1,908)Stock (248k)—1×1.86 0.34350.34850.48010.94774.5217.1
1B (1,908)+32k Tamilpieces10×8.20 0.33910.34500.48040.93354.7124.4

Continued pretraining of Qwen3.5-0.8B-Base from 0 to 1B tokens (one seed per arm). All bit-per-byte scores are lower-is-better; highlighted rows mark the best fresh.web score at each token budget. Matched H200s ran both 1B arms; 200M stock ran on H100 while extended 10× ran on H200 (a 5-step H100/H200 check matched loss to 4 decimals).

2.2 Per-slice bits per byte and Tamil likelihood tasks

Slice / benchmark Tok/byte (stock / ext.) Base (0 tok) 200M tokens (382 steps) 1B tokens (1,908 steps)
Stock Ext. 1× Ext. 10× Δ10× Stock Ext. 10× Δ10×
fresh.web (test)0.169 / 0.0630.6080 0.38460.39880.3712−3.5% 0.34350.3391−1.3%
D4.web0.173 / 0.0680.6044 0.39400.41210.3830−2.8% 0.34850.3450−1.0%
D4.literature0.176 / 0.0780.7350 0.54360.57030.5356−1.5% 0.48010.4804+0.0%
Verse (Kural)0.188 / 0.1011.2213 0.88280.91950.8822−0.1% 0.78570.7717−1.8%
Romanized Tamil0.375 / 0.3753.7435 2.29752.27212.2727−1.1% 2.12972.1322+0.1%
English0.225 / 0.2250.9594 0.95570.94900.9472−0.9% 0.94770.9335−1.5%
Code0.290 / 0.2720.8308 0.81540.81590.8051−1.3% 0.81910.8001−2.3%
Tamil likelihood tasks (accuracy ↑; chance: Belebele 0.250, XCOPA 0.500, Global PIQA ≈0.373)
Belebele (n = 900)—0.352 0.3060.3300.321+1.6 pp 0.3290.333+0.4 pp
XCOPA (n = 600)—0.478 0.5080.5180.538+3.0 pp 0.5220.553+3.2 pp
Global PIQA (n = 203)—0.369 0.4330.4040.409−2.5 pp 0.4240.419−0.5 pp

Per-slice bits per byte (↓) and Tamil likelihood task accuracies (↑) at 200M and 1B tokens. Δ10× is the relative change of Extended 10× versus Stock at the same token budget.

2.3 Subword-piece initialization is mandatory

We compare initializing each added token as the mean of the stock embeddings of its Qwen3.5 subword decomposition (pieces) against the global mean of all stock embeddings (mean). Because Qwen3.5-0.8B-Base ties input and output embeddings, initialization immediately shapes the output softmax. Pieces init starts at step-0 loss 8.20 (versus 1.86 for stock and 10.53 for mean init). After 26M tokens (50 steps), mean init reaches 0.7473 bpb on fresh.web—still worse than the untrained base model (0.6080)—while pieces init reaches 0.5910.

2.4 Uniform 1× updates leave added rows behind

Even with pieces init, training all parameters at a uniform learning rate (1×) leaves the extended model behind the stock control at 26M (0.5910 vs. 0.4749) and still behind by +3.7% at 200M tokens (0.3988 vs. 0.3846). Most of the early drop from 0.6080 to 0.3846 comes from adapting the backbone to Tamil prose; at 1× LR, the 32k brand-new rows move too slowly relative to the already-calibrated 248k stock rows.

2.5 Differential 10× step scaling flips the comparison

Scaling added-row parameter updates by 3× and 10× monotonically closes the 50-step gap: 0.5910 (1×) → 0.5322 (3×) → 0.4747 (10×), matching stock's 0.4749 after just 26M tokens. At 200M tokens, Extended 10× beats stock on every Tamil slice as well as English and code (fresh.web 0.3712 vs. 0.3846, −3.5%). At 1B tokens, the lead narrows to −1.3% on fresh.web (0.3391 vs. 0.3435), −1.0% on D4.web, and −1.8% on Thirukkural verse, while tying on D4.literature (0.4804 vs. 0.4801) and romanized Tamil (2.1322 vs. 2.1297). English (−1.5%) and code (−2.3%) improve without forgetting.

3 Four confounds and implementation pitfalls

A naive reading of the main table says vocabulary extension strictly dominates. Auditing our code and logs exposed four traps that qualify that conclusion.

3.1 Equal training tokens ≠ equal text exposure

Tokenizing the same 24 GB stream yields 4,576M tokens under stock Qwen3.5 versus 2,605M tokens under qwen3.5-ta-32k. At a 1B-token budget, the stock arm sees 21.9% of the corpus whereas the extended arm sees 38.4%—1.76× more unique text. Because English and code tokenize identically (or nearly so) across both arms, their 1B improvements (−1.5% English, −2.3% code) cannot come from better Tamil units; they measure the extra data exposure. That Tamil's 1B gain (−1.3%) is slightly smaller than English's suggests that at equal bytes (or equal epochs), the extended model has not yet overtaken stock in raw bpb, even though it delivers a permanent 2.69× decoding speedup and context expansion.

3.2 Unaligned vocabulary GEMM slowdown (+43% wall-clock)

On matched H200 GPUs at 1B tokens, Extended 10× ran at 24.4 s/step versus 17.1 s/step for stock—a 43% wall-clock slowdown despite adding only 4.3% analytical FLOPs (4.71 vs. 4.52 × 1018). Stock Qwen3.5 keeps its embedding matrix padded to 248,320 (3,880 × 64), whereas our Phase D script called resize_token_embeddings(280077) to avoid untrained padding rows receiving softmax mass. Because 280,077 is odd and indivisible by 8/16/64, the (BT, 1024) × (1024, 280077) output GEMM fell off vectorized Hopper Tensor Core kernels. Consequently, equal wall-clock time would give stock 43% more steps, reversing the 1B bpb lead. The clean fix—now shipped in our code and v2 recipe—pads embeddings with pad_to_multiple_of=128 (280,192) and slices logits[..., :active_vocab] before cross-entropy so padding rows receive exact zero probability mass and zero gradient at full Tensor Core speed.

3.3 Post-step delta scaling amplifies decoupled weight decay

Our Phase D trainer implemented 10× scaling by applying e_new ← e_before + 10 (e_after − e_before) after AdamW.step() with global weight_decay=0.1. Under decoupled weight decay, every parameter shrinks by ηλe even when its gradient is zero; multiplying the post-step delta by 10 therefore applied 10× weight decay (λ_eff = 1.0) to all 32,000 new rows on every step, shrinking rare Tamil tail embeddings toward zero even on steps where they did not appear, while also decaying 1D norms and GatedDeltaNet state-space parameters. Separating embeddings, norms, biases, and state-space parameters into a weight_decay=0.0 parameter group eliminates tail shrinkage completely.

3.4 Short-warmup cosine clipping and downstream task noise

Starting cosine decay at step 0 rather than step w (min((s+1)/w, cos(s/S))) clipped our 50-step (w = 25) ablations at 0.742× peak learning rate (crossing at step 18); fixing decay to start at s = w is essential for short hyperparameter sweeps. On downstream Tamil likelihood benchmarks, all 0.8B checkpoints remain near chance on Belebele (0.31–0.35), XCOPA (0.48–0.55), and Global PIQA (0.37–0.43), so bpb remains the primary signal at this scale.

4 Limitations and release

One model size, one seed at 200M and 1B, and every script, log, and cleaned tokenizer released under Apache 2.0.

This study tests a single model size (0.8B) and one seed per arm at 200M and 1B tokens; a second seed at 200M (≈$10 on spot GPUs) and an equal-byte, 128-aligned rerun at 1B are natural next steps. The untrained stock baseline was scored in fp32 on Apple Silicon while trained runs were scored in bf16 on CUDA, and FineWeb-2 Tamil is a public corpus that Qwen3.5 may have seen during pretraining (affecting both arms equally).

All training scripts (incorporating the four fixes above), evaluation harnesses, and raw per-run JSON logs are released in uraikal (Apache 2.0), and the cleaned v2 extended tokenizer is released as zhagaramlabs/qwen3.5-ta-32k.

Cite this work

@misc{gopalan2026qwentamilextension,
  title  = {Adding Tamil to a Pretrained Hybrid-Attention Model: Subword Initialization, Differential Step Scaling, and Compute Confounds},
  author = {Gopalan, Jayakumar},
  year   = {2026},
  note   = {Preprint. Zhagaram Labs},
  url    = {https://zhagaramlabs.com/papers/qwen-tamil-extension/}
}