Skip to content

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 Answer
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

answered a year ago

AWS
SUPPORT ENGINEER

revised a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.