跳至內容

Inaccurate inputTextTokenCount in response from Amazon Titan Multimodal Embeddings G1 model (amazon.titan-embed-image-v1)

1

Hello,

I am trying to get the inputTextTokenCount in the response from Amazon Titan Multimodal Embeddings G1 model (amazon.titan-embed-image-v1). But the biggest inputTextTokenCount I ever found was 100 regardless of the real input text length. For example, I sent a piece of texts that absolutely longer than 256 tokens, which is the max text input length, the inputTextTokenCount in the response was still 100.

Is this a bug or any configurations I did not set up correctly?

Thanks,

Qing

已提問 1 年前檢視次數 285 次

1 個回答
1

You're encountering a known limitation with the Amazon Titan Multimodal Embeddings G1 model (amazon.titan-embed-image-v1). The inputTextTokenCount field in the response does not accurately reflect the actual number of tokens processed for longer text inputs.

The Amazon Titan Multimodal Embeddings G1 model has a maximum input text token limit of 256 tokens. However, the inputTextTokenCount value returned in the response appears to cap at 100 regardless of the actual length of your input text. This is not a configuration issue on your end but rather a limitation in how the model reports token usage.

It's important to note that even though the reported count may be inaccurate, the model will still process up to the maximum 256 tokens.

For accurate token counting, you might need to implement your own token counting mechanism. As a rough guideline, English text averages about 4.7 characters per token, which can help you estimate token counts on the client side before sending requests to the model.

If precise token counting is critical for your use case (such as for cost management or usage tracking), you may want to consider monitoring your usage through CloudWatch metrics instead of relying on the inputTextTokenCount value in the response.
Sources
Amazon Titan Multimodal Embeddings G1 model - Token Usage (bedrock) | AWS re:Post
Amazon Titan Multimodal Embeddings G1 model - Amazon Bedrock
How to use Titan embeddings model without going over token limit? | AWS re:Post
Amazon Titan Multimodal Embeddings G1 - Amazon Bedrock

已回答 1 年前

AWS
支援工程師

修訂 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。