Ask HN: How do I train a custom LLM/ChatGPT on my own documents in Dec 2023?
800 pointsThere is a 5 month old thread [1] on this, but it might be already outdated.
What is the best approach for feeding custom set of documents to LLM and get non-halucinating and decent result in Dec 2023?
UPD: The question is generally about how to "teach" LLM answer questions using your set of documents (not necessarily train your own, so approaches like RAG counts)
[1] https://news.ycombinator.com/item?id=36832572
Comments (237) 63 threads
Show all comments
Showing thread 3 of 63
You have to upload your documents to S3, create a “Knowledge Base” then sync your documents into a vector database like OpenSearch or PineCone. You are then good to go via their playground or the AWS API.
I made a video here describing the process, check around 14 minutes in:
https://ensembleanalytics.io/blog/introducing-bedrock-knowle...
Bedrock is a decent product I think. All of the models in one place (apart from the big dogs from OpenAI) and a common API across them.
Continue this thread — 2 replies
AWS OpenSearch has fairly good integration so you could look up costs for that. It’s not the cheapest AWS service to run and not exactly serverless as you pay by the hour.
This isn't the same as the training data the LLM is trained on. As a result, it doesn't take advantage of the entire document set. So, if you have a billion documents, only 1-3 chunks will be picked for the final answer. When you know a question spans many many documents, the answer is never going to cover that.
You could make a recursive also where you parse all the chunks, generate summaries of those and then pass them to the next chunk sequentially and so on. But you can imagine how expensive and slow that will be. It might still work for you but this is a very lossy approach.
If you have that much data in your vdb, and the user is querying a slice, it just won't do to have them ask something too generic, they need to be asked to be specific.
Ie "what was that thing from last year?" "Sorry, could you be more specific?" "Oh uh the thing to do with the financial reports" "Financial reports, yes, what about them?" "It was something to do with the way we generate them" "Ah yes, the generation of financial reports; last year in December your team leader said on Slack...etc"
I agree it is high and it is not exactly serverless. You pay by the hour.
Bedrock itself is charged based on tokens exchanged.
I think Pinecone is a cheaper database for hobby and small business projects, though I haven't looked into it.
You can reduce a lot by committing to a 6-month contract, but it won't get cheaper than about ~$5,000/mo.
That's prohibitively expensive for small projects.
Fine tuning GPT 3.5 is much cheaper.
Continue this thread — 1 reply