Google Open-Sources LIT: A Visual, Interactive Model-Understanding Tool For NLP Models

Google AI Researchers recently released its open-source tool LIT (Language Interpretability Tool) for visualizing, auditing, and understanding the NLP models.

LIT focuses on core questions about model behavior, such as : 

Why did my model make this prediction? What kind of examples does my model perform poorly on? What happens under a controlled change in the input? This prediction be attributed to adversarial behavior or too undesirable priors in the training set? Etc.

LIT could be really helpful in understanding the model’s tendencies to behave according to biases and heuristics and save time for data scientists. LIT supports a variety of debugging workflows through a browser-based UI, and it is set up in such a way so that users can try choosing between visualizations and analysis for testing hypotheses and validate those hypotheses over a selected dataset.

LIT supports various models—including classification, seq2seq, and structured prediction. It is highly extensible through a declarative, framework-agnostic API.


  • Local explanations via salience maps, attention, and rich visualization of model predictions.
  • Aggregate analysis including custom metrics, slicing & binning, and visualization of embedding spaces.
  • Counterfactual generation via manual edits or generator plug-ins to dynamically create and evaluate new examples.
  • Side-by-side mode to compare two or more models or one model on a pair of examples.
  • Highly extensible to new model types, including classification, regression, span labeling, seq2seq, and language modeling. Supports multi-head models and multiple input features out of the box.
  • Framework-agnostic and compatible with TensorFlow, PyTorch, and more.