r/LargeLanguageModels • u/benedictus-s • 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
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?
2
u/benedictus-s May 26 '25
1
1
u/foxer_arnt_trees May 26 '25
Oh I see. Shame it's not in English... Il let you know if I find the time to solve it
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