MITB Banner

What Does Google’s Language Interpretability Tool Mean For Developers

Share

Recently, Google Research open-sourced a platform for visualisation and understanding of natural language processing (NLP) models known as Language Interpretability Tool (LIT). LIT integrates local explanations, aggregate analysis and counterfactual generation into a streamlined, browser-based interface to enable rapid exploration and error analysis.

Natural Language Processing technique has made several outstanding contributions in recent years. However, the NLP models suffer from several biases, which include the behaviour of these models under domain shift, adversarial settings, tendencies to behave according to social prejudices, shallow heuristics and more.

Why LIT?

Despite the recent explosion of work on language model understanding and evaluation, specific issues limit the models from being robust. To mitigate such problems, researchers often experiment with many techniques, looking at local explanations, aggregate metrics, and counterfactual variations of the input to build a full understanding of model behaviour and other such.

Certain tools claim to assist with these processes. For instance, TensorFlow Model Analysis (TFMA) open-source library that provides only aggregate metrics, interactive frontends that focus on the single-datapoint explanation and more integrated tools. However, switching between tools or adopting a new method from research code can be time-consuming as well as distracting from the real task of error analysis. This is why google researchers introduced the LIT tool.

Behind LIT

Language Interpretability Tool (LIT), a toolkit and browser-based user interface (UI) for NLP model understanding supports various tasks, such as local explanations, salience maps, rich visualisations of model prediction as well as aggregate analysis including metrics, embedding spaces, and flexible slicing. 

The LIT UI is written in TypeScript language and communicates with a Python backend that hosts models, datasets, counterfactual generators, and other interpretation components. The browser-based UI is a single-page web app, built with lit-element and MobX. The Python backend serves models, data, and interpretation components.

The tool allows the users to seamlessly hop between them to test local hypotheses and validate them over a dataset. LIT also provides support for a counterfactual generation, such as new data points can be added on the fly, and their effect on the model visualised immediately. 

As mentioned above, LIT has a browser-based UI composed of modules which contain controls and visualisations for specific tasks such as confusion matrix, data table, salience maps, scalar plot, attention. embeddings, and much more. It can work as a simple demo server, where one can enter text, press a button, and see the model’s predictions.

Features of LIT

  • Flexible: LIT supports a wide range of NLP tasks, including classification, seq2seq, language modelling, and structured prediction.
  • Extensible: This platform is designed for experimentation and can be reconfigured and extended for novel workflows.
  • Modular: Here, the components are self-contained, portable and straightforward to implement.
  • Framework Agnostic: This tool works with any model that can run from Python, including TensorFlow, PyTorch, among others.
  • Easy to Use: LIT includes a low barrier to entry, with only a small amount of code needed to add models and data along with an easy path to access sophisticated functionality.

Benefits of LIT

There are several ways the LIT tool can assist an NLP developer. Some of them are mentioned below-

  • Explore the dataset: With LIT, users can interactively explore datasets using different criteria across modules like the data table and the embeddings module.
  • Find interesting data points: This tool allows developers to identify interesting data points for analysis, cycle through them, and save selections for future use.
  • Explain local behaviour: Developers can now easily deep-dive into model behaviour on selected individual data points using a variety of modules depending on the model task and type.
  • Generate new data points: Using LIT, developers can create new data points based on data points of interest either manually through edits, or with a range of automatic counterfactual generators, such as back-translation, nearest-neighbour retrieval, among others.
  • Compare side-by-side: LIT allows developers to compare two or more models on the same data, or a single model on two data points simultaneously.
  • Compute metrics: LIT calculates and displays metrics for the whole dataset, the current selection, as well as on manual or automatically generated slices to easily find patterns in model performance.
Share
Picture of Ambika Choudhury

Ambika Choudhury

A Technical Journalist who loves writing about Machine Learning and Artificial Intelligence. A lover of music, writing and learning something out of the box.
Related Posts

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

Upcoming Large format Conference

May 30 and 31, 2024 | 📍 Bangalore, India

Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

AI Courses & Careers

Become a Certified Generative AI Engineer

AI Forum for India

Our Discord Community for AI Ecosystem, In collaboration with NVIDIA. 

Flagship Events

Rising 2024 | DE&I in Tech Summit

April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore

MachineCon GCC Summit 2024

June 28 2024 | 📍Bangalore, India

MachineCon USA 2024

26 July 2024 | 583 Park Avenue, New York

Cypher India 2024

September 25-27, 2024 | 📍Bangalore, India

Cypher USA 2024

Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA

Data Engineering Summit 2024

May 30 and 31, 2024 | 📍 Bangalore, India

Subscribe to Our Newsletter

The Belamy, our weekly Newsletter is a rage. Just enter your email below.