Ask HN: What are some good architectures for building recommendation systems?
I have been working on AI/recommendations(for music) for a while now and run a few experiments with some ALS models which have shown promising results during A/B tests. Would like to build a proper recommendation system with online and offline models. I have searched around and elastic search and Solr come up as good ways of building one (reduce the recommendation problem to an implicit search problem) but after talking to a few folks at work it seems like it may not be the most scalable or simplest solution for us. What are some other architectures to consider? Are there any good resources for this? After a lot of searching, I have not been able to find much other than the aforementioned Solr/elasticsearch solutions.
Here are a few links I found online while researching this.
https://www.elastic.co/blog/looking-at-content-recommendation-through-a-search-lens
https://mapr.com/blog/inside-look-at-components-of-recommendation-engine/#.VSv8o_nF81J
11 comments
[ 4.2 ms ] story [ 36.1 ms ] thread1. Decide whether you are okay with a batch approach or an online learning approach or a hybrid.
2. Start simple with a batch approach (similar to what you are doing):
a) Get features ready from your dataset (assuming you have interaction data) : Pre-processing via some big data framework (Map Reduce, Data flow etc)
b) Build a vector space and nearest neighbors datastructures.
c) Stick both into a database optimized for reads
d) Stick a service in front of it and serve.
Once you are happy with 2, you can try out variations involving either online updates to your recommender system which involves changes to the type of database you might want to optimize. etc
In the past, I have helped build Lambda architectures where we use a batch model to build a content vector space, build estimates of users in batch, update those in realtime (using PubSub/Kafka) based on user feedback.
Other online mechanisms could be to use Contextual Bandits: e.g. use context in terms of user interactions with the several arms of the bandits being recommendation choices etc. This interaction data can be used to continuously improve your policy. Of course, the key benefit over a Matrix Factorization setup where the interaction matrix is continuously rebuilt over time based on new data, is the in built exploration which minimizes regret.
At the moment, keras embedding model, multiprocessing, annoy, and emitting csv (object id, other object id, score) as a batch process and loading it in my database. Queryti recommend. This trades a prebuilt for near instant runtime and — near Nothing net new to break.
I’m working at commercial — 2-5 million item — scale, not ‘internet scale’ billions of items.
Hope that helps.
Also you can check 'Mahout in Action' book - part 1 is about recommendations and it explains everything that you need to know for building your own recommendation engine.
Fortunately, building a recommendation system is not that hard. Google and read up on postgresql's ts_vectors and refresh your linear algebra. You probably will have to make some trade-offs; the more personalized the recommendations, the less likely it is to scale well.
Note: It was over seven years since I worked with a recommendation system. The prebuilt solutions might have improved since then.