[GH-ISSUE #428] If the text embedding can be recovered to text? #368

Open
opened 2026-10-31 21:14:25 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @Zhangwenyao1 on GitHub (Feb 27, 2024).
Original GitHub issue: https://github.com/openai/CLIP/issues/428

Thanks for your excellent work!
I want to know if the text embedding can be recovered to text.

Originally created by @Zhangwenyao1 on GitHub (Feb 27, 2024). Original GitHub issue: https://github.com/openai/CLIP/issues/428 Thanks for your excellent work! I want to know if the text embedding can be recovered to text.
Author
Owner

@hamza13-12 commented on GitHub (Mar 31, 2024):

I believe you'd have to train your own decoder to make something like that work

<!-- gh-comment-id:2028890015 --> @hamza13-12 commented on GitHub (Mar 31, 2024): I believe you'd have to train your own decoder to make something like that work
Author
Owner

@zer0int commented on GitHub (May 24, 2024):

If you mean "getting a CLIP opinion about an image", yes, you can do that using gradient ascent.
You can optimize for the text that is "most alike" the image features, and get a "stochastic CLIP textual descriptions" of the image.

If you feed an image of a cat, CLIP will certainly conclude "cat", amongst many other things that may be puzzling to humans. For example, it may conclude "map" about your tabby cat's fur pattern. Or construct conjoined long words like "hallucinkaleidodimensional" about something colorful.

I made an intuitive and interactive GUI with attention visualization (you can see "where CLIP was looking" for a given word):
https://github.com/zer0int/CLIP-XAI-GUI

Or, for batch processing via the command-line:
https://github.com/zer0int/CLIP-text-image-interpretability

<!-- gh-comment-id:2130495347 --> @zer0int commented on GitHub (May 24, 2024): If you mean "getting a CLIP opinion about an image", yes, you can do that using gradient ascent. You can optimize for the text that is "most alike" the image features, and get a "stochastic CLIP textual descriptions" of the image. If you feed an image of a cat, CLIP will certainly conclude "cat", amongst many other things that may be puzzling to humans. For example, it may conclude "map" about your tabby cat's fur pattern. Or construct conjoined long words like "hallucinkaleidodimensional" about something colorful. I made an intuitive and interactive GUI with attention visualization (you can see "where CLIP was looking" for a given word): [https://github.com/zer0int/CLIP-XAI-GUI](https://github.com/zer0int/CLIP-XAI-GUI) Or, for batch processing via the command-line: [https://github.com/zer0int/CLIP-text-image-interpretability](https://github.com/zer0int/CLIP-text-image-interpretability)
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openai/CLIP#368
No description provided.