← Back to context

Comment by unoti

2 years ago

It's true that Markov chains are very limited in their capabilities. But one thing I love about them is that they are one of the simplest and most intuitive ways to write code that *learns* from input data.

If you're never written something that *learns*, try it out! Here's a very primitive one I wrote recently to explain the basic idea and explains it along the way.

https://github.com/unoti/markov-basics/blob/main/markov-basi...

This starts with generating US city names, and ends with generating text based on the Dungeons and Dragons DM guide.

> that they are one of the simplest and most intuitive ways to write code that learns from input data

Linear regression is significantly simpler and also learns from input data.

  • Markov chains are basically lookup tables. I don't see how linear regression is simpler that that.

    • Markov chains aren't lookup tables... Markov chains is the description of a process where you generate the next step by looking at preceding steps, that can be a lookup table but it can also be more complex like modern LLMs.

Thank you for sharing this! The implementation and examples were super intuitive.