M1-013M1: Mathematics & Statistics FundamentalsInformation TheoryMedium
⚡Flashcard Drill➔Mastery:

Define Mutual Information (MI) and Pointwise Mutual Information (PMI), and Detail Their Practical ML Applications

📐 Mathematical Definition
I(X;Y)=∑x,yp(x,y)log⁡p(x,y)p(x)p(y),PMI(x,y)=log⁡p(x,y)p(x)p(y)I(X;Y)=\sum_{x,y}p(x,y)\log\frac{p(x,y)}{p(x)p(y)},\qquad \mathrm{PMI}(x,y)=\log\frac{p(x,y)}{p(x)p(y)}
⚡ One-Sentence Core Answer
PMI measures the co-occurrence association of specific outcomes, while Mutual Information is the expected PMI across all outcomes, quantifying total shared non-linear information.

📌 Key Takeaways

  • •
    PMI: PMI(x;y)=log⁡P(x,y)P(x)P(y)\text{PMI}(x; y) = \log \frac{P(x, y)}{P(x)P(y)}; positive if co-occurring more often than random chance.
  • •
    Mutual Information: I(X;Y)=DKL(P(X,Y)∥P(X)P(Y))=H(X)−H(X∣Y)I(X; Y) = D_{\text{KL}}(P(X, Y) \parallel P(X)P(Y)) = H(X) - H(X\mid Y).
  • •
    Captures arbitrary non-linear dependencies, unlike linear Pearson correlation.
  • •
    Key uses: feature selection, Word2Vec matrix factorization, and contrastive self-supervised learning (InfoNCE).

📐 Mathematical Derivations

From definition: I(X;Y)=∑x,yP(x,y)log⁡P(x,y)P(x)P(y)I(X; Y) = \sum_{x, y} P(x, y)\log \frac{P(x, y)}{P(x)P(y)}. Decomposing: ∑x,yP(x,y)[log⁡P(x,y)−log⁡P(x)−log⁡P(y)]=−∑xP(x)log⁡P(x)−(−∑x,yP(x,y)log⁡P(x∣y))=H(X)−H(X∣Y)\sum_{x, y} P(x, y)[\log P(x, y) - \log P(x) - \log P(y)] = -\sum_x P(x)\log P(x) - \left(-\sum_{x, y} P(x, y)\log P(x\mid y)\right) = H(X) - H(X\mid Y). Symmetrically, I(X;Y)=H(Y)−H(Y∣X)=H(X)+H(Y)−H(X,Y)I(X; Y) = H(Y) - H(Y\mid X) = H(X) + H(Y) - H(X, Y). If XX and YY are independent, P(x,y)=P(x)P(y)  ⟹  I(X;Y)=0P(x, y)=P(x)P(y) \implies I(X; Y)=0. Furthermore, 0≤I(X;Y)≤min⁡(H(X),H(Y))0 \le I(X; Y) \le \min(H(X), H(Y)).

🏭 Production Trade-offs

Levy & Goldberg (2014) proved that Word2Vec SGNS implicitly factorizes a shifted Positive PMI (PPMI) matrix PPMI(w,c)−log⁡k\text{PPMI}(w, c) - \log k. In contrastive learning (CPC, CLIP), the InfoNCE loss minimizes a variational lower bound on mutual information I(X;Y)≥log⁡(K)−LInfoNCEI(X; Y) \ge \log(K) - \mathcal{L}_{\text{InfoNCE}}. In feature selection, MI handles non-linear relationships that Pearson correlation misses, but estimating continuous high-dimensional MI requires non-trivial binning or neural estimators (MINE).
⚠️ Common Interview Pitfalls
  • ✕
    PMI suffers from severe bias toward extremely low-frequency rare words (addressed by Normalized PMI or frequency exponents).
  • ✕
    Using Pearson correlation when relationships are strongly non-linear (e.g., Y=X2Y = X^2 where ρ=0\rho=0 but I(X;Y)I(X; Y) is large).
🎯 Interviewer Follow-up Inquiries
  • ?
    How does the InfoNCE loss function establish a lower bound on mutual information?
  • ?
    Why is high-dimensional mutual information estimation fundamentally prone to high sample variance?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
🎯 Drill This Card Now➔
📚

Associated Knowledge Base Guides & Mindmaps

Explore the comprehensive technical article, exam cards, and global architecture tree.

← PreviousM1-012: Explain Why KL Divergence is Asymmetric and Contrast the Optimization Behaviors of Forward vs. Reverse KL📋Back to BankNext →M1-014: Explain the Theoretical Equivalence Between Cross-Entropy Loss Minimization and Maximum Likelihood Estimation (MLE)
中文速览与面试要点

解释互信息与点互信息(PMI),它们分别用在哪里?

互信息衡量两变量共享的信息量;PMI 是单点对的信息贡献,MI 是 PMI 的期望。

核心要点

  • 互信息 I(X;Y)=KL(p(x,y)‖p(x)p(y)) 是'联合分布与独立分布的距离',因此 I=0 当且仅当严格独立——这比相关系数强得多,因为相关系数只捕捉线性依赖(例如 Y=X² 时相关系数为 0 但 MI>0)。把它展开即得 I(X;Y)=Σp(x,y)·PMI(x,y)=E[PMI],所以 PMI 是 MI 的逐点分解 :MI 是 PMI 的期望,PMI 描述单个点对贡献了多少信息。互信息的对称性来自 p(x,y) 的对称性,而非对称的 PMI 也可对称化为 PMI(x,y)+PMI(y,x)。
  • 两大应用:① 词向量 ——word2vec 的 SGNS 目标在数学上等价于分解 PMI 矩阵(Levy & Goldberg 2014 的经典结论),GloVe 则显式拟合 log 共现计数;PMI 的优点是能凸显低频但强关联的词对(因为除以边缘概率),缺点是低频词对 PMI 方差极大,故实践用 PMI^k (乘以计数阈值)或 NPMI (除以 −log p(x,y) 归一化到 [−1,1]);② 特征选择与因果发现 ——MI 用于筛选与目标非线性相关的特征,也是因果发现(PC 算法)中条件独立检验的基础。高维 MI 估计是难点:分箱法偏差大,KSG(k-NN)估计器更常用但维数灾难严重,故实践中常改用 MINE(神经估计)或直接回归预测目标。
  • MI=0 当且仅当独立
  • PMI 是词向量(word2vec/GloVe)与词共现分析的基础
  • 归一化 PMI(NPMI)便于跨频次比较

常见陷阱

  • 用相关系数替代 MI 判断独立性(漏掉非线性依赖)
  • 对低频词对直接使用 PMI(方差极大、不稳定)