Generate all possible sentences using a fine-tuned GPT-2 model
# ❓ Questions & Help

<!-- The GitHub issue tracker is primarly intended for bugs, feature requests,
     new models and benchmarks, and migration questions. For all other questions,
     we direct you to Stack Overflow (SO) where a whole community of PyTorch and
     Tensorflow enthusiast can help you out. Make sure to tag your question with the
     right deep learning framework as well as the huggingface-transformers tag: 
     https://stackoverflow.com/questions/tagged/huggingface-transformers 
     
     If your question wasn't answered after a period of time on Stack Overflow, you
     can always open a question on GitHub. You should then link to the SO question 
     that you posted.
     -->

## Details
<!-- Description of your issue -->

Is there a way to generate all possible sentences using a fine-tuned GPT-2 model given a certain sampling technique? For some reason I wan to exhaust all possible combination of tokens given a fine-tuned GPT-2 model with certain sampling technique. Is it doable? If it is not, how do we get an estimate of how many possible sentences are there in the latent space?

<!-- You should first ask your question on SO, and only if
     you didn't get an answer ask it here on GitHub. -->
**A link to original question on Stack Overflow**: 
What do you mean exactly be all possible sentences? 

The space of possible sentence that could be generated grows exponentially with the length of the sentences. Having **V** words in your vocabulary, there are **V^N** possible sentences of length **N** that could be sampled. If **V ~ 50,000** and **N = 10**, you are already at > 10^40 possibilities which is intractable.<|||||>Thanks for the reply. By all possible sentences I meant all possible sentences under some certain sampling technique. For example, if I want all possible sentences with top-k=1, there would be just 1 in the space. I can control the desired number of possible sentences by choosing sampling techniques at a certain level of strictness. However, I don't want to do a sampling, I want to find all of them by some BFS or DFS. What I plan to do is find some desired sampling technique so that there are say 1 million unique sentences in the space, then find out all of them. The provided util in the package only does sampling which could generate duplicate sentences. Does that make sense?