---
title: 'SpeLLM: Efficient Character-Level Decoding'
url: https://www.emergentmind.com/topics/spellm
type: topic
---

# SpeLLM: Efficient Character-Level Decoding

SpeLLM is a method for large language model decoding that decouples input and output vocabularies by predicting character-level strings through multiple output heads rather than a single token-level softmax. Introduced in "SpeLLM: Character-Level Multi-Head Decoding" [2507.16323], the method keeps a large BPE input vocabulary to preserve short input sequences while replacing the large output projection with $k$ smaller character heads. The stated objective is to reduce the linear dependence of output-layer cost on vocabulary size, while maintaining competitive downstream performance and increasing support for underrepresented languages and domains.

## 1. Motivation and problem setting

Modern decoder-only LLMs commonly use large BPE vocabularies, with $S \approx 100\text{K}+$, to shorten input sequences and reduce per-layer attention cost $O(n^2)$. However, the final output projection and softmax cost is $O(S \cdot d)$ per token, where $d$ is the hidden size, and this scales linearly with vocabulary size. SpeLLM is motivated by this asymmetry: expanding the vocabulary can improve tokenization, but the corresponding output projection becomes increasingly expensive [2507.16323].

The method therefore separates the role of the vocabulary on the input side from its role on the output side. The goal is to keep a large input BPE vocabulary so that text is represented with few tokens, while replacing the large token-level output softmax with a much smaller character-level output. This suggests a design in which vocabulary scaling remains useful for encoding efficiency, but generation no longer pays the full $O(S \cdot d)$ cost of a large output layer.

A recurrent misconception is to treat SpeLLM as a fully character-based language model. The reported design does not do that. It starts from an existing BPE-based LLM and modifies only its output head. Input encoding remains BPE-based, and some inference procedures still refer back to the original token head.

## 2. Architecture and probabilistic formulation

SpeLLM takes an existing BPE-based LLM $M$ and replaces its single token-level output head with character-level multi-head decoding. Let $h \in \mathbb{R}^d$ denote the final-layer hidden state at the current decoding position. A fixed character vocabulary $C$ of size $|C| = s$ is defined; one example given is $s=105$, including letters, digits, punctuation, and pad. The output layer then consists of $k$ independent linear heads $L_1,\ldots,L_k$, each mapping $\mathbb{R}^d \to \mathbb{R}^s$ [2507.16323].

At each token-generation step $t$, SpeLLM predicts $k$ characters in parallel. For the $i$-th head,
$$
P(c_{t,i} \mid \text{context}; \theta_i) = \operatorname{Softmax}(L_i(h))_c.
$$
The joint probability of the generated $k$-character string $x_t=(c_{t,1},\ldots,c_{t,k})$ is factorized across heads and steps:
$$
P(x_{1:T}\mid \text{context})
= \prod_{t=1}^T P(x_t\mid \text{context})
= \prod_{t=1}^T \prod_{i=1}^k P(c_{t,i}\mid \text{context};\,\theta_i).
$$

This factorization yields an effective output space of size $s^k$. The paper contrasts the original token-level output space size $S$ with the SpeLLM output space size $|C|^k = s^k$; an explicit example is $s=105$, $k=10$, giving a capacity of approximately $10^{20}$ possible strings. Because each head has only $s$ outputs, the output-layer cost drops from $O(S \cdot d)$ to $O(k \cdot s \cdot d)$ when $k \cdot s \ll S$.

The architectural claim is therefore not merely that characters are predicted, but that multiple characters are predicted simultaneously. The multi-head design is central: each head emits one character, and the concatenated characters form a candidate token string.

## 3. Self-distillation and model conversion

SpeLLM is not trained from scratch as an independent architecture. It is obtained by converting a standard pre-trained BPE model into a SpeLLM variant by self-distillation. In the reported setup, almost all of the original model is frozen; training updates are applied only to the $k$ new character heads, the original token output head for an auxiliary loss, and the last 5 transformer feed-forward layers [2507.16323].

The conversion pipeline runs the teacher model over FineWeb-Edu and records, at each position, the teacher’s top-5 token predictions and their probabilities, excluding the gold token. For each position, the training target is selected from those top-5 candidates. Each candidate token is converted to a character sequence of length $k$ by padding or truncation. The model then computes
$$
\text{char\_argmax} = \bigl(\arg\max \operatorname{Softmax}(L_i(h))\bigr)_{i=1}^k,
$$
and chooses as the label the candidate whose $k$-character sequence has the largest number of matching positions with $\text{char\_argmax}$, breaking ties by the highest teacher probability. The stated purpose is to prevent “blended” spellings when the teacher is uncertain.

The loss is the sum of a character-level term and a token-level auxiliary term:
$$
\mathcal{L} = \mathcal{L}_{char} + \mathcal{L}_{token}.
$$
The character loss is
$$
\mathcal{L}_{char}
= \sum_{i=1}^k \operatorname{CrossEntropy}(L_i(h),\, \text{label}_{c_i}),
$$
while the token-level auxiliary loss is computed on the teacher’s top-5 tokens only:
$$
\mathcal{L}_{token}
= \operatorname{CrossEntropy}(\text{token\_logits},\, \text{top\_5}).
$$
The reported interpretation is that training preserves teacher token-level information while forcing correct character spelling.

## 4. Inference procedure and computational profile

At inference time, SpeLLM computes the hidden state $h$, applies all $k$ character heads, selects one character per head, concatenates them into a $k$-character string, strips any pad suffix, and treats the result as one token candidate. If the resulting string is a valid BPE token, it is emitted directly [2507.16323].

Two optional recovery mechanisms are described. The first is **AutoCorrect**. If the produced string is not a valid token, the system enumerates all BPE tokens whose each character lies within the top-3 characters of each head, then re-scores that subset using the student’s token head and selects the highest-scoring candidate. The second is **Entropy-Fallback**. If the average entropy across the $k$ character heads exceeds a threshold $\tau$—an example threshold is $\tau = 0.22$—the decoder skips the character heads and falls back to the original token-level head.

The complexity analysis compares the standard token head cost, $O(S \cdot d)$ per decoding step, with the SpeLLM head cost of $O(k \cdot s \cdot d)$. In end-to-end terms,
$$
O(L \cdot d^2 + S \cdot d)
$$
becomes
$$
O(L \cdot d^2 + k \cdot s \cdot d),
$$
where $L$ is the number of transformer layers. The paper emphasizes that most compute still resides in the transformer body, and therefore head-level acceleration does not translate into proportional end-to-end speedup. The reported end-to-end decode result, using prompt length $100$ and generating $99$ additional tokens, is an average runtime reduction of $5.1\%$ across four models.

## 5. Experimental protocol and empirical results

The reported teacher models are Llama3-3B, Llama3-8B, Gemma2-2B, and Gemma2-9B. The character heads use $k=10$ and $s=105$ symbols. Distillation uses 500 K samples from FineWeb-Edu, truncated to 1,400 tokens, with training limited to the new heads and the last 5 feed-forward layers, using FP16 AdamW [2507.16323].

Intrinsic evaluation is performed on 5,000 unseen FineWeb-Edu samples by comparing SpeLLM’s output against the teacher’s top-5 tokens. The metrics are full exact match, 10-character match, and prefix-only match. Averaged over the four models, the reported results are:

| Setting | Total partial matches | Full exact |
|---|---:|---:|
| Without AutoCorrect | 94.89% | 91.75% |
| With AutoCorrect | 97.57% | 94.93% |

Downstream evaluation covers BoolQ and ARC-Easy with 500 samples each in zero-shot mode, GSM8K with 500 samples using 6-shot for smaller models and 3-shot for the 9B model, and CNN/DailyMail summarization with 100 samples in zero-shot mode. The reported comparison between SpeLLM and the teacher is that BoolQ and ARC-Easy are roughly equal or improve by up to $+6.2\%$, whereas GSM8K and CNN/DailyMail show small degradation that is largely recovered by AutoCorrect or Entropy-Fallback.

Ablations vary $k \in \{5,10,15\}$ on Llama3-3B. Exact matches increase with $k$, while total partial match remains stable at approximately $94$–$96\%$. Accuracy remains above $95\%$ on tokens of length at most 4 characters and decays mildly for longer tokens. The paper also reports a high correlation between low character-head entropy and correctness, which is the basis for entropy-triggered fallback.

## 6. Interpretation, limitations, and terminological ambiguity

The discussion in the paper attributes two principal benefits to the design. First, decoupling the output head from a very large BPE vocabulary allows practitioners to expand input vocabularies for low-resource languages without inflating inference cost. Second, character-level decoding naturally handles unseen or rare strings, including proper names and code symbols [2507.16323].

The limitations are explicit. SpeLLM still relies on BPE for input encoding and for AutoCorrect candidate generation, so it is not a fully end-to-end character model. The overall speedup is bounded because most cost remains in the transformer body rather than in the output head. Slight performance gaps remain on more difficult tasks such as GSM8K and CNN/DailyMail when fallback mechanisms are not used. These constraints place SpeLLM in a hybrid design space: the method alters the output interface and decoding procedure, but does not replace the underlying tokenized transformer architecture.

The name can also be confused with unrelated systems. A technical summary of "SPELL: Synthesis of Programmatic Edits using LLMs" discusses implications for a hypothetical system called “SpeLLM,” but that discussion concerns programmatic edits and API migration rather than character-level decoding [2602.01107]. Separately, "SPELL: Self-Play Reinforcement Learning for evolving Long-Context Language Models" uses the acronym SPELL for a multi-role self-play reinforcement learning framework for long-context reasoning [2509.23863]. In the literature represented here, SpeLLM therefore denotes a character-level multi-head decoding method, not either of the two SPELL frameworks.

Source: https://www.emergentmind.com/topics/spellm