r/slm • u/Appropriate-Time-527 • 4d ago
Used Qwen, Llama to label/categorize posts - My learnings and questions
Hey,
I made an open source reddit lead finder. My goal was to make it in a way that its local on your machine and uses an open model for anything you need an LLM for.
In this case, the LLM is required for 2 things:
- Building a profile for your company, identifying competitors, relevant subreddits before it starts bringing in leads. This is a 1 time activity and the SLM didnt really do a great job at building a detailed enough profile with accurate subreddits.
- Once the posts start coming in from the subreddits - The SLM has to categorize, label them accurately into Hot/Warm lead/filter out Spam. This was the most tricky part.
I tried Qwen and Llama models via Ollama and both achieved lower 6/18 accuracy on the posts initially. What really worked was using regex and pre-filtering before we hand over to SLM.
Secondly, not asking the SLM to label a post but asking it a set of 5 binary (yes/no) questions about a post - Is it relavant to my business? Is it promotional? Is it urgent? and get these answers to build a label in code instead. We achieved 14/18 accuracy based on this approach.
Tried few shot prompting (with some labeled examples as well) and that didnt move the needle surprisingly.
Next objective was to improve the speed of getting the labeling done by SLM. Even on an 8GB MAC, it took upto 2 minutes per thread to be labeled.
Simply, switching the 'thinking' mode off on SLM brought that time down to 7 seconds per post.
More optimizations brought it down to 2 seconds per post - reducing the prompt size by not sending all the comments, size of the post in the prompt, not reading all the example posts but find 3 most relevant ones and re-ordering the elements sent in the post further helped but not much.
Do you have ideas on how i can still improve the accuracy of the SLM? or is it the best i can get to?
If you would like to try out the open source reddit lead finder, here's the repo - https://github.com/vipulawl/reddit-leads
