Answers.Body: <p>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.</p>
  <p>An example of this approach at this URL: <a href="https://jameshwade.com/posts/2023-03-10_vectorstores.html" rel="nofollow noreferrer">https://jameshwade.com/posts/2023-03-10_vectorstores.html</a>.</p>
  <p>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.</p>
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-20T16:51:57.267Z
Answers.LastActivityDate: 2023-11-20T16:51:57.267Z
Answers.UserDisplayName: Harsh Gill
Answers.Body: <p>There are few options for that</p>
  <ul>
  <li><p><strong>Fine-tune GPT:</strong> You can fine-tune the GPT model on a specific book directly with data from the book as context and use that book later on for prompt Response. This is the best approach when you want responses for similar content.</p>
  </li>
  <li><p><strong>Chunking:</strong> You can convert the whole book into chunks which is digestible by GPT or LLM models convert the book to Embeddings and later on use a retrieval-based system to get the results. It will not require fine-tuning of the LLM but fetches a similar result of the Query or prompt. It is good when you want to create LLM LLM-based search engine.</p>
  </li>
  <li><p><strong>Agent-Based:</strong> You can train some agents based on the book, first get all the embeddings for the book, and store in some vector DB. Build some sort of agent to find content similar to the query and feed that query with the context fetched to the GPT. This is better when you want to create multiple book Agents and sort of things.</p>
  </li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-11-20T16:43:31.150Z
Answers.Text: can you provide links on fine-tuning GPT for a specific book?
Answers.UserDisplayName: mrtpk
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-04T13:49:47.290Z
Answers.LastActivityDate: 2024-01-04T13:49:47.290Z
Answers.UserDisplayName: Hiren Namera
Body: <p>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 &quot;knows&quot; 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.<p>
  Most use cases these days regarding own content seems to be stuff like &quot;chat with your documents&quot; or such. But this seems much easier due to context length and the lack of coherence between documents. <br>
  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 &quot;simply&quot; by splitting the text into chunks and embedding them?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-11-21T01:56:11.320Z
Comments.Text: 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.
Comments.UserDisplayName: Brian O'Donnell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-01-04T11:52:12.297Z
Comments.Text: can I please ask how you got on with this? I'm looking to do the same with a book.
  Thanks!
Comments.UserDisplayName: GeoffWhite
Tags: <embeddings><large-language-models><fine-tuning>
Title: How can I teach a book to an LLM?
UserDisplayName: dschuld
ThreadText: # How can I teach a book to an LLM?
  
  (Asked by: username_0 on 2023-09-21)
  
  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?
  
  **Tags:** embeddings, large-language-models, fine-tuning
  > **Comments:**
  > **username_1**: 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.  
  > **username_2**: can I please ask how you got on with this? I'm looking to do the same with a book. Thanks!  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2023-11-20. Score: 2
  
  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.
  
  
  ---
  
  ### Answer by username_4 on 2024-01-04. Score: 1
  
  There are few options for that
  
  * **Fine-tune GPT:** You can fine-tune the GPT model on a specific book directly with data from the book as context and use that book later on for prompt Response. This is the best approach when you want responses for similar content.
  * **Chunking:** You can convert the whole book into chunks which is digestible by GPT or LLM models convert the book to Embeddings and later on use a retrieval-based system to get the results. It will not require fine-tuning of the LLM but fetches a similar result of the Query or prompt. It is good when you want to create LLM LLM-based search engine.
  * **Agent-Based:** You can train some agents based on the book, first get all the embeddings for the book, and store in some vector DB. Build some sort of agent to find content similar to the query and feed that query with the context fetched to the GPT. This is better when you want to create multiple book Agents and sort of things.
  
  > **Comments:**
  > **username_5**: can you provide links on fine-tuning GPT for a specific book?  
  
  ---
  
  