Tokenizer as tropical DAG and toric chart

ConvexTok Tokenization Geometry

ConvexTok turns tokenizer construction into a shortest-path and sparse linear-programming problem over a byte-boundary DAG. ToricGT uses that DAG as real model input: byte boundaries are nodes, candidate substrings are edges, LP relaxation scores are edge features, and the final segmentation is the selected path used for BPB scoring.

ConvexTok preprint · OpenAI Parameter Golf

The key point is not merely “a different tokenizer.” The tokenization computation is itself a graph-structured dynamic program, so it matches TokenGT-style graphification instead of being hidden preprocessing.

Tokenization DAG

sample string: token graph Vertices are byte boundaries; arcs are candidate tokens. Click arcs and vertices for exact edge metadata. token 't'; span [0,1]; free byte fallback; cost 1.000; LP 0.00; selected notoken 'o'; span [1,2]; free byte fallback; cost 1.000; LP 0.00; selected notoken 'k'; span [2,3]; free byte fallback; cost 1.000; LP 0.00; selected notoken 'e'; span [3,4]; free byte fallback; cost 1.000; LP 0.00; selected notoken 'n'; span [4,5]; free byte fallback; cost 1.000; LP 0.00; selected notoken ' '; span [5,6]; free byte fallback; cost 1.000; LP 0.00; selected notoken 'g'; span [6,7]; free byte fallback; cost 1.000; LP 0.00; selected notoken 'r'; span [7,8]; free byte fallback; cost 1.000; LP 0.00; selected notoken 'a'; span [8,9]; free byte fallback; cost 1.000; LP 0.00; selected notoken 'p'; span [9,10]; free byte fallback; cost 1.000; LP 0.00; selected notoken 'h'; span [10,11]; free byte fallback; cost 1.000; LP 0.00; selected notoken 'token'; span [0,5]; selected rounded token; cost 0.270; LP 0.82; selected yestoken 'token '; span [0,6]; priced vocabulary token; cost 0.350; LP 0.48; selected notoken 'graph'; span [6,11]; selected rounded token; cost 0.210; LP 0.77; selected yestoken 'grap'; span [6,10]; priced vocabulary token; cost 0.290; LP 0.32; selected notoken 'token graph'; span [0,11]; LP-relaxation long-span candidate; cost 0.490; LP 0.41; selected no byte boundary 0; prefix ''0byte boundary 1; prefix 't'1byte boundary 2; prefix 'to'2byte boundary 3; prefix 'tok'3byte boundary 4; prefix 'toke'4byte boundary 5; prefix 'token'5byte boundary 6; prefix 'token '6byte boundary 7; prefix 'token g'7byte boundary 8; prefix 'token gr'8byte boundary 9; prefix 'token gra'9byte boundary 10; prefix 'token grap'10byte boundary 11; prefix 'token graph'11 tokenspacegraph selected rounded path priced vocabulary token LP-relaxation support free byte fallback
Click an arc or boundary vertex.

Edge metadata will appear here without loading any external plotting runtime.

Curved arcs span byte intervals. Cyan bottom arcs are fallback byte edges, violet arcs are priced candidate tokens, gold arcs are LP-relaxation support, and green arcs are the selected rounded token path. The model receives the same structure as TokenGT-style node/edge features; BPB is still scored on the flattened selected path.

Equations

D[j] = min(i,j,t)∈E D[i] + wt
min Σe cexe subject to flow conservation and xe ≤ ytoken(e), Σt yt ≤ B.

The min-plus recurrence is tropical dynamic programming. The LP lower bound gives a tokenizer-regret metric: path length minus relaxed optimum. ToricGT can log this gap to decide whether BPB is tokenizer-bound or model-bound.

Boundary nodeByte offset in the source string; causal topological order is left to right.
Candidate edgeA token proposal from offset i to j, carrying byte length, token rank, price, LP score, and selected-path flags.
Tropical pathThe rounded segmentation is a min-plus path through the DAG; active edges form a tropical curve inside the tokenizer graph.

Candidate Edge Metadata

spantokenkindcostLPselected
0→1tfree byte fallback1.0000.00no
1→2ofree byte fallback1.0000.00no
2→3kfree byte fallback1.0000.00no
3→4efree byte fallback1.0000.00no
4→5nfree byte fallback1.0000.00no
5→6 free byte fallback1.0000.00no
6→7gfree byte fallback1.0000.00no
7→8rfree byte fallback1.0000.00no
8→9afree byte fallback1.0000.00no
9→10pfree byte fallback1.0000.00no
10→11hfree byte fallback1.0000.00no
0→5tokenselected rounded token0.2700.82yes
0→6token priced vocabulary token0.3500.48no
6→11graphselected rounded token0.2100.77yes
6→10grappriced vocabulary token0.2900.32no
0→11token graphLP-relaxation long-span candidate0.4900.41no

1. BPB Use

FineWeb is graphified, but the OAI scoring path still flattens the selected token path. This keeps the byte objective primary while letting the model learn node/edge structure around the tokenizer.

2. Tropical Use

The dynamic program D[j]=min(D[i]+w) is min-plus computation. Active edges, margins, and path regret become tropical diagnostics instead of opaque tokenizer side effects.

3. Toric Use

Candidate-token exponents and LP scores define active faces of a tokenization polytope. Those faces are embedded into toric charts for fan, one-dimensional-cone, divisor, and sheaf-style audits.

4. Graph Use

Boundary nodes, candidate-token edges, endpoint offsets, edge ranks, selected-path flags, and LP scores are TokenGT-style features. The graph is causal left-to-right for FineWeb.

5. Regret Use

The LP lower bound gives a tokenizer-regret metric: if rounded path length is close to the LP optimum, BPB problems are more likely model-bound; otherwise tokenizer vocabulary or rounding is suspect.

6. OOD Use

Because substring choices are graph paths, the model sees reusable local graph grammar rather than isolated token IDs. That is the bridge to graph-structured biological and 3D tokenizers later.