How to control the target category for generative recommendations?
Thanks for your great work!
I'd like to know if there's a way to control which item categories are generated during the recommendation process. For example, if I want to recommend items only from specific categories, how can I configure this?
Is this currently supported out-of-the-box, or would I need to modify the code and retrain the model to achieve this? Do you have any suggestions or recommendations on how to approach this?
Additionally, I'm wondering if it's possible to input N categories simultaneously and generate recommendations for all N categories at once. What would be the best way to modify the code to achieve this?
Hello, thank you for your interest in our work! Could you please provide more details about your requirements? Are you planning to apply our framework to cross-domain recommendation? How exactly are you defining “category”? At the moment, we do not support limiting recommendations to specific item categories.
Thanks for your reply! Let me clarify my use case more concretely.
In my scenario, each item in the dataset has a simple category attribute, such as shorts, short-sleeve, long-sleeve, etc. This is not cross-domain recommendation, but just a single-domain dataset where each item belongs to a product category.
What I would like to achieve is:
Category‑restricted recommendation During inference, I would like to control which categories the model can recommend. For example, if I specify the category “shorts”, the model should only generate candidate items whose category is “shorts”.
Multi‑category input → multi‑SID output If I input multiple categories (e.g., “shorts” + “short‑sleeve”), I would like the model to generate multiple SIDs simultaneously, where each SID corresponds to one category. For example:
SID1 → recommended items from category “shorts” SID2 → recommended items from category “short‑sleeve” My questions are:
• Is there any way to restrict the generation space to specific item categories during inference? • If not supported yet, would this require modifying the generation logic, training data, or both? • Do you have any suggestions on how to implement such category‑controlled recommendation in MiniOneRec?
Thanks again for your time—I'd love to hear your thoughts.
Hello, regarding your questions: Currently, the functionality you need is not fully supported, but I believe that with minor modifications to the “constrained decoding” part of our existing code, it should be possible to achieve. You can pre‑construct constrained codebooks for different item categories, and then, during inference, control the model to generate candidate items only from the restricted codebook corresponding to the required category.
For your requirement 1: Extract the category information from the input, and during decoding, use the corresponding category‑specific codebook.
For requirement 2: Extract multiple categories from the input, and perform multiple beam_search runs (a few for each category, rather than our current “single beam search generating multiple outputs”), so that each run generates items for one specific category.
What you need is only a small modification to the generation logic:
In minionerec.trainer, construct the allowed prefix‑ID sets based on the given categories. During RL training and inference, specify the corresponding constrained codebook according to your needs. I hope this addresses your questions! Also, if you don’t mind, feel free to submit pull requests to us.