DMLR icon indicating copy to clipboard operation
DMLR copied to clipboard

thought_idx thought tokens

Open wangyaocan opened this issue 7 months ago • 1 comments

once visual tokens are interleaved with thought tokens and the sequence structure changes, can thought_idx still correctly refer to the intended visual tokens are interleaved with thought tokens ? If not, does the confidence computation end up evaluating a mixture of thought and visual tokens rather than the intended latent reasoning representations? inputs_step = dict( inputs_embeds=new_inputs_embeds, attention_mask=new_attn_mask, # pixel_values=inputs.get('pixel_values'), # image_grid_thw=inputs.get('image_grid_thw'), )

reward_thought_positions = None

            reward = get_confidence(
                model=model,
                inputs=inputs_step,
                thought_idx=reward_thought_idx,
                thought_hidden_states=combined_candidate,
                k=top_k,
                thought_positions=reward_thought_positions,
            )

wangyaocan avatar Apr 09 '26 02:04 wangyaocan

Thanks for your reply!

You’re right that once visual tokens are interleaved with thought tokens, the original indexing (e.g., thought_idx) may no longer cleanly refer to the intended latent reasoning segments. In such cases, the confidence computation can indeed end up operating over a mixture of thought and visual tokens, rather than purely over the intended reasoning representations.

However, this design is intentional on our side. We found that simply rewording or recalibrating confidence based only on internal thought representations can easily lead to overconfidence errors, as the model may become self-consistent without being grounded.

By incorporating visual tokens into the sequence, we encourage the model to re-anchor its confidence estimation to the actual visual evidence. In other words, instead of relying solely on latent reasoning signals, the model is nudged to cross-check its internal beliefs against the image itself, which helps mitigate hallucination and overconfidence.

So while this does introduce some mixing between modalities in the confidence computation, it serves as a form of grounding that improves overall reliability.

Chenngzz avatar Apr 11 '26 09:04 Chenngzz