Two choices are fixed before training starts: how text becomes tokens, and how much of each source the model reads. One paper cuts the token-cost gap between languages by 89%. The other picks a data mix for 1.4% of the training compute.
Pick a tokenizer, then press Play. Four toy languages share one budget of merges. Watch which language gets them. Then we build, piece by piece, BPE, a fairness score, the fair-max rule and a data mixer made from leverage scores.
You need a little Python and what a probability is. We build the rest from zero.
Session 1 of Georgia Tech CS 8803, LLM seminar. It rests on two papers: Foroutan, Meister, Paul, Niklaus, Ahmadi, Bosselut and Sennrich, Parity-Aware Byte-Pair Encoding: Improving Cross-lingual Fairness in Tokenization (2025), and Xie, Tonin and Cevher, Chameleon: A Flexible Data-mixing Framework for Language Model Pretraining and Finetuning (ICML 2025). Every idea is re-taught here in our own words and devices.
Toy, run live: real BPE on four made-up languages, each with its own letters and 36 words. Their shares of the training text are 64%, 24%, 8% and 4%. The paper's real result (Table 1, 128k merges, 30 languages): Gini 0.064 for Classical BPE and 0.007 for Parity-aware BPE.
Chapter 0
See why the tokenizer and the data mix set a model's limits before the first gradient step
You have a budget of 100 billion training tokens and a pile of text in 30 languages: web pages, books, code, encyclopedia articles. Before you pick a learning rate, you make two choices. Nothing later can undo them.
Choice one: how to cut text into pieces. A model reads integers, not letters. A tokenizer maps text to a sequence of integer tokens. The map is fixed for the model's whole life: every checkpoint and every fine-tune reuses it.
Choice two: how much of each source to train on. Call each source a domain (a language, or a source such as Wikipedia). A data mixture gives each domain a weight: the share of training batches drawn from it.
| Tokenizer | Data mixture | |
|---|---|---|
| It fixes | how many tokens a piece of text costs | how many tokens each domain gets |
| Usual answer | BPE on the pooled corpus | equal weights, or weights from a small trained model |
| This session's paper | Parity-aware BPE | Chameleon |
| Price of the fix | one small extra pass per merge | 0.8 GPU-hours, against 56 for the model |
A tokenizer can serve one language well and another badly. Text in the badly served language splits into more tokens. Services bill per token, and context windows count tokens. So the same message costs its writer more. The Parity-aware BPE paper calls this the tokenization tax.
Each bar is the token count for the same 60-character message, using the hero's tokenizers after 80 merges. Switch the tokenizer and compare the bills.
Toy tokenizers from the hero. We made up the price, $2 per million tokens.
With made-up numbers: under the toy Classical tokenizer, Alder packs 3.53 characters into each token and Dunya packs 1.00. A 60-character message costs Alder 60 / 3.53 = 17 tokens and Dunya 60 tokens. At $2 per million tokens, a million messages cost Alder $34 and Dunya $120. Dunya's writers pay 3.5 times more for the same words.
Failure. A multilingual product is slow and costly in some languages, and their chats run out of context early. Measure: count tokens per line on a parallel corpus (the same sentences translated into every language). Fix: change how the tokenizer learns, before pretraining. Once training starts, the vocabulary is fixed.
Chapter 1
Build a tokenizer that merges the most frequent pair of tokens, again and again
Every text, in any language, is a sequence of bytes: integers from 0 to 255. A tokenizer that starts from bytes never meets an unknown character.
Byte Pair Encoding (BPE) learns a list of merges. A merge is an ordered pair of tokens that becomes one new token. To apply a merge, replace every adjacent copy of the pair with the new token. Each replacement makes the sequence one token shorter.
Learning is a loop. Count every adjacent pair over the whole corpus. Take the most frequent pair, add it to the vocabulary, and apply it everywhere. Repeat K times. To encode new text later, apply the K merges in the same order.
The paper's own example: the merges (b, a) then (ba, b), on the text "babab". It starts as five tokens, b a b a b. The first merge gives ba ba b. The second gives ba bab. Step it yourself below.
The bars count each adjacent pair. Press Merge to fuse the top pair everywhere. Pick another text to start again.
"babab" is the paper's Example 3.1; for it the device applies the paper's two merges, (b, a) then (ba, b). The other texts take the top pair, with ties going to the pair seen first. Spaces split words, a simple stand-in for pre-tokenization: no merge crosses a space, and spaces are not counted in CR.
How much did the tokenizer shrink the text? Call a text b, its length in some unit u (bytes, characters or lines) |b|u, and the tokenizer τ. The tokens it makes for b are τ(b), and their count is |τ(b)|.
C-R of b under tau equals the length of b in units u, divided by the number of tokens in tau of b.
Tokenize the text b with τ. Count the tokens. Divide the length of b by that count. The result is CR.
"babab" is 5 bytes. Before any merge it is 5 tokens, so CR = 5 / 5 = 1.0. After two merges it is 2 tokens, so CR = 5 / 2 = 2.5. Two merges packed 2.5 bytes into each token.
For a whole corpus, add all the lengths and divide by all the token counts. So long documents weigh more than short ones. Classical BPE picks the K merges that make this one corpus-wide CR as large as it can, one greedy step at a time.
pythondef learn_bpe(corpus, K): # corpus: list of token lists (start: bytes) merges = [] for _ in range(K): counts = count_pairs(corpus) # every adjacent pair, over ALL text best = max(counts, key=counts.get) # the most frequent pair merges.append(best) corpus = [apply_merge(doc, best) for doc in corpus] return merges # encoding = apply merges in this order
The count line runs over all the text at once. If one language holds 64% of the text, its pairs win most of the votes.
Failure. A small language's text tokenizes at close to one token per byte. Measure: per-language CR on held-out text. Fix: Chapter 3 changes which text casts the votes.
Chapter 2
Turn the token cost of every language into one number that says how unequal the costs are
To compare languages, you need a fair ruler. Bytes fail: a Latin letter is 1 byte in UTF-8, and a Chinese character is 3. Words fail too: some languages put no spaces between words.
With made-up numbers: an English sentence has 20 characters, so 20 bytes. Its Chinese translation has 10 characters, so 30 bytes. In bytes, the same content looks 1.5 times longer.
The paper uses a parallel corpus, FLORES+: the same sentences, translated by people into each language. Every line holds the same content. So the cost of a language is the number of tokens per line. A gap in cost then comes from the tokenizer, not from the script.
Now turn many costs into one number. The paper borrows the Gini coefficient from economics, where it measures how unequal incomes are. Call the number of languages n. Sort the costs cheapest first and call them c1 to cn; i is a language's place in that order.
Gini of T equals one over n, times: n plus one, minus two times the sum over i of n plus one minus i, times c-i, divided by the sum over i of c-i.
Sort the costs c-i cheapest first. Give the cheapest the weight n, the next n − 1, down to 1 for the most costly. Add weight times cost and divide by the total cost. Double it, take it from n + 1, and divide by n.
With made-up costs 2, 3 and 7 (n = 3): the total is 12. The weighted sum is 3 × 2 + 2 × 3 + 1 × 7 = 19. Gini = (1/3) × (4 − 2 × 19 / 12) = (1/3) × 0.833 = 0.278. The most costly language pays 3.5 times the cheapest.
Equal costs, such as 5, 5, 5 and 5, give exactly 0. If one of four languages carries all the cost, the formula gives 0.75. Its largest value is (n − 1) / n, which nears 1 as n grows.
Left: five languages' token costs. Right: the Lorenz curve, the running share of total cost as you add languages cheapest first. Gini is twice the area between it and the diagonal. Drag the spread, then turn off sorting.
Five toy costs. The two marks on the scale are the paper's measured values on 30 languages (Table 1): 0.064 for Classical BPE and 0.007 for Parity-aware BPE.
Failure. Your fairness report shows a negative Gini. Measure: check the order of the costs. Fix: sort them cheapest first. The costs 7, 2, 3 left unsorted give (1/3) × (4 − 2 × 28 / 12) = −0.222, a number with no meaning.
Chapter 3
Change one step of BPE so that each merge goes to the language that is worst off
Classical BPE asks: which merge saves the most tokens over all the text? Parity-aware BPE asks: which merge helps the language that is worst off right now? It aims to make the smallest per-language compression rate as large as it can. The paper calls this a fair-max objective.
The loop keeps its shape. Only the pair count changes. At each step, find the worst-compressed language. Count pairs only in that language's training text. Then apply the chosen merge to every language.
Which language is worst off at step k? Call the set of languages ℒ. Call the tokenizer made from the merges so far τm<k. Call a language's compression rate under it CR(ℓ; τm<k), measured on a small parallel development set.
L-star equals the arg-min, over l in script L, of C-R of l under tau m-before-k.
Tokenize each language's development text with the merges so far. Compute each language's CR. The language with the lowest CR is ℓ-star. Count pairs in ℓ-star's training text and merge the top pair everywhere.
From the toy run after 4 merges: Alder 1.069, Brisa 1.084, Corvo 1.067, Dunya 1.051. The lowest is Dunya, so merge 5 comes from Dunya's text and lifts it to 1.098. Now Corvo, at 1.067, is lowest, so merge 6 comes from Corvo.
Pink marks the worst-off language, the one whose text picks the next merge. Press Step. Then switch to Classical and step the same budget.
The same toy as the hero. Here the development text is the training text itself; the paper uses the FLORES+ dev split.
Why apply the merge to every language? Two languages can share a piece of text, such as a common root or a number pattern. A merge found for one helps the other too. Gluing separate per-language vocabularies together would lose that.
The extra cost is one pass per merge to recompute each language's CR on the small development set. The paper writes it as O(|ℒ|) per merge; the slow part of BPE, counting pairs, stays the same. Encoding new text stays the same too, so the new tokenizer drops into any pipeline.
pythonfor _ in range(K): cr = {l: compression_rate(dev[l], merges) for l in langs} # NEW worst = min(cr, key=cr.get) # NEW: l-star counts = count_pairs(train[worst]) # NEW: only l-star votes best = max(counts, key=counts.get) merges.append(best) for l in langs: # same as before: train[l] = [apply_merge(d, best) for d in train[l]] # apply to ALL
Failure. A language gets stuck. Its development set is too small, or its text is already almost one token per pre-token, so its picks stop helping. Measure: count how often the rule picks each language in recent merges. Fix: the moving window. Among the last W = 100 picks, a language may appear at most α × W / |ℒ| times. With α = 2 and 30 languages that is 6.67, so at most 6 picks in every 100 merges.
Chapter 4
Read the paper's main table and find what moved, what held still and what got worse
The paper tests the base rule and four variants. All use 128,000 merges, trained on 30 languages of FineWeb2 in their natural, uneven proportions, and scored on FLORES+.
| Variant | What changes | Why |
|---|---|---|
| Base | fair-max at every merge | strict parity |
| Window | cap picks per language (W = 100, α = 2) | stop a stuck language |
| Hybrid | first half of the merges classical, second half fair-max | keep cheap shared merges |
| Hybrid + window | both | both |
| Ratios | pick the language furthest below a target rate rℓ, as CR / rℓ | no parallel dev set needed |
Blue is Classical BPE; teal is each Parity-aware variant. Pick a column. The last button shows what happens with more languages.
All values from the paper: Table 1 (FineWeb2, 30 languages, 128k), Table 5 (mC4, 30 languages) and Table 6 (mC4, 60 languages).
The headline: Gini falls from 0.064 to 0.007. That is (0.064 − 0.007) / 0.064 = 0.89, an 89% cut. Global compression on FLORES+ goes from 0.0275 to 0.0276 lines per token: no loss. Vocabulary use, the share of the vocabulary that appears in the test text, rises from 67.0% to 70.4%.
One column moves the wrong way. Fertility, the average number of tokens per word, rises from 3.990 to 4.080, a 2.3% cost. Merges spent on small languages are merges the big languages do not get.
The gain shrinks as you add languages. On mC4 with 30 languages, Gini falls from 0.067 to 0.027 (60%). With 60 languages, it falls from 0.144 to 0.083 (42%). More languages share the same budget, so each gets fewer turns.
Does fairness cost accuracy? The authors trained 3-billion-parameter models on 100 billion tokens and tested 22 languages on 12 benchmarks. With the hybrid tokenizer, 14 languages went up and 6 went down, mostly within the error bars. Persian fell from 42.80 to 39.15. Bengali stayed at chance (23.54 against 25.00) with every tokenizer.
Failure. The ratios variant cuts Gini only to 0.040. Its targets come from FLORES+ byte counts, but its pair counts come from FineWeb2, whose text differs by language. Measure: Gini on a parallel set after training. Fix: use a small parallel dev set; in the paper, 100 lines already gave 0.014.
Chapter 5
See how small proxy models pick domain weights, and why their answer drifts
Now the second choice. You have k domains, D1 to Dk. You need one weight per domain, each at least 0, all adding to 1. A set of such weights is a point on the probability simplex. Weight 0.25 on Wikipedia means a quarter of the training batches come from Wikipedia.
Early models picked weights by hand, favouring text that looked good, such as Wikipedia. The Chameleon paper's verdict: "neither optimal nor scalable." Newer methods train a small, cheap proxy model, read weights from it, and train the large base model with those weights. Weights found on a small model tend to help a larger one.
| Method | Where the weights come from | When a domain is added |
|---|---|---|
| DoReMi | a reference model and a proxy; weights favour domains where the proxy trails the reference | retrain both |
| DoGE | one gradient per domain at every proxy step: 1.7× the time per step at 7 domains, 2.5× at 17 | retrain |
| Chameleon | the proxy's embeddings of each domain’s text | embed the new domain |
DoReMi and DoGE read their weights from the proxy's training run: its losses, or its gradients. That makes the weights depend on when you stop. Chameleon trains its proxy for 2,000 steps; the paper trains the others' proxies for 10,000.
Each bar is one SlimPajama domain's weight. The grey tick is the equal weight, 1/7. Pick a method and slide the proxy's training steps.
All weights from the Chameleon paper, Table 14 (82M proxy on SlimPajama at 1k, 2k, 5k and 10k steps).
Read the Arxiv domain. DoReMi gives it 0.251 at 1,000 steps and 0.057 at 10,000: (0.251 − 0.057) / 0.251 = 77% lower. Chameleon gives it 0.088 and then 0.096, a change of 9%. Stopping DoReMi early would hand you a different mixture.
Failure. You stop a proxy early to save compute, and the base model trains on a mix that the full run would not pick. Measure: compute the weights at two checkpoints and compare. Fix: train until the weights settle, or use a method whose weights do not come from the training trace.
Chapter 6
Embed each domain, compare the embeddings, and score how hard each one is to rebuild from the rest
Chameleon asks what the data is, not how hard the proxy finds it. Step one turns each domain into one vector. Run a batch of the domain's examples through the proxy and average their hidden vectors. Call the domain Di, one example a, and the proxy's layer-L vector for that example h(L)(a).
X-i equals one over the size of D-i, times the sum over a in D-i of h-L of a.
Feed each example a of domain D-i through the proxy. Take its layer-L vector h-L of a. Average all of them. The average is x-i.
With made-up 2-number vectors: two examples give [1, 0] and [0.6, 0.4]. Their average is x-i = [0.8, 0.2]. A real x-i has 768 numbers.
Step two compares every pair of domains with a dot product. The k-by-k table of these is the domain affinity matrix Ω. The paper keeps this simple linear kernel, "as the LM itself already introduces significant non-linearity."
Step three scores each domain. Call the number of domains k, a small positive number that steadies the result λ, and the k-by-k identity matrix I. The score is a kernel ridge leverage score (KRLS).
S-lambda of D-i equals the i-i entry of omega times the inverse of, omega plus k lambda I.
Build Ω from the dot products. Add k-lambda to its diagonal and invert. Multiply Ω by that inverse. Domain i's score is the i-th number on the diagonal.
Take k = 2 and λ = 0.5, so kλ = 1. Two independent domains, [1, 0] and [0, 1], give Ω = I and a score of 1/2 each. Two identical domains, [1, 0] and [1, 0], give 1/3 each. Add a third, unique domain [0, 1] (now kλ = 1.5): the identical pair falls to 0.286 each and the unique one scores 0.400.
Left: three domain embeddings as arrows. Drag a tip. Right: each domain's leverage score. Bring two arrows together and watch both scores drop.
Toy embeddings with 2 numbers each; real ones have 768. The formula is the paper's Definition 3.1.
A high score means the other vectors cannot rebuild this domain's vector well: it is unique. A low score means the others already cover it. Computing it costs one matrix inverse of size k, and k is the number of domains, not documents.
Failure. Two domains hold the same text under two names. Both score low, and pretraining upweights low scores (next chapter). In the toy above, the pair gets 0.42 + 0.42 = 84% of the mix. Measure: look for off-diagonal entries of Ω close to the diagonal ones. Fix: merge duplicate domains before you score.
Chapter 7
Invert the score for pretraining, keep it for fine-tuning, and test the weights on SlimPajama
Pretraining and fine-tuning want opposite things. A base model needs broad, shared knowledge. Fine-tuning needs what the base model has not seen. So Chameleon uses one score two ways.
For pretraining, take the inverse of each domain's score, Sλ−1(Di), which is large for well-covered domains. Turn these into weights with a softmax: exponentiate and divide by the total. A temperature τmix sets how sharp the weights are.
Alpha-i P-T equals e to the power of: one over S-lambda of D-i, divided by tau-mix; all divided by the sum over j of the same term for D-j.
Invert each score S-lambda. Divide by tau-mix. Exponentiate. Divide each result by the total. The shares are the weights alpha-i. For fine-tuning, use S-lambda itself in place of its inverse.
Use the scores of the pair and the loner from Chapter 6: 0.286, 0.286, 0.400. The inverses are 3.5, 3.5, 2.5. With tau-mix = 1 the weights are 0.42, 0.42, 0.16. With tau-mix = 5 they are 0.355, 0.355, 0.290: the same order, flatter.
Why invert? The inverse score is proportional to the Christoffel function, a standard measure of how dense the data is near a point. Dense regions hold the knowledge most domains share, which a base model needs most.
Grey is Uniform, blue is DoReMi and DoGE (lighter), teal is Chameleon. Switch between the weights, the test perplexity they give a 684M model, and what each method cost.
All values from the Chameleon paper: Table 12 (weights), Table 2 (perplexity of 684M models) and Table 13 (H100 GPU-hours).
The paper's numbers: C4 gets 0.247, which is 1.73 times the equal share of 0.143. Wikipedia gets 0.073, half the equal share. The two broad web domains, CC and C4, take 0.449 together. Average perplexity falls from 24.20 (Uniform) to 22.31, a 7.8% drop, level with DoGE (22.32). The weights cost 0.8 GPU-hours, against 7.4 for DoReMi, 6.3 for DoGE and 56 for training the model: 1.4%.
The weights also scale up. With a 1.2B model, average perplexity falls from 16.86 to 15.03. Accuracy on 13 tasks rises from 40.5 to 41.5, the best of the methods tested.
Failure. The average improves while a domain you care about gets worse: Wikipedia goes from 12.42 to 13.90. Measure: per-domain perplexity, not only the average; Chameleon beats Uniform on 4 of 7 domains. Fix: if that domain matters, raise its weight by hand, or add a fine-tuning stage that uses the direct score.
Chapter 8
Reuse the same proxy on a new dataset and on fine-tuning sets, and count the compute saved
Data changes during a project. A new source arrives, or you split a domain in two. A method that reads weights from a training run must run again. Chameleon's proxy only embeds text, so a new domain needs only a forward pass over its samples.
The paper's test: take the proxy trained on SlimPajama and point it at the Pile. Of the Pile's original 22 domains, 17 are still available. Chameleon embeds 4,000 samples per Pile domain and recomputes the scores. DoReMi, DoGE and RegMix need new proxies. RegMix is a method that trains many tiny models on random mixes and fits a regression to pick the best mix for a target task.
Pick a test. On the Pile, the top bars are the extra compute on a log scale; the bottom bars are test perplexity. For fine-tuning, each row is one language.
All values from the Chameleon paper: Table 7 (the Pile, 684M models; Human is the Pile's hand-set mix), Table 9 (Wiki40b) and Table 10 (the Stack).
The extra compute: 4.62 × 1015 FLOPs for Chameleon, against 1.34 × 1018 for DoReMi. That is 1.34 × 1018 / 4.62 × 1015 = 290 times less. RegMix needs 758 times more. Average perplexity: 19.94 for Chameleon, 23.05 for the Pile's hand-set mix, a 13.5% drop.
Fine-tuning flips the sign: use the score itself, so unique domains get more weight. The paper fine-tunes the Pile-trained model for 10,000 steps. On 7 languages of Wiki40b, average perplexity falls from 9.43 to 8.58. On 7 programming languages of the Stack, it falls from 22.02 to 17.18. Every domain improves in both sets. Using the inverse score here does worse.
Failure. The average drops while some domains get worse. On the Pile, Chameleon beats the hand-set mix on 11 of 17 domains; PubMed abstracts go from 17.87 to 21.87. Measure: per-domain perplexity on the new data. Fix: check the domains your users need. A proxy can only embed text it can represent, so test it on a few samples of each new domain first.
Chapter 9
Multiply the tokenizer's exchange rate by the mixture's share to get what the model reads
Neither paper cites the other, but both act on the same training run. The mixture decides how many tokens a language gets. The tokenizer decides how much text each token carries. So the text a model reads in a language is the product of the two.
Call the language's mixture weight αℓ, the total training budget in tokens N, and its compression rate under the tokenizer CR(ℓ; τ), in characters per token.
Text-l equals alpha-l times N times C-R of l under tau.
Multiply the budget N by the share alpha-l to get the tokens the language gets. Multiply by CR to turn tokens into characters. If either factor is small, the product is small.
With the toy: N = 100 billion tokens and Dunya's share alpha = 0.04 give 4 billion tokens. Under Classical BPE, Dunya's CR is 1.00, so the model reads 4 billion characters. Under Parity-aware BPE it is 2.16, so 8.64 billion. Same share, 2.16 times the text.
Bars show billions of characters read in a 100-billion-token run, for big Alder and small Dunya. Slide Dunya's share and switch the tokenizer.
Toy CR values from the hero after 80 merges. Alder takes whatever share Dunya does not, out of 68% (the toy's other two languages keep 32%).
A caveat. The two papers split data on different axes. Parity-aware BPE splits by language; Chameleon's SlimPajama test splits by source, mostly English. Neither ran the joint experiment, so the product above is logic, not a measured result. One more open question: Chameleon's proxy tokenizes its input too. An unfair tokenizer might distort the domain embeddings. Neither paper tests this.
The order is fixed. Learn the tokenizer first. Then train the proxy on tokenized text and compute the weights. Then start the base run, which uses both.
Failure. A language stays weak after both fixes, like Bengali at chance. Measure: estimate text-ℓ, not only its weight or its token cost. Fix: raise whichever factor is small.
Chapter 10
Keep the terms, the numbers, the code and the open questions in one place
Two choices sit upstream of every pretraining run. Parity-aware BPE changes who votes on each merge, and cuts the Gini of token costs by 89% with no loss in compression. Chameleon scores how unique each domain is from a proxy's embeddings. It gets a strong mix for 1.4% of the training compute and needs no retraining when data changes.
| Term | Meaning | Number to remember |
|---|---|---|
| Compression rate (CR) | units of text per token | "babab": 1.0, then 2.5 after two merges |
| Gini coefficient | inequality of per-language token cost | 0.064 to 0.007 (89% lower) |
| Fair-max | each merge serves the worst-off language | extra cost: O(|ℒ|) per merge |
| Moving window | cap on picks per language | W = 100, α = 2: 6 of 100 for 30 languages |
| Fertility | tokens per word | 3.990 to 4.080 (2.3% worse) |
| Proxy model | small model used to pick weights | 82M, 2,000 steps |
| KRLS | how hard a domain is to rebuild from the others | pair 0.286, loner 0.400 |
| αPT, αFT | softmax of the inverse score, or of the score | τmix 5 to 10 (PT), 0.2 to 0.5 (FT) |
| Cost of the weights | GPU-hours to get the mix | 0.8 vs 7.4 (DoReMi), 6.3 (DoGE); model 56 |
| Transfer to the Pile | reuse the proxy on new domains | 290× less compute than DoReMi |
pythonimport numpy as np def gini(costs): # tokens per parallel line, one per language c = np.sort(np.asarray(costs, float)); n = len(c) # sort first! w = np.arange(n, 0, -1) # n, n-1, ..., 1 return (n + 1 - 2 * (w @ c) / c.sum()) / n def chameleon_weights(X, lam=0.5, tau=1.0, phase="pretrain"): k = X.shape[0] # X: (k domains, p dims), mean hidden states omega = X @ X.T # (k, k) affinity matrix S = np.diag(omega @ np.linalg.inv(omega + k * lam * np.eye(k))) # KRLS z = (1 / S if phase == "pretrain" else S) / tau e = np.exp(z - z.max()) return e / e.sum() print(gini([2, 3, 7])) # 0.278 print(chameleon_weights(np.array([[1., 0], [1, 0], [0, 1]]))) # [0.42 0.42 0.16]
The Parity-aware BPE authors say that their fairness counts tokens only. They tested up to 60 languages and two vocabulary sizes, and call for larger models, more languages, code and other modalities. BPE also cannot compress past the pre-tokenized length, so some gap remains. The Chameleon authors plan an online version that updates weights during training, and a version aimed at a chosen task.
Credit: Session 1 of Georgia Tech CS 8803, LLM seminar. Papers: Parity-Aware Byte-Pair Encoding (Foroutan et al., arXiv 2508.04796) and Chameleon (Xie, Tonin and Cevher, ICML 2025, arXiv 2505.24844). The toy languages and all made-up numbers are ours.
Teach it back: open Present or Teach and explain the fair-max rule and the leverage score to a friend. Then go back to the merge budget and predict the Gini before you press Play.