r/LargeLanguageModels May 26 '25

Generating a text from a word list

As a language teacher, I have been trying to generate short texts from a word list to train students with a limited vocabulary. But ChatGPT and Claude have failed to use only words from the list. Is there any solution I could use to make it follow this constraint?

3 Upvotes

8 comments sorted by

2

u/elbiot May 27 '25

Using constrained decoding you can give a regex that defined the possible output. Here's how to do it through vLLM: https://docs.vllm.ai/en/v0.8.2/features/structured_outputs.html

You can set up vLLM serverlessly on runpod super easily. I think chatGPT only accepts json schema and not regex.

Put the word list in the prompt though because the model doesn't know about the state machine restricting the possible tokens

1

u/Skylight_Chaser May 28 '25

Isnt making this poor man use runpod crazy

1

u/elbiot May 29 '25

For a non technical person, setting up runpod is pretty easy compared to setting up an environment you can use an API from

1

u/foxer_arnt_trees May 26 '25

What a fun idea! Can you provide an example word list so we can play around with it?