1
0
Fork 0
mirror of https://github.com/p-e-w/heretic.git synced 2026-12-03 18:42:57 +07:00

[GH-ISSUE #351] Ideogram is the first image model with refusals. #189

Open
opened 2026-11-01 04:18:26 +07:00 by bsakaguchi · 14 comments
Owner

Originally created by @Ph0rk0z on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/p-e-w/heretic/issues/351

Apparently ideogram has a refusal "image" that it generates, similar to how LLMs give you an "i cannot". Not sure if the model itself is worth it, but if you are looking for something new and exciting to break, might be interesting to experiment on. It is also a transformer (DiT) and a 9b. The techniques would be similar. First of it's kind so has me curious.

Originally created by @Ph0rk0z on GitHub (Jun 4, 2026). Original GitHub issue: https://github.com/p-e-w/heretic/issues/351 Apparently ideogram has a refusal "image" that it generates, similar to how LLMs give you an "i cannot". Not sure if the model itself is worth it, but if you are looking for something new and exciting to break, might be interesting to experiment on. It is also a transformer (DiT) and a 9b. The techniques would be similar. First of it's kind so has me curious.
Author
Owner

@p-e-w commented on GitHub (Jun 4, 2026):

It might already be sufficient to abliterate the text encoder, depending on where the decision is made. If residuals produced by the text encoder are the information the model uses to differentiate "good" and "bad" inputs, then making the residuals for "bad" inputs resemble those for "good" ones (e.g. with ARA) could remove restrictions.

<!-- gh-comment-id:4622590646 --> @p-e-w commented on GitHub (Jun 4, 2026): It might already be sufficient to abliterate the text encoder, depending on where the decision is made. If residuals produced by the text encoder are the information the model uses to differentiate "good" and "bad" inputs, then making the residuals for "bad" inputs resemble those for "good" ones (e.g. with ARA) could remove restrictions.
Author
Owner

@kabachuha commented on GitHub (Jun 4, 2026):

Nope, the refusal is inside in the diffusion model itself. If properly aligned (e.g. DPO / KTO, or more advanced online RL methods), diffusion models can theoretically "analyze" the content of the noised image in self-attention and divert the trajectory into the "poisoned" distribution, just as they do when they continue /inpaint the no-text partially noised image.
Diffusion models are harder, if not impossible to decensor without extensive training, because they don't exhibit the single token refusal direction fragility. Even with adversarial DPO, you will need a lot of data to move the distribution away. This applies to diffusion language models as well.

<!-- gh-comment-id:4623129749 --> @kabachuha commented on GitHub (Jun 4, 2026): Nope, the refusal is inside in the diffusion model itself. If properly aligned (e.g. DPO / KTO, or more advanced online RL methods), diffusion models can theoretically "analyze" the content of the noised image in self-attention and divert the trajectory into the "poisoned" distribution, just as they do when they continue /inpaint the no-text partially noised image. Diffusion models are harder, if not impossible to decensor without extensive training, because they don't exhibit the single token refusal direction fragility. Even with adversarial DPO, you will need a lot of data to move the distribution away. This applies to diffusion language models as well.
Author
Owner

@Ph0rk0z commented on GitHub (Jun 4, 2026):

I thought this is a transformer though and not a regular diffusion model.

<!-- gh-comment-id:4623266013 --> @Ph0rk0z commented on GitHub (Jun 4, 2026): I thought this is a transformer though and not a regular diffusion model.
Author
Owner

@kabachuha commented on GitHub (Jun 4, 2026):

Diffusion model with a transformer backbone

The transformer just processes all the "image tokens" in parallel, similar to the LLM prefill, transforming them into the corrected noise/velocity, and not "printing" it patch by patch autoregressively

<!-- gh-comment-id:4623373367 --> @kabachuha commented on GitHub (Jun 4, 2026): Diffusion model with a transformer backbone The transformer just processes all the "image tokens" in parallel, similar to the LLM prefill, transforming them into the corrected noise/velocity, and not "printing" it patch by patch autoregressively
Author
Owner

@p-e-w commented on GitHub (Jun 4, 2026):

Nope, the refusal is inside in the diffusion model itself.

Sure, the refusal happens there, but it might still use the output of the text encoder to decide whether to refuse.

diffusion models can theoretically "analyze" the content of the noised image in self-attention and divert the trajectory into the "poisoned" distribution

They can theoretically do that, but that doesn't mean this is how refusal works in Ideogram.

<!-- gh-comment-id:4623663010 --> @p-e-w commented on GitHub (Jun 4, 2026): > Nope, the refusal is inside in the diffusion model itself. Sure, the refusal happens there, but it might still use the output of the text encoder to decide whether to refuse. > diffusion models can theoretically "analyze" the content of the noised image in self-attention and divert the trajectory into the "poisoned" distribution They can theoretically do that, but that doesn't mean this is how refusal works in Ideogram.
Author
Owner

@dreamfast commented on GitHub (Jun 5, 2026):

https://huggingface.co/DreamFast/Qwen3-VL-8B-Heretic-1.3.0 Here's an abliterated text encoder, however it wont make much of a difference.

I had experimented and found that by making a custom CLIP encoder you can change the roles, things like assistant or user, to just assistant \n and it will pass some basic prompts that otherwise are rejected.

However even then, it's very sensitive. And the ones that to get through, it's 90% body horror.

The refusal is baked into the DiT. There is more than one refusal mechanism too. Even if the text encoder is good, something during the image generation can trip it up again.

Analyzing different prompts, layers 31 to 33 seem to get the most difference comparing safe vs unsafe prompts.

Something like this would easily be solved with a lora or fine tuning. I might have another crack at it though to see if it's something that can be tuned out.

Some other notes,

https://ideogram.ai/blog/ideogram-4.0/ - using the proper json structure will help with false positives. This model strictly wants JSON in a specific format.

Also the ComfyUI workflow provided was bugged. CFG was set way high.

So there's a few things to consider to get good results.

<!-- gh-comment-id:4629441749 --> @dreamfast commented on GitHub (Jun 5, 2026): https://huggingface.co/DreamFast/Qwen3-VL-8B-Heretic-1.3.0 Here's an abliterated text encoder, however it wont make much of a difference. I had experimented and found that by making a custom CLIP encoder you can change the roles, things like assistant or user, to just `assistant \n` and it will pass some basic prompts that otherwise are rejected. However even then, it's very sensitive. And the ones that to get through, it's 90% body horror. The refusal is baked into the DiT. There is more than one refusal mechanism too. Even if the text encoder is good, something during the image generation can trip it up again. Analyzing different prompts, layers 31 to 33 seem to get the most difference comparing safe vs unsafe prompts. Something like this would easily be solved with a lora or fine tuning. I might have another crack at it though to see if it's something that can be tuned out. Some other notes, https://ideogram.ai/blog/ideogram-4.0/ - using the proper json structure will help with false positives. This model strictly wants JSON in a specific format. Also the ComfyUI workflow provided was bugged. CFG was set way high. So there's a few things to consider to get good results.
Author
Owner

@Ph0rk0z commented on GitHub (Jun 5, 2026):

What happens if you skip those layers?

<!-- gh-comment-id:4630987807 --> @Ph0rk0z commented on GitHub (Jun 5, 2026): What happens if you skip those layers?
Author
Owner

@dreamfast commented on GitHub (Jun 5, 2026):

What happens if you skip those layers?

The most safety layer is 33, I had averaged layers 31 and 32 over 33, zero'd 33, replace 33 with layer 33... you get the idea. In all attempts it'd ruin the generation.

I did smaller averages like 0.1 and 0.01 from 32 -> 33, but the safety was still intact.

So yeah. Messing with any of those layers just breaks the image generation. You just get a colored box with swatches pattern. :(

<!-- gh-comment-id:4631063497 --> @dreamfast commented on GitHub (Jun 5, 2026): > What happens if you skip those layers? The most safety layer is 33, I had averaged layers 31 and 32 over 33, zero'd 33, replace 33 with layer 33... you get the idea. In all attempts it'd ruin the generation. I did smaller averages like 0.1 and 0.01 from 32 -> 33, but the safety was still intact. So yeah. Messing with any of those layers just breaks the image generation. You just get a colored box with swatches pattern. :(
Author
Owner

@Ph0rk0z commented on GitHub (Jun 5, 2026):

So it nans? I wouldn't zero them (you're multiplying a lot of shit by 0), isn't there a node that lets you just skip them from the forward pass?

<!-- gh-comment-id:4631240278 --> @Ph0rk0z commented on GitHub (Jun 5, 2026): So it nans? I wouldn't zero them (you're multiplying a lot of shit by 0), isn't there a node that lets you just skip them from the forward pass?
Author
Owner

@dreamfast commented on GitHub (Jun 5, 2026):

So it nans? I wouldn't zero them (you're multiplying a lot of shit by 0), isn't there a node that lets you just skip them from the forward pass?

Maybe yeah. I am still new to all this too, so I was just trying a mix of different things to see what happens.

I didn't know those nodes existed too, so that's cool there's an easier way to just skip layers. I'll try it out when I get a moment.

<!-- gh-comment-id:4631260970 --> @dreamfast commented on GitHub (Jun 5, 2026): > So it nans? I wouldn't zero them (you're multiplying a lot of shit by 0), isn't there a node that lets you just skip them from the forward pass? Maybe yeah. I am still new to all this too, so I was just trying a mix of different things to see what happens. I didn't know those nodes existed too, so that's cool there's an easier way to just skip layers. I'll try it out when I get a moment.
Author
Owner

@p-e-w commented on GitHub (Jun 5, 2026):

Note that the layers that show the strongest residual separation are not necessarily the layers where the refusal decision is made. Indeed, the separation can be understood as indicating that the decision has already happened, which might have been in the blocks of the same layer, or in the preceding layers.

Try modifying a few layers before the layer where you see the clearest separation. Also, try targeting attention blocks and MLPs separately.

<!-- gh-comment-id:4631477664 --> @p-e-w commented on GitHub (Jun 5, 2026): Note that the layers that show the strongest residual separation are not necessarily the layers where the refusal decision is made. Indeed, the separation can be understood as indicating that the decision has already happened, which might have been in the blocks of the same layer, or in the preceding layers. Try modifying a few layers *before* the layer where you see the clearest separation. Also, try targeting attention blocks and MLPs separately.
Author
Owner

@p-e-w commented on GitHub (Jun 5, 2026):

Also, it might be better to slightly modify a few consecutive layers than to strongly modify a single one. With a big intervention, the chance that something important breaks increases.

<!-- gh-comment-id:4631490108 --> @p-e-w commented on GitHub (Jun 5, 2026): Also, it might be better to slightly modify a few consecutive layers than to strongly modify a single one. With a big intervention, the chance that something important breaks increases.
Author
Owner

@Vinay-Umrethe commented on GitHub (Jun 6, 2026):

Apparently ideogram has a refusal "image" that it generates, similar to how LLMs give you an "i cannot". Not sure if the model itself is worth it, but if you are looking for something new and exciting to break, might be interesting to experiment on. It is also a transformer (DiT) and a 9b. The techniques would be similar. First of it's kind so has me curious.

You can't do this to me

Tested with a normal Qwen (local), it did generated one without any filter, but view was distant, when told for a close-up it generated that "I cannot" equivalent image filter

<!-- gh-comment-id:4640225532 --> @Vinay-Umrethe commented on GitHub (Jun 6, 2026): > Apparently ideogram has a refusal "image" that it generates, similar to how LLMs give you an "i cannot". Not sure if the model itself is worth it, but if you are looking for something new and exciting to break, might be interesting to experiment on. It is also a transformer (DiT) and a 9b. The techniques would be similar. First of it's kind so has me curious. ![You can't do this to me](https://media1.tenor.com/m/Ix3E9a-vz98AAAAd/you-cant-do-this-to-me-do-you-know.gif) Tested with a normal Qwen (local), it did generated one without any filter, but view was distant, when told for a close-up it generated that "I cannot" equivalent image filter
Author
Owner

@Ph0rk0z commented on GitHub (Jun 7, 2026):

It's uncensored by dumping a 1.005 sigma into the sampling. At least mostly. Sucks at unstructured prompts, like the quality is just bad. Also short prompts. Has limb issues similar to klein but that might be due to me only using the cond model and not giving it enough steps.

<!-- gh-comment-id:4643112530 --> @Ph0rk0z commented on GitHub (Jun 7, 2026): It's uncensored by dumping a 1.005 sigma into the sampling. At least mostly. Sucks at unstructured prompts, like the quality is just bad. Also short prompts. Has limb issues similar to klein but that might be due to me only using the cond model and not giving it enough steps.
Sign in to join this conversation.
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
p-e-w/heretic#189
No description provided.