Visualization for Machine Learning

Spring 2024

Visualization for NLP

  • NLP Basic
  • Visualizing Traditional NLP Model’s Internal Structure
  • Visualizing Traditional NLP Model’s Behavior
  • Visualizing LLMs

Visualization for NLP

  • NLP Basic
  • Visualizing Traditional NLP Model’s Internal Structure
  • Visualizing Traditional NLP Model’s Behavior
  • Visualizing LLMs

NLP Basic

NLP Basic

NLP Basic

NLP Basic

NLP Basic

NLP Basic

NLP Basic: Tasks

Low-Level Tasks

Named entity recognition Relation extraction Text classification Keyword extraction Parts-of-speech tagging Grammatical error correction

High-Level Tasks

Text summarization Text Q&A Text generation Image/video caption Fake news detection Dialogue understanding

Visualization for NLP

  • NLP Basic
  • Visualizing Traditional NLP Model’s Internal Structure
  • Visualizing Traditional NLP Model’s Behavior
  • Visualizing LLMs

Visualization for NLP

  • NLP Basic
  • Visualizing Traditional NLP Model’s Internal Structure
  • Visualizing Traditional NLP Model’s Behavior
  • Visualizing LLMs

Visualizing Internal Structure: RNN

RNNbow: Visualizing Learning Via Backpropagation Gradients in RNNs Cashman et al. CGA 2018

Visualizing Internal Structure: RNN

Visualizing Internal Structure: RNN

Visualizing Internal Structure: RNN

Comparing gradients at different epochs of training:

Visualizing Internal Structure: RNN

Comparing gradients at different epochs of training:

Visualizing Internal Structure: RNN

Exploring vanishing gradient

Visualizing Internal Structure: RNN

Poorly Learning C

Visualizing Internal Structure: Hidden States

Visualizing Internal Structure: Hidden States

Hidden values in LSTM/RNN

Visualizing Internal Structure: Hidden States

Hidden States Sequence of high-dimensional vectors. What are some options for visualization?

Visualizing Internal Structure: Hidden States

Hidden States Sequence of high-dimensional vectors. What are some options for visualization?

Visualizing Internal Structure: Hidden States

Hidden States Sequence of high-dimensional vectors. What are some options for visualization?

Visualizing Internal Structure: Hidden States

User selects sequences. Configurable threshold: all hidden states in the selected sequence must exceed threshold

Visualizing Internal Structure: Hidden States

User selects sequences. Configurable threshold: all hidden states in the selected sequence must exceed threshold

Visualizing Internal Structure: Hidden States

How to visualize the collection-level hidden states?

Visualization for NLP

  • NLP Basic
  • Visualizing Traditional NLP Model’s Internal Structure
  • Visualizing Traditional NLP Model’s Behavior
  • Visualizing LLMs

Visualizing Behavior: iSea

Overall Accuracy on Test Set: 80%

Visualizing Behavior: iSea

Where does the model make mistakes?

Why does the model make these mistakes?

How can we improve the model performance?

Visualizing Behavior: iSea

Subpopulation-Level Error Analysis is Common for NLP Models

Visualizing Behavior: iSea

Subpopulation-Level Error Analysis is Common for NLP Models

Not able to capture the errors grounded in specific semantic concepts.

Requires prior knowledge to construct subpopulations.

Visualizing Behavior: iSea

Visualizing Behavior: iSea

Visualizing Behavior: iSea

Features to Describe A Subpopulation

  • Token
    • e.g., all the documents that contain “delicious”.
  • Concept
    • e.g., all the documents that contain “delicious”/“tasty”/”yummy”/…
  • High-level Features
    • e.g., all the documents that contain a high percentage of adjectives.

Visualizing Behavior: iSea

To describe error-prone subpopulations, we use a set of if-then rules.

Visualizing Behavior: iSea

Through iterative design process, we identified four principles of presenting the error rules:

  • Principle 1: Limit the number of conditions.
    • To keep the rule interpretable.
  • Principle 2: Test significance.
    • To ensure the high error rate in the subpopulation does not occur by chance
  • Principle 3: Limit the cardinality of features.
    • Use low/medium/high instead of actual values (e.g., >20, <30) to keep it interpretable.
  • Principle 4: Avoid negation for tokens.
    • To ensure actionable insights.

Visualizing Behavior: iSea

Automatic Error Discovery

Visualizing Behavior: iSea

Automatic Error Discovery

Visualizing Behavior: iSea

Automatic Error Discovery

Visualizing Behavior: iSea

Views to Support Learning

Visualizing Behavior: iSea

Validating

Visualizing Behavior: iSea

Validating

Visualizing Behavior: iSea

Validating

Visualizing Behavior: iSea

Interpret Errors Causes

Visualizing Behavior: iSea

Hypothesis Testing

Visualizing Behavior: iSea

Rule Editing & Concept Construction

Visualizing Behavior: iSea

Visualizing Behavior: Polyjuice

Generating various counterfactuals

Visualizing Behavior: Polyjuice

Visualization for NLP

  • NLP Basic
  • Visualizing Traditional NLP Model’s Internal Structure
  • Visualizing Traditional NLP Model’s Behavior
  • Visualizing LLMs

Visualizing LLMs

Visualizing LLMs

Visualizing LLMs

Visualizing LLMs

Visualizing LLMs

Visualizing LLMs

Visualizing LLMs

Visualizing LLMs

Visualizing LLMs

Visualizing LLMs

Visualizing LLMs

Visualizing LLMs

Visualizing LLMs

Visualizing LLMs

Visualizing LLMs

Visualizing LLMs

POEM: Interactive Prompt Optimization for Enhancing Multimodal Reasoning of Large Language Models

Visualizing LLMs

Multi-Modal Interaction

Visualizing LLMs

POEM: Interactive Prompt Optimization for Enhancing Multimodal Reasoning of Large Language Models