Source-linked AI summary

The Art of Hierarchical Competing Patterns: Gaussian Process Optimization of Hyphenation

Ondřej Sojka, Petr Sojka

arXiv:2609.07638v1cs.CLcs.DLcs.LG

TL;DR

Generating hyphenation patterns still depends on manually tuned patgen profiles, despite their use in typesetting and rendering. The paper uses Gaussian-process optimization to search for profiles, and finds smaller patterns on all 17 datasets and improved held-out F1/7 on 16.

  • Problem

    Pattern generation requires a consistently hyphenated word list and heuristically optimized patgen parameters, despite hyphenation’s role in typesetting and rendering.

    Source: §1 · p. 1, §1.3 · p. 3
  • Method

    The paper formulates patgen profile selection as black-box hyperparameter optimization and uses per-level Gaussian-process search.

    Source: §4.1 · p. 4, §6 · p. 9
  • Results

    Optimized profiles reduce trie size on all 17 datasets and improve held-out F1/7 on 16, with a median trie ratio of 0.407 relative to the hand-tuned baseline.

    Source: §5.5 · p. 8, §6 · p. 9
  • Takeaways & Limitations

    Per-level search makes profile optimization more systematic and reproducible, with the budget-matched comparison indicating gains from systematic search rather than one optimizer’s consistent superiority.

    Source: §6 · p. 9

    The workflow retains heuristic choices, uses one seed, and relies on word lists whose consistency varies; broader claims require more languages, scripts, repeated runs, and rendered-text outcomes.

    Source: Limitations · p. 10

Abstract

from arXiv · show

Hyphenation patterns remain a compact and widely deployed solution for word breaking in typesetting systems, text processors, and web rendering engines, but their generation still depends on manually tuned patgen program parameter profiles. We formulate patgen profile selection as a black-box hyperparameter optimization problem and evaluate Gaussian-process Bayesian optimization for this task. The search objective combines a precision-oriented F_{1/7}-score with an explicit trie size-accuracy trade-off using a normalized trie-size penalty. We evaluate the method on 17 hyphenated word-list datasets covering 14 languages and multiple scripts. Against two strong hand-tuned profiles regenerated from the same 8/10 training split and evaluated on the same 1/10 held-out test split, the GP-optimized profiles improve F_{1/7} on 16 of 17 datasets and reduce trie size on all 17. The median optimized/baseline trie ratio is 0.407. A dataset-level sign test gives p = 1.37e-4; a separate budget-matched comparison on five representative datasets shows that systematic search is competitive and usually improves over the best hand-tuned profile under the fixed comparison objective. The results show that model-based optimization can make pattern generation more reproducible and less dependent on expert trial-and-error while keeping the accuracy-compactness trade-off explicit.

1 Motivation and Hyphenation Problem Solutions

Hyphenation affects the quality and space use of paged and mobile text, yet pattern generation still relies on manually optimized patgen profiles. This paper applies per-level Gaussian-process search to profile selection and previews accuracy–compactness gains across its datasets.

1 Motivation and Hyphenation Problem Solutions

  • Pattern-based hyphenation matters in paged text and mobile HTML, where better automatic hyphenation can reduce wasted screen space, scrolling, and paper use.The motivation includes narrow academic-paper columns and small mobile screens.Source: §1 · pp. 1–2

1.3 Language-Agnostic Neural Syllabification

  • 17 datasets show smaller optimized profiles, with higher accuracy on 16; the figure also plots the validation frontier for cssk/cshyphen.The comparison uses held-out test results for the dataset-wide panel and the validation split for the cssk/cshyphen frontier.Source: Figure 1 · p. 1, §1.3 · p. 3

1.1 Pattern-Based Hyphenation with Finite-State Methods

  • Patgen stores local-context hyphenation patterns in a packed trie, while finite-state transducers offer a formal automata framework but report lower Dutch accuracy than Liang’s pattern-based method.Bouma reports 99.1% accuracy on running Dutch text versus 99.8% for Liang’s method (Bouma, 2003, Table 5).Source: §1.1 · p. 2

1.2 Subword Segmentation by Transformers

  • Subword segmentation and typographic hyphenation both build compact character-level segmentation artifacts, but wrong typographic boundaries directly damage rendered documents.The passage contrasts line-breaking hyphenation with subword tokenization, a dominant paradigm in modern NLP.Source: §1.2 · p. 2

1.3 Language-Agnostic Neural Syllabification

  • Neural sequence models can use context and morphology, whereas static pattern tries cannot resolve context-dependent segmentations unseen in the word list.The paper contrasts this with patgen’s efficiency, small-data performance, and auditable pattern-based errors.Source: §1.3 · pp. 2–3
  • Generating patterns still requires a consistently hyphenated word list and heuristic patgen parameters; the paper frames profile selection as black-box optimization.The proposed Gaussian-process approach compares optimized profiles with regenerated hand-tuned baselines and budget-matched alternatives.Source: §1.3 · p. 3

2 Datasets: Hyphenated Word Lists

The evaluation uses a deliberately heterogeneous benchmark of 17 hyphenated word lists spanning different sizes, scripts, languages, and curation levels. This variation lets the study examine whether one reproducible search protocol works across different data conditions.

  • The benchmark contains 17 word lists in several alphabets, including Latin, Cyrillic, and Thai, with sizes ranging from 10,000 to 1,000,000 words.The collection includes language sets such as the joint Czech–Slovak dataset cssk.Source: §2 · p. 3
  • Average segment lengths and hyphenation-mark density vary substantially, from short Wiktionary entries to Thai sentence-like lines.Source: §2 · p. 3
  • Data quality also differs: some lists are maintained by human volunteers, while Wiktionary-derived lists have no quality guarantee; curated lists are interpreted separately.This separates the curated-list results from any gains attributable to Wiktionary noise alone.Source: §2 · p. 3

3 Pattern Generation with patgen

Patgen generates compact pattern tries from hyphenated word lists by evaluating candidate patterns and applying a profile of adjustable settings. The profile governs pattern windows, hyphenation levels, and weights that determine which patterns are accepted.

  • Patgen evaluates candidate patterns against the training list, reporting good, bad, and missed counts as true positives, false positives, and false negatives.Source: §3 · p. 3
  • A patgen profile specifies edge constraints, pattern-length windows, hyphenation levels, and selection weights; odd levels create patterns and even levels inhibit lower-level decisions.The profile’s weights are summarized in Table 1.Source: §3 · p. 3, Table 1 · p. 4
  • The acceptance inequality’s α counts positive examples and β counts negative examples in the word list.Positive examples include correct splits or fixes; negative examples include incorrect splits or broken correct hyphenations.Source: §3 · p. 3

4 Pattern Generation Evaluation Metrics

The evaluation prioritizes precision while tracking recall, trie size, and generalization to unseen data. It compares strategies through parameter profiles that fully determine patgen runs, including hand-tuned baselines and validation-selected profiles.

4 Pattern Generation Evaluation Metrics

  • F1/7 is the primary combined score, weighting precision more heavily than recall because errors in automatically typeset documents are undesirable.Precision is the ratio of correct hyphenations to correct plus incorrect identified points; recall, also called coverage, is secondary.Source: §4 · p. 4
  • Trie size counts the nodes storing generated patterns, while trie depth limits the O(1) time to find hyphenation points for a word.Source: §4 · p. 4
  • Generalization is measured on a deterministic, surface-form-disjoint 8/1/1 train/validation/test split, with profiles selected on validation and F1/7 reported on held-out test data.Source: §4 · p. 4

4.1 Parameter Profiles

  • A parameter profile is the set of adjustable values that fully determines a patgen run and resulting pattern quality; the study uses cshyphen and wortliste as hand-tuned baselines.The profile specifies pattern-length windows and weights for every hyphenation level; the optimization question is whether an algorithm can find a better profile than trial and error.Source: §4.1 · pp. 4–5

5 Optimizing Pattern Generation with Gaussian Processes

The section frames patgen profile selection as reproducible black-box optimization, with a validation objective balancing precision-oriented accuracy and trie compactness.

5 Optimizing Pattern Generation with Gaussian Processes

  • The method searches candidate profiles with a Gaussian Process, selects the best observed validation objective, and evaluates that profile once on held-out test data.The objective includes F1/7 and a normalized trie-size penalty; λtrie is fixed at 0.0005.Source: §5 · p. 5

5.1 Results

  • A deterministic 8/1/1 split holds out test data; bootstrap intervals address finite test-list uncertainty, while one-run matched searches do not establish a ranking among optimizers.Random Search, TPE, and GP each received 153 evaluations under the same search space and fixed objective.Source: §5.1 · p. 6

5.2 Representative results

  • cssk/cshyphen reaches F1/7 = 0.9995 with 7,697 nodes versus baseline 0.9993 and 11,461 nodes.For de/wortliste, the optimized profile reaches F1/7 = 0.9964 with 17,146 nodes versus the validation-selected cshyphen baseline at 0.9925 and 44,070 nodes.Source: §5.2 · p. 6

5.3 The objective accuracy–compactness trade-off and trie size reduction

  • Because F1/7 prioritizes precision, some selected profiles accept lower recall for fewer erroneous hyphens and substantially smaller tries.The fixed objective makes the accuracy–compactness trade-off explicit.Source: §5.3 · p. 6

5.4 Search-space limitations

  • The search retains author-selected heuristics, and three profiles reach the weight-ratio upper bound of 30, motivating wider bounds and repeated-seed checks.The tested weight-ratio and threshold ranges are experimental choices, not universally optimal limits.Source: §5.4 · pp. 6–8

5.5 Summary statistics

  • Compared with the validation-selected hand-tuned baseline, GP-optimized profiles achieved higher F1/7 on 16/17 datasets and smaller tries on 17/17, with a median trie ratio of 0.407.Source: §5.5 · p. 8

5.6 Efficiency and effectiveness remarks

  • The 17-dataset run took 3 hours 31 minutes wall-clock; optimization is paid offline, and deployment remains a deterministic pattern trie for existing TEX-style engines.This is an observed run time, not a controlled cross-system benchmark.Source: §5.6 · p. 8

5.7 Reproducibility

  • The search exports a TEX-compatible pattern set, and code, data, configurations, histories, and selected profiles are available in the pat-gen-opt repository.The authors report that no GPUs were used in the experiments.Source: §5.7 · p. 8

6 Conclusion and Future Work

GP optimization improves the manually crafted profiles on 16 of 17 datasets, with optimized profiles reducing trie size across all 17. The conclusion also points to broader pattern-generation uses and several avenues for improving the workflow.

6 Conclusion and Future Work

  • Trie size falls on all 17 datasets, while held-out F1/7 improves on 16 of 17 under the evaluated objective and search space.The per-level GP search also improves profiles crafted manually; a budget-matched comparison attributes the improvement to systematic search rather than one optimizer’s consistent superiority.Source: §6 · p. 9
  • A maintainer with a hyphenated word list can run pat-gen-opt, inspect the validation accuracy–size trade-off, and export the selected .pat file.The results are presented as a reproducible baseline for pattern-based typesetting and rendering engines.Source: §6 · p. 9
  • Future work could use richer parameter settings, more hyphenation levels, and faster optimization such as annealing.The conclusion also identifies further insight into GP profile development as a next step.Source: §6 · p. 9
  • UTFpatgen supports patterns for arbitrary alphabets and joint multilingual or multi-script sets whose profiles can be searched in the same workflow.The text also points to bootstrapping and transfer learning for wider deployment, including weighted hyphenation.Source: §6 · p. 9
  • Pattern-based workflows can extend to Thai segmentation, compound boundaries, context-dependent ligatures, Fraktur s variants, and context-sensitive spelling correction.Each task needs an annotated list and precision-weighted objective; the resulting trie is compact and auditable, and existing engines execute it unchanged.Source: §6 · p. 9

Limitations

The workflow makes several search choices explicit and reproducible, but does not eliminate them; the evidence is also bounded by one seed and available word-list data.

Limitations

  • The workflow still relies on heuristic choices for parameter ranges, level count, objective weight, and evaluation budget, and results use one seed and available word lists.Broader claims require more languages, scripts, repeated runs, and rendered-text outcomes; Wiktionary-derived resources are especially limited by data consistency.Source: Limitations · p. 10

A Motivation Examples

Hyphenation quality matters in mobile rendering, where it can improve spacing and reduce scrolling. The examples also place pattern files within a broad ecosystem of text-rendering engines.

A Motivation Examples

  • Mobile operating systems and browsers use TEX hyphenation patterns for CSS3, and patterns are among the most widely executed language resources.The passage links mobile rendering quality to the importance of hyphenation.Source: A Motivation Examples · p. 11
  • TEX, LibreOffice, Android, Typst, Apache FOP, Hyphenopoly, and pyphen use TEX patterns or derived resources.A better pattern set can be deployed by replacing a file in each engine without changing code.Source: A Motivation Examples · p. 11
  • Figure 3 contrasts whitespace rivers without hyphenation on the left with denser spacing and fewer scrolling lines on the right.The passage describes the comparison on a mobile device.Source: Figure 3 · p. 11

B Dataset and Profile Details

The dataset overview identifies the repository snapshot used and directs readers to a table for dataset details.

B Dataset and Profile Details

  • The dataset collection is taken from repository commit 422515a by Sojka and Sojka (2026).The overview directs readers to Table 5 for dataset details.Source: B Dataset and Profile Details · p. 11

C Detailed Evaluation Metrics and Space-Intensive Evidence

The appendix identifies what the detailed tables report and notes that Random Search selected the same profile on four datasets. The supplied passages describe table contents but do not provide their cell values.

C Detailed Evaluation Metrics and Space-Intensive Evidence

  • Tables 7 and 8 provide detailed optimized test counts and paired-bootstrap intervals for the optimized-minus-baseline F1/7 differences.Table 7 expands Table 3; Table 8 reports paired percentile bootstrap intervals.Source: C Detailed Evaluation Metrics and… · p. 11
  • Table 5 summarizes dataset file size, entry count, average segment length, average hyphenation points, and distinct lowercase characters.The caption specifies UTF-8 file size in kBytes and character-based counts and averages.Source: Table 5 · p. 12
  • Table 6 presents parameter-profile examples, combining pat_start and pat_finish as “Lengths” and good_wt, bad_wt, and thresh as “Params.”Source: Table 6 · p. 12
  • Table 9 reports the space-intensive evidence for the separate budget-matched hyperparameter-optimization comparison.Source: C Detailed Evaluation Metrics and… · p. 12
  • Random Search selected the identical profile on cssk/cshyphen, nl/wiktionary, ru/wiktionary, and th/orchid because all datasets used the same 153 random draws.The passage describes that shared-seed draw as the per-dataset argmax on all four datasets.Source: C Detailed Evaluation Metrics and… · p. 12

D How the Per-Level Search Behaves

The appendix traces how the per-level GP search proceeds, what the search space offers, and how the surrogate explores it. Its figures show both cross-dataset differences and the changing search behavior on cssk/cshyphen.

D How the Per-Level Search Behaves

  • The search evaluated 153 profiles per dataset, using batches of five over 30 iterations plus three final evaluations, with a Matérn-kernel surrogate and UCB acquisition at κ = 2.5.The recorded evaluations are replotted; no additional patgen runs were needed.Source: D How the Per-Level Search Behaves · p. 12
  • Permutation importance attributes 37% of objective variation to w3, 23% to t4, and 19% to w1; the other five coordinates account for about 21%.The two-dimensional views are conditional slices holding the other six coordinates at the best profile found so far.Source: D How the Per-Level Search Behaves · pp. 12–13
  • The median run reached 99% of its final gain after 89 evaluations, and the selected profile appeared at the median evaluation of 100 out of 153.A 50-evaluation budget would have returned a worse profile in most datasets.Source: Figure 4 · p. 15
  • 31% of the 85 initial random draws beat the hand-tuned profile on both axes, with at least one such draw in 11 of 17 datasets.The passage interprets model-based search as locating a better corner of a space that often already offers superior profiles.Source: Figure 5 · p. 15
  • The cssk/cshyphen posterior-mean and uncertainty slices show where the model places high objective values and where uncertainty remains; UCB trades these quantities off.The acquisition rule is UCB(x) = µ(x) + 2.5 σ(x).Source: Figure 6 · p. 16
  • Across evaluations on cssk/cshyphen, the w1 posterior uncertainty band narrows while the incumbent moves through the observed range.These are conditional slices with the other seven coordinates held at the best profile found so far.Source: Figure 7 · p. 16
  • The cssk/cshyphen projections show broad sampling alongside concentration of high-scoring evaluations in particular weight-ratio and threshold regions.The figure also compares empirical coordinate distributions for all evaluations against the best 15.Source: Figure 8 · p. 16
  • On cssk/cshyphen, later evaluations cluster near the upper-left edge of the accuracy–compactness cloud, where profiles are both more accurate and smaller.The plotted frontier is best validation F1/7 attainable at each trie size.Source: Figure 9 · p. 17
Loading 2609.07638v1…