Example

Visual Example of Discriminator Operation in Replaced Token Detection

The discriminator's task in replaced token detection is to classify each token in a sequence that has been altered by a generator. It receives an input sequence and produces a label of either original\mathrm{original} or replaced\mathrm{replaced} for each position.

For example, if the sequence generated is "The boy spent decades working on toys .", the process can be visualized as follows:

replaced:[CLS]Theboyspentdecadesworkingontoys.\multicolumn9cDiscriminator (the model we want)label:originaloriginaloriginaloriginalreplacedoriginaloriginaloriginaloriginal\begin{array}{r c c c c c c c c c} \text{replaced:} & [\mathrm{CLS}] & \text{The} & \text{boy} & \text{spent} & \text{decades} & \text{working} & \text{on} & \text{toys} & . \\ & \downarrow & \downarrow & \downarrow & \downarrow & \downarrow & \downarrow & \downarrow & \downarrow & \downarrow \\ & \multicolumn{9}{c}{\text{Discriminator (the model we want)}} \\ & \downarrow & \downarrow & \downarrow & \downarrow & \downarrow & \downarrow & \downarrow & \downarrow & \downarrow \\ \text{label:} & \mathrm{original} & \mathrm{original} & \mathrm{original} & \mathrm{original} & \mathrm{replaced} & \mathrm{original} & \mathrm{original} & \mathrm{original} & \mathrm{original} \end{array}

As shown, the model accurately identifies "decades" as replaced\mathrm{replaced} and "toys" as original\mathrm{original}, even though "toys" was masked and regenerated by the generator, because it matches the original text.

Image 0

0

1

Updated 2026-04-16

Contributors are:

Who are from:

Tags

Ch.1 Pre-training - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences