cd /news/large-language-models/distinguish-between-thinking-and-res… · home topics large-language-models article
[ARTICLE · art-53311] src=discuss.huggingface.co ↗ pub= topic=large-language-models verified=true sentiment=· neutral

Distinguish between thinking and responding during generation

A developer building a custom logits processor for generative models seeks to implement two-phase generation that separates reasoning from verbatim text output. The challenge involves detecting the transition between thinking and responding phases using only the Hugging Face library, as alternatives like Ollama and vLLM have limitations. The goal is to enable precise text classification with inline tags while allowing models to reason freely before generating structured output.

read1 min views1 publishedJul 9, 2026

Hi, I am building a custom logits processor that forces the generation of models to exactly follow the input text, plus classify parts of the text using special inline tags for precise text classification using generative models.

I successfully implemented the processor for models that generate the output directly without any chain of thought, deep reasoning, or thinking.

Now I would like to follow up on this by doing a two-phase generation, where I let the model reason however it wants, and then start the verbatim generation of the input text plus the classified spans. However, I am now thinking about how to divide this generation, first I thought about checking for the end-of-thinking token during generation, but it seems naive, as Ollama api or vLLM divide these, and you can simply pick the info you need from the data structure.

I need the possibility to access the logits during generation, which Ollama does not allow, and vLLM added this after I created my processor to fit HF, so I was wondering if there is a way to divide the two phases using only the HF library.

── more in #large-language-models 4 stories · sorted by recency
── more on @hugging face 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/distinguish-between-…] indexed:0 read:1min 2026-07-09 ·