Abstract
The ICX360 toolkit is an open-source Python library designed to provide comprehensive explanations for Large Language Model (LLM) outputs. By integrating three distinct methods—MExGen, CELL, and Token Highlighter—ICX360 addresses the limitations of traditional XAI tools, which often struggle with the semantic complexity of natural language and the restricted access of commercial APIs. The toolkit supports multi-level granularity (from tokens to sentences) and accommodates various model access levels, offering a unified framework for in-context explainability in generative AI.
Introduction
As Large Language Models (LLMs) become central to high-stakes applications in medicine, law, and finance, the need for transparency is paramount. Users and developers must understand why a model generated a specific response. However, existing explainable AI (XAI) libraries like SHAP or Captum were largely designed for classification tasks and often fail when applied to long-form text generation. They typically attribute importance to individual, fragmented tokens, resulting in explanations that are difficult for humans to interpret. Furthermore, many state-of-the-art models are only accessible via black-box APIs, rendering gradient-based white-box methods unusable.
The ICX360 Toolkit
ICX360 bridges these gaps by providing a modular, extensible library for "in-context explainability." It focuses on explaining outputs based on the provided prompts across different levels of model access.
As shown in the comparison above, ICX360 is the only toolkit that simultaneously supports generative models, API access, interpretable attribution units, contrastive explanations, and full-generation explanations.
Core Methodologies
The toolkit implements three primary explainers, categorized by their required model access and algorithmic approach:
- MExGen (Multi-Level Explanations): A perturbation-based approach that evaluates how input modifications affect the output. It employs a "top-down" strategy, starting with coarse units like sentences before refining to words, significantly reducing computational overhead.
- CELL (Contrastive Explanations): Designed for black-box models, CELL identifies minor prompt tweaks that would lead to a different, specified output property (e.g., making a response more preferable or contradictory).
- Token Highlighter: A white-box method for local models that uses gradients of the output's log-likelihood to highlight influential input segments.
A New Taxonomy for LLM Explainability
ICX360 introduces a structured way to categorize XAI methods based on model access and linguistic granularity. This taxonomy helps developers choose the right tool for their specific deployment scenario.
The toolkit's architecture relies on modular software abstractions to maintain this flexibility:
- Model Wrappers: Standardize interfaces for Hugging Face and vLLM.
- Infillers: Handle text perturbation for black-box methods.
- Scalarizers: Convert complex text outputs into numerical scores for attribution.
- Segmenters: Use linguistic tools (like spaCy) to group tokens into meaningful phrases and sentences.
Key Innovations
A major innovation in ICX360 is solving the "Granularity Problem." Traditional tools often break words into meaningless sub-word tokens. By using Segmenters, ICX360 provides explanations at the level of words, phrases, or sentences, which are far more intuitive for human users. Additionally, by using Scalarizers to evaluate the entire generated sequence rather than individual tokens, the toolkit captures the global context of the LLM's reasoning.
Conclusion and Future Directions
ICX360 represents a significant step toward making generative AI more transparent and accountable. While perturbation-based methods currently face computational challenges, the toolkit's modular design allows for future integration of more efficient algorithms. Upcoming versions aim to support conversational AI contexts and the explanation of internal "reasoning traces" like Chain-of-Thought.
The toolkit is available as an open-source project at https://github.com/IBM/ICX360.
Summary updated