logoalt Hacker News

ivanjermakov • today at 1:58 PM • 3 replies • view on HN

Do you know where <||> syntax is coming from? I find it very odd that existing markup wasn't used and there is very little info online about it.


Replies

jesdo • today at 2:10 PM

To the LLM, the <|...|> tags are single, special tokens. They are rendered as <|...|> tags for readability, but to the model the tags are single tokens.

I do not know why these tokens are visualized as <|...|>, but I speculate that this way they are easily recognizable as special-purpose tokens, and difficult to confuse with other types of existing markup.

➕ show 1 reply
embedding-shape • today at 3:00 PM

The first place I think I encountered it, was GPT-2's tokenizer, back when OpenAI did actual open source stuff, maybe around 2020?

I'm guessing as with most stuff in the LLM ecosystem, someone did it, no one re-evaluated why and just copied it wholesale, and here we are. The most important point, that this sequence of text never occurs in "real text", is the main point of the specific character chosen, and seems to still work good for that purpose.

The original usage is only "<|endoftext|>" I think, which was the EOS token for GPT-2, then more and more special tokens were added as various delimiters to new model releases.

t_mahmood • today at 2:05 PM

Correct me if I wrong, I saw this when llama.cpp or ollama initializes, it is used as token separator of some sort.

➕ show 1 reply