Learning Where to Sample in Structured Prediction

Tianlin Shi, Jacob Steinhardt, Percy LiangAISTATS 2015

Introduction

Standard inference algorithms for structured prediction often waste computational resources by treating every part of a problem as equally difficult. In tasks like part-of-speech tagging or image segmentation, variables are interdependent, leading to an astronomical number of possible outputs. Approximate inference methods like Gibbs sampling are commonly used but suffer from a "hidden tax": they typically iterate through variables in a fixed, cyclic order, regardless of their individual complexity or ambiguity.

Methodology: HeteroSampler

This paper introduces HeteroSampler, a reinforcement learning-based framework that learns to dynamically allocate computation to the "hardest" parts of an output. By framing inference as a sequential decision-making problem, the authors develop a policy that decides which variable to update next.

The Meta-Model and Reward System

The core of HeteroSampler is a "meta-model"—a single-layer neural network—that acts as a manager. At each step, the manager evaluates the current state of the prediction and selects a variable for sampling. The reinforcement learning (RL) agent is rewarded based on improvements in the log-likelihood of the model.

Meta-Features

To ensure rapid decision-making, the manager utilizes computationally inexpensive "meta-features":

  • Staleness (vary): Tracks how many neighbors have changed since the variable was last sampled.
  • Neighbor Discord (nb): Measures inconsistency among neighboring labels.
  • Uncertainty (cond-ent & unigram-ent): Evaluates conditional and isolated ambiguity.
  • Sampling Frequency (sp): Tracks how many times a variable has been visited.

Experimental Setup

The framework was evaluated across five diverse structured prediction tasks: Named-Entity Recognition (NER), Part-of-Speech (POS) Tagging, Handwriting Recognition, Color Inpainting, and Scene Decomposition.

Results and Discussion

HeteroSampler consistently outperformed standard cyclic Gibbs sampling across all datasets.

Accuracy and Log-Probability vs. Average Number of Transitions across several tasks. HeteroSampler converges significantly faster than cyclic Gibbs sampling.

Efficiency and Convergence

As shown in the results, HeteroSampler reaches the "ceiling" accuracy of standard Gibbs sampling 2 to 5 times faster. By prioritizing "stale" or uncertain variables, the algorithm avoids redundant computations on "easy" parts of the problem (e.g., unambiguous words like "the").

Improved Optima

In complex tasks like Color Inpainting, the learned sampling order allowed the algorithm to find better local optima (higher log-probability) than the cyclic approach. This suggests that a dynamic sampling policy can help the model escape poor local configurations more effectively.

Conclusion

HeteroSampler demonstrates that inference can be treated as a learnable policy rather than a static procedure. By using cheap meta-features to guide sampling, the framework achieves significant speedups with negligible overhead. Future work may explore learning these features directly from data or extending the policy to decide how to sample in addition to where.

Summary updated

BibTeX
@inproceedings{shi2015learning,
  author = {Tianlin Shi and Jacob Steinhardt and Percy Liang},
  title = {{Learning Where to Sample in Structured Prediction}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2015},
}
Figure