AI Does Not Always Need a Neural Network: Markov Chain
Word prediction with a Markov chain, from transition counts to probabilities for the next word.
A Markov chain predicts the next word from the last one to three words alone. It needs no neural network for that, only counted transitions. Because it learns its probabilities from example sentences, it is one of the simplest methods of machine learning and therefore of AI. This page works through the method on 14 short sentences and shows what a language model such as GPT adds on top.
Choose the order, the starting context, and the selection method at the top. Press "Play" and the computation runs by itself, or use the step list to jump to any point. The corpus is German. "myBytes ist Ihr Deep-Learning-Spezialist" means "myBytes is your deep learning specialist."
All computations run in your browser. Teaching example, not a production forecast.
What the View Shows and Where It Ends
Training means counting. For each state, that is, the last one to three tokens, the model records which token follows and how often. The counts become probabilities when each count is divided by the sum of all outgoing transitions of that state.
The limit of the method is its memory. Words outside the window have no influence, and a state that never occurred in the corpus has no successor. A higher order sees more context but spreads the little data across more states.
The corpus consists of 14 short German example sentences about myBytes and AI and is deliberately tiny. They are promotional lines used here as training material, not verified statements. This page is a teaching example and not a language model for production use.
More Interactive Models
If you have a question about this, just give us a call: +49 40 60940415.