The Doctor Is Not the Mother: DS4 Latent Reasoning A developer added a CoLaR (Compressed Latent Reasoning) head to DeepSeek Flash v4, enabling the model to reason in latent space with a learned stop criterion. The enhanced model correctly solved a modified version of the classic "doctor riddle" by recognizing that the mother died, making the father the doctor, while the base model pattern-matched the wrong answer. This demonstrates how latent reasoning can improve logical consistency in large language models. The Doctor is NOT the Mother N https://hashnode.com/@nickmitchko Adding a CoLaR Head to DeepSeek Flash v4 for Latent Reasoning with Learned Stop Criteria Published on blog.n.ichol.ai The Riddle A father and his son are driving down the road. They crash. Only the son survives, but he is injured. The son is taken to the hospital where the doctor proclaims, "I cannot operate on my son " ...How is this possible? So the doctor is the boy's mother, not a huge leap to make that conclusion. And this riddle is all over the internet, and certainly in many LLM's training data. But if you turn it around, and the mother is driving, what would AI say. A mother and her son... The correct answer is that the doctor is now the father : the boy has two parents, and his father happens to be the surgeon. Give this riddle to a standard large language model and here's what you get: This is a classic logic puzzle The answer is: The doctor is the boy's mother. The puzzle sets up the expectation that doctors are male, but the doctor is actually the boy's mother. It doesn't notice that the premises changed. It pattern-matches the cached training answer — "doctor riddle → doctor is mother" — and regurgitates it without checking consistency. So how do we make it think? Give this same riddle to a model equipped with a CoLaR head — a mechanism for thinking in latent space with a learned stop criterion — and the result is entirely different: Let me work through this carefully. The standard answer to this riddle is "the doctor is the mother" — it's a classic gender bias reveal. But let me re-read the prompt. "A mom and her son are driving... they crash and only the son survives." Wait — the mom dies. If the mom is dead, she can't be the doctor operating on her son. So the standard answer is wrong here. The doctor says "my son" — so the doctor is a parent of the boy. The mother is dead. Therefore the doctor must be the father. Answer: The doctor is the boy's father. This is actually the same model, but the second has an auxiliary CoLaR head training to keep the thinking tokens compressed by 16x and decoded after. What is CoLaR? CoLaR stands for Compressed Latent Reasoning https://huggingface.co/papers/2505.16552 . It's a lightweight adapter head that I've grafted onto an existing transformer model in our case, DeepSeek Flash v4 . The head enables the model to: Compress in latent space — reason using continuous vector representations rather than committing to discrete output tokens Self-determine when to stop — using a learned "stop head" that decides when sufficient reasoning has occurred Iterate and revise — revisit and refine its reasoning without being locked into a token-by-token path The result is a model that can think before it speaks , not unlike the system-1 / system-2 distinction in cognitive science. Standard autoregressive generation is fast, intuitive, and error-prone system 1 . CoLaR-enhanced generation is slower, deliberative, and more accurate system 2 . Thinking in Latent Space Here's the core idea. In a standard transformer, generation works like this simplified, of course : Input hidden states Output →