tree: d24e4af1e913760aca89c2989a2665d00dd722b8 [path history] [tgz]
  4. example_preprocessor_config.pb
  5. mru_features.h
  7. native_inference.h
  10. tab_features.h
  12. tab_features_test_helper.h
  15. tab_score_predictor.h
  18. window_features.h

Tab Ranker

The Tab Ranker is an experimental model used to predict tab reactivation. We are setting up experiments to use this model as a factor in deciding which tabs to discard when the system is low on memory.


The input to the model is a list of metrics about a background tab, such as whether it is pinned, how long it has been in the background, and how many events it has received. The output is a floating point value, where a higher number suggests the tab is more likely to be reactivated than a lower number. The range of possible outputs is dependent on the model; what matters is the relative ordering of scores, not the precise value of a score.

The metrics used for inference are the same metrics logged to UKM by TabMetricsLogger. Using these metrics, we trained a DNN model. The inferencing code in consists of the model weights generated by TensorFlow and basic operations to execute the model over an example.

See [] for details on how the tf.native code is cleaned up for Chromium.

Example preprocessing

Examples are provided to the model as an array of floats, with each element corresponding to a feature. For scalar metrics like WasRecentlyActive(), this feature is simply a 0 or 1.

A metric with multiple possible values, like an enum or bucketized number, is broken into a number of features, each corresponding to one of its possible values. For example, a value of 7 for the PageTransitionCoreType metric is represented as a 1 in the PageTransitionCoreType_7 feature. See

The AssistRanker handles this example preprocessing based on the configuration provided in example_preprocessor_config.pb. This can be examined with the utility:

  ./components/assist_ranker/ \
  out/Release \

Scoring a tab

Use TabActivityWatcher::CalculateReactivationScore() to get a score from a WebContents.

Internally, TabScorePredictor::ScoreTab is the interface to the model. The caller needs to track a number of metrics about the tab and its window. These metrics must be calculated in the same way they were logged, as otherwise the results will not be valid.