Show HN: Predictive text using only 13kb of JavaScript. no LLM
1–10 of 42 posts
Re: Show HN: Predictive text using only 13kb of JavaScript. no LLM
#2Re: Show HN: Predictive text using only 13kb of JavaScript. no LLM
#3Re: Show HN: Predictive text using only 13kb of JavaScript. no LLM
#4Seeing that you use Obsidian: Have you thought about turning that into an Obsidian plugin that offers the predictions as editor suggestions?
Re: Show HN: Predictive text using only 13kb of JavaScript. no LLM
#5So this is basically a Markov chain right?
Re: Show HN: Predictive text using only 13kb of JavaScript. no LLM
#6Re: Show HN: Predictive text using only 13kb of JavaScript. no LLM
#7Re: Show HN: Predictive text using only 13kb of JavaScript. no LLM
#8Earlier quoted context omitted.
I don't think so. It's basically just traversing nested arrays and picking a random member on each level.
Yep. Sounds like a Markov chain to me.
Re: Show HN: Predictive text using only 13kb of JavaScript. no LLM
#9What is amazing to me is this: imagine that English only had 10,000 words. For each of those 10,000 words there’s 100 valid subsequent words. So there’s 1 million valid bigrams. Now if you want trigrams that takes you to 100 million, and for 4-grams it’ll be 10 billion. Just for that, you’d need 14 bytes per word and gigabytes of storage.
LLMs typically have context windows in the hundreds if not thousands. (Back in my day GPT2 had a context window of 1024 and we called that an LLM. And we liked it.) So it’s kind of amazing that a model that can fit on a flash drive can make reasonable next token prediction on the whole internet and with a context size that can fit a whole book.