Skip to main content

Add your description here

Project description

Conversational Markov

LLMs don't normally sound like they're talking to you. The LLM in its most basic state simply continues the text it's given. LLMs sound like they're talking to you when they're set up to always complete one side of a conversation.

Technically, there's nothing stopping you from making a Markov chain generator do this, too. Train it on prompts and responses delineated by a sentinel token, and then, during inference, you can make the starting state any given prompt followed by the sentinel, and it will autocomplete something that sounds like a fitting response.

This project explores that.
Now, practically, there are reasons Markov chain generators are not typically used this way: state size increases linearly with every extra word you want to be able to prompt the MCG with, and model size correspondingly increases exponentially. With just a few words and a decent sized corpus, you'll be running out of memory trying to load the whole thing.

This project is a naïve example of a Markov chain generator set up to respond to prompts, using an off-the-shelf library. It uses a state size of 3, enough to allow it to process just the first and last word of a prompt plus the sentinel token.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

conversational_markov-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

conversational_markov-0.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file conversational_markov-0.1.0.tar.gz.

File metadata

File hashes

Hashes for conversational_markov-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b332bd6ecce050a6b2a29f6bce277e31783d8c456c2192ed0a531a3d5fffb11b
MD5 ea3046085e3191938d9d4bb18b0aa1c0
BLAKE2b-256 6a9a87fe6f82f3a47d5489526bc44a2289a49e4bc6d8063654ccc490ddd368c7

See more details on using hashes here.

File details

Details for the file conversational_markov-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for conversational_markov-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db0340f301c2a99bc44e959fefe0d0653906aa5dca0e404140e692a4152496b9
MD5 00d620328184fe1386d42d74d5e5acf5
BLAKE2b-256 adcd6828ac9bfdf670a604e9bc164af6dc5dbad83c08a18aa0e815940ea17020

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page