ArticleslgStudy

computer science

Stochastic computing

Stochastic computing is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Stochastic computing rather than just read about it. In short: Stochastic computing is a collection of techniques that represent continuous values by streams of random bits. Complex computations can then be computed by simple bit-wise operations on the streams.

Stochastic computing — main illustration
Stochastic computing — illustration

Key takeaways

  • Stochastic computing belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Stochastic computing to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Stochastic computing from memory before moving on to harder problems.

Reference excerpt

Stochastic computing is a collection of techniques that represent continuous values by streams of random bits. Complex computations can then be computed by simple bit-wise operations on the streams. Stochastic computing is distinct from the study of randomized algorithms.

Motivation and a simple example Suppose that p , q ∈ [ 0 , 1 ] {\displaystyle p,q\in [0,1]} is given, and we wish to compute p × q {\displaystyle p\times q} . Stochastic computing performs this operation using probability instead of arithmetic. Specifically, suppose that there are two random, independent bit streams called stochastic numbers (i.e. Bernoulli processes), where the probability of a 1 in the first stream is p {\displaystyle p} , and the probability in the second stream is q {\displaystyle q} . We can take the logical AND of the two streams.

The probability of a 1 in the output stream is p q {\displaystyle pq} . By observing enough output bits and measuring the frequency of 1s, it is possible to estimate p q {\displaystyle pq} to arbitrary accuracy. The operation above converts a fairly complicated computation (multiplication of p {\displaystyle p} and q {\displaystyle q} ) into a series of very simple operations (evaluation of a i ∧ b i {\displaystyle a_{i}\land b_{i}} ) on random bits. To put in another perspective, assuming the truth table of an AND gate. Conventional interpretation is that the output is true if and only if input A and B are true. However, if the table is interpreted vertically, (0011) AND (0101) is (0001), i.e., 1/2 x 1/2 = 1/4, which is exactly an arithmetic multiplication. As the information is presented in probability distribution, probability multiplication is literally an AND operation.

More generally speaking, stochastic computing represents numbers as streams of random bits and reconstructs numbers by calculating frequencies. The computations are performed on the streams and translate complicated operations on p {\displaystyle p} and q {\displaystyle q} into simple operations on their stream representations. (Because of the method of reconstruction, devices that perform these operations are sometimes called stochastic averaging processors.) In modern terms, stochastic computing can be viewed as an interpretation of calculations in probabilistic terms, which are then evaluated with a Gibbs sampler. It can also be interpreted as a hybrid analog/digital computer.

History

Stochastic computing was first introduced in a pioneering paper by John von Neumann in 1953. However, the theory could not be fully developed until advances in computing of the 1960s,

mostly through a series of simultaneous and parallel efforts in the US and the UK. By the late 1960s, attention turned to the design of special-purpose hardware to perform stochastic computation. A host of these machines were constructed between 1969 and 1974; RASCEL is pictured in this article. Despite the intense interest in the 1960s and 1970s, stochastic computing ultimately failed to compete with more traditional digital logic, for reasons outlined below. The first (and last) International Symposium on Stochastic Computing took place in 1978; active research in the area dwindled over the next few years. Although stochastic computing declined as a general method of computing, it has shown promise in several applications. Research has traditionally focused on certain tasks in machine learning and control.

Somewhat recently, interest has turned towards stochastic decoding, which applies stochastic computing to the decoding of error correcting codes. More recently, stochastic circuits have been successfully used in image processing tasks such as edge detection and image thresholding. Recent advancement in stochastic circuits also shows promising speed and energy efficiency advantages in artificial intelligence (AI) hardware acceleration on edge computing.

Strengths and weaknesses Although stochastic computing was a historical failure, it may still remain relevant for solving certain problems. To understand when it remains relevant, it is useful to compare stochastic computing with more traditional methods of digital computing.

Strengths Suppose we wish to multiply two numbers each with n {\displaystyle n} bits of precision. Using the typical long multiplication method, we need to perform

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Stochastic computing

Start with the simplest possible case. Write down what Stochastic computing claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Stochastic computing before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Stochastic computing ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Stochastic computing

In research
Stochastic computing appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Stochastic computing in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Stochastic computing is common in secondary-school and first-year university syllabi. It links to neighbouring topics History of computing hardware, Models of computation, Statistical randomness, so understanding it makes those chapters shorter.
In everyday life
Look for Stochastic computing outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Stochastic computing in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Stochastic computing means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Stochastic computing out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Stochastic computing in simple terms?

Stochastic computing is a collection of techniques that represent continuous values by streams of random bits. Complex computations can then be computed by simple bit-wise operations on the streams.

Why does Stochastic computing matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Stochastic computing?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Stochastic computing.

Tags

  • History of computing hardware
  • Models of computation
  • Statistical randomness

Keep exploring