Towards Compositionality in Concept Learning

Adam Stein, Aaditya Naik, Yinjun Wu, Mayur Naik, Eric Wong

Introduction

While foundation models like CLIP or LLaMA are incredibly powerful, their internal logic remains opaque. Concept-based interpretability attempts to solve this by decomposing high-dimensional embeddings into discrete, human-understandable "concepts" (like color: red or shape: cube).

However, existing unsupervised methods like PCA or KMeans suffer from a major flaw: they lack compositionality. In an ideal system, if you have a vector for "white birds" and a vector for "small birds," adding them together should yield the representation for "small white birds." Existing methods often fail this "addition test," resulting in concept vectors that might describe individual features well but do not work together to explain a complete sample. This entanglement makes it difficult to use these concepts for fine-grained model editing or reliable debugging.

PCA fails to compose concepts accurately. Adding "white" and "small" yields unrelated birds.

Compositional Concept Extraction (CCE)

To address this, the authors propose Compositional Concept Extraction (CCE). This method is built on the insight that concepts belong to broader attributes (e.g., "Color" is an attribute; "Red" and "Blue" are concepts within it). To achieve compositionality, CCE enforces two structural properties:

  1. Inter-attribute Orthogonality: Concepts from different attributes (e.g., Red and Cube) should be orthogonal to each other.
  2. Intra-attribute Non-orthogonality: Concepts within the same attribute (e.g., Red and Blue) do not need to be orthogonal.

The Algorithm

  • Outer Loop: The algorithm finds one attribute at a time within a specific subspace. Once an attribute is identified, CCE uses "orthogonal rejection" to remove that subspace from the data before looking for the next attribute. This ensures that the next set of concepts discovered is mathematically independent of the first.
  • Inner Loop: Within each subspace, CCE jointly learns the subspace projection and the concept centroids. It optimizes a Silhouette score—a metric usually used to measure clustering quality—to ensure the discovered concepts are distinct and representative of the data.
  • Regularization: To prevent the model from "cheating" by picking arbitrary subspaces, a regularization term ensures the centroids in the subspace correspond to meaningful clusters in the original high-dimensional space.

Key Insights and Results

The researchers evaluated CCE across both vision and language modalities using datasets like CLEVR (synthetic geometric objects), CUB (real-world birds), HAM10000 (medical skin lesions), Truth (factual statements), and 20 Newsgroups.

  • Orthogonality is the Key to Logic: The paper mathematically proves that if concept vectors from different attributes are orthogonal, they will naturally behave compositionally when summed. This bridges the gap between linear algebra and human-like categorical logic.
  • Beyond Ground Truth: CCE doesn't just recover provided labels; it discovers "latent" compositional concepts. For example, in the bird dataset, it discovered a "Birds in Hands" concept which could then be composed with "White Birds" to identify "White Birds in Hands."
Successful composition: combining "white" and "size: 3-5in" correctly identifies small white birds.

Quantitative Performance

  • Compositionality Scores: On the CLEVR dataset, CCE achieved a perfect Mean Average Precision (MAP) of 1.000 for predicting composed concepts, matching the ground truth and significantly beating baselines like PCA (0.981) and ACE (0.834).
  • Cosine Similarity: CCE's extracted concepts were much closer to the "true" ground-truth concepts than any other method. On CLEVR, CCE reached a 0.992 average cosine similarity with ground truth, while PCA only managed 0.580.
  • Downstream Accuracy: Interestingly, using these compositional concepts as features for a simple linear classifier often resulted in higher accuracy than using the raw, uninterpretable embeddings. In real-world settings (CUB and HAM), CCE-based classifiers outperformed "No concept" baselines by a visible margin as the number of concepts increased, proving that compositional features are highly discriminative.

Limitations and Future Work

While CCE marks a significant step forward, it has limitations. The authors acknowledge the "Hot Dog" problem: not all concepts are compositional. The meaning of "hot" and "dog" does not linearly combine to form the concept of a "hot dog." CCE is designed for "flat" compositional structures and may struggle with idiomatic or highly non-linear relationships.

Additionally, like most unsupervised methods, CCE finds the vectors, but a human (or a Vision-Language Model like GPT-4o) must still inspect the top-activated images to assign semantic names to the clusters. Future work could explore hierarchical compositions (e.g., "Part of a Wing" $\subset$ "Wing" $\subset$ "Bird") rather than assuming a strictly flat structure of attributes.

Summary updated

BibTeX
@inproceedings{stein2024towards,
  author = {Adam Stein and Aaditya Naik and Yinjun Wu and Mayur Naik and Eric Wong},
  title = {{Towards Compositionality in Concept Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=upO8FUwf92},
}
Figure