Manuscript Offprint
arXiv:2610.24937MLFont: Machine Learning-Driven Font Subsetting and Range-Compact Unicode-Range Slicing for Low-Latency Web Typography
Abstract
CSS3 @font-face rules with unicode-range descriptors partition web fonts into downloadable slices. While Latin fonts need ~20 KB in WOFF2, Pan-European (LGC) and East Asian (CJK) fonts contain 2,297–30,759 codepoints (158 KB–5.9 MB in WOFF2), where heuristic partitioning causes unused-glyph downloads, high HTTP RTT, CSS bloat, or missing-glyph fallbacks. We present MLFont, a machine learning and optimization framework that learns font slicing strategies from corpora via three stages: (1) a Zipfian High-Frequency Tier (most) isolating top-frequency codepoints; (2) a Latent Co-Occurrence Topic Tier using Online Variational Bayes LDA (Online LDA) or a Deep Neural Network Topic Model (DNNTM) with Shannon Entropy Difference Loss and Sinkhorn-Knopp normalization; and (3) a Memetic Range-Compact Genetic Algorithm (GA) with Potts-Viterbi dynamic programming and island bridging that minimizes topic discrepancy and CSS fragmentation. Across five Google Noto fonts (LGC, KR, JP, TC, SC), MLFont cuts 3G per-glyph latency by 56.7%–75.3% over single-file delivery and 46.1%–66.3% over equal-bin baselines on CJK with 100% coverage, reduces CSS intervals by 17.9%–41.7%, and achieves 1.56×–6.09× cold-cache speedups (65.4%–84.9% CJK and 44.7% LGC bandwidth savings) across 20 websites in simulator and Headless Chrome benchmarks (45/45 exact slice-set parity).
Code: https://github.com/wq2012/mlfont
Models: https://huggingface.co/collections/wq2012/mlfont
1 Introduction
Web fonts are a foundational pillar of modern digital typography, enabling consistent visual identity and multilingual rendering across heterogeneous client operating systems [4, 8]. However, serving heavy font libraries over the web presents a severe systems and networking bottleneck known as the Heavy Web Font Loading Problem. Whereas a standard Western Latin typeface contains 200–400 glyphs and compresses to 15–30 KB under WOFF2 Brotli compression [1, 8], Pan-Unicode typefaces such as Noto Sans (Latin-Greek-Cyrillic, 2,297 codepoints) and East Asian CJK typefaces such as Noto Sans CJK (16,663 to 30,759 codepoints across Japanese, Traditional Chinese, Korean, and Simplified Chinese) span 3.0 MB to 5.9 MB per font weight even after WOFF2 compression [9]. Downloading a multi-megabyte font file over cellular or emerging-market networks (e.g., 2G/3G) causes multi-second render-blocking delays, manifesting as Flash of Invisible Text (FOIT) or jarring layout shifts from Flash of Unstyled Text (FOUT).
To mitigate full-font downloads, the W3C CSS Fonts Module Level 3 specification introduced the unicode-range descriptor within @font-face rules [4]. This mechanism allows a single logical typeface to be partitioned into K disjoint physical WOFF2 subset files (slices) . When a browser parses a web page, it inspects the active DOM characters and lazily fetches only those slices whose unicode-range intervals intersect the page's character set. Unlike patch-based protocols such as the W3C Incremental Font Transfer (IFT) specification [14]—which require precomputed patch sets and a client-side patch-application engine—static unicode-range slicing operates purely over standard immutable CDN files and is supported by all major modern web browsers; MLFont's learned co-occurrence partitions can also inform IFT patch-table groupings.
Despite widespread browser support for unicode-range, designing an optimal codepoint partition for a font of codepoints is a challenging combinatorial optimization problem governed by three competing physical forces:
(1) Bandwidth Waste (Over-fetching): If a slice groups together characters that rarely co-occur on the same web page, downloading for a single needed character forces the client to download hundreds of unused glyphs, resulting in poor glyph utilization (< 6%).
(2) HTTP Request Overhead (RTT Multiplication): If characters that frequently co-occur on a single web page are scattered across many slices, rendering a single page triggers dozens of distinct HTTP requests, multiplying network Round-Trip Time (RTT) overhead.
(a) Zipfian Codepoint Document-Frequency Decay

(b) Latency vs. CSS Unicode-Range Pareto Frontier (Noto Sans SC)
Total CSS unicode-range Intervals (log scale, lower is more compact)
Figure 1: (a) Empirical Zipfian decay of codepoint document frequencies across five Google Noto fonts on Wikipedia corpora, motivating Tier-1 high-frequency isolation (most_1..M). (b) Pareto trade-off between mean per-glyph download latency (GIN-3g, session length L = 10) and total CSS unicode-range intervals on Noto Sans SC (30,759 codepoints).
(3) CSS Stylesheet Fragmentation: In a CSS @font-face rule, each slice's codepoint set must be serialized as a comma-separated list of hexadecimal intervals (e.g., U+4E00-4E05, U+4E08). If a slicing strategy assigns numerically adjacent Unicode codepoints to different slices, the resulting CSS stylesheet explodes to tens of thousands of disjoint hex intervals, inflating the render-blocking CSS payload itself.
Traditional heuristics fail to reconcile these three objectives. Uniform codepoint binning (equal_bin) preserves contiguous Unicode ranges but ignores semantic character co-occurrence, causing nearly every slice to be fetched on every CJK page. Static language/script subsetting (language_slice) works for coarse script separation (e.g., Latin vs. Cyrillic) but breaks down on CJK Unified Ideographs—where 20,000+ Han characters share a single Unicode block—and leaves thousands of font codepoints unassigned (causing missing-glyph tofu whenever pages contain cross-script citations, rare Hanja/Kanji, or symbols).
In this work, we present MLFont, an open-source reproduction and algorithmic extension of Google’s machine learning font slicing technology [19, 5] that learns font slicing strategies from large-scale web document corpora. Our key contributions are:
• Two-Tier Frequency and Topic Co-Occurrence Architecture: We exploit the steep Zipfian power-law decay of character document frequencies (Figure 1a) by isolating the top most frequent codepoints into deterministic, universally cached Tier-1 slices (most), and modeling latent co-occurrence across the remaining tail codepoints via Online Variational Bayes LDA (Online LDA) or a Deep Neural Network Topic Model (DNNTM) that unifies discriminative non-negative Shannon Entropy Difference Losses [15] with nonnegative sparse autoencoder reconstruction [10, 17], paired with two-tier Hungarian contiguous-bin Bayes alignment.
• Bi-Stochastic Affinity Normalization and Memetic Range-Compact GA: We analyze five topic-codepoint normalization schemes (topic_sum, row_sum, global_max, spectral_norm, and Sinkhorn-Knopp bi-stochastic scaling sinkhorn [16]) and introduce a Memetic Range-Compact Genetic Algorithm (GA) with a power-law slice-capacity curriculum max_diff(t), Lagrangian 1D Potts-Viterbi dynamic programming relaxation [13, 18], sparse-tail monochromatic island bridging, and tier-capacity invariance that compacts fragmented Unicode assignments into contiguous unicode-range runs (-17.9% to -41.7% intervals) while strictly enforcing balanced slice capacities.
• Multi-Page Session Network Simulator, Real-Website Browser Benchmarking, and Open-Source Release: We formulate a realistic multi-page browsing session evaluator across seven network/session profiles, evaluate both canonical fixed-byte and physical WOFF2 slice sizes across five Google Noto fonts, validate end-to-end page font loading across 20 multi-domain websites in both our analytical simulator and real Headless Chrome (1.56× to 6.09× cold-cache speedups and 45/45 [100.0%] exact slice-set agreement with Chrome), and release our open-source library (https://github.com/wq2012/mlfont) and pretrained Noto model bundles (https://huggingface.co/collections/wq2012/mlfont).
A strategy has full font coverage iff (i.e., unassigned font codepoints). Under our standard network simulator (STANDARD EVALUATION PARAMETERS), each glyph is modeled with a canonical compressed size of bytes ( ), while our physical WOFF2 evaluation mode measures exact Brotli-compressed ‘.woff2’ slice byte sizes (Appendix B).
2.1 CSS Unicode-Range Interval Complexity
For any subset , let denote its minimal decomposition into maximal contiguous integer intervals such that . The number of CSS unicode-range intervals for slice is :
where are the sorted elements of . The total CSS range complexity of strategy is .
2.2 Multi-Page Browsing Session Latency Model
Web users navigate across multiple pages within a browsing session while the browser's HTTP cache retains previously downloaded font slices. We evaluate over a corpus of test documents , where each page is represented by the set of unique Unicode codepoints appearing on that page, and denotes the page codepoints covered by strategy (with recorded as evaluation missing codepoints).
Pages are partitioned into sequential browsing sessions of length (default ). Within a session , let denote the set of slice indices already cached by the browser prior to loading page (with ). Upon visiting page , the browser fetches all uncached slices intersecting :
and updates its cache . Given a network profile parameterized by Round-Trip Time (ms) and effective bandwidth (bytes/ms), the RTT latency, download latency, and total per-glyph latency on page (normalized by covered page glyphs ) are:
Eq. (4) charges one RTT per newly fetched slice (serial requests). We further define Upfront Glyph Utilization ( , measured on the first, cold-cache page of each session) and Session Glyph Utilization ( , across all L pages in session ) as:
3 The MLFont Framework
To minimize expected per-glyph latency while bounding CSS interval complexity , MLFont decomposes codepoint partitioning into three stages.
3.1 Tier 1: Zipfian Document-Frequency Isolation
Given a training corpus of documents represented by binary indicator matrix (where iff codepoint occurs in document ), the document frequency of codepoint is . As shown in Figure 1(a), exhibits a steep Zipfian decay [20]: in Noto Sans SC, the top 1,000 codepoints (3.3% of the font) account for 76.3% of total document-frequency mass across the 7,425 active characters (and the Tier-1 slices cover 87.9% of visible tokens on our SC benchmark websites, Section 4.4).
If these ubiquitous codepoints are mixed into latent topic slices, every topic slice containing even a single high-frequency character will be triggered on almost every page. MLFont therefore isolates the top high-frequency codepoints into deterministic prefix slices specified by tuple (e.g., for Simplified Chinese). Sorting such that (breaking ties by ascending codepoint value), Tier 1 forms :
The remaining tail codepoints and restricted corpus matrix are passed to Tier 2.
3.2 Tier 2: Latent Character Co-Occurrence Topic Models
We model the co-occurrence structure of tail codepoints across documents by learning a positive topic-codepoint affinity matrix , where is the number of topic slices. Because large CJK fonts contain thousands of archival or rare variants that never appear in a training corpus ( ) while capacity-balanced slicing requires every slice to hold codepoints, spreading active characters uniformly across all slices when would force every active slice to be padded with unobserved ( ) characters and severely degrade bandwidth utilization. Both MLFont topic learners therefore fit their latent parameters over the active corpus vocabulary ( ) and project the learned -topic posteriors onto the full matrix via two-tier contiguous-bin Bayes alignment (align_and_smooth_topic_matrix):
(1) Partition into contiguous equal-sized Unicode bins of capacity , and initialize with a smooth distance-decaying Dirichlet prior , where is the home bin of codepoint .
(2) Compute Bayes codepoint-to-topic posteriors over , and define the core active set ( when and , and 1 otherwise) and effective core topic capacity .
(3) Two-Tier Bijective Hungarian Assignment: Rank topics by DF-weighted posterior mass , select the dominant topic rows , and align them bijectively to the most core-populated Unicode bins via the Hungarian algorithm (linear_sum_assignment). For each aligned pair , is increased on by , where renormalizes over and the floor and confidence scale grow with the DF ramp on core codepoints (and are otherwise), so core active characters concentrate into dense topic slices. The remaining tail topics are bijectively aligned by a second Hungarian assignment to the remaining sparse bins, adding , so all rows of carry distinct learned posteriors while unobserved (DF = 0) codepoints remain compactly grouped in contiguous Unicode blocks.
3.2.1 Online Variational Bayes LDA (OnlineLdaLearner)
Treating each document row as a bag-of-codepoints, we fit a full K-topic Latent Dirichlet Allocation model [2] using online stochastic variational inference [6] (scikit-learn LatentDirichletAllocation [12]): 20 online updates on mini-batches of 1,000 documents (sampled with replacement) with step size yield the variational Dirichlet parameters , followed by two-tier contiguous-bin Bayes alignment to form .
3.2.2 Deep Neural Network Topic Model (DnnTmLearner)
While generative autoencoder topic models [10, 17] reconstruct bag-of-words inputs under sparsity penalties, pure reconstruction losses often expend model capacity on document-length variations rather than sharp codepoint clustering. To systematically bridge generative and discriminative neural topic modeling [19], DNNTM trains a two-layer feed-forward encoder (hidden width 128 for LGC and 256 for CJK, ELU hidden activations [3], Softmax output) alongside an optional projected nonnegative linear decoder (project_nonnegative, row-normalized as ). At each step, maps a real document mini-batch ( ), synthetic Bernoulli noise documents ( ), and one-hot single-codepoint identity probes (a random subset of 256 probe rows per step when ) to topic distributions , , and . Let denote Shannon entropy, denote mean row entropy, and denote the batch-average topic marginal. Shifting each entropy difference by to guarantee non-negativity, the discriminative Shannon Entropy Difference Loss (ALL_COMBINED) minimizes [15]:
We also formulate the projected nonnegative sparse reconstruction objective (AUTOENCODER, where is the row-normalized document distribution, is the mean squared decoder weight, , and ) and the unified objective (HYBRID_AUTOENCODER, ). Minimizing Eq. (10) forces real documents and individual codepoint probes to produce peaked (low-entropy) topic assignments while maximizing marginal entropy to prevent topic collapse, and pushes uniform fake documents toward high-entropy uniform mixtures. We optimize (and ) using Adam [7] in PyTorch [11] with initial learning rate , decayed by factor every 100 steps (StepLR) over 300 steps on LGC and 400 steps on CJK (500 default in DnnTmConfig). After training, the probe posteriors (blended with the column-normalized decoder at encoder weight 0.75 for HYBRID_AUTOENCODER and 0.35 for AUTOENCODER) are passed through two-tier contiguous-bin alignment to produce .
3.2.3 Affinity Matrix Normalization and Capacity Balancing
Given ,
mlfont.maths.normalize_lambda_matrix supports
five normalization operators :
(i) topic_sum (Column ): , normalizing each code-point column into a probability distribution over topics.
(ii) row_sum (Row ): , normalizing each topic row into a distribution over codepoints.
(iii) global_max scaling): .
(iv) spectral_norm (Spectral scaling): , where is the largest singular value of .
(v) sinkhorn (Sinkhorn-Knopp bi-stochastic scaling [16]): 25 alternating iterations rescale each topic row to total mass and each codepoint column to unit mass, yielding with positive diagonal —the rectangular analogue of a doubly stochastic matrix with prescribed marginals ( ), approached up to the iteration budget.
In greedy capacity-balanced assignment (balance_topics_greedy), entries are traversed in descending order of and assigned if codepoint is unassigned and . Because global_max and spectral_norm rescale by a positive global scalar , they induce the exact same global ordering under balance_topics_greedy, whereas sinkhorn jointly normalizes row and column competition to further reduce greedy 3G/2G latency (Table 2).
3.3 Tier 3: Memetic Range-Compact Genetic Algorithm
Let denote a slice assignment vector over the sorted tail codepoints , inducing topic slices that combine with the fixed Tier-1 slices to form total slices. Greedy assignment minimizes topic discrepancy but produces fragmented CSS unicode-range intervals whenever adjacent codepoints have different dominant topics.
We formulate range-compact slicing as a constrained memetic evolutionary optimization problem over population ( survivors, 40 mutations, and 20 crossovers per generation) across generations. Each candidate is evaluated by the weighted linear objective:
where (range_cost_weight, for LGC and for CJK) and the raw range and topic consistency costs are:
Whereas the reported CSS interval count of the complete strategy is (Eq. 12 vs. Section 2.1), counts global adjacent breaks along so every local boundary transition is penalized in time (and Proposition 1 proves that smoothing adjacent breaks monotonically reduces both and ). For cross-font visualization in Figure 2, history events log the per-codepoint normalized costs and .
Power-Law Slice-Capacity Curriculum. To prevent degenerate slice collapse while allowing flexible boundary shifts in early generations, generation enforces a power-law curriculum bound (PowerDecay) on the maximum slice-size spread and non-vanishing constraint :
(a) Population Range Cost Trajectory

(b) Topic Consistency Cost C_topic(t)
(c) Power-Law Slice-Size Constraint Decay
Figure 2: Convergence of the Memetic Range-Compact Genetic Algorithm (RangeCompactGeneticLearner) across all five Google Noto fonts over T = 1200 generations: (a) relative population range fragmentation cost , (b) best per-codepoint topic consistency cost , and (c) power-law slice-capacity curriculum max_diff(t) (p = 3.0).
with (decay_power), for Noto Sans LGC, and (30, 50) for CJK fonts (Figure 2c).
Memetic 1D Potts-Viterbi Relaxation, Sparse-Tail Island Bridging, and Tier Invariance. On 30,000-codepoint CJK fonts, purely random local mutations struggle to eliminate thousands of isolated single-codepoint islands scattered across contiguous Unicode blocks. We therefore augment the 7 evolutionary mutation operators (MERGE_SHORT_RANGE 0.30, LEFT_SHIFT 0.20, RIGHT_SHIFT 0.20, PURELY_RANDOM 0.10, SWAP_TOPIC 0.10, INCREASE_MIN_TOPIC 0.05, DECREASE_MAX_TOPIC 0.05) with three domain-specific memetic mechanisms (Algorithm 1 and Proposition 2 in Appendix C):
(1) Lagrangian 1D Potts-Viterbi Dynamic Programming (potts_viterbi_smooth_topics): Observing that Eq. (11) without hard cardinality bounds is a 1D Potts Markov Random Field [13] over maximal contiguous Unicode segments, we introduce dual slice-capacity multipliers and solve the exact global MAP sequence via tropical min-sum Viterbi dynamic programming [18] in time per sweep (reducing the naïve transition step to via ).
(2) Sparse-Tail Monochromatic Island Bridging (build_island_bridged_topics): On sparse CJK repertoires ( ), only foreground slices carry core active characters while background slices hold unobserved (DF = 0) characters. Whenever an active character is surrounded by unobserved neighbors , naive greedy assignment creates a 3-run split ( ranges). Our island-bridging operator identifies short background islands ( ) enclosed by identical foreground slices ( ) and absorbs them into , strictly reducing by 2 per bridged island while compacting remaining codepoints into single contiguous Unicode runs.
(3) Tier-Capacity Invariance and Boundary-Preserving Repair (repair_max_diff): All neighborhood mutations and capacity-repair transfers restrict donor/receiver swaps to remain within or within (preventing background codepoints from stealing foreground capacity and evicting active DF 2 characters into background slices) and prioritize codepoints at interval boundaries so capacity repair never creates new interior interval splits.
4 Experimental Evaluation
4.1 Experimental Setup and Datasets
We evaluate MLFont on five Google Noto fonts using uniformly sampled, deterministically shuffled (seed=42) train/test splits from wikimedia/wikipedia (20231101):
(1) Noto Sans LGC (NotoSans-Regular.ttf): valid cmap codepoints ( , , core slices of ); 1,500 train and 300 test Wikipedia pages sampled uniformly across 6 languages (en, de, fr, pl, ru, el).
(2) Noto Sans KR (NotoSansKR-Regular.otf): codepoints ( , , in tail, , core slices of , 52 total slices); 1,600 train / 400 test Korean (ko) pages.
(3) Noto Sans JP (NotoSansJP-Regular.otf): codepoints ( , , in tail, , core slices of , 62 total slices); 1,600 train / 400 test Japanese (ja) pages.
(4) Noto Sans TC (NotoSansTC-Regular.otf):
Table 1: Main benchmark results on GIN-3g (, bytes/ms, session length ) across all five Google Noto fonts. Missing (Eval / Font) reports uncovered evaluation corpus codepoints and unassigned font cmap codepoints. Best full-coverage (0/0 missing) metrics per font are bolded.
| Font Family | Strategy | Slices | Missing (Eval / Font) | CSS Ranges | Mean (ms) | P95 (ms) | Upfront Util | Session Util |
|---|---|---|---|---|---|---|---|---|
| Noto Sans LGC (2,297 cps) | single_slice | 1 | 0 / 0 | 123 | 15.22 | 143.10 | 2.83% | 8.66% |
| equal_bin_20 | 20 | 0 / 0 | 140 | 9.44 | 43.41 | 20.92% | 23.17% | |
| random_slice_20 | 20 | 0 / 0 | 2,180 | 27.11 | 256.54 | 2.91% | 8.66% | |
| language_slice (.nam) | 8 | 6 / 300 | 92 | 10.62 | 66.28 | 18.85% | 15.08% | |
| MLFont Online LDA (20 slices) | 20 | 0 / 0 | 537 | 7.11 | 40.95 | 19.16% | 31.26% | |
| MLFont DNNTM (20 slices) | 20 | 0 / 0 | 549 | 6.59 | 31.88 | 31.79% | 32.56% | |
| MLFont Range-Compact GA (20 slices) | 20 | 0 / 0 | 384 | 7.06 | 40.06 | 18.05% | 30.31% | |
| Noto Sans KR (22,853 cps) | single_slice | 1 | 0 / 0 | 4,598 | 62.73 | 435.34 | 0.91% | 3.31% |
| equal_bin_52 | 52 | 0 / 0 | 4,635 | 68.09 | 350.87 | 1.70% | 3.76% | |
| random_slice_52 | 52 | 0 / 0 | 22,493 | 71.01 | 532.06 | 0.95% | 3.31% | |
| language_slice (.nam) | 10 | 34 / 4,322 | 4,579 | 51.20 | 380.39 | 1.33% | 4.22% | |
| most_300_300_equal_bin_50 | 52 | 0 / 0 | 5,608 | 51.88 | 187.72 | 3.02% | 3.81% | |
| MLFont Online LDA (52 slices) | 52 | 0 / 0 | 8,327 | 17.48 | 91.73 | 7.04% | 12.03% | |
| MLFont DNNTM (52 slices) | 52 | 0 / 0 | 8,354 | 17.59 | 87.21 | 8.88% | 11.51% | |
| MLFont Range-Compact GA (52 slices) | 52 | 0 / 0 | 6,769 | 21.06 | 93.00 | 6.32% | 9.25% | |
| Noto Sans JP (16,663 cps) | single_slice | 1 | 0 / 0 | 4,830 | 23.72 | 175.72 | 2.15% | 7.62% |
| equal_bin_62 | 62 | 0 / 0 | 4,876 | 25.58 | 187.34 | 2.76% | 8.56% | |
| random_slice_62 | 62 | 0 / 0 | 16,450 | 30.81 | 239.66 | 2.17% | 7.62% | |
| language_slice (.nam) | 10 | 43 / 7,632 | 5,617 | 11.42 | 77.00 | 5.00% | 15.84% | |
| most_500_500_equal_bin_60 | 62 | 0 / 0 | 5,975 | 20.50 | 103.64 | 5.45% | 8.92% | |
| MLFont Online LDA (62 slices) | 62 | 0 / 0 | 8,888 | 9.31 | 53.61 | 9.61% | 21.31% | |
| MLFont DNNTM (62 slices) | 62 | 0 / 0 | 8,710 | 9.30 | 50.47 | 10.22% | 20.88% | |
| MLFont Range-Compact GA (62 slices) | 62 | 0 / 0 | 7,298 | 11.37 | 59.70 | 8.91% | 16.91% | |
| Noto Sans TC (20,637 cps) | single_slice | 1 | 0 / 0 | 5,036 | 31.43 | 176.24 | 2.02% | 7.88% |
| equal_bin_82 | 82 | 0 / 0 | 5,098 | 31.03 | 185.64 | 2.70% | 9.67% | |
| random_slice_82 | 82 | 0 / 0 | 20,436 | 38.91 | 248.25 | 2.07% | 7.88% | |
| language_slice (.nam) | 10 | 126 / 11,699 | 5,767 | 13.23 | 71.40 | 5.10% | 18.89% | |
| most_600_600_equal_bin_80 | 82 | 0 / 0 | 6,672 | 24.90 | 119.91 | 4.33% | 9.83% | |
| MLFont Online LDA (82 slices) | 82 | 0 / 0 | 11,867 | 13.43 | 67.58 | 7.60% | 19.59% | |
| MLFont DNNTM (82 slices) | 82 | 0 / 0 | 11,410 | 13.84 | 60.72 | 7.63% | 19.30% | |
| MLFont Range-Compact GA (82 slices) | 82 | 0 / 0 | 8,743 | 15.07 | 71.62 | 7.07% | 17.37% | |
| Noto Sans SC (30,759 cps) | single_slice | 1 | 0 / 0 | 418 | 63.47 | 407.72 | 1.12% | 5.55% |
| equal_bin_102 | 102 | 0 / 0 | 519 | 45.26 | 310.69 | 1.82% | 7.63% | |
| random_slice_102 | 102 | 0 / 0 | 30,457 | 64.71 | 514.64 | 1.20% | 5.55% | |
| language_slice (.nam) | 10 | 126 / 19,659 | 6,646 | 21.82 | 139.59 | 3.40% | 16.05% | |
| most_1000_500_equal_bin_100 | 102 | 0 / 0 | 2,965 | 29.38 | 131.07 | 4.25% | 7.82% | |
| MLFont Online LDA (102 slices) | 102 | 0 / 0 | 10,177 | 15.93 | 83.23 | 6.30% | 16.90% | |
| MLFont DNNTM (102 slices) | 102 | 0 / 0 | 9,640 | 15.71 | 82.49 | 6.72% | 16.57% | |
| MLFont Range-Compact GA (102 slices) | 102 | 0 / 0 | 5,935 | 17.67 | 94.33 | 5.97% | 14.64% |
20,637 codepoints (, , in tail, , core slices of , 82 total slices); 1,600 train / 400 test Chinese Wikipedia (zh) pages filtered to Traditional script by marker characters.
(5) Noto Sans SC (NotoSansSC-Regular.OTF): codepoints (, , in tail, , core slices of , 102 total slices); 1,600 train / 400 test Chinese Wikipedia (zh) pages filtered to Simplified script by marker characters.
We evaluate across seven standard network/session configurations defined in STANDARD_EVALUATION_PARAMS: GIN-2g-poor (, , ), GIN-2g (, , ), GIN-3g (, , ), residential-DSL (, , ), residential-ADSL2+ (, , ), GIN-3g_no_session (), and GIN-3g_short_session (). We compare our three MLFont learners (Online LDA, DNNTM, and Range-Compact GA) against five heuristic baselines—single_slice, equal_bin_K, random_slice_K, language_slice (using the 12 canonical Unicode .nam script subset files), and most_M_equal_bin_K.
4.2 Main Benchmark Results
Table 1 and Figure 3 summarize our primary evaluation across all five Google Noto fonts on GIN-3g. Three consistent findings emerge:
(1) Substantial Latency Reduction over Heuristics: Across all five fonts, MLFont reduces mean per-glyph latency on GIN-3g by 56.7% to 75.3% compared to single_slice (e.g., from 63.47 ms to 15.71 ms on Noto Sans SC and from 62.73 ms to 17.48 ms on Noto Sans KR), and by 46.1% to 66.3% compared to the strong two-tier heuristic most_M_equal_bin_K across all four CJK fonts.
(2) Eliminating Missing Glyphs vs. Static Script Slicing: Because the 12 canonical Unicode .nam script files cover only standard regional character sets, language_slice leaves 300 font codepoints unassigned in Noto Sans LGC and 4,322 to 19,659 codepoints unassigned across CJK fonts (dropping up to 126 distinct characters that occur on our Wikipedia test pages). All MLFont strategies guarantee 0 missing codepoints (100% font coverage)
(a) Mean Per-Glyph Latency Across 5 Noto Fonts (Lower is Better)

(b) Session Downloaded Glyph Utilization (Higher is Better)
Figure 3: Cross-font evaluation on GIN-3g ( pages/session) across all five Google Noto fonts: (a) Mean per-glyph download latency (ms, lower is better) and (b) Session glyph cache utilization (% , higher is better).
while outperforming language_slice on mean latency on Noto Sans LGC (6.59 ms vs. 10.62 ms), KR (17.48 ms vs. 51.20 ms), JP (9.30 ms vs. 11.42 ms), and SC (15.71 ms vs. 21.82 ms); on TC, mean latency is on par (13.43 ms vs. 13.23 ms) while ML-Font reduces P95 tail latency by 15.0% (60.72 ms vs. 71.40 ms) with higher session utilization (19.59% vs. 18.89%).
(3) Memetic Range-Compact GA Compresses CSS Rules by 17.9%–41.7%: Across all five fonts, our Memetic Range-Compact GA dramatically compresses CSS unicode-range intervals relative to greedy Online LDA: by 28.5% on LGC (384 vs. 537 ranges, and slightly faster latency at 7.06 ms vs. 7.11 ms), 18.7% on KR (6,769 vs. 8,327), 17.9% on JP (7,298 vs. 8,888), 26.3% on TC (8,743 vs. 11,867), and 41.7% on SC (5,935 vs. 10,177), while retaining nearly identical low network latency (17.67 ms vs. 15.93 ms on SC) and nearly doubling session cache utilization over most_1000_500_equal_bin_100 (14.64% vs. 7.82%).
4.3 Ablation and Multi-Seed Stability Studies
Topic Matrix Normalization, DNNTM Loss, and Slice Count K. Table 2 (Top) compares the five normalization operators on Noto Sans LGC (): Sinkhorn-Knopp bi-stochastic normalization (sinkhorn) achieves the lowest greedy 3G latency (6.98 ms), 2G latency (24.65 ms), and highest session utilization (31.77%) by jointly equalizing row capacities and column competition. Table 2 (Middle) compares all five DNNTM objectives: while pure nonnegative sparse autoencoder reconstruction (AUTOENCODER, 7.55 ms) outperforms heuristics, combining it with discriminative entropy-difference learning (HYBRID_AUTOENCODER, 7.06 ms) and full three-
Table 2: Ablation studies on Noto Sans LGC (): (Top) Topic affinity matrix normalization. (Middle) DNNTM training loss objectives. (Bottom) Topic slice count ().
| Normalization (K = 20) | Ranges | 2G (ms) | 3G (ms) | Sess Util |
|---|---|---|---|---|
| row_sum (Row ) | 421 | 25.15 | 7.12 | 31.15% |
| topic_sum (Col ) | 549 | 25.17 | 7.12 | 31.26% |
| global_max () | 537 | 25.15 | 7.11 | 31.26% |
| spectral_norm () | 537 | 25.15 | 7.11 | 31.26% |
| sinkhorn (Bi-stochastic) | 542 | 24.65 | 6.98 | 31.77% |
| DNNTM Loss Objective (K = 20) | Ranges | 2G (ms) | 3G (ms) | Sess Util |
| AUTOENCODER (Sparse KL+Ent) | 590 | 26.70 | 7.55 | 30.75% |
| HYBRID_AUTOENCODER (Diff+AE) | 565 | 24.95 | 7.06 | 30.66% |
| REAL_FAKE_AND_REAL_AVG_DIFF | 497 | 24.32 | 6.88 | 31.01% |
| REAL_FAKE_DIFF | 480 | 23.85 | 6.75 | 31.70% |
| ALL_COMBINED (Default) | 549 | 23.29 | 6.59 | 32.56% |
| Topic Slice Count K () | Ranges | 2G (ms) | 3G (ms) | Sess Util |
| K = 5 () | 397 | 29.65 | 7.76 | 19.24% |
| K = 10 () | 460 | 25.57 | 6.92 | 24.44% |
| K = 20 (, Default) | 537 | 25.15 | 7.11 | 31.26% |
| K = 40 () | 589 | 29.75 | 8.84 | 35.79% |
| K = 60 () | 645 | 34.20 | 10.42 | 39.39% |
term entropy-difference optimization (ALL_COMBINED, 6.59 ms, 32.56% utilization) yields the sharpest co-occurrence clusters. Table 2 (Bottom) illustrates the RTT vs. bandwidth trade-off as K varies from 5 to 60: session utilization increases monotonically with K (19.24% to 39.39%), while 2G and DSL mean latency are minimized at K = 20 (3G mean latency is minimized at K = 10).
Table 3: Effect of browsing session length on mean per-glyph latency (ms) and session utilization () on Noto Sans SC (GIN-3g).
| Strategy (Noto Sans SC) | (ms) | (ms) | (ms) | Sess Util () |
|---|---|---|---|---|
| single_slice | 418.33 | 152.09 | 63.47 | 5.55% |
| equal_bin_102 | 296.91 | 116.97 | 45.26 | 7.63% |
| most_1000_500_equal_bin_100 | 130.06 | 73.57 | 29.38 | 7.82% |
| MLFont Online LDA (102) | 81.79 | 36.68 | 15.93 | 16.90% |
| MLFont DNNTM (102) | 78.20 | 35.89 | 15.71 | 16.57% |
| MLFont Range-Compact GA (102) | 89.11 | 40.78 | 17.67 | 14.64% |
Browsing Session Length L and Multi-Seed Reproducibility. Table 3 evaluates Noto Sans SC across cold-cache single-page visits (L = 1), short sessions (L = 3), and standard sessions (L = 10). Even at L = 1, MLFont DNNTM (78.20 ms) and Online LDA (81.79 ms) reduce latency by 81.3% and 80.4% over single_slice (418.33 ms) and by 39.9% and 37.1% over most_1000_500_equal_bin_100 (130.06 ms). Across three independent random seeds ( ), MLFont exhibits tight stability: on Noto Sans SC, GIN-3g mean latency and range counts are ms ( ranges) for Online LDA, ms ( ranges) for DNNTM, and ms ( ranges) for Range-Compact GA (Table 8 in Appendix B).
4.4 Real-Website Font Loading Simulation and Headless Chrome Verification
To let frontend developers evaluate how fast MLFont-sliced webfonts load on arbitrary HTML websites and network conditions before deployment, our library provides an interactive side-by-side browser simulator (web/demo.html), a programmatic HTML/URL website simulator (WebsiteFontSimulator / mlfont-simulate), and an automated Headless Chrome benchmark (run_headless_chrome_benchmark). Across 20 representative multi-domain websites spanning all five Google Noto fonts (Figure 4 and Table 9 in Appendix B), MLFont Range-Compact GA achieves 1.56× to 6.09× cold-cache page font load speedups over single_slice (3.43× mean and up to 4.97× on Noto Sans SC with 72.0% bandwidth savings; 6.09× mean and 84.9% bandwidth savings on Noto Sans KR; 65.4%-84.9% across CJK and 44.7% on LGC), while progressive Wave-1 delivery of the Tier-1 most slices renders 84.9%-96.9% of visible CJK page tokens, with first text paint at 748 ms on Cable-5Mbps for Noto Sans SC (vs. 9,869 ms for the unsliced 5,987 KB font; in WebsiteFontSimulator, all two-tier strategies share the exact physical Tier-1 .woff2 slice bytes, and their minor First Text Paint differences reflect the Wave-0 gzipped CSS size of uncompacted online_lda/dnntm vs. range_compact). Executing real Headless Chrome (v155.0.8059.79) against the physical .woff2 slices (3 pages × 3 strategies per font = 45 cases) confirms 45/45 (100.0%) exact slice-set agreement between WebsiteFontSimulator and Chromium Blink's document.fonts engine, achieving 1.54× to 6.02× mean end-to-end document.fonts.ready speedups and reducing first-page local WOFF2 decompression and OpenType instantiation latency by 1.17× to 4.15×.
Limitations and Systems Considerations. Three practical systems factors govern real-world unicode-range deployments: (1) WOFF2 OpenType table replication: splitting a font into physical .woff2 files replicates shared OpenType tables (CFF/glyf, hmtx, GSUB/GPOS), increasing static CDN storage by +46.6% to +175.3% (Table 7); across the 8-page Noto Sans SC website session, heuristic slicing (equal_bin_102 fetching 68.1 cumulative slices and most_1000_500_equal_bin_100 fetching 71.8 cumulative slices) incurs negative net session byte savings (-1.6% and -7.6%) relative to the monolithic WOFF2 font, whereas MLFont restricts cumulative fetches to 29.8–39.9 co-occurring slices and achieves +38.2% to +52.9% net session byte savings; (2) Cross-slice OpenType shaping: GSUB/GPOS ligatures and kerning cannot span distinct @font-face slice files, so complex shaping scripts (e.g., Arabic/Indic) should group shaping clusters within shared slices; and (3) Serial RTT surrogate vs. HTTP/2 multiplexing: Tier-2/3 training optimizes the additive 1-RTT per-slice surrogate (Eq. 4) for linear tractability, whereas WebsiteFontSimulator and Headless Chrome evaluate wave-multiplexed parallel fetching.
5 Conclusion
We presented MLFont, a machine learning and evolutionary optimization framework for web font subsetting and unicode-range slicing. By combining Tier-1 Zipfian frequency isolation, Tier-2 Online LDA and DNNTM topic modeling with two-tier contiguous-bin Bayes alignment and Sinkhorn-Knopp normalization, and a Tier-3 Memetic Range-Compact GA with power-law curriculum constraints, 1D Potts-Viterbi relaxation, and sparse-tail island bridging, MLFont cuts multipage per-glyph network latency by 56.7%-75.3% across open-source Google Noto benchmarks and accelerates real-website font loading by CJK and 44.7% LGC bandwidth reduction, with 45/45 exact Headless Chrome slice-set parity) while compressing CSS rules by up to 41.7% and guaranteeing 100% glyph coverage.
References
[1] Jyrki Alakuijala, Evgenii Kliuchnikov, Zoltan Szabadka, and Lode Vandevenne. Comparison of Brotli, Deflate, Zopfli, LZMA, LZHAM and Bzip2 compression algorithms. Technical report, Google Inc., 2015.
[2] David M. Blei, Andrew Y. Ng, and Michael I. Jordan. Latent Dirichlet allocation. Journal of Machine Learning Research, 3:993–1022, 2003.
[3] Djork-Arné Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network learning by exponential linear units (ELUs). In International Conference on Learning Representations (ICLR), 2016.
[4] John Daggett, Myles C. Maxfield, and Chris Lilley. CSS fonts module level 3. W3c recommendation, World Wide Web Consortium (W3C), 2018.
[5] Google Fonts. Noto Sans SC Sliced: Machine learning font slicing announcement. https://x.com/googlefonts/status/900019727732531200, 2017.
[6] Matthew Hoffman, Francis R. Bach, and David M. Blei. Online learning for latent Dirichlet allocation. In Advances in Neural Information Processing Systems (NeurIPS), volume 23, pages 856–864, 2010.
[7] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
[8] Vladimir Levantovsky and Raph Levien. WOFF file format 2.0. W3c recommendation, World Wide Web Consortium (W3C), 2018.
[9] Ken Lunde. CJKV Information Processing. O'Reilly Media, 2nd edition, 2009.
[10] Yishu Miao, Lei Yu, and Phil Blunsom. Neural variational inference for text processing. In International Conference on Machine Learning (ICML), pages 1727–1736, 2016.
[11] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. PyTorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems (NeurIPS), volume 32, pages 8024–8035, 2019.
[12] Fabian Pedregosa, Gaël Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, Olivier Grisel, Mathieu Blondel, Peter Prettenhofer, Ron Weiss, Vincent Dubourg, et al. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.
[13] Renfrey B. Potts. Some generalized order-disorder transformations. Mathematical Proceedings of the Cambridge Philosophical Society, 48(1):106–109, 1952.
[14] Garret Rieger, Chris Lilley, and Myles C. Maxfield. Incremental font transfer. W3c working draft, World Wide Web Consortium (W3C), 2023.
[15] Claude E. Shannon. A mathematical theory of communication. The Bell System Technical Journal, 27(3):379–423, 1948.
[16] Richard Sinkhorn and Paul Knopp. Concerning nonnegative matrices and doubly stochastic matrices. Pacific Journal of Mathematics, 21(2):343–348, 1967.
[17] Akash Srivastava and Charles Sutton. Autoencoding variational inference for topic models. In International Conference on Learning Representations (ICLR), 2017.
[18] Andrew J. Viterbi. Error bounds for convolutional codes and an asymptotically optimum decoding algorithm. IEEE Transactions on Information Theory, 13(2):260–269, 1967.
[19] Quan Wang and Yiran Mao. Learning better font slicing strategies from data. Technical Disclosure Commons, Defensive Publications Series, 906, 2017.
[20] George Kingsley Zipf. Human Behavior and the Principle of Least Effort: An Introduction to Human Ecology. Addison-Wesley, 1949.
A Open-Source Codebase and Design Decisions
To ensure long-term reproducibility and facilitate adoption by web typography engineers and machine learning researchers, we provide a complete open-source implementation of MLFont (mlfont)—an open-source reproduction effort of Google's machine learning font slicing technology [19, 5]—under the Apache 2.0 License at https://github.com/wq2012/mlfont and on PyPI at https://pypi.org/project/mlfont/.
A.1 Modular Software Architecture
The mlfont library is structured into modular, dependency-isolated components with zero proprietary dependencies:
-
mlfont.schemas: Strongly typed data-classes (SlicingStrategy, EvaluationParams, DistributionStats, StrategyEvaluationResult, DecayConfig, RangeCompactConfig, GeneticHistoryEvent) with deterministic JSON and CSS unicode-range serialization (U+XXXX-YYYY) and contiguous interval merging.
-
mlfont.data: OpenType/TrueType cmap codepoint extraction via fontTools (extract_codepoints_from_font), canonical Unicode .nam subset file parsing, and document-codepoint co-occurrence matrix construction (DocumentCorpusProcessor).
-
mlfont.frequency: Zipfian document-frequency partitioner (get_slices_based_on_frequency, FrequencySolver) and contiguous equal-bin splitter (get_equally_sized_chunks).
-
mlfont.maths: Topic-codepoint affinity matrix normalization operators (topic_sum, row_sum, global_max, spectral spectral_norm, and Sinkhorn-Knopp bi-stochastic sinkhorn), curriculum decay schedules (PowerDecay, ExponentialDecay), and greedy/diff-constrained capacity-balanced slice assignment (balance_topics_greedy, balance_topics_diff_constrained).
-
mlfont.olda: Variational Bayes Online Latent Dirichlet Allocation (OnlineLdaLearner / OnlineLDASolver) with two-tier Hungarian contiguous-bin Bayes posterior alignment (align_and_smooth_topic_matrix).
-
mlfont.dnntm: PyTorch implementation of the Deep Neural Network Topic Model (DnnTmLearner / DNNTMSolver), unifying discriminative non-negative Shannon Entropy Difference Losses (ALL_COMBINED, REAL_FAKE_DIFF, REAL_FAKE_AND_REAL_AVERAGE_DIFF) with non-negative sparse autoencoder reconstruction (AUTOENCODER, HYBRID_AUTOENCODER).
-
mlfont.range_compact: Memetic Range-Compact Genetic Algorithm (RangeCompactGeneticLearner / RangeCompactGASolver) with power-law slice-capacity curriculum max_diff(t), Lagrangian 1D Potts-Viterbi dynamic programming (potts_viterbi_smooth_topics), sparse-tail monochromatic island bridging (build_island_bridged_topics), tier-capacity invariance, single-point crossover, seven mutation operators, and boundary-preserving batch capacity repair.
-
mlfont.baselines: Reference implementations of single_slice, equal_bin, random_slice, language_slice, most_and_equal_bin, and greedy_topic.
-
mlfont.subsetter: Parallel physical font subsetting engine (slice_font_file / slice_font_to_woff2, FontSubsetter) powered by fontTools.subset and Brotli compression to emit production .woff2 slice binaries and @font-face CSS stylesheets.
-
mlfontEvaluator: Multi-page browsing session simulator (FontLoadingEvaluator) supporting arbitrary session lengths L, RTT/bandwidth profiles, and both canonical (200 B/glyph) and exact physical WOFF2 slice byte sizes.
-
mlfont.simulator: Real-website HTML/URL font-loading simulator (WebsiteFontSimulator, mlfont-simulate) and automated Headless Chrome benchmark (run_headless_chrome_benchmark), paired with an interactive side-by-side browser simulator (web/demo.html).
-
mlfont.export: Safe, zero-code-execution model serialization using Hugging Face safetensors (model.safetensors) alongside .nam subset files, held-out test_samples.json, and automated Model Card generation.
A.2 Algorithmic Summary and Open-Source Capabilities
Table 4 summarizes the core algorithmic components and open-source engineering capabilities of the mlfont toolkit, spanning two-tier Zipfian/topic decomposition, Sinkhorn-Knopp bi-stochastic normalization, unified discriminative + nonnegative autoencoder DNNTM objectives, memetic 1D Potts-Viterbi + sparse-tail island-bridging optimization, and end-to-end website/browser benchmarking.
B Open-Dataset Benchmark and Pretrained Models
B.1 Pretrained Hugging Face Model and WOFF2 Slice Catalog
We release five pretrained MLFont model bundles and physically subsetted WOFF2 Google Noto font
Table 4: Summary of core algorithmic modules and engineering capabilities in the open-source mlfont library.
| System Component | Open-Source Implementation (mlfont) |
|---|---|
| Data & Corpus Processing | Pure Python 3.10+ with NumPy & SciPy sparse co-occurrence matrices over public Wikimedia/Wikipedia corpora (wikimedia/wikipedia) |
| Tier-1 Frequency Isolation | Deterministic Zipfian document-frequency partitioner (FrequencySolver, most_1..M) |
| Online LDA Solver | OnlineLdaLearner with two-tier Hungarian contiguous-bin Bayes alignment + Sinkhorn-Knopp bi-stochastic scaling |
| Neural Topic Model (DNNTM) | PyTorch DnnTmLearner unifying non-negative Shannon Entropy Difference Losses with Nonnegative Sparse Autoencoder reconstruction |
| Combinatorial Optimizer | Memetic RangeCompactGeneticLearner (PowerDecay + Lagrangian 1D Potts-Viterbi DP + Sparse-Tail Island Bridging) |
| Physical Font Subsetting | fontTools.subset (woff2 Brotli compression) + CSS3 @font-face unicode-range stylesheet generator |
| Website & Browser Simulator | WebsiteFontSimulator (mlfont-simulate) + interactive web/demo.html + Headless Chrome document.fonts benchmark |
| Checkpoint Serialization | Safe, zero-code-execution Hugging Face safetensors (model.safetensors) + JSON strategy bundles |
packages on the Hugging Face Hub in the ML-Font Collection at https://huggingface.co/collections/wq2012/mlfont (and in the GitHub repository's pretrained_models/ directory at https://github.com/wq2012/mlfont). Each bundle provides model.safetensors (storing codepoints, remaining_codepoints, frequency_array, lambda_matrix, dnntm_lambda_matrix, and dna_assignment), strategy.json, olda_strategy.json, dnntm_strategy.json, test_samples.json, font_sliced.css, physicalwoff2/slice_.woff2 files, and nam/slice_.nam files (Table 5).
B.2 Complete Multi-Network Benchmark Results (GIN-2g, GIN-3g, DSL, ADSL2+)
Table 6 reports the complete evaluation metrics across GIN-2g (, ), GIN-3g (, ), residential-DSL (, ), and residential-ADSL2+ (, ) for all five Google Noto fonts. Table 7 compares the canonical 200 B/glyph network model against exact physical WOFF2 slice byte sizes (which average 193.5 B/glyph on LGC and 242.9–303.2 B/glyph on CJK due to replicated OpenType layout tables across slices), Table 8 reports multi-seed stability across random seeds {42, 43, 44}, and Figure 4 and Table 9 report the real-website simulation and Headless Chrome (v155.0.8059.79) benchmark across all five Noto fonts.
C Mathematical Proofs and Algorithmic Details
Algorithm 1 summarizes the complete memetic evolutionary loop of RangeCompactGeneticLearner, Proposition 1 establishes the monotonic interval-reduction property motivating its neighborhood-smoothing mutation operators, and Proposition 2 establishes the exact dynamic programming complexity of the Lagrangian 1D Potts-Viterbi relaxation and the strict interval reduction of sparse-tail island bridging.
Proposition 1 (Interval Monotonicity of Neighborhood Smoothing). Let be a slice assignment vector over sorted codepoints . Suppose index satisfies and . Define the smoothed assignment identical to except . Then both the per-slice CSS range sum and the global break count satisfy:
and : it equals -2 when and , 0 when and (the removed break reappears between and ), and -1 otherwise.
Proof. Consider the two affected slices and . Because and , we have . Thus is the left endpoint of an interval in , so removing from yields if and otherwise. Inserting into extends the interval ending at , yielding (and if ). For , setting eliminates the break between and ; the indicator between and changes from to , which is +1 only in the contiguous case , -1 only in the contiguous case , and 0 otherwise. Hence the net change is never positive; the smoothing mutation operators of Section 3.3 apply it only where it strictly reduces .
Proposition 2 (Linear-in-K Potts-Viterbi Optimality and Island Bridging). For any dual slice-capacity multiplier vector , minimizing the Lagrangian relaxation over decomposes into independent 1D Potts chains along maximal contiguous Unicode segments and is solved globally in time. Moreover, absorbing any contiguous background island enclosed by identical foreground assignments within a contiguous Unicode segment strictly reduces by at least 2.
Proof. At any non-contiguous boundary , the indicator is independent of , decoupling the chain across
Table 5: Summary of released pretrained MLFont models and physically sliced WOFF2 Google Noto font bundles on Hugging Face (https://huggingface.co/collections/wq2012/mlfont).
| Hugging Face Repository | Font Binary | Languages / Scripts | Codepoints | Tier-1 (most) | Topics | Total Slices | Physical WOFF2 (CSS) |
|---|---|---|---|---|---|---|---|
| wq2012/mlfont-notosans-lgc | NotoSans-Regular.ttf | en, de, fr, pl, ru, el | 2,297 | 20 (5) | 20 | 434.1 KB (7.8 KB CSS) | |
| wq2012/mlfont-notosanskr | NotoSansKR-Regular.otf | Korean (ko, Hangul/Hanja) | 22,853 | (300,300) | 50 (6) | 52 | 5.29 MB (78.0 KB CSS) |
| wq2012/mlfont-notosansjp | NotoSansJP-Regular.otf | 16,663 | (500,500) | 60 (12) | 62 | 4.67 MB (85.3 KB CSS) | |
| wq2012/mlfont-notosanstc | NotoSansTC-Regular.otf | Trad. Chinese (zh-Hant) | 20,637 | (600,600) | 80 (20) | 82 | 5.94 MB (104.1 KB CSS) |
| wq2012/mlfont-notosanssc | NotoSansSC-Regular.otf | Simp. Chinese (zh-Hans) | 30,759 | (1000,500) | 100 (18) | 102 | 8.89 MB (83.9 KB CSS) |
Table 6: Complete cross-network latency benchmark results (Mean and P95 per-glyph latency in ms, pages/session) across GIN-2g, GIN-3g, residential-DSL, and residential-ADSL2+ for all five Google Noto fonts.
| Font Family | Strategy | CSS Ranges | 2G Mean | 2G P95 | 3G Mean | 3G P95 | DSL Mean | DSL P95 | ADSL2+ Mean |
|---|---|---|---|---|---|---|---|---|---|
| Noto Sans LGC (2,297 cps) | single_slice | 123 | 60.26 | 566.45 | 15.22 | 143.10 | 3.00 | 28.17 | 0.37 |
| equal.bin_20 | 140 | 33.37 | 153.43 | 9.44 | 43.41 | 1.56 | 7.17 | 0.65 | |
| random.slice_20 | 2,180 | 95.82 | 906.75 | 27.11 | 256.54 | 4.48 | 42.35 | 1.87 | |
| language_slice (300 unass.) | 92 | 40.17 | 258.54 | 10.62 | 66.28 | 1.95 | 12.76 | 0.45 | |
| MLFont Online LDA (20) | 537 | 25.15 | 144.76 | 7.11 | 40.95 | 1.17 | 6.76 | 0.49 | |
| MLFont DNNTM (20) | 549 | 23.29 | 112.70 | 6.59 | 31.88 | 1.09 | 5.26 | 0.45 | |
| MLFont Range-Compact GA (20) | 384 | 25.05 | 142.01 | 7.06 | 40.06 | 1.17 | 6.64 | 0.48 | |
| Noto Sans KR (22,853 cps) | single_slice | 4,598 | 250.67 | 1739.45 | 62.73 | 435.34 | 12.53 | 86.92 | 1.28 |
| equal.bin_52 | 4,635 | 259.74 | 1338.41 | 68.09 | 350.87 | 12.67 | 65.29 | 2.69 | |
| random.slice_52 | 22,493 | 270.86 | 2029.63 | 71.01 | 532.06 | 13.21 | 99.02 | 2.80 | |
| language_slice (4,322 unass.) | 4,579 | 203.56 | 1514.81 | 51.20 | 380.39 | 10.15 | 75.57 | 1.16 | |
| most_300_300_equal.bin_50 | 5,608 | 197.85 | 715.15 | 51.88 | 187.72 | 9.65 | 34.86 | 2.05 | |
| MLFont Online LDA (52) | 8,327 | 66.59 | 348.80 | 17.48 | 91.73 | 3.25 | 16.99 | 0.70 | |
| MLFont DNNTM (52) | 8,354 | 66.97 | 331.00 | 17.59 | 87.21 | 3.26 | 16.10 | 0.71 | |
| MLFont Range-Compact GA (52) | 6,769 | 80.22 | 354.26 | 21.06 | 93.00 | 3.91 | 17.27 | 0.84 | |
| Noto Sans JP (16,663 cps) | single_slice | 4,830 | 94.75 | 701.82 | 23.72 | 175.72 | 4.73 | 35.06 | 0.49 |
| equal.bin_62 | 4,876 | 95.38 | 698.56 | 25.58 | 187.34 | 4.60 | 33.66 | 1.24 | |
| random.slice_62 | 16,450 | 114.88 | 893.64 | 30.81 | 239.66 | 5.53 | 43.06 | 1.49 | |
| language_slice (7,632 unass.) | 5,617 | 45.20 | 305.76 | 11.42 | 77.00 | 2.25 | 15.22 | 0.28 | |
| most_500_500_equal.bin_60 | 5,975 | 76.50 | 387.35 | 20.50 | 103.64 | 3.69 | 18.69 | 0.99 | |
| MLFont Online LDA (62) | 8,888 | 34.87 | 201.00 | 9.31 | 53.61 | 1.68 | 9.71 | 0.44 | |
| MLFont DNNTM (62) | 8,710 | 34.80 | 188.72 | 9.30 | 50.47 | 1.68 | 9.12 | 0.44 | |
| MLFont Range-Compact GA (62) | 7,298 | 42.53 | 223.47 | 11.37 | 59.70 | 2.05 | 10.79 | 0.54 | |
| Noto Sans TC (20,637 cps) | single_slice | 5,036 | 125.58 | 704.12 | 31.43 | 176.24 | 6.28 | 35.18 | 0.64 |
| equal.bin_82 | 5,098 | 115.29 | 689.78 | 31.03 | 185.64 | 5.54 | 33.17 | 1.55 | |
| random.slice_82 | 20,436 | 144.57 | 922.42 | 38.91 | 248.25 | 6.95 | 44.36 | 1.94 | |
| language_slice (11,699 unass.) | 5,767 | 52.25 | 282.95 | 13.23 | 71.40 | 2.60 | 14.08 | 0.33 | |
| most_600_600_equal.bin_80 | 6,672 | 92.66 | 446.08 | 24.90 | 119.91 | 4.46 | 21.47 | 1.23 | |
| MLFont Online LDA (82) | 11,867 | 50.11 | 250.61 | 13.43 | 67.58 | 2.42 | 12.04 | 0.65 | |
| MLFont DNNTM (82) | 11,410 | 51.65 | 226.65 | 13.84 | 60.72 | 2.49 | 10.93 | 0.67 | |
| MLFont Range-Compact GA (82) | 8,743 | 56.19 | 265.70 | 15.07 | 71.62 | 2.71 | 12.79 | 0.73 | |
| Noto Sans SC (30,759 cps) | single_slice | 418 | 253.67 | 1629.56 | 63.47 | 407.72 | 12.68 | 81.45 | 1.29 |
| equal.bin_102 | 519 | 169.75 | 1165.36 | 45.26 | 310.69 | 8.21 | 56.33 | 2.09 | |
| random.slice_102 | 30,457 | 242.74 | 1930.38 | 64.71 | 514.64 | 11.73 | 93.32 | 2.99 | |
| language_slice (19,659 unass.) | 6,646 | 86.54 | 554.31 | 21.82 | 139.59 | 4.31 | 27.61 | 0.51 | |
| most_1000_500_equal.bin_100 | 2,965 | 110.52 | 502.64 | 29.38 | 131.07 | 5.35 | 24.59 | 1.32 | |
| MLFont Online LDA (102) | 10,177 | 60.16 | 314.64 | 15.93 | 83.23 | 2.92 | 15.27 | 0.69 | |
| MLFont DNNTM (102) | 9,640 | 59.30 | 311.97 | 15.71 | 82.49 | 2.88 | 15.14 | 0.68 | |
| MLFont Range-Compact GA (102) | 5,935 | 66.67 | 356.73 | 17.67 | 94.33 | 3.23 | 17.32 | 0.78 |
non-contiguous gaps. Within any contiguous segment, let denote the minimum prefix cost ending in state . Because the pairwise Potts penalty takes only two values (0 for and for ), the Bellman recursion simplifies to where is computed once per step in time, yielding total complexity. Finally, if is a background run with inside a contiguous Unicode block, setting for eliminates the two boundary transitions at and and any internal transitions within , giving .
Table 7: Comparison of canonical 200 B/glyph simulation vs. exact physical WOFF2 slice byte sizes for MLFont Range-Compact GA ().
| Font Family | Slices | Avg WOFF2 B/glyph | GIN-3g (200 B) | GIN-3g (Physical WOFF2) | DSL (200 B) | DSL (Physical WOFF2) |
|---|---|---|---|---|---|---|
| Noto Sans LGC | 20 | 193.5 B | 7.06 / 40.06 | 6.71 / 39.49 | 1.17 / 6.64 | 1.10 / 6.47 |
| Noto Sans KR | 52 | 242.9 B | 21.06 / 93.00 | 25.52 / 116.06 | 3.91 / 17.27 | 4.80 / 22.05 |
| Noto Sans JP | 62 | 293.7 B | 11.37 / 59.70 | 16.29 / 87.35 | 2.05 / 10.79 | 3.04 / 16.37 |
| Noto Sans TC | 82 | 302.0 B | 15.07 / 71.62 | 20.75 / 99.90 | 2.71 / 12.79 | 3.85 / 18.42 |
| Noto Sans SC | 102 | 303.2 B | 17.67 / 94.33 | 23.96 / 126.04 | 3.23 / 17.32 | 4.49 / 23.67 |
Table 8: Multi-seed reproducibility across 3 independent random seeds ({42, 43, 44}): mean ± standard deviation of GIN-3g per-glyph latency (ms) and total CSS unicode-range interval count.
| Font Family | MLFont Learner | GIN-3g Mean ± Std (ms) | CSS Ranges ± Std |
|---|---|---|---|
| Noto Sans LGC (2,297 cps) | Online LDA () | 7.11 ± 0.03 | 528.0 ± 17.9 |
| DNNTM () | 6.66 ± 0.20 | 539.0 ± 7.3 | |
| Range-Compact GA () | 7.19 ± 0.10 | 339.0 ± 42.0 | |
| Noto Sans SC (30,759 cps) | Online LDA (102 slices) | 15.83 ± 0.08 | 10,162.7 ± 33.8 |
| DNNTM (102 slices) | 15.83 ± 0.09 | 9,698.0 ± 44.5 | |
| Range-Compact GA (102 slices) | 17.70 ± 0.11 | 5,931.7 ± 3.4 |
Algorithm 1: Memetic Range-Compact Genetic Algorithm (RangeCompactGeneticLearner)
Require: Sorted tail codepoints , normalized topic matrix , survivors , mutations , crossovers , iterations , decay bounds , power , weight .
Ensure: Best-found range-compact slice assignment (a heuristic, not a certified global optimum).
1: Identify foreground topic tier (the most populated greedy topics when , and all topics on dense LGC fonts) vs. background archive tier ; initialize seeds (balance_topics_diff_constrained), (balance_topics_greedy), and (init_gene_by_equal_binning), repaired via tier-preserving_repair_max_diff to satisfy .
2: for generation to do
3: .
4: Sample offspring via the 7 mutation operators (MERGE_SHORT_RANGE, LEFT/RIGHT_SHIFT, PURELY_RANDOM, SWAP_TOPIC, INCREASE_MIN/DECREASE_MAX_TOPIC) preserving tier membership, and repair capacity violations via boundary-first_repair_max_diff(, ).
5: Sample offspring via single-point crossover and retain valid offspring satisfying .
6: At curriculum milestones , inject memetic candidates via short-run smoothing () and Lagrangian 1D Potts-Viterbi DP (potts_viterbi_smooth_topics); at (when ), also inject sparse-tail island bridging (build_island_bridged_topics).
7: Deduplicate by topic-array hash, evaluate , and keep top elites.
8: end for
9: return Best elite individual .
(a) Per-Website Cold Load Latency (Noto Sans SC, 8 Real Websites)

(b) Headless Chrome Benchmark Across 5 Noto Fonts (Cable 5 Mbps)
Figure 4: Real-website font loading simulation and Headless Chrome (v155.0.8059.79) verification across all five Google Noto fonts (experiments/website_simulation_report.json): (a) Per-website cold-cache font load latency on Noto Sans SC across 8 Simplified Chinese websites on Cable-5Mbps (5 Mbps, 28 ms RTT) and (b) Real Headless Chrome end-to-end document.fonts.ready latency across all 5 Noto fonts (mean over all 3 Chrome-benchmarked pages per font, with 45/45 exact slice-set parity) showing to speedup over single_slice (ratio of means: SC , TC , JP , KR , LGC ; mean per-page speedup: SC , TC , JP , KR , LGC ).
Table 9: Real-Website Font Loading Simulation (20 websites across 5 Google Noto fonts) and Real Headless Chrome (v155.0.8059.79, document.fonts API) Verification on GIN-3g (400 kbps, 400 ms RTT) and Cable-5Mbps (5 Mbps, 28 ms RTT). Simulator columns are means over the listed pages; Chrome Dec. is measured on the first benchmark page of each font. Chrome matched the simulator's exact slice set in all 45 of 45 cases (100.0%).
| Font (Full WOFF2) | Strategy | Slices | Transfer | Saved | 3G Cold | Cable Cold | 1st Paint | Warm | Chrome Dec. | Speedup (3G/Cab) |
|---|---|---|---|---|---|---|---|---|---|---|
| Noto Sans SC(5,987.0 KB, 8 p.) | single_slice (Full) | 1.00/1 | 5,988.7 KB | 0.0% | 123,450 ms | 9,869 ms | 9,869 ms | 0 ms | 230.6 ms (1.00×) | 1.00× / 1.00× |
| equal_bin_102 | 55.12/102 | 4,924.0 KB | 17.8% | 105,099 ms | 8,371 ms | 946 ms | 295 ms | 118.6 ms (1.94×) | 1.17× / 1.18× | |
| most_1000_500_eq_100 | 21.75/102 | 2,111.4 KB | 64.7% | 45,201 ms | 3,606 ms | 721 ms | 1,066 ms | — | 2.73× / 2.74× | |
| MLFont Range-Compact (102) | 16.88/102 | 1,673.7 KB | 72.0% | 36,044 ms | 2,880 ms | 748 ms | 494 ms | 55.6 ms (4.15×) | 3.43× / 3.43× | |
| Noto Sans TC(4,047.4 KB, 3 p.) | single_slice (Full) | 1.00/1 | 4,067.0 KB | 0.0% | 84,100 ms | 6,728 ms | 6,728 ms | 0 ms | 170.5 ms (1.00×) | 1.00× / 1.00× |
| equal_bin_82 | 52.00/82 | 3,881.7 KB | 4.6% | 83,644 ms | 6,662 ms | 834 ms | 589 ms | 182.8 ms (0.93×) | 1.01× / 1.01× | |
| MLFont Range-Compact (82) | 16.00/82 | 1,406.8 KB | 65.4% | 30,431 ms | 2,436 ms | 665 ms | 737 ms | 63.8 ms (2.67×) | 2.76× / 2.76× | |
| Noto Sans JP(3,260.2 KB, 3 p.) | single_slice (Full) | 1.00/1 | 3,279.1 KB | 0.0% | 67,965 ms | 5,437 ms | 5,437 ms | 0 ms | 151.6 ms (1.00×) | 1.00× / 1.00× |
| equal_bin_62 | 37.00/62 | 2,873.3 KB | 12.4% | 61,789 ms | 4,924 ms | 859 ms | 989 ms | 92.8 ms (1.63×) | 1.10× / 1.10× | |
| MLFont Range-Compact (62) | 10.33/62 | 1,062.9 KB | 67.6% | 23,117 ms | 1,851 ms | 689 ms | 568 ms | 60.0 ms (2.53×) | 2.94× / 2.94× | |
| Noto Sans KR(3,032.4 KB, 3 p.) | single_slice (Full) | 1.00/1 | 3,048.7 KB | 0.0% | 63,246 ms | 5,059 ms | 5,059 ms | 0 ms | 147.4 ms (1.00×) | 1.00× / 1.00× |
| equal_bin_52 | 24.00/52 | 2,516.7 KB | 17.4% | 53,552 ms | 4,274 ms | 1,120 ms | 99 ms | 74.4 ms (1.98×) | 1.18× / 1.18× | |
| MLFont Range-Compact (52) | 5.67/52 | 461.2 KB | 84.9% | 10,394 ms | 836 ms | 287 ms | 97 ms | 43.5 ms (3.39×) | 6.09× / 6.06× | |
| Noto Sans LGC(157.7 KB, 3 p.) | single_slice (Full) | 1.00/1 | 158.4 KB | 0.0% | 4,043 ms | 316 ms | 316 ms | 0 ms | 28.6 ms (1.00×) | 1.00× / 1.00× |
| equal_bin_20 | 4.00/20 | 87.8 KB | 44.6% | 2,599 ms | 201 ms | 201 ms | 32 ms | 27.2 ms (1.05×) | 1.56× / 1.57× | |
| MLFont Range-Compact (20) | 4.00/20 | 87.6 KB | 44.7% | 2,596 ms | 201 ms | 201 ms | 0 ms | 24.5 ms (1.17×) | 1.56× / 1.57× |