All research

Research · AI · Browser

Adaptive web optimization

A machine-learning model that runs in the browser, reads a user’s activity log, and predicts the next action — so the application can prefetch what they will need before they click.

Laptop on a desk showing a sequence of interface panels, the last one highlighted

Context

Web applications load more assets per page than they used to. A statistical average of “where users go next” can prefetch for the crowd. It cannot prefetch for a person. That is a latency problem, a server-load problem, and a privacy problem if the model has to live on a remote GPU.

What we built

A client-side neural network, trained on activity logs, that predicts the next page or task. The model runs in TensorFlow.js. The prediction is used to prefetch assets, warm the path, and — when useful — prepare capacity on the services that are about to be hit.

Outcome

The approach was presented as a working method: sequential models in the browser, one-hot encodings of navigation, and predictive prefetching as a product behaviour rather than a server-side batch job. The talks below walk through the architecture and the training loop.

Why the browser

The prediction is personal. A model that lives on the server sees aggregates, adds round-trips, and ships behavioural data off-device. A model that lives in JavaScript can train and infer on the same machine that produced the log. Latency drops. The activity history does not have to leave the client. The work also holds when the network is poor — the interesting case for prefetching.

TensorFlow.js is the runtime because it can load a pre-trained graph, retrain on local sequences, or build a sequential network from scratch, and because it already runs in the environments we ship: browsers, not research notebooks.

How the prediction works

Navigation is a sequence: home, feed, messages, marketplace, feed again. Neural networks do not consume those labels as strings. Each page is mapped to a number, then to a one-hot vector the size of the site map. A sequential model with dense hidden layers — ReLU inside, softmax on the last layer — is fitted on windows of that history. At inference time the current window goes in; the next page comes out.

Linear regression is the wrong tool here: the target is a class, not a line. A single decision tree can classify, but it does not adapt to a person’s changing path as cleanly. The network is the compromise that can mimic a regressor when we need one, and a classifier when we need the next action.

What the prediction is for

If the next page is messages, the client can request that payload while the UI is idle. When the person clicks, the data is already in memory. The same signal can flag unusual flows, estimate load on a specific service, and personalise a workflow that the user repeats every day — without a generic “most popular next step” for the whole population.

The research also covers the surrounding craft: enough examples to avoid overfitting, loss curves (mean squared error, mean absolute error) watched across epochs, and the point at which more training stops paying for itself. Pre-trained models in the TensorFlow.js ecosystem — classification, speech, toxicity, generation — sit next to this custom predictor when a product needs more than navigation.

Talks

The method was presented at engineering conferences as a practical path for putting machine learning in front-end applications, not only behind an API.