What is perplexity?
The exponential of the cross-entropy loss, . Roughly, the number of equally likely options the model is choosing between.
Where it is taught
Cross-entropy. How do you score a prediction that is a whole distribution? Look at the probability it gave to what actually happened, and take minus its logarithm.
What the lesson leaves you with
- The loss for one prediction is , where is the probability given to the true answer.
- Cross-entropy is the average of that over the data. Guessing uniformly over options costs .
- With softmax, the gradient at the logits is simply .
Questions
- What is perplexity?
- The exponential of the cross-entropy loss, e^{L}. Roughly, the number of equally likely options the model is choosing between.
- Where is perplexity used in AI?
- How do you score a prediction that is a whole distribution? Look at the probability it gave to what actually happened, and take minus its logarithm.
- What is the key idea to remember about perplexity?
- The loss for one prediction is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi>ln</mi><mo></mo><mi>p</mi></mrow><annotation encoding="application/x-tex">-ln p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="katex-base"><span class="katex-strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord">−</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mop">ln</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">p</span></span></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="katex-base"><span class="katex-strut" style="height:0.625em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span></span></span></span> is the probability given to the true answer.
- Where can I learn perplexity step by step?
- In the lesson “Cross-entropy” in Gradient’s course on the maths behind AI, with interactive diagrams and questions.