liveBook · Manning

Perplexity

As explained in Domain-Specific Small Language Models

A measure of how well a language model predicts tokens in sequence, with lower values generally indicating better predictive fit.

Perplexity measures how well a model predicts sequences: lower values generally indicate better predictive fit. Word perplexity measures predictive power; byte perplexity evaluates next-byte prediction. section 4.1.4 section 8.5

Perplexity also compares model performance in deployment-oriented evaluations, including quantized models. For generated protein sequences, it serves as a quality score; biological relevance still requires domain-specific validation. section 6.5 section 8.5

hf-causal (pretrained=EleutherAI/gpt-neo-2.7B,dtype=float16), limit: None, provide_description: False, num_fewshot: 0, batch_size: None
|  Task  |Version|    Metric     | Value |   |Stderr|
|--------|------:|---------------|------:|---|------|
|wikitext|      1|word_perplexity|13.9382|   |      |
|        |       |byte_perplexity| 1.6367|   |      |
|        |       |bits_per_byte  | 0.7108|   |      |

A Wikitext evaluation reports word perplexity of 13.9382 and byte perplexity of 1.6367 for GPT-Neo 2.7B. section 4.1.4

How Domain-Specific Small Language Models covers it

How deep it goes
Defines word- and byte-level measures and reports task scores, but gives no formula or interpretation procedure.
Examples
Uses GPT-Neo Wikitext scores and generated protein sequences as evaluation examples.
What you can do after
Evaluate language-model predictions with LM-Eval on Wikitext and compare reported perplexity scores.
How it connects
Connects language-model evaluation with Wikitext, bits per byte, quantization, and protein-sequence generation.

Also explained in

Compare how 5 books explain perplexity →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Domain-Specific Small Language Models. The section links point to the parts of the book it draws on.