by coder68 · 1y ago · 0 comments
I have stopped trying to use LLMs for this project and switched to discriminative models (Logistic Regression with TFIDF or Embeddings), which are both more computationally efficient and more debuggable. I'm not entirely sure why, but for anything with many possible answers, or to which there is some subjectivity, I have not had success with LLMs simply due to inconsistency of responses.
For VERY obvious tasks like: "is this store a restaurant or not?" I have definitely had success, so YMMV.
I've found encoder only models to be vastly better for anything that doesn't require natural language responses and the majority of them are small enough that _pretraining_ a model for each task costs a few hundred dollars.
In my original comment this is what I was referring to: using the embeddings produced by these models, not using something like GPT to classify text (that's wildly inefficient and in my experience gets subpar results).
To answer your question: you simply use the embedding vector as the features in whatever model you're trying to train. I've found this to get significantly superior results with significantly less examples than any traditional NLP approach to vector representation.
> What are you pre-training on, and for what task?
My experience has been that you don't need to pretrain at all. The embeddings are more information rich than anything you could attempt to achieve with other vector representations you might come up with using the set of data you have. This might not be true at extreme scales, but for nearly all traditional nlp classification tasks I've found this to be so much easier to implement and so much better performing there's really not a good reason to start with a "simpler" approach.
Others have had success with SetFit as the training framework and Ettin as the base model.
I have also considered training a small language model for synthetic data generation.
For example:
If contains cafe and not internet/cyber/etc -> restaurant
No -> (tfidf) -> yes, no, unsure
unsure -> embeddings -> yes, no, unsure
unsure -> llm -> yes, no, unsure
unsure -> human queue ->...
One big benefit is that it uses the cheapest and most understandable approaches for the majority of cases, and scales up quite nicely. It has a neat place for very custom issues to be fixed too.
There will always be some things that simple approaches think are clear but aren’t, which is awkward but then all pipelines end up with that somewhere.
Edit - you can also deploy things earlier if you start from the beginning of the chain. Moving from big deploy to iteration on the remaining issues is often a win just in deployment issues.
re: inconsistencies in output, OpenAI provide a seed and system_fingerprint options to (mostly) produce deterministic output.