Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically remove the string "<|image_sentinel|>" from chat outputs #627

Conversation

rhennigan
Copy link
Member

This occasionally appears in chat outputs when using gpt-4-vision. It's clearly a special token used by OpenAI, since the vision model can't read it like other models can:

In[1]:= AssociationMap[
    Function[
        LLMSynthesize[
            "Repeat the following string back to me:\nMy favorite token is <|image_sentinel|>!",
            LLMEvaluator -> <| "Model" -> #1, "MaxTokens" -> 64 |>
        ]
    ],
    { "gpt-3.5-turbo", "gpt-4", "gpt-4-turbo-preview", "gpt-4-vision-preview" }
]

Out[1]= <|
    "gpt-3.5-turbo"        -> "My favorite token is <|image_sentinel|>!",
    "gpt-4"                -> "My favorite token is <|image_sentinel|>!",
    "gpt-4-turbo-preview"  -> "My favorite token is <|image_sentinel|>!",
    "gpt-4-vision-preview" -> "\"My favorite token is !\""
|>

The fact that it occasionally appears in chat outputs is almost certainly a bug on OpenAI's end. However, it's simple enough to just delete it from chat outputs as a workaround.

@rhennigan rhennigan merged commit 44c656a into main Mar 16, 2024
1 check passed
@rhennigan rhennigan deleted the 534-the-string-image-sentinel-frequently-shows-up-in-gpt-4-vision-responses branch March 16, 2024 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The string <|image_sentinel|> frequently shows up in gpt-4-vision responses
1 participant