Abstract
Large Language Models (LLMs) are often perceived as universal tools, yet they struggle with highly subjective user behaviors, such as web browsing. We propose that browsing logs form a "language of browsing" unique to each user. This paper introduces HeTLM (Heterogeneity-aware Training of Language Model), an actor-critic framework that endogenously clusters users to train specialized small-parameter models. Our results show that small, specialized LMs can outperform massive models like GPT-4o and Llama-3 in this domain, while simultaneously reducing performance variance across heterogeneous user groups.
The Challenge of Heterogeneity in Browsing
Standard LLM alignment assumes a single set of parameters can satisfy a diverse user base. However, in the domain of web browsing, sequences of page visits are deeply idiosyncratic. A single "average" model often fails to capture the nuances of individual intent, leading to high variance in alignment. We address three key questions: (i) Can small LMs represent the "language of browsing" better than large LMs? (ii) Can a single set of parameters adequately capture heterogeneous behaviors? (iii) Can specialized training improve alignment by reducing performance variance?
HeTLM: A Framework for Heterogeneous Alignment
The core of our approach is HeTLM, which treats browsing as a sequence prediction task. Unlike traditional methods that use fixed clusters, HeTLM employs an Actor-Critic framework for endogenous learning.
As shown in Figure 1, the system consists of three primary components:
- Encoder (SBERT): Converts a user's session history into a fixed-length embedding ($z_b$).
- Selector (Actor): An MLP ($h_\psi$) that assigns users to one of $K$ clusters based on their behavioral embeddings.
- Predictors (Critics): Multiple instances of a small LLM ($g_\phi$), each fine-tuned specifically on data from users assigned to its cluster.
A critical innovation is the page-level tokenizer. By treating each unique URL as a distinct token rather than using standard subword units (like BPE), the model aligns its vocabulary directly with the idiosyncratic "language" of the specific web domain.
Key Results: Small Models, Big Impact
Our experiments on large-scale e-commerce datasets revealed that architectural specialization and vocabulary alignment often matter more than raw parameter count in niche domains.
1. Specialization Over Scale
One of the most significant findings is that small models (350M–500M parameters) outperformed "frontier" models. For instance, HeTLM achieved an F1-score for Cart/Purchase prediction of 0.522, significantly higher than the 0.403 achieved by the much larger Qwen-2.5-7B. This suggests that for domain-specific sequences, a custom tokenizer and specialized training are more effective than general-purpose scale.
2. The Power of Endogenous Clustering
HeTLM's ability to learn clusters during training (endogenous) proved superior to pre-defined K-means clustering (exogenous). By grouping users whose behaviors are best predicted by the same sub-model, HeTLM discovers latent behavioral patterns that raw embeddings might miss.
As detailed in Figure 5, the HeTLM framework allows smaller models to achieve state-of-the-art performance. Notably, the QWEN-2.5-500M HeTLM achieved a Hit Rate of 0.803 and an IoA of 0.434, vastly outperforming the single QWEN-2.5-7B model (HR: 0.699, IoA: 0.253).
3. Improved Alignment and Efficiency
By using cluster-specific parameters, HeTLM achieves a higher mean performance and lower variance across the user base. This ensures that the model is consistently helpful for all users, not just the "average" one. Furthermore, because only one small cluster-specific model is invoked during inference, the system is more computationally efficient than running a single massive model.
Conclusion
The "language of browsing" requires a departure from the "one-size-fits-all" paradigm of modern LLMs. HeTLM demonstrates that by respecting human heterogeneity through endogenous clustering and domain-specific tokenization, we can build models that are more accurate, more aligned, and more efficient. Future work will explore the scalability of this approach to even larger behavioral datasets and more complex predictive journeys.
Summary updated