What it is used for

A Boltzmann machine is designed for problems made of many small constraints that must be satisfied together. Each connection between units carries one weak constraint, and the network searches for the arrangement of states that satisfies the most of them at once. Because the network learns from examples, it can also interpret examples that arrive later: given a partial example, the network can complete it by finding the internal arrangement that best generates that example.

The original form is now rarely used directly, but its descendants have worked on real tasks. Its restricted variant was used to read patterns in movie ratings and give recommendations, and stacks of that variant became the building material of deep belief networks, one of the triggers of the deep learning revival in 2006. Both uses are proven in the Real examples and Expert level chapters below.

How to use it

There is no product named Boltzmann Machine that an end user installs. What happens is that a researcher prepares a set of examples, then lets the network fluctuate randomly from one arrangement of states to another. Arrangements that fit the learned constraints appear more often, and the strengths of the connections between units, called weights in this corpus, are shifted little by little until the arrangements the network produces resemble the examples it was shown.

For today's reader, the most likely way to meet this idea is through its descendants. The restricted Boltzmann machine simplifies this network's connections into two layers, and that is the form that spread through recommendation systems and feature learning in the era before today's models. This article explains the original form, because the whole family starts from it.

Real examples

The following examples are not invented for this article. Both are recorded in primary papers written by the researchers themselves.

The first example is the experiment in the founding paper itself, in 1985. Its authors ran simulations of the encoder problem, the problem of training a network to pass a pattern through a narrow middle layer, and showed one good solution for a 4-2-4 arrangement: four units on the input side, two units in the middle, and four units on the output side. In that experiment all weights were incremented or decremented by a fixed weight step of 2, following the difference between the network's behavior while clamped to an example and while running freely. The authors themselves honestly recorded that their experiments had to stay small, because simulation on a sequential computer of that era was very slow and this learning method demands a great many rounds of gradual cooling.

The second example comes from its descendant, two decades later. In 2007, Ruslan Salakhutdinov, Andriy Mnih, and Geoffrey Hinton applied the restricted Boltzmann machine to the Netflix data set of user ratings of movies. The abstract of their paper states, reading exactly: "RBM's can be successfully applied to the Netflix data set, containing over 100 million user/movie ratings." The result was measurable: this model slightly outperformed carefully tuned SVD models, and when the predictions of multiple restricted Boltzmann machine models and multiple SVD models were linearly combined, the error rate was well over 6 percent better than the score of Netflix's own system.

Practitioner level

The units of a Boltzmann machine fall into two groups. Visible units are the network's interface with the outside world; during training, the states of the visible units are set to follow the given example, a state the paper calls clamped. Hidden units work inside and capture regularities that cannot be expressed by pairwise constraints among the visible units alone; the founding paper gives the example of needing a hidden unit when three visible units are required to follow an even parity pattern, a regularity that pairwise interactions alone cannot enforce.

Connections between units are symmetric: a connection has the same strength in both directions. Its learning rule compares two states. While the network is clamped to an example, record how often each pair of units is on together. While the network runs freely with no input, record the same thing. Each weight is then changed in proportion to the difference between the two records, so pairs that are on together more often in the examples than in the network's own imaginings are strengthened. The founding paper stresses that this rule uses only locally available information, namely the behavior of the two units that the weight itself connects.

So that the network does not get trapped in an arrangement that is merely passable, the search starts at a high temperature, when the network ignores small differences and moves quickly, and the temperature is then lowered gradually. This method is called annealing, following the way materials are tempered in physics. Its price is high: every round of learning demands that the network be left until it reaches its settled state, called thermal equilibrium, and that demand repeats a very large number of times. The two shortcuts that later made this family practical are these. The restricted Boltzmann machine removes connections within a single layer, so visible and hidden units form two layers connected only between layers. And a learning method named contrastive divergence, proposed by Hinton in 2002, replaces the long free running phase with a short run that starts from the data.

Expert level

Diagram of a Boltzmann machine example

*Diagram of a Boltzmann machine example: circles are units and lines are the weighted connections between units. Work by Sunny vd, public domain, via Wikimedia Commons.*

A Boltzmann machine is an energy based model. Every global arrangement of units has an energy, and at thermal equilibrium the probability of the network being in an arrangement follows the Boltzmann distribution over its energy: low energy arrangements are more likely to appear. Learning means shaping that energy surface through the weights and biases, until the distribution over visible unit arrangements when the network runs freely matches the distribution of the examples it was shown. The founding paper calls that state of full agreement a perfect model of its environment, and shows that the gradient of the mismatch between the two distributions reduces to a simple local rule: the change in a weight is proportional to the difference between the probability of two units being on together in the clamped phase and in the free phase.

Its most important descendant is the restricted Boltzmann machine, a two layer undirected graphical model that is the subject of the Netflix paper above. In 2006, Hinton, Osindero, and Teh showed that stacks of restricted Boltzmann machines can be trained one layer at a time in a greedy way to build a deep belief network, with the top two layers forming an undirected associative memory. After fine tuning, the result is stated in that paper's abstract, reading exactly: "After fine-tuning, a network with three hidden layers forms a very good generative model of the joint distribution of handwritten digit images and their labels." That generative model gave better digit classification than the best discriminative learning algorithms of the time, and this result is often pointed to as one of the openers of the deep learning revival. One author of the Boltzmann machine, Geoffrey Hinton, is the same person at both ends of this history, and this corpus has its own article about him.

Limits and risks

The greatest weakness of the Boltzmann machine was admitted by its authors from the start: its learning method is very slow. The 1985 paper itself states that the current version of its learning algorithm was very slow, and simulation on the sequential computers of the era limited experiments to small networks. The fully connected original form never became a daily tool; what spread was its restricted variant, and even that is now studied more often as history and foundation than used in new systems.

There is also a limit attached to every model that learns from examples. This machine imitates the distribution of the examples it is shown, including the shortcomings and biases of those examples, and the new examples it generates are the product of imitating patterns, not proof that their content is true. The output of such a model therefore remains raw material that must be checked, especially when it is used for important decisions.