The Beginning of the End for AI Tokenization? H-Net Explained
Why do LLMs split New York into two tokens? Explore H-Net, a byte-level architecture that learns its own chunks and trains with about 10x less data.
Large language models (LLMs) do not process words directly. They process tokens. A tokenizer compresses multiple characters into a single unit. This gives models a middle ground between processing individual letters and treating every word as its own token. Tokenization also keeps the vocabulary at a fixed size. Models can build rare words by combining tokens, so they do not need a separate representation for every possible word. Tokenization reduces the computation needed to process text and still lets models represent words they have never seen before. For this reason, nearly every modern LLM relies on it.
Limitations of Byte Pair Encoding
Most modern LLMs use byte pair encoding (BPE). BPE builds a vocabulary by repeatedly merging character sequences that frequently appear together in training data, until it reaches the vocabulary limit.
Frequency does not always reflect meaning. For example, "New York" refers to one city, but a tokenizer may split it into two tokens. Treating the phrase as one unit could be more useful in some contexts.
The token boundaries are also fixed before training begins. Even if a model later learns that the tokens "New" and "York" are closely related, it cannot change how the text is divided based on meaning or context. As a result, the model processes "New" and "York" as two separate positions in the transformer, even when they refer to a single city. During text generation, the model also needs a separate decoding step for each token. Processing two tokens for a rare term that appears only as a pair adds computation. One extra token has a small cost, but the cost grows across billions of words, especially for common terms split into many fragments.
The question is whether the model could group information based on what it learns during training instead of relying on fixed boundaries.
HNet: Learned Chunking
HNet is an architecture that learns how to group information. The original research was published in July 2025. Cartesia, the company behind the research, later conducted larger scaling experiments.
HNet takes raw bytes as input. A smaller network learns to group these bytes into larger chunks before passing them to the main transformer. The network learns chunk boundaries from the surrounding context, not from how often characters appear together. The model can learn to group "New York" into one chunk when it refers to the city. It does not explicitly understand that New York is a city. It learns which groupings help it predict text more accurately.
The chunking process trains together with the language model. The model learns which characters belong together as it improves at predicting the next byte. Chunk boundaries are not set before training.
HNet compresses bytes in multiple stages. Each stage groups smaller pieces into larger chunks. The first stage might combine bytes into character-like units, and the next stage groups them into larger chunks. Boundaries are not fixed. The same word can be divided differently depending on context, even within the same passage.
Example: A Made-Up Word
Cartesia tested this with the invented word "borvexila." When HNet first encounters the word, it splits it into several small chunks. As the word appears repeatedly in the passage, the model groups it into fewer, larger chunks.
This change happens during inference. The model does not update its weights. Earlier occurrences of the word become part of the context, which changes how the model places chunk boundaries. HNet does not learn a new chunking rule at inference. It uses what it learned during training to adjust chunking to the context.
The same behavior appears with repeating patterns. When given a number sequence with recurring patterns, HNet can group the recurring sequences instead of processing each digit separately. This could benefit coding and mathematics.
Efficiency Trade-Off
Better compression does not automatically mean higher efficiency. HNet still processes every byte through its smaller networks before passing compressed representations to the main transformer. These networks also require computation, which adds overhead during training and inference. The key question is whether savings in the main transformer outweigh the cost of creating and processing chunks.
Controlled Comparison
Cartesia tested this by taking a standard transformer and replacing its tokenization components with HNet's learned chunking. All other elements stayed the same. The only difference was whether the input was divided into predefined tokens or learned chunks.
HNet achieved lower validation loss across all tested model sizes. Cartesia measured HNet as 1.28 times more compute efficient than the BPE transformer. The BPE transformer would need 28% more training compute to reach the same validation loss.
Performance on Unfamiliar Data
The gap widened on unfamiliar data. After training, Cartesia evaluated both models on different datasets without updating their weights. Across these downstream evaluations, the conventional transformer needed roughly twice as much training compute as HNet to reach the same prediction loss.
The gap was largest for programming languages, especially languages not included in the training mix:
| Comparison | Additional training compute needed by the BPE transformer |
|---|---|
| Unfamiliar programming languages (median) | 3.1 times |
| Prolog | 5.37 times |
HNet did not process these languages faster during inference. It reached better prediction loss with substantially less training compute. This suggests that the way HNet groups information helps its knowledge transfer to unfamiliar data.
Scaling Experiments
The initial experiment had limits. HNet's compression ratio and main transformer architecture were nearly identical to the BPE baseline. This design isolated the effect of learned tokenization. HNet can also compress across multiple stages, use different compression ratios, and adapt the LLM architecture to learned chunks.
Multi-Stage Compression
Multiple stages matter because meaningful patterns exist at different scales. Individual bytes can form a character, several characters can form a word, and several words can form a phrase. Instead of learning all these relationships in one step, HNet builds larger representations from smaller ones.
A compression ratio of four means that, on average, four input positions combine into one. If the first stage compresses by four and the second stage compresses by another two, the main transformer processes roughly one position for every eight original bytes. These values are averages. HNet creates chunks of different sizes depending on context.
Aggressive compression reduces the number of positions the main transformer processes. It also places more demand on the smaller networks to preserve useful information. The goal is a balance between information retained and computation saved.
Two-Stage HNet Compared with SmolLM3
Cartesia trained a two-stage HNet with 3.67 billion parameters. They compared it with SmolLM3, a conventional transformer published by Hugging Face with about 3 billion parameters. The HNet targeted four-times compression in the first stage and two-times compression in the second stage.
Cartesia did not explain how they chose this compression ratio beyond stating that it is based on prior work. They also did not link that work.
A small network predicts where each chunk ends. Training optimizes these decisions together with the rest of the model to improve next-byte prediction. An additional training objective keeps the model close to the target compression ratio without forcing every chunk to be the same length. Cartesia did not describe the architecture in detail.
The trained model averaged 7.6 bytes per position processed by its main transformer. The SmolLM3 tokenizer averages 4.5 bytes per token. For the same text, the HNet main transformer processes about 40% fewer positions.
This does not mean the full model uses 40% less computation. HNet still spends compute on its encoder, chunking, and decoder networks. These networks account for roughly 43% of HNet's total training compute. In SmolLM3, the embedding and output layers account for 8%. Although the main transformer processes fewer positions, much of the savings goes to learning and reconstructing compressed representations.
To make the comparison fair, Cartesia matched the two models to within 2% of training FLOPs per byte. Both models used about the same training compute per byte. The additional computation in HNet's smaller networks offset most of the savings in the main transformer.
Data Efficiency
If HNet costs about the same to train, the next question is whether it offers any advantage. Cartesia's results show that HNet learned more from the same amount of data.
SmolLM3 was pretrained on 11 trillion tokens. Cartesia tested how much training HNet needed to match SmolLM3's benchmark performance. They recreated SmolLM3's initial training data mixture and excluded its later training stages. Across six selected benchmarks, HNet reached SmolLM3's final average score after processing about 1 trillion token equivalents. This is about 10 times less training data.
Compute allocation differed across data categories. HNet compresses code more aggressively than BPE. This may allow it to spend less compute on code and more on other data.
Cartesia's results indicate that the gain comes from making computation more useful for learning, not from large computation savings.
Why HNet Needs Less Data
HNet's advantage grows on unfamiliar data. Its compute efficiency was 1.28 times on the original validation distribution. It rose to about 2 times on downstream evaluations and to 3.1 times for unfamiliar programming languages. The way HNet represents information affects how well its knowledge transfers to new data. This explains its stronger results on held-out benchmarks.
Cartesia published a second blog post to examine this behavior. Two language models can reach the same pretraining loss but perform differently on downstream tasks, depending on how their inputs were represented during training.
Loss-to-Loss Scaling
Cartesia separated two concepts that are often treated as related:
- How efficiently a model learns to predict its original training distribution.
- How well that learning transfers to other distributions.
With these separated, Cartesia defined a loss-to-loss scaling law. Conventional scaling laws measure how prediction loss improves with more training compute. Loss-to-loss scaling laws measure how a model's loss on one distribution relates to its loss on another.
Pretraining loss often predicts downstream performance. If two models reach the same validation loss, they should perform similarly on other datasets. Cartesia found that this relationship can change depending on tokenization.
Byte-Level Transformer
Cartesia compared the conventional BPE transformer with a pure byte-level transformer. The byte-level transformer does not compress input. It processes every byte through the main network.
As expected, the byte-level transformer was much more expensive to train. BPE required about 7.2 times less training compute to reach the same validation loss.
When both models reached the same validation loss, the byte-level transformer performed better on downstream evaluations. The difference in loss-to-loss scaling equaled about 1.5 times more training compute for BPE. Although BPE was cheaper to train, its pretraining loss did not translate into downstream performance as effectively. Representation affects not only the speed of learning but also how well learning transfers to unfamiliar data.
Pre-Tokenization
Cartesia also examined how BPE works in practice. BPE relies on pre-tokenization, which applies manually designed rules that split text into smaller pieces before merging begins. For example, these rules prevent tokens from crossing word boundaries.
Cartesia tested BPE without pre-tokenization, letting it learn its vocabulary directly from raw data. This version compressed better. It averaged 6.03 bytes per token, compared with 4.57 bytes per token with pre-tokenization.
Fewer tokens would normally suggest greater efficiency. The results showed otherwise. Despite processing fewer tokens, the model without pre-tokenization needed 1.5 times more compute to reach the same validation loss. It also performed worse on downstream evaluations, requiring 1.3 times more compute in the loss-to-loss scaling comparison. The way information is grouped can matter as much as how much it is compressed.
Cartesia noted one caveat. Some of the weakest downstream results without pre-tokenization came from the prompt boundary problem, which affects how the probabilities of tokenized models are evaluated.
Comparison with HNet
When Cartesia added HNet to the loss-to-loss scaling experiments, HNet matched the downstream transfer efficiency of the pure byte-level transformer. It kept the computational savings of compressed input. Compared with BPE, HNet's loss-to-loss scaling was 1.61 times more compute efficient.
HNet was 1.28 times more compute efficient at reaching the same pretraining validation loss. Better downstream transfer compounds this gain to about 2.06 times total compute efficiency (1.28 × 1.61). HNet achieves both goals: computational savings from compression and stronger downstream transfer from learning directly from bytes.
Is End-to-End Learning Necessary?
A separate model could determine chunk boundaries without training them alongside the language model. If that approach performs as well, end-to-end training may not be needed.
Cartesia tested this with models that shared the same setup and differed only in how chunk boundaries were determined. They compared HNet with the byte latent transformer (BLT). BLT uses a separately trained byte-level model to estimate how uncertain the next byte is. When uncertainty crosses a threshold, BLT starts a new chunk. This approach groups predictable sequences together and processes less predictable sequences in smaller pieces.
Both approaches compress raw bytes dynamically. Only HNet learns chunk boundaries directly from the language modeling objective. HNet performed better even when the researchers matched architectures and compression ratios.
Cartesia also tested a third approach. A smaller HNet, pretrained separately, determined chunk boundaries. The boundaries could still adapt to the input, but the chunking network was not updated with the larger model. The fully end-to-end HNet again performed best. The model benefits from learning which chunks help its own predictions.
Summary of Reported Results
| Comparison | HNet result |
|---|---|
| Validation loss vs. BPE transformer | 1.28 times more compute efficient (BPE needs 28% more compute) |
| Downstream prediction loss vs. BPE transformer | About 2 times less compute |
| Unfamiliar programming languages (median) | BPE needs 3.1 times more compute |
| Prolog | BPE needs 5.37 times more compute |
| Loss-to-loss scaling vs. BPE | 1.61 times more compute efficient |
| Combined pretraining and downstream efficiency | About 2.06 times |
| Benchmark average vs. SmolLM3 (six benchmarks) | About 10 times less training data |
| Main transformer positions vs. SmolLM3 | About 40% fewer |
| DNA sequence experiments vs. conventional transformer baseline | About 6 to 7 times better compute efficiency |
Applications Beyond Text
DNA sequences. DNA uses four letters: A, C, G, and T. In protein-coding regions, DNA is read in three-letter groups called codons. Outside these regions, grouping in threes does not necessarily make sense. HNet placed its chunk boundaries along the three-letter pattern in protein-coding regions and used different groupings elsewhere. The model was not told what a codon is. In DNA scaling experiments, HNet achieved about six to seven times better compute efficiency than the conventional transformer baseline.
Images. Cartesia also ran preliminary experiments that applied the same approach to images. The model learned to group pixels into larger representations.
Open Questions
HNet is more than a tokenizer. It is an architecture that learns to organize raw input into chunks based on the content it receives. Replacing tokenization in every LLM is still a distant prospect.
Reduced training compute does not guarantee faster text generation or lower serving costs. Inference efficiency remains an open question. The effects of instruction tuning, reinforcement learning, and scaling to much larger models are also not yet known.
Learning how to divide information into tokens before training may limit how models represent data over the long term. Learned chunking offers an alternative to fixed tokenization.
Tokenization and the Problem with BPE
Tokenization compresses characters into units, but fixed BPE boundaries built by frequency ignore meaning and context.
- LLMs process tokens rather than words directly, compressing multiple characters into one unit.
- Tokenization restricts vocabulary to a fixed size and lets models represent rare or unseen words by combining tokens.
- Most modern LLMs use BPE (byte pair encoding), which merges frequently co-occurring character sequences up to a vocabulary limit.
- Example: New York is one city but may be split into two tokens, New and York.
- Token boundaries are fixed before training, so the model cannot later adjust them based on meaning, costing extra positions and decoding steps.
Introducing H-Net
H-Net is introduced as a method that lets the model decide how to group information based on what it learned in training.
- The video presents the research paper H-Net as an attempt to let the model group information based on learned context instead of fixed tokens.
- The more context a model carries, the more compute is needed to serve it, which matters for AI agents.
How H-Net Works
H-Net takes raw bytes, uses a smaller network to learn chunk boundaries from context, and trains this chunking jointly with the language model.
- Instead of predefined tokens, H-Net takes in raw bytes directly and uses a smaller network to group them into larger chunks before the main transformer.
- Chunk boundaries are learned from surrounding context rather than from how frequently characters appear together.
- Example: the model can group New York into a single chunk when referring to the city, without explicitly knowing it is a city.
- The chunking process is trained together with the language model, so boundaries are learned as the model improves at predicting the next byte.
- H-Net compresses bytes through multiple stages, with early stages combining bytes into word-like units and later stages forming larger chunks.
Context-Dependent Chunking
Chunk boundaries are context-dependent and adapt during inference without updating weights, as shown with the made-up word borvexila and repeated number patterns.
- The researchers tested a made-up word called borvexila.
- On first encounter, H-Net splits borvexila into several small chunks; as it repeats, the model groups it into fewer, larger chunks.
- This adaptation happens during inference without updating H-Net's weights, because earlier occurrences become part of the context.
- H-Net uses what it learned in training to adjust chunking decisions dynamically, rather than learning a new rule at inference.
- With sequences of numbers containing recurring patterns, H-Net can group recurring sequences instead of processing each digit, which could help coding and math.
Compute Efficiency Versus BPE
H-Net still processes every byte through its smaller networks, so savings in the main transformer must outweigh this overhead.
- H-Net still processes every individual byte through its smaller networks before passing compressed representations to the main transformer.
- The smaller networks add overhead during both training and inference.
- To test efficiency, Cartesia replaced tokenization in a standard transformer with H-Net's learned chunking while keeping everything else the same.
- H-Net consistently achieved lower validation loss across all tested model sizes.
- H-Net was 1.28 times more compute efficient than the BPE transformer; the BPE transformer would need 28% more training compute to reach the same validation loss.
Transfer to Unfamiliar Data
H-Net's advantage grows on unfamiliar data and programming languages, with especially large gains on Prolog.
- After training, both models were evaluated on different datasets without updating weights to test transfer to other domains.
- On downstream evaluations, the conventional transformer needed roughly twice as much training compute as H-Net to reach the same prediction loss.
- On unfamiliar programming languages, not in the original training mix, the conventional transformer needed a median of 3.1 times more training compute to match H-Net.
- For Prolog specifically, the conventional transformer needed 5.37 times more training compute.
- H-Net did not process unfamiliar languages faster at inference; it achieved better prediction loss with less training compute.
Compression Stages and Ratios
Multi-stage compression and the compression ratio are key design choices, balancing preserved information against computation saved.
- The first experiment kept H-Net's compression ratio and main transformer architecture nearly identical to the BPE baseline to isolate the effect of learned tokenization.
- H-Net can compress across multiple stages, use different compression ratios, and optimize the LLM architecture for learned chunks.
- Multiple stages matter because meaningful patterns exist at different scales: bytes form characters, characters form words, and words form phrases.
- A compression ratio of four means on average four input positions are grouped into one; a four-times stage followed by a two-times stage means the main transformer processes about one position per eight bytes.
- Compressing more aggressively reduces main transformer positions but puts more pressure on smaller networks to preserve useful information.
Scaling Experiment Against SmolLM3
A larger two-stage H-Net with 3.67 billion parameters outperforms SmolLM3 in data efficiency, using about 10 times less training data for the same average benchmark score.
- Cartesia trained a larger two-stage H-Net with 3.67 billion parameters and compared it against Hugging Face SmolLM3, a conventional transformer with around 3 billion parameters.
- The researchers targeted four times compression in the first stage followed by two times in the second stage; the video notes they did not clarify how they chose this number beyond citing prior work.
- A small network predicts where each chunk ends, trained jointly with the model to improve next byte prediction, with an extra objective keeping compression close to the target without equal-length chunks.
- The trained H-Net averaged around 7.6 bytes per main transformer position, versus about 4.5 bytes per token for SmolLM3's tokenizer, so the main transformer processes around 40% fewer positions.
- H-Net's smaller encoder, chunking, and decoder networks account for roughly 43% of its total training compute, compared with 8% for the embedding and output layers of SmolLM3.
- Cartesia matched training FLOPs per byte within 2%, leaving both models with roughly the same compute per byte.
- Trained on about 1 trillion token equivalents, H-Net reached SmolLM3's final average score across six selected benchmarks, versus SmolLM3's roughly 11 trillion token pre-training, about 10 times less data.
- The data-efficiency gain may come from H-Net compressing code more aggressively than BPE, so it spends less compute on code and more on other data.
Why Downstream Transfer Improves
Loss-to-loss scaling shows that tokenization affects how well pre-training loss transfers downstream, and H-Net keeps both compute savings and strong transfer.
- Cartesia published a second blog investigating why two models with the same pre-training loss can perform very differently downstream.
- Loss-to-loss scaling laws measure how loss on one distribution relates to loss on another, separating training efficiency from transfer.
- A pure byte-level transformer, which does not compress, reached the same validation loss as BPE while needing about 7.2 times more training compute for BPE to match it.
- At equal validation loss, the byte-level transformer performed better downstream; the gap equaled about 1.5 times more training compute for BPE.
- Removing pre-tokenization rules let BPE compress 6.03 bytes per token instead of 4.57, but this needed 1.5 times more compute to reach the same validation loss and gave 1.3 times more compute in loss-to-loss scaling.
- H-Net matched the downstream transfer efficiency of the byte-level transformer while keeping compression savings, about 1.61 times more compute efficient than BPE in loss-to-loss scaling.
- Overall, H-Net was 1.28 times more compute efficient on pre-training loss, compounding to roughly 2.06 times better compute efficiency in total.
Learned Boundaries Versus BLT
H-Net's learned chunking outperforms BLT's separately trained uncertainty-based boundaries and a frozen pre-trained chunker, so end-to-end training matters.
- Cartesia compared H-Net against BLT (byte latent transformer), which uses a separately trained byte-level model to estimate next-byte uncertainty and starts a new chunk when uncertainty crosses a threshold.
- Only H-Net learns chunk boundaries directly from the language modeling objective.
- H-Net still performed better than BLT even when architectures and compression ratios were matched.
- A third approach used a smaller, separately pre-trained H-Net to set chunk boundaries without updating it alongside the larger model; the fully end-to-end H-Net still performed best.
DNA and Image Applications
H-Net shows gains in DNA modeling, where it learns codon-like groupings without being taught, and preliminary results on images are promising.
- For DNA sequences, the model must learn patterns from four letters: A, C, G, and T.
- In protein coding regions, DNA is read in groups of three letters called codons; H-Net learned to place chunk boundaries along these three-letter patterns without being explicitly taught what a codon is.
- H-Net used different groupings outside protein coding regions.
- In DNA scaling experiments, H-Net achieved around six to seven times better compute efficiency than the conventional transformer baseline.
- Cartesia showed preliminary experiments applying the idea to images, where the model learns to group pixels into larger representations.
Open Questions and Outlook
H-Net is an architecture for learning how to organize raw information, but replacing tokenization in every LLM remains uncertain, with inference efficiency and post-training behavior unresolved.
- The presenter argues H-Net is not just another tokenizer but an architecture that learns to organize raw information into useful chunks depending on the input.
- Reduced training compute does not automatically mean faster text generation or cheaper serving.
- It is unknown how H-Net's advantages will hold up after instruction tuning, reinforcement learning, or scaling to much larger models.
- The presenter suggests determining token divisions before training may not make sense in the long run.
