1
$\begingroup$

I am trying to find out how I can teach the content of a whole, multiple hundert pages book to an LLM so that it "knows" all details and can be queried, give summaries etc. The book is one consistent story, private and has never been published. I thought training LLM on a long book would be a common use case, but I found surprisingly little information about this.

Most use cases these days regarding own content seems to be stuff like "chat with your documents" or such. But this seems much easier due to context length and the lack of coherence between documents.
I am not an ML expert but know the basics of embeddings and fine tunings. Is either of these approaches better suited? How could a raw book be turned into a proper training data set for fine tuning a model? This could not be done manually, as the length is almost a million words. Or could it work "simply" by splitting the text into chunks and embedding them?

$\endgroup$
1
  • $\begingroup$ Have you tried Claude 2 which has a context of about 235 pages? Maybe you could summarize each chapter using the Claude 2 app, then put the summaries together as an abridged book, reset Claude, and give it the document and submit your prompts. That would be a relatively quick approach that doesn't require any programming. ChatGPT 4 Turbo will have a context of about 300 pages. $\endgroup$ Nov 21 at 1:56

1 Answer 1

1
$\begingroup$

Using embeddings is an effective approach when you have limited data, such as a book, and want to extract relevant context and related text for querying.

An example of this approach at this URL: https://jameshwade.com/posts/2023-03-10_vectorstores.html.

The idea behind using embeddings is to train a model to understand the semantic relationships within the document and use that knowledge to provide accurate responses.

Another option for improving model performance is fine-tuning, but it typically requires a larger amount of data, specifically data that includes the desired prompts and corresponding answers. So if you dont have alot of good data relating to prompting, embeddings would be the way id suggest.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .