5 comments

  • kouteiheika36 minutes ago
    &gt; Opus 4.7 tokenizer used 1.46x the number of tokens as Opus 4.6<p>Interesting. Unfortunately Anthropic doesn&#x27;t actually share their tokenizer, but my educated guess is that they might have made the tokenizer more semantically aware to make the model perform better. What do I mean by that? Let me give you an example. (This isn&#x27;t necessarily what they did exactly; just illustrating the idea.)<p>Let&#x27;s take the gpt-oss-120b tokenizer as an example. Here&#x27;s how a few pieces of text tokenize (I use &quot;|&quot; here to separate tokens):<p><pre><code> Kill -&gt; [70074] Killed -&gt; [192794] kill -&gt; [25752] k|illed -&gt; [74, 7905] &lt;space&gt;kill -&gt; [15874] &lt;space&gt;killed -&gt; [17372] </code></pre> You have 3 different tokens which encode the same word (Kill, kill, &lt;space&gt;kill) depending on its capitalization and whether there&#x27;s a space before it or not, you have separate tokens if it&#x27;s the past tense, etc.<p>This is <i>not</i> necessarily an ideal way of encoding text, because the model must learn by brute force that these tokens are, indeed, related. Now, imagine if you&#x27;d encode these like this:<p><pre><code> &lt;capitalize&gt;|kill &lt;capitalize&gt;|kill|ed kill| kill|ed &lt;space&gt;|kill &lt;space&gt;|kill|ed </code></pre> Notice that this makes much more sense now - the model now only has to learn what &quot;&lt;capitalize&gt;&quot; is, what &quot;kill&quot; is, what &quot;&lt;space&gt;&quot; is, and what &quot;ed&quot; (the past tense suffix) is, and it can compose those together. The downside is that it increases the token usage.<p>So I wouldn&#x27;t be surprised if this is what they did. Or, my guess number #2, they removed the tokenizer altogether and replaced them with a small trained model (something like the Byte Latent Transformer) and simply &quot;emulate&quot; the token counts.
  • great_psy40 minutes ago
    Is there any provided reason from anthropic why they changed the tokenizer ?<p>Is there a quality increase from this change or is it a money grab ?
  • tomglynch1 hour ago
    Interesting findings. Might need a way to downsample images on upload to keep costs down.
    • simonw1 hour ago
      Yeah that should work - it looks like the same pixel dimension image at smaller sizes has about the same token cost for 4.6 and 4.7, so the image cost increase only kicks in if you use larger images that 4.6 would have presumably resized before inspecting.
  • mudkipdev1 hour ago
    Why do you need an API key to tokenize the text? Isn&#x27;t it supposed to be a cheap step that everything else in the model relies on?
    • kouteiheika28 minutes ago
      I&#x27;d guess it&#x27;s because they don&#x27;t want people to reverse engineer it.<p>Note that they&#x27;re the only provider which doesn&#x27;t make their tokenizer available offline as a library (i.e. the only provider whose tokenizer is secret).
    • simonw1 hour ago
      I&#x27;d love it if that API (which I do not believe Anthropic charge anything for) worked without an API key.
  • yogigan23 minutes ago
    [dead]