VKVlad KulikovPublic / lectures
Information Theory for ML3 / 16

Module 3. Cross-Entropy and KL Divergence

Choose your answers and select “Check”. Numbers accept a decimal point, comma, or simple fraction. Answers and drafts are saved in this browser and shared between RU/EN.

Checked: 0 / 29 · Correct: 0

Question 3.2.1

3.2. Cross-entropy: the model's average logarithmic bill

What are the roles of PP and QQ in H(P,Q)H(P,Q)?

One correct option

Question 3.2.2

3.2. Cross-entropy: the model's average logarithmic bill

What happens if p(x)>0p(x)>0 but q(x)=0q(x)=0 for some outcome xx?

One correct option

Question 3.2.3

3.2. Cross-entropy: the model's average logarithmic bill

Does a one-hot label in a dataset row imply that the true P(Y∣X=x)P(Y\mid X=x) is degenerate?

One correct option

Question 3.3.1

3.3. KL divergence: the part of the loss attributable to the model

Which identity is correct?

One correct option

Question 3.3.2

3.3. KL divergence: the part of the loss attributable to the model

When is DKL(P∥Q)=0D_{\mathrm{KL}}(P\|Q)=0?

One correct option

Question 3.3.3

3.3. KL divergence: the part of the loss attributable to the model

Why is log-loss called a strictly proper scoring rule?

One correct option

Question 3.4.2

3.4. The wrong code: how KL becomes extra bits

In what sense is DKL,2(P∥Q)D_{\mathrm{KL},2}(P\|Q) a number of “extra bits”?

One correct option

Question 3.5.1

3.5. One formula for classification and language modeling

How does conditional cross-entropy decompose?

One correct option

Question 3.5.2

3.5. One formula for classification and language modeling

Under ordinary teacher forcing, which prefixes weight the autoregressive KL decomposition?

One correct option

Question 3.5.3

3.5. One formula for classification and language modeling

Why does a good teacher-forced NLL not fully describe free-running generation?

One correct option

Question 3.5.4

3.5. One formula for classification and language modeling

What does the next-token objective guarantee on its own?

One correct option

Question 3.6.1

3.6. Why CrossEntropyLoss is so convenient to optimize

For a soft target rr, what is the gradient of softmax cross-entropy with respect to the logits?

One correct option

Question 3.6.2

3.6. Why CrossEntropyLoss is so convenient to optimize

What is the standard input to torch.nn.CrossEntropyLoss that avoids redundant transformations of the model output?

One correct option

Question 3.7.1

3.7. Perplexity: returning from the logarithmic scale

If mean NLL is measured in nats, then

One correct option

Question 3.7.2

3.7. Perplexity: returning from the logarithmic scale

What is the exact empirical interpretation of PPL?

One correct option

Question 3.7.3

3.7. Perplexity: returning from the logarithmic scale

Can a model have low predictive entropy and high perplexity at the same time?

One correct option

Question 3.7.4

3.7. Perplexity: returning from the logarithmic scale

Why are PPL values from different tokenizers not directly comparable?

One correct option

Question 3.3.4

Optional mathematical and reference deepening

What does maximum likelihood minimize when the model family is misspecified?

One correct option

Question 3.4.1

Optional mathematical and reference deepening

Can every distribution be given a one-symbol binary prefix code with lengths exactly −log⁡2q(x)-\log_2 q(x)?

One correct option

Question 3.6.3

Optional mathematical and reference deepening

What does label smoothing do?

One correct option

Question 3.6.4

Optional mathematical and reference deepening

May a weighted or label-smoothed training loss be exponentiated and reported without qualification as token perplexity?

One correct option

Question 3.8.1

Optional mathematical and reference deepening

When does the difference between forward and reverse KL become especially visible?

One correct option

Question 3.8.2

Optional mathematical and reference deepening

Which statement is correct for the canonical example of a bimodal mixture approximated by a single Gaussian?

One correct option

Question 3.8.3

Optional mathematical and reference deepening

Is posterior collapse in a VAE just another name for reverse KL selecting one mode?

One correct option

Question 3.9.1

Optional mathematical and reference deepening

Which description of DPO is most accurate?

One correct option

Question 3.C.1

Computational block

Let

P=(0.5, 0.25, 0.25),Q=(0.7, 0.2, 0.1).P=(0.5,\ 0.25,\ 0.25), \qquad Q=(0.7,\ 0.2,\ 0.1).

Compute the cross-entropy H(P,Q)H(P,Q) in bits, rounded to three decimals. (tolerance 0.002)

Question 3.C.2

Computational block

For the same PP and QQ, compute DKL(Q∥P)D_{\mathrm{KL}}(Q\|P) in bits, rounded to three decimals. (tolerance 0.002)

Question 3.C.3

Computational block

A model assigns probabilities 0.50.5, 0.250.25, 0.1250.125 and 0.50.5 to the four tokens that were actually observed. Compute the perplexity, rounded to three decimals. (tolerance 0.005)

Question 3.C.4

Computational block

Logits z=(2,1,0)z=(2,1,0) enter a softmax, and the observed class is the first one. Compute the gradient of the cross-entropy with respect to the logit of that class, rounded to three decimals. (tolerance 0.002)