Back to Feed
Training & Fine-Tuning / Benchmarks & Evals

Optimizing Memory for Recommender Training

Original: Batch Size or Negatives? A Selection Rule for Memory-Constrained Recommender Training

Listen to the summary

Uses a voice available on your device

Audio options
On this page 4 sections

Key Takeaways

  • Maximizing batch size while minimizing negative samples yields faster model convergence.
  • The research defines an optimal allocation rule of n = k = sqrt(B) for a fixed memory budget B.
  • The findings were validated using standard optimizers like SGD and Adam.
  • The proposed unbiased gradient estimation for class sampling meets the theoretical conditions of standard convergence proofs.

Summary & Methodology Analysis

When training recommender systems, developers often face a constrained memory budget that must be split between the batch size, which is the number of users processed at once, and the number of negative samples, which are the items the user did not interact with used to calculate loss in a sampled-softmax approach. Sampled-softmax is an approximation technique used to compute the probability distribution over a massive catalog of items without calculating scores for every single product in the library. The authors treat the final softmax layer as a multi-class logistic regression problem to derive a convergence analysis, decomposing the variance of the gradient into two parts: one driven by the mini-batch size and one driven by the count of negative samples.

Interactive System Flowchart

Click diagram to expand and zoom

Cross-Examination & FAQs

A deeper dive clarifying mechanics, constraints, and baseline evaluations.

Q1. What is the main problem addressed by the authors?

The authors address how to best split a fixed memory budget between the batch size and the number of negative items during training.

Q2. What is the key takeaway for practitioners?

The research shows that it is better to prioritize a larger batch size over a higher number of negative samples to reach faster convergence.

Q3. Does this require new specialized hardware?

The paper does not specify any new hardware requirements.

Q4. What is the specific rule for memory allocation?

The paper suggests using the rule n = k = sqrt(B), where n is the batch size, k is the number of negative classes, and B is the total memory budget.

Q5. How did the authors validate their findings?

They tested their rule across sequential recommendation benchmarks including SASRec, BERT4Rec, gSASRec, MovieLens-20M, MovieLens-1M, Gowalla, and Netflix using SGD and Adam optimizers.

Q6. Does the unbiased gradient correction improve performance?

No, the authors state that the proposed unbiased correction does not provide significant empirical performance improvements over the standard baseline.

Q7. Are there limitations to this research?

The authors suggest that larger experiments with more diverse architectures are needed to strengthen the findings, and they acknowledge that their proposed correction does not boost performance.

Q8. Is this applicable to all recommender architectures?

The paper suggests that experiments with more diverse architectures could further strengthen their findings.

Q9. What is the impact on training speed?

The analysis confirms that following the n = k = sqrt(B) rule leads to faster model convergence.