• partial_accumen@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    edit-2
    3 days ago

    Tf is a token?

    If you plugged this question into an LLM here’s how it would be broken into input tokens:

    BOS (Beginning of Sequence) | Tf | is | a | token | ? | EOS (End of Sequence)

    So this sentence would be 7 input tokens into an LLM. The sentence before this one, which is my response, would be 15 output tokens. The big LLM providers charge you per token used (usually the 1000 tokens used). Some LLM providers charge one price for input tokens and another for output tokens.

    Here’s how that translates to actual dollars to you. Here’s an price list from Oracle Cloud, a large company providing LLM service. Lets take the Google Gemini 2.5 Pro LLM model hosted at Oracle Cloud:

    • Oracle Cloud Infrastructure Generative AI - Google - Gemini 2.5 Pro - Input Tokens - Text, Image, Audio, and Video less than 200K input tokens = $1.25/1,000,000 tokens

    • Oracle Cloud Infrastructure Generative AI - Google - Gemini 2.5 Pro - Output Tokens - Text Output less than 200K input tokens = $10/1,000,000 tokens

    So your input question would have cost you $0.0000175 and my single sentence response to you would have cost you $0.00015.

    Some LLMs (like those discussed in the article) separate each letter as a separate token for processing as input. In that case your same question in one of those LLMs would be 13 tokens instead of 7.