Multidimensional counting grids: Inferring word order from disordered bags of words

Nebojsa Jojic, Alessandro Perina

TL;DR

Counting Grids offer a powerful alternative to traditional topic models like Latent Dirichlet Allocation (LDA) by modeling bag-of-words data as continuous, spatial "thematic shifts" rather than discrete mixtures. By mapping documents to overlapping windows on a multidimensional grid, this generative model uncovers latent order and topology across diverse data types, significantly outperforming standard subspace models in text, computer vision, and biology applications.

What Problem Does This Paper Address?

When dealing with unstructured data—like text documents, image features, or gene expression profiles—researchers frequently rely on "bag-of-words" representations. To analyze these bags, standard topic models (such as LDA) assume that each document is a mixture of a few distinct, discrete topics.

However, this assumption falls short when the underlying themes change smoothly and continuously. For instance, news stories evolve day by day, with words gradually appearing and disappearing as one event transitions into another.

Figure 1: Usage counts for five terms in CNN news blog over the first 18 days of March

Standard topic models struggle to capture this topological continuity efficiently. The authors address this gap by proposing a model that can infer a continuous latent space (or ordering) directly from disordered bags of words.

Methods

The authors introduce Multidimensional Counting Grids. Instead of discrete topics, the model defines a $D$-dimensional discrete grid (typically 2D or 3D) where every point on the grid is a normalized distribution over the vocabulary. To avoid edge effects, the grid is wrapped around as a torus.

Figure 2: An example of a counting grid geometry. In general, the data is embedded into a hypercube which is wrapped around along each dimension to avoid local minima that would be caused by abrupt cuts along any dimension.

A bag of words is assumed to be generated by:

  1. Selecting a hypercube window ($W_k$) at a specific location ($k$) on the grid.
  2. Averaging all the word distributions within that window to create a single histogram.
  3. Sampling words from this averaged distribution.

The model uses a variational Expectation-Maximization (EM) algorithm for inference and learning. In the E-step, documents are mapped to the grid window that minimizes the KL-divergence between the document's word counts and the window's averaged distribution. In the M-step, the grid's word distributions are updated. Crucially, the authors utilize cumulative sums to make both steps linear in the size of the counting grid, ensuring high computational efficiency.

Datasets

The model was evaluated across three distinct domains:

  • Text: The CMU 20 Newsgroup dataset, focusing on challenging subsets of highly related groups (e.g., news-20-same, containing computer-related sub-reddits/groups).
  • Images: The Visual Scene Dataset (Oliva & Torralba, 2001), consisting of roughly 250 images across four natural and four artificial scene categories, converted into bags of visual words using SIFT descriptors.
  • Biology:
  • An HIV dataset containing cellular presentation peptide counts from 181 patients to predict viral load.
  • An E. coli promoter gene sequence dataset.
  • Microarray expression datasets for prostate, brain, and colon cancer.

Key Insights and Ideas

  • Overlapping Windows as Regularizers: Because the windows on the grid heavily overlap, the model is incredibly robust against overtraining. Thousands of parameters are constrained to sum up in large, shared groups, forcing the model to discover true latent structures rather than memorizing noise.
  • Topology Matters: By forcing data into a grid, the model naturally maps similar concepts close to each other. For example, in text classification, the boundaries between different newsgroups form a complex but continuous transition map.
  • Dimensionality Flexibility: While 2D grids excel at capturing spatial shifts like camera panning in images, 3D grids perform better for highly complex data like text or biological sequences, indicating that some datasets require higher-dimensional topologies to properly untangle their themes.

Key Results

  • Text Classification: On the difficult news-20-same dataset, Counting Grids achieved significantly higher accuracy (~80%) compared to LDA (~73%) and the Spherical Admixture Model (SAM).
  • Scene Classification: Counting Grids consistently beat LDA and SAM in both unsupervised embedding and supervised classification tasks, proving robust even when training data was reduced to just 10% of the dataset.
Figure 4: Scene classification. a) Unsupervised embedding evaluation in terms of the classification based on the latent space. (Reisinger et al., 2010) (SAM) does not report result for “Artificial” dataset. We kept fixed W and we varied E; The number in brackets is the coverage κ. b-c) Supervised image classification results using different counting grids and LDA models for different classes (each class contains 250 images). See text for details.
  • Bioinformatics: In predicting HIV viral load, 3D counting grids outperformed LDA across various model capacities, explaining over 9% of the log viral load variance (compared to less than 4% from traditional targeting efficiency analysis). On the Colon cancer microarray dataset, the model achieved an 89.2% classification accuracy, setting a new state-of-the-art at the time.

Limitations and Future Work

The primary limitation of the basic Counting Grid model is that it only accounts for continuous spatial/thematic shifts. It cannot handle discrete mixing—for example, a scene that contains a mix of entirely different, non-adjacent objects, or a document discussing two completely unrelated topics simultaneously.

The authors note that combining the spatial tracking of Counting Grids with the discrete mixing capabilities of LDA represents a promising and necessary direction for future research.

Summary updated

BibTeX
@inproceedings{jojic2011multidimensional,
  author = {Nebojsa Jojic and Alessandro Perina},
  title = {{Multidimensional counting grids: Inferring word order from disordered bags of words}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2011},
}
Figure