One of the most frequent questions that I am asked by my clients is how to tune LLM models on their data, whether it’s proprietary or data from certain public domain, like legal. In this article I will cover three archetypes how to achieve it.

The tradeoff between these archetypes is the cost and the effort required vs how domain specific the model is. If mostly general knowledge is required first archetype can be sufficient, but for more specific domains archetype number 3 is more relevant.

Here are the three archetypes:

  1. Use out of the box LLM API with the power of prompt engineering to pass context of your problem. In this case, you take a question and ask your model to give an answer. You may provide some context and a few examples as a context, and this is proven to improve the model quite a bit. This is a cost effective, easy to implement and requires careful prompt engineering. The model is limited mostly to general knowledge and the knowledge included in the limited context.

  2. Fine tune pre-trained LLM with your proprietary data. In this archetype, you take existing pre-trained model and train it further on proprietary data. Transfer learning can be another option in this case. This will still require GPU compute, probably on a cluster but not as expensive as training the model from scratch. The model will have a lot more domain specific knowledge than in the first archetype.

  3. Train your own LLM from scratch. This is the most expensive and hardest to implement archetype. The cost of training such a model is in hundreds of millions of dollars and training can last for months. Sam Altman estimated that the cost to train GPT-4 was about $100 million. An example of such model was trained by Bloomberg - BloombergGPT, which was trained on Bloomberg financial data.


If you like what I write, consider subscribing to my newsletter, where I share weekly practical AI tips, write my about thoughts on AI and experiments.
Photo by Gery Wibowo on Unsplash


This article reflects my personal views and opinions only, which may be different from the companies and employers that I am associated with.