# 矩阵分解（推荐系统）

推荐系统中的**矩阵分解**是一种基于嵌入的协同过滤技术，它为每个用户和每个物品学习一个潜在因子向量，使得用户向量与物品向量的点积能够预测该用户对该物品的偏好。给定一个包含 \( m \) 个用户和 \( n \) 个物品的反馈矩阵 \( A \in \mathbb{R}^{m \times n} \)，模型学习一个用户嵌入矩阵 \( U \in \mathbb{R}^{m \times d} \) 和一个物品嵌入矩阵 \( V \in \mathbb{R}^{n \times d} \)，使得 \( U V^T \) 逼近 \( A \)，其中嵌入维度 \( d \) 通常远小于 \( m \) 或 \( n \)。<sup>[1](https://developers.google.com/machine-learning/recommendation/collaborative/matrix)</sup> 该技术在2006年[奈飞奖](https://www.edgepedia.org/zh/netflix-prize)（Netflix Prize）竞赛中扮演了重要角色，此后成为商业协同过滤系统的核心。<sup>[2](https://gwern.net/doc/ai/tabular/2009-koren.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 模型形式 | 用户矩阵 \( U \in \mathbb{R}^{m \times d} \) 和物品矩阵 \( V \in \mathbb{R}^{n \times d} \)；\( U V^T \) 的 \((i,j)\) 项是点积 \(\langle U_i, V_j \rangle\)，训练使其接近 \( A_{ij} \)<sup>[1](https://developers.google.com/machine-learning/recommendation/collaborative/matrix)</sup> |
| 紧凑性 | 完整矩阵有 \( O(nm) \) 个元素，而嵌入只有 \( O((n+m)d) \) 个，在现实系统中节省显著<sup>[1](https://developers.google.com/machine-learning/recommendation/collaborative/matrix)</sup> |
| 标准优化器 | 交替最小二乘法（ALS），Spark MLlib 中的默认方法，秩为10、迭代10次、正则化参数为1.0<sup>[3](https://spark.apache.org/docs/3.5.7/ml-collaborative-filtering.html)</sup> |
| 奈飞奖 | 2006年的竞赛，基于约50万名客户对超过17000部电影的逾1亿条评分；将RMSE降低10%即可获得100万美元奖金；BellKor以8.43%的改进幅度赢得2007年进度奖，以9.46%的改进幅度赢得2008年进度奖<sup>[2](https://gwern.net/doc/ai/tabular/2009-koren.pdf)</sup> |
| 生产环境结果 | 在奈飞，仅矩阵分解（社区称之为SVD）就达到了0.8914的RMSE，而Cinematch为0.9525，与受限玻尔兹曼机进行线性融合后达到0.88<sup>[4](https://netflixtechblog.com/netflix-recommendations-beyond-the-5-stars-part-1-55838468f429)</sup> |
| 与神经模型对比 | 在适当的超参数选择下，点积显著优于学习到的MLP相似度，且MLP在生产环境的物品推荐中成本过高<sup>[5](https://arxiv.org/abs/2005.09683)</sup> |
| 主要局限 | 新用户和新物品没有学习到的因子，产生冷启动问题，促使人们采用数据驱动和混合缓解策略<sup>[6](https://openurl.ebsco.com/contentitem/doi%3A10.1007%2Fs10844-022-00698-5?id=ebsco%3Adoi%3A10.1007%2Fs10844-022-00698-5&sid=ebsco%3Aplink%3Acrawler)</sup> |

## 模型工作原理

该模型将推荐视为矩阵补全：用户-物品矩阵的大多数单元格是空的，因为用户只对一小部分物品进行评分或交互，而学习到的因子用于预测缺失的条目。一个常见的目标是最小化观测对上平方误差之和，

\[ \min_{U \in \mathbb{R}^{m \times d},\ V \in \mathbb{R}^{n \times d}} \sum_{(i,j) \in \mathrm{obs}} (A_{ij} - \langle U_i, V_j \rangle)^2. \]

仅对观测条目求和本身是不够的，因为一个不预测任何有用信息的模型仍然可以在观测值上取得低损失，但泛化能力很差；加权变体通过给未观测对也分配权重来解决这个问题。<sup>[1](https://developers.google.com/machine-learning/recommendation/collaborative/matrix)</sup>

**优化。** 两大类算法占主导地位。[随机梯度下降](https://www.edgepedia.org/zh/stochastic-gradient-descent)直接从损失中更新每个因子。[交替最小二乘](https://www.edgepedia.org/zh/alternating-least-squares)法则先固定 \( U \) 求解 \( V \)，再固定 \( V \) 求解 \( U \)；每个阶段归结为一个可以精确求解并分布到多台机器上的线性系统，且该过程保证收敛，因为每一步都降低损失。<sup>[1](https://developers.google.com/machine-learning/recommendation/collaborative/matrix)</sup> Spark MLlib 将ALS实现为其基于模型的协同过滤方法，暴露潜在因子数量（秩）、迭代次数和正则化参数。<sup>[3](https://spark.apache.org/docs/3.5.7/ml-collaborative-filtering.html)</sup> [托管服务](https://www.edgepedia.org/zh/managed-services)也采用相同的设计：BigQuery ML 使用 `NUM_FACTORS` 选项训练矩阵分解模型，并使用ALS进行显式反馈训练。<sup>[7](https://docs.cloud.google.com/bigquery/docs/bigqueryml-mf-explicit-tutorial)</sup>

## 显式与隐式反馈

标准公式将矩阵元素视为显式偏好，例如用户按等级对电影评分。<sup>[3](https://spark.apache.org/docs/3.5.7/ml-collaborative-filtering.html)</sup> 然而，大多数现实世界的数据是隐式的：浏览、点击、购买和收听事件表明用户采取了行动，但不表明他们有多喜欢结果。雅虎研究员胡一凡（Yifan Hu）与耶胡达·科伦（Yehuda Koren）和克里斯·沃林斯基（Chris Volinsky）在2008年发表的一篇有影响力的论文中重新定义了这个问题，将观测到的行为计数视为偏好的置信度水平而非评分，从而产生了一个为隐式反馈推荐器量身定制的因子模型。<sup>[8](https://www.researchgate.net/publication/220765111_Collaborative_Filtering_for_Implicit_Feedback_Datasets)</sup> Spark的隐式反馈ALS变体遵循了这种方法。<sup>[3](https://spark.apache.org/docs/3.5.7/ml-collaborative-filtering.html)</sup>

随后出现了为隐式数据构建的变体。Spotify Research于2014年12月在NIPS研讨会上提出了逻辑矩阵分解（Logistic Matrix Factorization），这是一种概率模型，用于估计用户偏好某物品的概率；在Spotify音乐收听行为数据集上，它在实验上优于广泛采用的隐式矩阵分解方法，作者指出该方法易于实现且高度可并行化。<sup>[9](https://research.atspotify.com/publications/logistic-matrix-factorization-for-implicit-feedback-data)</sup> Spotify公开描述了在其Discovery功能中使用基于隐式反馈的矩阵分解。<sup>[10](https://link.springer.com/article/10.1007/s11257-019-09237-4)</sup>

## 奈飞奖与工业采用

2006年，奈飞宣布举办一场竞赛以改进其推荐系统，发布了一个训练集，包含约50万名匿名客户对超过17000部电影的逾1亿条评分，每部电影评分为1至5星，第一个将Cinematch算法的RMSE降低10%或以上的团队将获得100万美元奖金，否则颁发每年5万美元的进度奖。数据的发布激发了协同过滤研究的一波热潮，来自182个国家的超过48000个团队下载了数据。综述论文背后的团队最初名为BellKor，于2007年夏天夺得头名，以比奈飞系统好8.43%的成绩赢得2007年进度奖，随后与Big Chaos团队联合，以9.46%的成绩赢得2008年进度奖。<sup>[2](https://gwern.net/doc/ai/tabular/2009-koren.pdf)</sup>

获胜技术进入了生产环境。奈飞报告称，获奖集成中表现最好的两种算法是矩阵分解（社区通常称之为SVD）和受限玻尔兹曼机；仅SVD就取得了0.8914的RMSE，RBM为0.8990，两者的线性融合为0.88，而Cinematch为0.9525，目标为0.8572。奈飞对这些算法进行了调整——它们原本是为1亿条评分而非奈飞持有的50多亿条评分构建的——并将两者都投入了生产。<sup>[4](https://netflixtechblog.com/netflix-recommendations-beyond-the-5-stars-part-1-55838468f429)</sup> 2024年的一项评估在四个协同过滤数据集上测试了六种代表性矩阵分解模型，结论是矩阵分解模型仍然是当前商业协同过滤推荐系统的核心，不同的模型适合不同的需求，如预测质量、新颖性、多样性、可解释性和群体推荐。<sup>[11](https://arxiv.org/abs/2410.17644)</sup>

## 矩阵分解与神经协同过滤

[神经协同过滤](https://www.edgepedia.org/zh/neural-collaborative-filtering)（NCF）用多层感知机在两个嵌入上计算的学习相似度函数取代点积。以因子分解机闻名的研究员斯特芬·伦德尔（Steffen Rendle）与瓦利德·克里切内（Walid Krichene）、张立（Li Zhang）和约翰·安德森（John Anderson）在2020年进行了一项再分析，重新审视了推广NCF的论文中的实验，发现经过适当的超参数选择，简单的点积显著优于学习到的相似度。作者还表明，尽管MLP理论上可以逼近任何函数，但MLP学习点积并非易事，且基于MLP的相似度在生产环境中的物品推荐中成本过高，而点积允许非常高效的检索算法；他们得出结论，点积可能是更好的默认选择。<sup>[5](https://arxiv.org/abs/2005.09683)</sup>

后续工作深化了这一比较，但并未就两者的优劣得出定论。巴里理工大学的维托·沃尔特·阿内利（Vito Walter Anelli）及其同事在2021年RecSys会议上的一项复现研究证实了原始实验的可复现性，并将评估扩展到准确性之外：矩阵分解提供了更好的准确性，包括在物品长尾上，而NCF提供了更好的物品覆盖率和更多样化的推荐列表。<sup>[12](https://abellogin.github.io/2021/recsys.pdf)</sup> 徐达（Da Xu）及其同事在ICML 2021上的理论分析表明，过参数化的NCF和矩阵分解协同过滤作为核化预测器具有相似的表达能力，它们的优化路径相关，且两种模型在转导与归纳设置中表现出不同的泛化行为，纠正暴露偏差在归纳评估中起着关键作用。<sup>[13](https://proceedings.mlr.press/v139/xu21d.html)</sup>

## 局限性与部署

**冷启动。** 由于模型只为训练数据中出现的用户和物品学习因子，新用户或新物品没有嵌入，无法接收或被分配有意义的推荐。一项对2010年1月至2021年12月冷启动缓解研究的系统综述将策略分为数据驱动和方法驱动两类，方法驱动的工作集中在深度学习、矩阵分解、混合方法以及新颖的协同过滤或基于内容的方法上；综述指出，冷启动问题限制了组织实现推荐系统的商业价值，因为吸引新用户和推广新物品需要营销和运营成本。<sup>[6](https://openurl.ebsco.com/contentitem/doi%3A10.1007%2Fs10844-022-00698-5?id=ebsco%3Adoi%3A10.1007%2Fs10844-022-00698-5&sid=ebsco%3Aplink%3Acrawler)</sup>

**服务。** 在推荐时，矩阵分解模型从预计算的用户矩阵中查找用户的嵌入，然后搜索接近它的物品嵌入，这是一个最近邻问题；对于大规模语料库，系统离线预计算顶级候选或使用近似最近邻工具，如谷歌的ScaNN。<sup>[14](https://developers.google.cn/machine-learning/recommendation/dnn/retrieval?hl=en)</sup> 开源工具反映了该技术的持续使用：Python库Implicit为隐式反馈提供了ALS、贝叶斯个性化排序、逻辑矩阵分解和物品-物品最近邻模型的快速实现，使用多线程[Cython](https://www.edgepedia.org/zh/cython)和OpenMP训练，并为ALS和BPR提供CUDA内核。<sup>[15](https://benfred.github.io/implicit/)</sup>

## References

1. [Matrix factorization, Google Machine Learning Crash Course](https://developers.google.com/machine-learning/recommendation/collaborative/matrix)
2. [Yehuda Koren, Robert Bell, Chris Volinsky (2009). Matrix Factorization Techniques for Recommender Systems. Computer 42(8), 30–37.](https://gwern.net/doc/ai/tabular/2009-koren.pdf)
3. [Collaborative filtering, Spark 3.5.7 Documentation](https://spark.apache.org/docs/3.5.7/ml-collaborative-filtering.html)
4. [Xavier Amatriain, Justin Basilico (2012). Netflix Recommendations: Beyond the 5 stars, Part 1. Netflix Tech Blog.](https://netflixtechblog.com/netflix-recommendations-beyond-the-5-stars-part-1-55838468f429)
5. [Steffen Rendle, Walid Krichene, Li Zhang, John Anderson (2020). Neural Collaborative Filtering vs. Matrix Factorization Revisited. arXiv:2005.09683.](https://arxiv.org/abs/2005.09683)
6. [Deepak Kumar Panda, Sanjog Ray (2022). Approaches and algorithms to mitigate cold start problems in recommender systems: a systematic literature review. Journal of Intelligent Information Systems 59(2), 341.](https://openurl.ebsco.com/contentitem/doi%3A10.1007%2Fs10844-022-00698-5?id=ebsco%3Adoi%3A10.1007%2Fs10844-022-00698-5&sid=ebsco%3Aplink%3Acrawler)
7. [Create recommendations based on explicit feedback with a matrix factorization model, BigQuery ML tutorial](https://docs.cloud.google.com/bigquery/docs/bigqueryml-mf-explicit-tutorial)
8. [Yifan Hu, Yehuda Koren, Chris Volinsky (2008). Collaborative Filtering for Implicit Feedback Datasets. ICDM 2008.](https://www.researchgate.net/publication/220765111_Collaborative_Filtering_for_Implicit_Feedback_Datasets)
9. [Chris Johnson (2014). Logistic Matrix Factorization for Implicit Feedback Data. Spotify Research, NIPS Workshop on Distributed Matrix Computations.](https://research.atspotify.com/publications/logistic-matrix-factorization-for-implicit-feedback-data)
10. [Effects of recommendations on the playlist creation behavior of users. User Modeling and User-Adapted Interaction (2019).](https://link.springer.com/article/10.1007/s11257-019-09237-4)
11. [Jesús Bobadilla, Jorge Dueñas-Lerín, Fernando Ortega, Abraham Gutierrez (2024). Comprehensive Evaluation of Matrix Factorization Models for Collaborative Filtering Recommender Systems. arXiv:2410.17644.](https://arxiv.org/abs/2410.17644)
12. [Vito Walter Anelli, Alejandro Bellogín, Tommaso Di Noia, Claudio Pomo (2021). Reenvisioning the comparison between Neural Collaborative Filtering and Matrix Factorization. RecSys '21.](https://abellogin.github.io/2021/recsys.pdf)
13. [Da Xu, Chuanwei Ruan, Evren Korpeoglu, Sushant Kumar, Kannan Achan (2021). Rethinking Neural vs. Matrix-Factorization Collaborative Filtering: the Theoretical Perspectives. ICML 2021, PMLR 139:11514–11524.](https://proceedings.mlr.press/v139/xu21d.html)
14. [Retrieval, Google Machine Learning recommendation course](https://developers.google.cn/machine-learning/recommendation/dnn/retrieval?hl=en)
15. [Implicit: Fast Python Collaborative Filtering for Implicit Datasets](https://benfred.github.io/implicit/)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 17, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Machine learning methods › Recommender systems › Matrix factorization and latent factor models

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/matrix-factorization-recommender-systems

English original: https://www.edgepedia.org/matrix-factorization-recommender-systems
