<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Marco De Santis</title>
    <link>https://marcodsn.com</link>
    <description>Experiments and paper notes on how neural models reason, run and learn.</description>
    <language>en</language>
    <lastBuildDate>Sun, 20 Sep 2026 00:00:00 GMT</lastBuildDate>
    <atom:link href="https://marcodsn.com/rss.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>On Jev and System One Models</title>
      <link>https://marcodsn.com/blog/on-jev-and-system-one-models</link>
      <guid isPermaLink="true">https://marcodsn.com/blog/on-jev-and-system-one-models</guid>
      <description>On Jev, System One models, and my own reproduction: alpha-sys-1.</description>
      <dc:creator>Marco De Santis</dc:creator>
      <pubDate>Sun, 20 Sep 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[<p>On September 15, 2026, <a href="https://www.linkedin.com/in/diogomda" rel="nofollow">Diogo Almeida</a>, co-author of <a href="https://arxiv.org/abs/2203.02155" rel="nofollow">InstructGPT</a><small> [Note 1: A series of OpenAI language models trained with RLHF to follow instructions.]</small> and contributor to OpenAI’s work on RLHF,<small> [Note 2: Reinforcement Learning with Human Feedback, a training technique used in many modern LLM training pipelines.]</small> announced his new company and product: <a href="https://typesafe.ai/blog/introducing-system-one-models-and-jev" rel="nofollow">Jev, by TypeSafe AI</a>.</p> <p>This model broke the internet (or X, mostly) and became immediately very popular, advertised as a GPT-5.6 Terra-level model for a fraction of the cost and orders of magnitude faster; but what even is Jev?</p> <h2 id="why-is-it-special">Why is it special?</h2> <p>Jev is described as a System One model, so, what is that? You may have heard of “Thinking, Fast and Slow”, a popular book by psychologist Daniel Kahneman; I personally heard of this book for the first time in the ML space, around the time OpenAI’s o1<small> [Note 3: OpenAI's first o-series reasoning model, trained to spend more computation reasoning before answering.]</small> was released. <em>Sorry for the digression</em>. The point is that this book popularized the theory of the differentiation of modes of thought: “System 1” is the intuitive, fast thinking mode, while System 2 is the slow, deliberate, and logical mode.</p> <p>You can think of the usual reasoning-enabled LLM as a System 2 model: the thinking process is deliberate thinking, while the text after that (the actual answer) is either actions (tool/function calling) or speech.</p> <p>Jev instead, being marketed as a System 1 model, is not an LLM (at least according to TypeSafe’s description, more on that later); it can’t generate text, and its output is <strong>calibrated probabilities</strong>: given many questions in which Jev answers with a probability of 80% for its chosen answer, about 80% of those answers should be correct. That’s the calibration claim, at least.</p> <h2 id="so-not-an-llm">So, not an LLM?</h2> <p>Maybe not. Or maybe…</p> <p>Many hypotheses on Jev’s architecture are being shared on the web, with about as many reproductions, using different architectures and training techniques. Some people are even accusing TypeSafe AI of getting the spotlight for a project they already released months prior, with some examples being <a href="https://laya.convaiinnovations.com" rel="nofollow">Laya</a> and <a href="https://x.com/george_onx/status/2100293114808119379" rel="nofollow">GLiNER</a>.</p> <p>But are these really the same thing? While both these models and Jev return probabilities over a schema as an output (which yes, was not a “scientific breakthrough” ideated by TypeSafe AI), Jev seems to be a much more knowledgeable model than either Laya or GLiNER. So, did TypeSafe just train a bigger Laya? No, probably not.<small> [Note 4: This is my hypothesis, not a disclosed architecture. TypeSafe describes a new architecture and Reinforcement Learning for Calibrated Decisions (RLCD), but hasn't published enough detail to establish Jev's backbone or parameter count.]</small></p> <p>Laya is a BERT-inspired model, based on <a href="https://huggingface.co/answerdotai/ModernBERT-large" rel="nofollow">ModernBERT-large</a>, a roughly 400M-parameter language model with bidirectional attention, usually ideal to be tuned as a classifier. GLiNER is encoder-based too.</p> <p>The problem is the cost of scaling this from scratch: to get a more knowledgeable model, you need a bigger model trained on a lot more data. Masked language models also get their direct prediction targets from only a subset of the input positions, unlike causal LLMs, which predict the next token at nearly every position.<small> [Note 5: The original BERT recipe selected 15% of positions for prediction; other recipes use different masking rates. The other tokens still provide context and receive gradients, so this is not by itself proof that encoders are less compute-efficient at every scale but it would a costly experiment given the lack of pre-existing research on the topic.]</small></p> <p>Do you know what already has that large-scale training behind it and is available in different sizes, licenses, and flavors online? Yes, LLMs!</p> <h2 id="but-llms-generate-text-not-probabilities">But, LLMs generate text, not probabilities</h2> <p>Wrong! And this is, again, nothing new.</p> <p>LLMs have been adapted to tasks different from text generation for years already: they have been used as <a href="https://arxiv.org/abs/2307.16645" rel="nofollow">sentence embedders</a>, as <a href="https://arxiv.org/abs/2607.05391" rel="nofollow">scorers/judges</a>, as <a href="https://arxiv.org/abs/2005.14165" rel="nofollow">classifiers</a>.<small> [Note 6: Scaling Sentence Embeddings with Large Language Models; LLM-as-a-Verifier: A General-Purpose Verification Framework; and Language Models are Few-Shot Learners, which includes classification by comparing the probabilities of possible completions.]</small></p> <p>These methods share the same base idea: a single forward pass on a well-trained LLM is able to leverage its immense knowledge and (partly) capabilities for tasks different from text generation, without the latency of generating a whole response.</p> <p>For the uninitiated, a single forward pass will give you the distribution for the next token over the full vocabulary of the model (e.g. “rate this conversation, only answer with a number from 1 to 10”, and you can then take the scores for the answer tokens, as in LLM-as-a-Verifier), plus the hidden states for each token position (generally used when you want to use an LLM as an embedding model).</p> <p>One detail: those answers need to be single tokens for this readout to work in one pass. The LLM-as-a-Verifier paper actually suggests using letters, A, B, C and so on, even for score levels, then renormalize their logits with a softmax. This will be useful later.</p> <h2 id="llms-are-usually-overconfident-in-text-isnt-that-a-problem-here">LLMs are usually overconfident in text, isn’t that a problem here?</h2> <p>Yes, that is a big problem of LLMs, they can tell you something wrong is certainly right, and that’s certainly bad for a Jev-like model in which confidence should be meaningful; and yet, this topic was already encountered.</p> <p>In 2022 Anthropic released a paper titled <a href="https://arxiv.org/abs/2207.05221" rel="nofollow">“Language Models (Mostly) Know What They Know”</a>, which tries to answer the question “can a language model tell when it knows something, and when it probably doesn’t?”, and the answer, surprisingly, is mostly yes, especially with bigger models.</p> <p>A preceding paper titled <a href="https://aclanthology.org/2021.tacl-1.57/" rel="nofollow">“How Can We Know When Language Models Know?”</a> finds that LLM probabilities are often miscalibrated (the top token score is not automatically a reliable confidence estimate), but also finds improvements with scale and studies techniques such as temperature scaling to improve calibration on a fitted domain.</p> <p>Temperature scaling is simply dividing the logits by a positive number before the softmax: above one, the distribution becomes flatter; below one, sharper. You fit that number on development examples. It doesn’t change which answer wins, only how confident the model is about it.</p> <p>So, what we got till now is that:</p> <ul><li>bigger models can have more reliable scores as a confidence metric, though scale alone doesn’t guarantee calibration;</li> <li>you probably don’t want to train a 30B BERT model from scratch;</li> <li>temperature scaling can improve calibration on fitted domains.</li></ul> <h2 id="can-we-replicate-jev">Can we replicate Jev?</h2> <p>I think so, yeah, and from the evidence we got I would do that using an LLM. I’m not the first to think of this, and from a new benchmark called <a href="https://benchmarkheaven.com/jev-models" rel="nofollow">JevBench</a> you can actually see some of those LLM-based reproductions.</p> <p>The surprising thing is that you don’t even need to tune an LLM to act like Jev, and instead taking the token distribution for the first token after our Jev-like input can already give satisfactory results.</p> <p>How do I know this?</p> <h2 id="my-own-reproduction-of-jev">My own reproduction of Jev</h2> <p>I started by benchmarking some models against Jev on different datasets: from multiple-choice knowledge tasks (ARC-Easy, SciQ, OpenBookQA, CommonsenseQA), to soft-label tasks (ChaosNLI), to similarity-score prediction (STS-B), and a lot more.</p> <p>Unfortunately I am not able to share Jev’s results because of the publication restrictions in the Jev’s license I had to sign, though what I think I can say is that on the knowledge and NLI tasks, Jev scored very similarly to Qwen3.8-27B with temperature scaling enabled. The comparison varies by task; it’s not the same ranking everywhere.</p> <p>For Qwen I used the Q4_K_M quantization through llama.cpp, with reasoning disabled: one pass, reading the label probabilities, NOT asking it to generate a confidence score. In the tables <strong>+ T</strong> means a temperature fitted on that environment’s dev split.</p> <p>So, with that in mind, I wanted to create something, to tune some models, to make something I myself would use daily. I ended up choosing Liquid’s <a href="https://huggingface.co/LiquidAI/LFM2.5-VL-3B" rel="nofollow">LFM2.5-VL</a> family of models, in sizes 450M, 1.6B and 3B parameters.</p> <p>YES, these are vision-enabled models, and they are also built to be pretty fast (<a href="https://marcodsn.com/blog/lfm2-architecture-search">LFM2’s architecture is crazy good for inference speed</a>).</p> <p>Aaaaand, after benchmarking them, they were not great, not the usual download-and-use models at least.</p> <figure><figcaption>Untuned weights, dev-fitted temperatures. Test NLL / soft-label CE; lower is better.</figcaption> <div role="region" aria-label="Untuned weights, dev-fitted temperatures. Test NLL / soft-label CE; lower is better." tabindex="0"><table aria-label="Untuned weights, dev-fitted temperatures. Test NLL / soft-label CE; lower is better."><thead><tr><th scope="col">Environment</th><th scope="col">LFM 450M + T</th><th scope="col">LFM 1.6B + T</th><th scope="col">LFM 3B + T</th><th scope="col">Qwen 27B + T</th></tr></thead><tbody><tr><th scope="row">MCQ</th><td><span>0.929</span> <span aria-label="95% confidence interval 0.909 to 0.954">[0.909, 0.954]</span></td><td><span>0.527</span> <span aria-label="95% confidence interval 0.505 to 0.550">[0.505, 0.550]</span></td><td><span>0.386</span> <span aria-label="95% confidence interval 0.367 to 0.407">[0.367, 0.407]</span></td><td><span>0.159</span> <span aria-label="95% confidence interval 0.144 to 0.174">[0.144, 0.174]</span></td></tr><tr><th scope="row">ChaosNLI</th><td><span>0.941</span> <span aria-label="95% confidence interval 0.932 to 0.951">[0.932, 0.951]</span></td><td><span>0.835</span> <span aria-label="95% confidence interval 0.823 to 0.846">[0.823, 0.846]</span></td><td><span>0.795</span> <span aria-label="95% confidence interval 0.782 to 0.807">[0.782, 0.807]</span></td><td><span>0.706</span> <span aria-label="95% confidence interval 0.693 to 0.719">[0.693, 0.719]</span></td></tr><tr><th scope="row">CivilComments</th><td><span>0.581</span> <span aria-label="95% confidence interval 0.573 to 0.589">[0.573, 0.589]</span></td><td><span>0.629</span> <span aria-label="95% confidence interval 0.622 to 0.635">[0.622, 0.635]</span></td><td><span>0.423</span> <span aria-label="95% confidence interval 0.414 to 0.431">[0.414, 0.431]</span></td><td><span>0.473</span> <span aria-label="95% confidence interval 0.464 to 0.481">[0.464, 0.481]</span></td></tr><tr><th scope="row">STS-B</th><td><span>1.782</span> <span aria-label="95% confidence interval 1.776 to 1.787">[1.776, 1.787]</span></td><td><span>1.749</span> <span aria-label="95% confidence interval 1.728 to 1.774">[1.728, 1.774]</span></td><td><span>1.576</span> <span aria-label="95% confidence interval 1.552 to 1.600">[1.552, 1.600]</span></td><td><span>1.347</span> <span aria-label="95% confidence interval 1.298 to 1.387">[1.298, 1.387]</span></td></tr><tr><th scope="row">Folktables</th><td><span>0.693</span> <span aria-label="95% confidence interval 0.693 to 0.694">[0.693, 0.694]</span></td><td><span>0.612</span> <span aria-label="95% confidence interval 0.606 to 0.619">[0.606, 0.619]</span></td><td><span>0.610</span> <span aria-label="95% confidence interval 0.603 to 0.617">[0.603, 0.617]</span></td><td><span>0.472</span> <span aria-label="95% confidence interval 0.463 to 0.480">[0.463, 0.480]</span></td></tr></tbody></table></div></figure> <p>These are test NLL scores (cross-entropy for the soft-label tasks), <strong>lower is better</strong>. “Untuned” means the weights haven’t been fine-tuned; the models still get a dev-fitted temperature.</p> <p>The brackets are 95% confidence intervals, from a bootstrap over groups of related examples.<small> [Note 8: Groups are questions for MCQ, shared premises for ChaosNLI, articles for CivilComments, connected components of shared sentences for STS-B, households for Folktables, source images for CIFAR-10/C, and slides for Camelyon17. These intervals are conditional on each checkpoint, not intervals over training seeds. The evaluation uses the repository's splits, including custom grouped splits.]</small></p> <p>So it was time to tune some models… I present you… <strong>alpha-sys-1</strong>.</p> <p>The models are on Hugging Face: <a href="https://huggingface.co/nullsilver/alpha-sys-1-450M/tree/260919" rel="nofollow">alpha-sys-1-450M</a>, <a href="https://huggingface.co/nullsilver/alpha-sys-1-1.6B/tree/260919" rel="nofollow">alpha-sys-1-1.6B</a>, and <a href="https://huggingface.co/nullsilver/alpha-sys-1-3B/tree/260920" rel="nofollow">alpha-sys-1-3B</a>. Code and instructions are on <a href="https://github.com/nullsilver-labs/alpha-sys-1" rel="nofollow">GitHub</a>.</p> <figure><figcaption>Released checkpoints, no post-hoc temperature. Test NLL / soft-label CE; lower is better.</figcaption> <div role="region" aria-label="Released checkpoints, no post-hoc temperature. Test NLL / soft-label CE; lower is better." tabindex="0"><table aria-label="Released checkpoints, no post-hoc temperature. Test NLL / soft-label CE; lower is better."><thead><tr><th scope="col">Environment</th><th scope="col">alpha-sys-1 450M</th><th scope="col">alpha-sys-1 1.6B</th><th scope="col">alpha-sys-1 3B</th></tr></thead><tbody><tr><th scope="row">MCQ</th><td><span>0.727</span> <span aria-label="95% confidence interval 0.702 to 0.754">[0.702, 0.754]</span></td><td><span>0.427</span> <span aria-label="95% confidence interval 0.405 to 0.449">[0.405, 0.449]</span></td><td><span>0.289</span> <span aria-label="95% confidence interval 0.272 to 0.307">[0.272, 0.307]</span></td></tr><tr><th scope="row">ChaosNLI</th><td><span>0.902</span> <span aria-label="95% confidence interval 0.883 to 0.921">[0.883, 0.921]</span></td><td><span>0.784</span> <span aria-label="95% confidence interval 0.769 to 0.800">[0.769, 0.800]</span></td><td><span>0.735</span> <span aria-label="95% confidence interval 0.721 to 0.750">[0.721, 0.750]</span></td></tr><tr><th scope="row">CivilComments</th><td><span>0.324</span> <span aria-label="95% confidence interval 0.316 to 0.332">[0.316, 0.332]</span></td><td><span>0.323</span> <span aria-label="95% confidence interval 0.315 to 0.331">[0.315, 0.331]</span></td><td><span>0.319</span> <span aria-label="95% confidence interval 0.311 to 0.327">[0.311, 0.327]</span></td></tr><tr><th scope="row">STS-B</th><td><span>1.107</span> <span aria-label="95% confidence interval 1.045 to 1.166">[1.045, 1.166]</span></td><td><span>1.033</span> <span aria-label="95% confidence interval 0.981 to 1.081">[0.981, 1.081]</span></td><td><span>0.961</span> <span aria-label="95% confidence interval 0.914 to 1.005">[0.914, 1.005]</span></td></tr><tr><th scope="row">Folktables</th><td><span>0.436</span> <span aria-label="95% confidence interval 0.426 to 0.444">[0.426, 0.444]</span></td><td><span>0.448</span> <span aria-label="95% confidence interval 0.440 to 0.456">[0.440, 0.456]</span></td><td><span>0.441</span> <span aria-label="95% confidence interval 0.432 to 0.449">[0.432, 0.449]</span></td></tr></tbody></table></div></figure> <p>And, since these are vision models, here are the image tasks too. This table shows the change in loss compared to the untuned model + T, with a paired confidence interval: <strong>negative means the tuned model is better</strong>.</p> <figure><figcaption>Image environments: paired change in CE (released model minus its untuned base + T). Negative is better.</figcaption> <div role="region" aria-label="Image environments: paired change in CE (released model minus its untuned base + T). Negative is better." tabindex="0"><table aria-label="Image environments: paired change in CE (released model minus its untuned base + T). Negative is better."><thead><tr><th scope="col">Environment</th><th scope="col">450M</th><th scope="col">1.6B</th><th scope="col">3B</th></tr></thead><tbody><tr><th scope="row">CIFAR-10 + C</th><td><span>-0.295</span> <span aria-label="95% confidence interval -0.360 to -0.231">[-0.360, -0.231]</span></td><td><span>-0.272</span> <span aria-label="95% confidence interval -0.322 to -0.222">[-0.322, -0.222]</span></td><td><span>-0.064</span> <span aria-label="95% confidence interval -0.088 to -0.042">[-0.088, -0.042]</span></td></tr><tr><th scope="row">Camelyon17</th><td><span>-0.491</span> <span aria-label="95% confidence interval -0.531 to -0.453">[-0.531, -0.453]</span></td><td><span>-0.493</span> <span aria-label="95% confidence interval -0.539 to -0.462">[-0.539, -0.462]</span></td><td><span>-0.493</span> <span aria-label="95% confidence interval -0.578 to -0.436">[-0.578, -0.436]</span></td></tr></tbody></table></div></figure> <h3 id="about-those-metrics">About those metrics</h3> <p>These scores emphasize getting the probabilities right. For a question with one correct answer, NLL is the negative log of the probability assigned to that answer: confidently wrong answers are punished much more than uncertain ones.</p> <p>And as we remember from before: among answers assigned a probability of 80%, about 80% should be correct. That does not mean “be more confident”; it means be confident when you have reason to be, and uncertain when you don’t.</p> <p>Some datasets don’t have just one correct label, though. ChaosNLI has distributions from 100 annotators; CivilComments has annotator shares for toxicity. There, cross-entropy measures how well the model matches that distribution, rather than pretending everyone agreed with the majority.</p> <p>I also measured <strong>Brier score</strong>, which uses squared probability error. Both Brier and log loss are proper scoring rules: in expectation, the best thing to report is the true distribution. They reward useful predictions as well as calibration, so the loss can also improve because the model learns more about the task.</p> <p>Why not just use <strong>ECE</strong>, the expected calibration error? Because a model that always answers with the correct population base rate can have perfect ECE without telling you which examples are different. I report it too, just not alone.</p> <details><summary>Brier, KL and ECE for alpha-sys-1-3B</summary> <figure><figcaption>Released 3B: distribution scores, with top-label ECE beside them. KL is to the target distribution.</figcaption> <div role="region" aria-label="Released 3B: distribution scores, with top-label ECE beside them. KL is to the target distribution." tabindex="0"><table aria-label="Released 3B: distribution scores, with top-label ECE beside them. KL is to the target distribution."><thead><tr><th scope="col">Environment</th><th scope="col">Brier ↓</th><th scope="col">KL ↓</th><th scope="col">ECE (top-label)</th></tr></thead><tbody><tr><th scope="row">MCQ</th><td><span>0.152</span> <span aria-label="95% confidence interval 0.142 to 0.162">[0.142, 0.162]</span></td><td><span>0.289</span> <span aria-label="95% confidence interval 0.272 to 0.307">[0.272, 0.307]</span></td><td><span>0.008</span> <span aria-label="95% confidence interval 0.006 to 0.017">[0.006, 0.017]</span></td></tr><tr><th scope="row">ChaosNLI</th><td><span>0.133</span> <span aria-label="95% confidence interval 0.125 to 0.142">[0.125, 0.142]</span></td><td><span>0.205</span> <span aria-label="95% confidence interval 0.195 to 0.216">[0.195, 0.216]</span></td><td><span>0.049</span> <span aria-label="95% confidence interval 0.041 to 0.069">[0.041, 0.069]</span></td></tr><tr><th scope="row">CivilComments</th><td><span>0.040</span> <span aria-label="95% confidence interval 0.038 to 0.042">[0.038, 0.042]</span></td><td><span>0.088</span> <span aria-label="95% confidence interval 0.085 to 0.091">[0.085, 0.091]</span></td><td><span>0.067</span> <span aria-label="95% confidence interval 0.062 to 0.071">[0.062, 0.071]</span></td></tr><tr><th scope="row">STS-B</th><td><span>0.270</span> <span aria-label="95% confidence interval 0.250 to 0.288">[0.250, 0.288]</span></td><td><span>0.558</span> <span aria-label="95% confidence interval 0.513 to 0.600">[0.513, 0.600]</span></td><td><span>0.033</span> <span aria-label="95% confidence interval 0.028 to 0.053">[0.028, 0.053]</span></td></tr><tr><th scope="row">Folktables</th><td><span>0.289</span> <span aria-label="95% confidence interval 0.283 to 0.295">[0.283, 0.295]</span></td><td><span>0.441</span> <span aria-label="95% confidence interval 0.432 to 0.449">[0.432, 0.449]</span></td><td><span>0.014</span> <span aria-label="95% confidence interval 0.012 to 0.022">[0.012, 0.022]</span></td></tr></tbody></table></div></figure> <p>On soft-label tasks, top-label ECE compares confidence against agreement with the majority or modal label, not against the annotator distribution. CE and KL are the useful readings there; KL measures the difference from the target distribution.</p></details> <details><summary>Reliability and resolution</summary> <figure><figcaption>MCQ: top-label Murphy diagnostics, not an exact decomposition of the multiclass Brier column.</figcaption> <div role="region" aria-label="MCQ: top-label Murphy diagnostics, not an exact decomposition of the multiclass Brier column." tabindex="0"><table aria-label="MCQ: top-label Murphy diagnostics, not an exact decomposition of the multiclass Brier column."><thead><tr><th scope="col">Model</th><th scope="col">Brier ↓</th><th scope="col">Reliability ↓</th><th scope="col">Resolution ↑</th><th scope="col">ECE ↓</th></tr></thead><tbody><tr><th scope="row">Untuned LFM 3B + T</th><td><span>0.192</span> <span aria-label="95% confidence interval 0.181 to 0.205">[0.181, 0.205]</span></td><td><span>0.001</span> <span aria-label="95% confidence interval 0.001 to 0.002">[0.001, 0.002]</span></td><td><span>0.030</span> <span aria-label="95% confidence interval 0.026 to 0.035">[0.026, 0.035]</span></td><td><span>0.032</span> <span aria-label="95% confidence interval 0.028 to 0.041">[0.028, 0.041]</span></td></tr><tr><th scope="row">alpha-sys-1 3B</th><td><span>0.152</span> <span aria-label="95% confidence interval 0.142 to 0.162">[0.142, 0.162]</span></td><td><span>0.000</span> <span aria-label="95% confidence interval 0.000 to 0.001">[0.000, 0.001]</span></td><td><span>0.027</span> <span aria-label="95% confidence interval 0.023 to 0.032">[0.023, 0.032]</span></td><td><span>0.008</span> <span aria-label="95% confidence interval 0.006 to 0.017">[0.006, 0.017]</span></td></tr></tbody></table></div></figure> <p>Reliability measures how well confidence matches correctness within bins; resolution measures whether those bins separate easier from harder cases. These are binned, top-label Murphy diagnostics, not an exact decomposition of the multiclass Brier column. The full results also include confidence-versus-correctness AUROC and accuracy when keeping the most confident 80% of examples.</p></details> <p>One naming detail: the API’s <code>confidence</code> field summarizes how concentrated the distribution is, using normalized entropy. The confidence used in the evaluation is the top answer’s probability, which is what the 80% example above refers to.</p> <h3 id="how-did-i-train-them">How did I train them?</h3> <p>The idea is pretty simple: fine-tune the model to predict the answer distribution, instead of training it to write an answer.</p> <p>I used cross-entropy against a target called <code>y_soft</code>: one-hot when the dataset has one answer, and a soft distribution when we have several annotations. No RLCD, no teacher model for these checkpoints, just supervised fine-tuning. The loss is computed over the full vocabulary, with target mass on the answer-label tokens, so the model also learns to put its probability mass on the labels we actually read.</p> <p>Every released model is trained on the same mixture of seven environments:</p> <ul><li><strong>MCQ:</strong> <a href="https://huggingface.co/datasets/allenai/ai2_arc" rel="nofollow">ARC-Easy</a>, <a href="https://huggingface.co/datasets/allenai/sciq" rel="nofollow">SciQ</a>, <a href="https://huggingface.co/datasets/allenai/openbookqa" rel="nofollow">OpenBookQA</a> and <a href="https://huggingface.co/datasets/tau/commonsense_qa" rel="nofollow">CommonsenseQA</a>.</li> <li><strong><a href="https://github.com/easonnie/ChaosNLI" rel="nofollow">ChaosNLI</a>:</strong> natural-language inference with human disagreement.</li> <li><strong><a href="https://wilds.stanford.edu/datasets/" rel="nofollow">CivilComments-WILDS</a>:</strong> toxicity, using annotator shares.</li> <li><strong><a href="https://huggingface.co/datasets/mteb/stsbenchmark-sts" rel="nofollow">STS-B</a>:</strong> sentence similarity. I spread each annotator mean over the two neighboring score levels; this is a constructed target, not a histogram of the original votes.</li> <li><strong><a href="https://github.com/socialfoundations/folktables" rel="nofollow">Folktables</a>:</strong> income prediction from tabular records serialized as text, training on California 2014 and testing across states and years.</li> <li><strong><a href="https://www.cs.toronto.edu/~kriz/cifar.html" rel="nofollow">CIFAR-10</a>:</strong> clean images for training, clean and <a href="https://github.com/hendrycks/robustness" rel="nofollow">corrupted images</a> for evaluation.</li> <li><strong><a href="https://wilds.stanford.edu/datasets/" rel="nofollow">Camelyon17-WILDS</a>:</strong> histopathology patches, with held-out hospitals in evaluation.</li></ul> <p>All three sizes use <strong>LoRA rank 32</strong>, learning rate <strong>1e-4</strong>, and an effective batch size of <strong>32</strong>. The vision tower stays frozen; the adapters train the language model and projector, and are then merged into the released weights. Each run fits on a 24 GB GPU, though the 3B needed smaller micro-batches.</p> <p>I shuffle the choice options on every draw, so the model can’t simply learn to prefer the first answer. The environments are sampled in proportion to the square root of their training-set sizes. Why not equally? Well, I tried that, and STS-B kept seeing the same small dataset while the image tasks were still learning. It overfit and pulled the stopping point too early for the other tasks.</p> <p>Another thing that didn’t work: adding ordinary single-label NLI examples to get more training volume. They taught certainty, which is exactly what the disagreement labels in ChaosNLI punish. Keeping only its 100-annotator training rows worked much better in the single-domain experiments.</p> <p>I trained <strong>three seeds per size</strong>, with a budget of 10,500 steps per mixture and dev evaluation every 300 steps. The saved checkpoint is the one with the lowest mean dev cross-entropy across environments, not the highest accuracy. The released seed is also chosen on dev only; it happened to be seed 1 for all three sizes.</p> <p>The tables show those released checkpoints, without temperature scaling on top. The <a href="https://marcodsn.com/assets/on-jev-and-system-one-models/results.json">full aggregate results</a> include all three seeds and their paired comparisons. Every released model improves over its untuned + T baseline on all seven environments; one of the other 3B seeds has a CIFAR interval that includes zero.</p> <h2 id="why-that-name">Why that name?</h2> <p>I’m answering this right away: alpha stands for the first revision of an AI system I am working on, sys-1 means System 1, so alpha-sys-1 will be the System 1 model used in that system, as simple as that.</p> <h2 id="it-does-not-perform-like-qwen-at-all">It does not perform like Qwen at all</h2> <p>Yeah, even the 3B model does not have enough knowledge to solve some tasks that instead are easy for Qwen (and Jev), but on most of the environments I tuned it on, it is still way better than Laya:</p> <figure><figcaption>Same text test splits. Test NLL / soft-label CE; lower is better.</figcaption> <div role="region" aria-label="Same text test splits. Test NLL / soft-label CE; lower is better." tabindex="0"><table aria-label="Same text test splits. Test NLL / soft-label CE; lower is better."><thead><tr><th scope="col">Environment</th><th scope="col">Laya 0.1.6</th><th scope="col">Laya 0.1.6 + T</th><th scope="col">alpha-sys-1 3B</th></tr></thead><tbody><tr><th scope="row">MCQ</th><td><span>1.199</span> <span aria-label="95% confidence interval 1.177 to 1.225">[1.177, 1.225]</span></td><td><span>1.179</span> <span aria-label="95% confidence interval 1.163 to 1.197">[1.163, 1.197]</span></td><td><span>0.289</span> <span aria-label="95% confidence interval 0.272 to 0.307">[0.272, 0.307]</span></td></tr><tr><th scope="row">ChaosNLI</th><td><span>1.029</span> <span aria-label="95% confidence interval 1.003 to 1.055">[1.003, 1.055]</span></td><td><span>0.825</span> <span aria-label="95% confidence interval 0.815 to 0.836">[0.815, 0.836]</span></td><td><span>0.735</span> <span aria-label="95% confidence interval 0.721 to 0.750">[0.721, 0.750]</span></td></tr><tr><th scope="row">CivilComments</th><td><span>0.381</span> <span aria-label="95% confidence interval 0.375 to 0.386">[0.375, 0.386]</span></td><td><span>0.319</span> <span aria-label="95% confidence interval 0.312 to 0.327">[0.312, 0.327]</span></td><td><span>0.319</span> <span aria-label="95% confidence interval 0.311 to 0.327">[0.311, 0.327]</span></td></tr><tr><th scope="row">STS-B</th><td><span>1.674</span> <span aria-label="95% confidence interval 1.645 to 1.700">[1.645, 1.700]</span></td><td><span>1.606</span> <span aria-label="95% confidence interval 1.575 to 1.632">[1.575, 1.632]</span></td><td><span>0.961</span> <span aria-label="95% confidence interval 0.914 to 1.005">[0.914, 1.005]</span></td></tr><tr><th scope="row">Folktables</th><td><span>0.721</span> <span aria-label="95% confidence interval 0.719 to 0.723">[0.719, 0.723]</span></td><td><span>0.693</span> <span aria-label="95% confidence interval 0.693 to 0.693">[0.693, 0.693]</span></td><td><span>0.441</span> <span aria-label="95% confidence interval 0.432 to 0.449">[0.432, 0.449]</span></td></tr></tbody></table></div></figure> <p>Not everywhere: Laya with temperature scaling is competitive on CivilComments, and it wins on BoolQ, which I hadn’t trained on. These are results for the English checkpoint through Laya 0.1.6.</p> <h3 id="and-on-tasks-it-hasnt-seen">And on tasks it hasn’t seen?</h3> <p>I also tested on BoolQ and Yelp review stars, neither of which is in my fine-tuning mixture:</p> <figure><figcaption>Tasks excluded from alpha-sys-1 fine-tuning. Untuned LFM baselines here all use the first assistant token, plus T.</figcaption> <div role="region" aria-label="Tasks excluded from alpha-sys-1 fine-tuning. Untuned LFM baselines here all use the first assistant token, plus T." tabindex="0"><table aria-label="Tasks excluded from alpha-sys-1 fine-tuning. Untuned LFM baselines here all use the first assistant token, plus T."><thead><tr><th scope="col">Model</th><th scope="col">BoolQ</th><th scope="col">Yelp stars</th></tr></thead><tbody><tr><th scope="row">Untuned LFM 450M + T</th><td><span>0.646</span> <span aria-label="95% confidence interval 0.639 to 0.655">[0.639, 0.655]</span></td><td><span>1.466</span> <span aria-label="95% confidence interval 1.452 to 1.480">[1.452, 1.480]</span></td></tr><tr><th scope="row">alpha-sys-1 450M</th><td><span>0.661</span> <span aria-label="95% confidence interval 0.649 to 0.675">[0.649, 0.675]</span></td><td><span>1.467</span> <span aria-label="95% confidence interval 1.444 to 1.490">[1.444, 1.490]</span></td></tr><tr><th scope="row">Untuned LFM 1.6B + T</th><td><span>0.471</span> <span aria-label="95% confidence interval 0.455 to 0.485">[0.455, 0.485]</span></td><td><span>1.226</span> <span aria-label="95% confidence interval 1.204 to 1.248">[1.204, 1.248]</span></td></tr><tr><th scope="row">alpha-sys-1 1.6B</th><td><span>0.479</span> <span aria-label="95% confidence interval 0.469 to 0.489">[0.469, 0.489]</span></td><td><span>1.110</span> <span aria-label="95% confidence interval 1.090 to 1.130">[1.090, 1.130]</span></td></tr><tr><th scope="row">Untuned LFM 3B + T</th><td><span>0.393</span> <span aria-label="95% confidence interval 0.379 to 0.408">[0.379, 0.408]</span></td><td><span>0.972</span> <span aria-label="95% confidence interval 0.948 to 0.994">[0.948, 0.994]</span></td></tr><tr><th scope="row">alpha-sys-1 3B</th><td><span>0.405</span> <span aria-label="95% confidence interval 0.390 to 0.420">[0.390, 0.420]</span></td><td><span>0.973</span> <span aria-label="95% confidence interval 0.949 to 0.992">[0.949, 0.992]</span></td></tr><tr><th scope="row">Qwen 27B + T</th><td><span>0.316</span> <span aria-label="95% confidence interval 0.302 to 0.329">[0.302, 0.329]</span></td><td><span>0.858</span> <span aria-label="95% confidence interval 0.831 to 0.885">[0.831, 0.885]</span></td></tr><tr><th scope="row">Laya 0.1.6 + T</th><td><span>0.168</span> <span aria-label="95% confidence interval 0.154 to 0.183">[0.154, 0.183]</span></td><td><span>1.080</span> <span aria-label="95% confidence interval 1.055 to 1.103">[1.055, 1.103]</span></td></tr></tbody></table></div></figure> <p>Here the improvements aren’t consistent. The models mostly stay around their untuned bases, sometimes better, sometimes worse. “Unseen” means unseen in my fine-tuning, not necessarily unseen in pretraining or in Laya’s training. The untuned LFM references in this table all use the first assistant token, plus a dev-fitted temperature.</p> <p>I also tried leaving an entire environment out of training at 1.6B, without using its dev split either. Only the held-out MCQ fold passed; ChaosNLI and CIFAR didn’t. So training on a few tasks doesn’t automatically teach the model to be calibrated on a new one. The seven-environment leave-one-out experiment is still unfinished.</p> <details><summary>A note on the experiment's gates and limitations</summary> <p>The mixture-versus-specialists gate failed at 450M and 1.6B: the models were close, but not consistently within the required confidence intervals. There were no 3B specialists to compare against. The three-environment leave-one-out gate at 1.6B failed too.</p> <p>The earlier single-domain 1.6B model passed the CIFAR corruption-confidence gate; the 450M failed. Those were specialist checkpoints, not the released mixtures. Some early gate definitions were amended after results, with the original verdicts preserved; those amended readings aren’t pre-registered passes. The changes to the training recipe are recorded alongside the earlier runs too.</p> <p>The released interface supports up to 26 options, and training used English data and at most one image per question. It returns probabilities in the System One shape, with image support; it isn’t a reconstruction of Jev’s undisclosed architecture. These image evaluations are not clinical validation, and there isn’t a controlled latency comparison against Jev in this release.</p> <p>The weights inherit Liquid’s <a href="https://huggingface.co/nullsilver/alpha-sys-1-3B/blob/260920/LICENSE">LFM Open License v1.0</a>, including its $10M annual-revenue threshold for commercial use under the standard grant.</p></details> <p>Now can you imagine what would happen if we added external engram memory to this model? Yeah… stay tuned for that.</p>]]></content:encoded>
    </item>
    <item>
      <title>Compressing Reasoning Without Breaking It</title>
      <link>https://marcodsn.com/blog/reasoning-compression</link>
      <guid isPermaLink="true">https://marcodsn.com/blog/reasoning-compression</guid>
      <description>A study on reasoning compression via self-distillation.</description>
      <dc:creator>Marco De Santis</dc:creator>
      <pubDate>Sun, 12 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[<p>Reasoning models are natural over-thinkers: they can spend hundreds of tokens answering to a simple ”Hello!”; they love to restate the given problems, to narrate all of their transitions, and it doesn’t happen rarely that the tokens needed for the actual computation are just a fraction of those that get generated. It comes naturally to the mind that if we could compress this reasoning, dropping the fluff, the restatements and the narration, we would get the same answers faster. But is this intuition provably correct? Or are we being too naive?</p> <p>Spoiler: it works! But let’s analyze things step by step.</p> <h2 id="reasoning-compression">Reasoning compression</h2> <p>Reasoning (and output) compression is not a new science: “caveman”-prompting<small> [Note 1: A technique consisting in prompting an LLM to drop articles, fillers ('just', 'really', 'basically', etc.), pleasantries, and to prefer short synonyms.]</small> for output compression <a href="https://github.com/juliusbrussee/caveman" rel="nofollow">has been around for a while now</a>, and <a href="https://huggingface.co/kai-os/Grug-12B" rel="nofollow">models trained specifically with caveman-compressed traces</a> are starting to come out already. <a href="https://www.reddit.com/r/LocalLLaMA/s/1LZywDqDKF" rel="nofollow">Multiple reasoning leaks</a> from GPT-5.5 also suggest that OpenAI took that same approach to optimize the token efficiency of their latest frontier LLMs.</p> <p>With these premises, I decided to start working on Flint (Flint as in “The Flint-stones”), a project originally comprised of a dataset of caveman-compressed reasoning traces (with the post-thought answers kept verbatim) and a series of models fine-tuned on this dataset. Things did not go well from the start, let’s see why.</p> <h2 id="so-what-went-wrong">So, what went wrong?</h2> <p>The original flint-sft dataset pipeline was the following:</p> <ol><li>Get real reasoning traces from <a href="https://huggingface.co/google/gemma-4-31B-it" rel="nofollow">gemma-4-31B-it</a></li> <li>Compress the <em>whole traces</em> (foreshadowing) using fast, online, free LLMs (at the time <a href="https://huggingface.co/stepfun-ai/Step-3.7-Flash" rel="nofollow">stepfun-ai/Step-3.7-Flash</a> and <a href="https://huggingface.co/nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B-BF16" rel="nofollow">nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B</a> were available for free on the <a href="https://portal.nousresearch.com/" rel="nofollow">Nous Portal</a>)</li></ol> <p>Gemma was chosen as the most praised open LLM for reasoning efficiency (both by the community and by <a href="https://artificialanalysis.ai/?output-tokens=intelligence-vs-output-tokens-per-task&amp;model-filters=open-source" rel="nofollow">reputable benchmarks</a>), and I was self-convinced that the compressor model would not matter as long as the instructions (how to compress) were followed nicely; though, it seems like I was wrong!</p> <p>Because of GPU constraints, I decided to train <a href="https://huggingface.co/google/gemma-4-12B-it" rel="nofollow">gemma-4-12B-it</a> instead of the 31B release from which I took the traces, and results were… horrible! I did not record the data (at the time I just thought I would leave the project there, without touching it ever again, “R.I.P. Flint”), though <em>from what I remember</em> looping had increased significantly, and performance in the AIME2026 benchmark got ~halved.</p> <p>Why did this happen? Well, let’s start with two (now very obvious) problems in this old pipeline of mine:</p> <ol><li>The model was tuned on traces generated from another model.</li> <li>The traces were compressed using yet another model.</li></ol> <p>Both of these say the same thing: the distributions<small> [Note 2: The numerical scores for each token at each step, considering the entire tokens sequence.]</small> of the original model were different from both the traces generator and the compressor.</p> <h3 id="isnt-distillation-from-bigger-to-smaller-models-a-proven-strategy">Isn’t distillation from bigger to smaller models a proven strategy?</h3> <p>If you are into the more technical side of the LLMs world, you may know that: yes, training smaller models on the outputs of bigger models is a very well proven technique to efficiently improve the small models performance (<a href="https://www.anthropic.com/news/detecting-and-preventing-distillation-attacks" rel="nofollow">and the big labs are wary of that</a>), but we need to add a few important notes:</p> <ol><li>Distillation prefers full logits distributions: usually we record the scores for each token for each step and use that distributions in training, while for Flint only the chosen token at each step was used for training (that’s a lot less data per step).</li> <li>Distillation generally needs a lot of data, and the more it has to skew the original model distribution the more data will be needed: my original dataset, while “biggish” (15k examples, a lot more than the final, and successful, datasets), is not nearly big enough to skew the distribution of the original model in a good way given the initial distance between them.</li></ol> <p>So yes, distillation is a good and proven strategy, but only if done right.</p> <h2 id="the-new-pipeline">The new pipeline</h2> <p>Before starting to experiment again on Flint, I decided to completely redo the data pipeline. With the new intuition in hand (“self-distillation may solve all of my problems!“) I decided to create <a href="https://huggingface.co/datasets/marcodsn/crucible" rel="nofollow">crucible</a>, a merged dataset with over 37k rows that combines logical, creative and multilingual task types, specifically designed with distillation in mind.</p> <p>The idea now changed to the following: take crucible and an LLM we want to optimize, generate samples from crucible with <em>that</em> LLM (produces a crucible-sft-model_name dataset), compress the traces (produces a flint-sft-model_name dataset), and tune the original LLM on the compressed traces (produces a model_name-flint model).</p> <h2 id="new-pipeline-new-problems">New pipeline, new problems</h2> <p>I decided to test the new pipeline on a small model first, <a href="https://huggingface.co/Qwen/Qwen3.5-4B" rel="nofollow">Qwen/Qwen3.5-4B</a>, and that’s when I found another hard stop. While the control I created worked perfectly fine now (crucible-sft-model_name, the uncompressed SFT dataset, was used to tune the original LLM and showed no performance degradation), the (flat, “whole trace”) compression-trained model showed signs of collapse with greedy decoding (temperature=0<small> [Note 3: Temperature is an inference-time value settable between 0 and 2 (by convention, the upper limit is not strict) that controls creativity (or even better, the *unpredictability* of the outputs). Setting temperature to 0 generally means that we are doing deterministic generation, so re-running a generation at temperature=0 shall always return the same answer.]</small>): lots of <a href="https://www.liquid.ai/blog/antidoom" rel="nofollow">doom loops</a>, degraded performance.</p> <div><table><thead><tr><th>Benchmark</th><th>accuracy</th><th>avg reasoning tokens</th><th>loop rate</th><th>truncation rate</th></tr></thead><tbody><tr><td>GSM8K</td><td>.03</td><td>7,960</td><td>.93</td><td>.97</td></tr><tr><td>MATH-500</td><td>.02</td><td>8,033</td><td>.64</td><td>.98</td></tr><tr><td>HumanEval</td><td>.04</td><td>7,919</td><td>.55</td><td>.96</td></tr><tr><td>MBPP</td><td>.01</td><td>8,019</td><td>.84</td><td>.97</td></tr><tr><td>MMLU-Pro</td><td>.05</td><td>7,499</td><td>.42</td><td>.90</td></tr></tbody></table></div> <p>Now, a result that really surprised me… At temperature=1, the model was <em>fine</em>, more than fine actually; let’s look at the temperature sweep benchmark:</p> <div><table><thead><tr><th>GSM8K loop sweep @ t=0 (n=50)</th><th>Accuracy</th><th>Loop rate</th><th>Avg reasoning tokens</th><th>Truncated rate</th></tr></thead><tbody><tr><td>original model</td><td>.64</td><td>.28</td><td>3915.1</td><td>.36</td></tr><tr><td>uncompressed SFT</td><td>.54</td><td>.34</td><td>4894.2</td><td>.44</td></tr><tr><td>flat compression</td><td>.02</td><td>.96</td><td>8030.5</td><td>.98</td></tr></tbody></table></div> <div><table><thead><tr><th>GSM8K loop sweep @ t=0.6 (n=50)</th><th>Accuracy</th><th>Loop rate</th><th>Avg reasoning tokens</th><th>Truncated rate</th></tr></thead><tbody><tr><td>original model</td><td>.68</td><td>.12</td><td>3827.4</td><td>.32</td></tr><tr><td>uncompressed SFT</td><td>.58</td><td>.22</td><td>4729.8</td><td>.42</td></tr><tr><td>flat compression</td><td>.20</td><td>.74</td><td>6531.3</td><td>.78</td></tr></tbody></table></div> <div><table><thead><tr><th>GSM8K loop sweep @ t=1 (n=50)</th><th>Accuracy</th><th>Loop rate</th><th>Avg reasoning tokens</th><th>Truncated rate</th></tr></thead><tbody><tr><td>original model</td><td>.74</td><td>.00</td><td>4140.6</td><td>.26</td></tr><tr><td>uncompressed SFT</td><td>.64</td><td>.18</td><td>4319.3</td><td>.36</td></tr><tr><td>flat compression</td><td>.90</td><td>.04</td><td>1500.9</td><td>.06</td></tr></tbody></table></div> <p><strong>Note:</strong> “GSM8K loop sweep” is a small random (fixed) subset of GSM8K we used for our fast temperature sweep benchmarks.</p> <p>Setting the temperature=1 made the model incredibly good, both in accuracy and in token usage (+16 points and less than half the tokens!!); so, how and why did greedy decoding break? First, something you should know: <em>reasoning models usually perform better at higher temperatures</em>; you can see this in the results for the original model, and also on the models’ own pages (Qwen itself suggests a temperature between 0.6 and 1.0).</p> <p>A higher temperature helps the model escape loops: “Wait, let me try this instead…” and similar phrases are often used by reasoning LLMs to move out of a failed attempt, but these same phrases are also the same on which they can easily get stuck. A higher temperature here helps by flattening the probabilities of our tokens, making the re-use of the exact phrases less probable.</p> <p>Our loops, though, are <em>kind of special</em>:</p> <blockquote><p><span><span><span aria-hidden="true"><span><span style="height:0.7278em;vertical-align:-0.0833em;"></span><span>4</span><span style="margin-right:0.2222em;"></span><span>×</span><span style="margin-right:0.2222em;"></span></span><span><span style="height:0.6444em;"></span><span>125</span><span style="margin-right:0.2778em;"></span><span>=</span><span style="margin-right:0.2778em;"></span></span><span><span style="height:0.6444em;"></span><span>500</span></span></span></span></span>.<br/> <span><span><span aria-hidden="true"><span><span style="height:0.7278em;vertical-align:-0.0833em;"></span><span>500</span><span style="margin-right:0.2222em;"></span><span>−</span><span style="margin-right:0.2222em;"></span></span><span><span style="height:0.6444em;"></span><span>2</span><span style="margin-right:0.2778em;"></span><span>=</span><span style="margin-right:0.2778em;"></span></span><span><span style="height:0.6444em;"></span><span>498</span></span></span></span></span>.<br/> <span><span><span aria-hidden="true"><span><span style="height:0.7278em;vertical-align:-0.0833em;"></span><span>125</span><span style="margin-right:0.2222em;"></span><span>+</span><span style="margin-right:0.2222em;"></span></span><span><span style="height:0.6444em;"></span><span>498</span><span style="margin-right:0.2778em;"></span><span>=</span><span style="margin-right:0.2778em;"></span></span><span><span style="height:0.6444em;"></span><span>623</span></span></span></span></span>.<br/> <span><span><span aria-hidden="true"><span><span style="height:0.7278em;vertical-align:-0.0833em;"></span><span>125</span><span style="margin-right:0.2222em;"></span><span>+</span><span style="margin-right:0.2222em;"></span></span><span><span style="height:0.6444em;"></span><span>498</span><span style="margin-right:0.2778em;"></span><span>=</span><span style="margin-right:0.2778em;"></span></span><span><span style="height:0.6444em;"></span><span>623</span></span></span></span></span>.<br/> <span><span><span aria-hidden="true"><span><span style="height:0.7278em;vertical-align:-0.0833em;"></span><span>125</span><span style="margin-right:0.2222em;"></span><span>+</span><span style="margin-right:0.2222em;"></span></span><span><span style="height:0.6444em;"></span><span>500</span><span style="margin-right:0.2778em;"></span><span>=</span><span style="margin-right:0.2778em;"></span></span><span><span style="height:0.6444em;"></span><span>625</span></span></span></span></span>.<br/> <span><span><span aria-hidden="true"><span><span style="height:0.7278em;vertical-align:-0.0833em;"></span><span>625</span><span style="margin-right:0.2222em;"></span><span>−</span><span style="margin-right:0.2222em;"></span></span><span><span style="height:0.6444em;"></span><span>2</span><span style="margin-right:0.2778em;"></span><span>=</span><span style="margin-right:0.2778em;"></span></span><span><span style="height:0.6444em;"></span><span>623</span></span></span></span></span>.<br/> Correct.<br/> [… repeats identically, hundreds of times]</p></blockquote> <p>What’s interesting here is that 623 was actually the right answer; the model did not loop in an intermediate verification step. So, the thinking did not really break, but what broke is the stopping mechanism. We will come back to this later, when we better analyze loops and recent proposed solutions. Now let’s move to the headline experiment!</p> <h3 id="section-aware-compression">Section-aware compression</h3> <p>What if we compress (or drop) only the non-computation spans of our traces? Let me explain: in the introduction we talked about how LLMs are especially inefficient in everything that is not “raw computation” (as in, useful reasoning to solve a problem, step-by-step calculations etc.), so the new idea is: keep the computation verbatim (and the verification steps too), and compress or drop the remaining sections (restatements, planning, transitions, narration).</p> <p>This adds a step in our data pipeline: we now need an LLM to take the traces and to label each section for us before compression happens; but the results, let me assure you, are well worth the effort. Look at the chart and table below to get an idea:</p> <figure><p><em>Chart: Scatter plot of Avg reasoning tokens (log scale) versus GSM8K accuracy (t=0). It is shown in the post on the site.</em></p>  <figcaption><strong>Figure 1:</strong> GSM8K accuracy at greedy decoding versus average reasoning tokens. Up and to the left is better. Section-aware compression beats uncompressed SFT while using about half the tokens; flat compression spends the most tokens and collapses to a score of .03, looping on 93% of problems. Loop rates under each label.</figcaption></figure> <div><table><thead><tr><th>GSM8K t=0</th><th>accuracy</th><th>avg reasoning tokens</th><th>loop rate</th></tr></thead><tbody><tr><td>original model</td><td>.575</td><td>4,413</td><td>.22</td></tr><tr><td>uncompressed SFT</td><td>.62</td><td>4,402</td><td>.25</td></tr><tr><td>flat compression</td><td>.03</td><td>7,960</td><td>.93</td></tr><tr><td>section-aware</td><td>.77</td><td>2,586</td><td>.11</td></tr><tr><td>section-aware, trained bare</td><td>.82</td><td>1,524</td><td>.12</td></tr></tbody></table></div> <p>I am also throwing in the temperature sweep data:</p> <div><table><thead><tr><th>GSM8K loop sweep @ t=0 (n=50)</th><th>accuracy</th><th>avg reasoning tokens</th><th>loop rate</th></tr></thead><tbody><tr><td>original model</td><td>.64</td><td>3,915</td><td>.28</td></tr><tr><td>uncompressed SFT</td><td>.54</td><td>4,894</td><td>.34</td></tr><tr><td>flat compression</td><td>.02</td><td>8,031</td><td>.96</td></tr><tr><td>section-aware</td><td>.82</td><td>2,211</td><td>.14</td></tr><tr><td>section-aware, trained bare</td><td><strong>.86</strong></td><td><strong>1,228</strong></td><td>.10</td></tr></tbody></table></div> <div><table><thead><tr><th>GSM8K loop sweep @ t=0.6 (n=50)</th><th>accuracy</th><th>avg reasoning tokens</th><th>loop rate</th></tr></thead><tbody><tr><td>original model</td><td>.68</td><td>3,827</td><td>.12</td></tr><tr><td>uncompressed SFT</td><td>.58</td><td>4,730</td><td>.22</td></tr><tr><td>flat compression</td><td>.20</td><td>6,531</td><td>.74</td></tr><tr><td>section-aware</td><td>.84</td><td>2,266</td><td>.08</td></tr><tr><td>section-aware, trained bare</td><td>.82</td><td>1,911</td><td>.12</td></tr></tbody></table></div> <div><table><thead><tr><th>GSM8K loop sweep @ t=1 (n=50)</th><th>accuracy</th><th>avg reasoning tokens</th><th>loop rate</th></tr></thead><tbody><tr><td>original model</td><td>.74</td><td>4,141</td><td>.00</td></tr><tr><td>uncompressed SFT</td><td>.64</td><td>4,319</td><td>.18</td></tr><tr><td>flat compression</td><td>.90</td><td>1,501</td><td>.04</td></tr><tr><td>section-aware</td><td>.78</td><td>2,610</td><td>.08</td></tr><tr><td>section-aware, trained bare</td><td>.74</td><td>3,373</td><td>.16</td></tr></tbody></table></div> <p>Notice the “trained bare” addition, we will get back to it soon.</p> <p>As you can observe, section-aware training completely solves the greedy collapse, and beats not only the collapsed compression-trained model, but also the original model and our control, while using about a third of the tokens in the bare trained variant! Flat compression still dominates in the temperature=1 benchmark, but section-aware is still satisfactory, achieving the same score as the original model while using ~19% less tokens, and it also remains stable at lower temperatures; <em>keep in mind that only 50 samples are present in the loop sweep benchmark</em>. Also notice how for the section-aware model the number of doom loops increased together with the temperature.</p> <h3 id="training-bare">Training bare</h3> <p>For this study I ran many compression experiments; the more questions came up the more experiments needed to be run. At one point one of my questions was: does training with a system prompt affect performance? Initially we decided to use a system prompt (e.g. “Please reason step by step, and put your final answer within <code>\boxed{}</code>.” for the math domain), but what I found is that <em>not including the system prompt at training time</em>, and only including it at eval time, improves performance significantly!</p> <p>Check the full bench sweep for the 2 models below:</p> <div><table><thead><tr><th>trained WITH prompt</th><th>accuracy</th><th>avg reasoning tokens</th><th>loop rate</th><th>truncation rate</th></tr></thead><tbody><tr><td>GSM8K</td><td>.77</td><td>2,586</td><td>.11</td><td>.22</td></tr><tr><td>MATH-500</td><td>.53</td><td>5,120</td><td>.16</td><td>.47</td></tr><tr><td>HumanEval</td><td>.53</td><td>5,047</td><td>.16</td><td>.43</td></tr><tr><td>MBPP</td><td>.41</td><td>6,090</td><td>.32</td><td>.59</td></tr><tr><td>MMLU-Pro</td><td>.52</td><td>4,427</td><td>.14</td><td>.35</td></tr></tbody></table></div> <div><table><thead><tr><th>trained W/O prompt</th><th>accuracy</th><th>avg reasoning tokens</th><th>loop rate</th><th>truncation rate</th></tr></thead><tbody><tr><td>GSM8K</td><td><strong>.82</strong></td><td><strong>1,524</strong></td><td>.12</td><td>.15</td></tr><tr><td>MATH-500</td><td>.57</td><td>3,821</td><td>.25</td><td>.43</td></tr><tr><td>HumanEval</td><td>TBD</td><td>—</td><td>—</td><td>—</td></tr><tr><td>MBPP</td><td>TBD</td><td>—</td><td>—</td><td>—</td></tr><tr><td>MMLU-Pro</td><td>TBD</td><td>—</td><td>—</td><td>—</td></tr></tbody></table></div> <p>Training without a prompt gives us better performance with less tokens at inference time, but why is that? My hypothesis here is behavior gating: using system prompts while training on a new behavior makes that behavior be gated behind the used prompts; while you may think that under this assumption the prompt-trained model shall perform just like the bare-trained one given that the system prompt is available at inference time, it is possible that by training <em>without the system prompts the per-domain gains accumulated</em>, while training with the prompts may have caused the gains to be split in domain-side compartments.</p> <p>To verify a form of behavior gating I also decided to train the model with and without an <a href="https://github.com/marcodsn/reasoning-compression/blob/main/flint/prompts/system_prompt_base.j2" rel="nofollow">identity system prompt</a>; this prompt tells the model everything about the style it shall follow, how to speak and so on. The result was positive and training the model with this identity prompt effectively gates the compressed reasoning behavior behind it: if you use this system prompt at eval time the reasoning is compressed, otherwise it is not and the model performs just like the original.</p> <h3 id="can-we-fix-the-greedy-collapse">Can we fix the greedy collapse?</h3> <p>Just around the time I started re-experimenting on Flint, a new research post by <a href="https://www.liquid.ai/" rel="nofollow">Liquid AI</a> was released: <a href="https://www.liquid.ai/blog/antidoom" rel="nofollow">Reducing Doom Loops with Final Token Preference Optimization</a>. This post illustrates a new technique designed to kill doom loops: “oh, couldn’t that be exactly we need to fix the flat compression collapse under greedy decoding?” that’s what I thought, but the answer was a solid <em>no</em>.</p> <p>Remember when we talked about the loops we got before, and about how they were <em>special</em>. Antidoom works by making the loop-causing tokens less probable in the output distribution of a model, but that our flat compression models loop on tokens that we should absolutely <strong>not</strong> remove: they often loop on numbers, sometimes even on the final answer; we can’t make number and the correct solution LESS probable! Or maybe, we can: I actually ran FTPO, against my own intution, and following are the results:</p> <div><table><thead><tr><th>Arm</th><th>accuracy</th><th>avg reasoning tokens</th><th>loop rate</th><th>truncation rate</th></tr></thead><tbody><tr><td>sft-flint-adaptive-v2</td><td>.03</td><td>7,960</td><td>.93</td><td>.97</td></tr><tr><td>sft-flint-adaptive-v2-antidoom</td><td>.00</td><td>8,192</td><td>.81</td><td>1.00</td></tr></tbody></table></div> <p>Long story short: the loops do decrease, but the model is not able to ever find or output the answer; even when it does not loop it can’t stop trying to output a solution it will never be able to output. Sounds like a nightmare to me, so let’s stop experimenting with antidoom here, just to be safe in case LLMs ever become sentient.</p> <h2 id="what-else-did-not-work">What else did not work?</h2> <p>I also wanted to share a few more failed intuitions I got while working on Flint (after all, sharing failures is also important to accelerate research):</p> <ol><li><strong>“If we keep the last section of the reasoning trace verbatim, the model may stop looping.”</strong> Nope: the flat compression model still collapses into loops even when retaining the original trace’s closure.</li> <li><strong>“Training for more epochs may improve things”</strong> No again: I tried training with flat compression for 3 epochs instead of 2 but the result was just a worse model overall, both in accuracy and length of the reasoning.</li> <li><strong>“I shall try using a better model as the segmenter for section-aware training.”</strong> That also did not work; why? I don’t have a definitive answer yet. I tested training with segmentation done by a bigger LLM while still delegating the compression step to the original model, but the result was, once again, a worse model overall.</li></ol> <h2 id="what-about-non-reasoning-tasks">What about non-reasoning tasks?</h2> <p>I built <a href="https://huggingface.co/datasets/marcodsn/crucible" rel="nofollow">crucible</a> with the objective to also retain writing abilities: included are multilingual, open-ended, creative queries. These are (obviously) not objectively verifiable, but we used an LLM-as-a-judge to compare the samples from our compressed models against those generated by the original model, and the (section-aware, the only we tested) compressed models won more overall, while using around 10% less thinking tokens; even though this does not mean that the compressed models write better, we can assume that they <em>at least</em> don’t write much worse.</p> <h2 id="do-all-of-these-findings-transfer-across-families-and-sizes">Do all of these findings transfer across families and sizes?</h2> <p>When I decided I was satisfied with the results I got with Qwen3.5-4B, I decided to move on to gemma-4-12b-it; we are changing model family (in particular, the underlying architecture) and size. As I was resource constrained at this point (distilling and tuning a 12b model at home takes time) I decided to only train the uncompressed SFT control and a compressed variant with the best settings we got so far: a section-aware, bare trained version.</p> <p>So, how did it go? The answer is: surprisingly well! Check the table below:</p> <div><table><thead><tr><th>gemma-4-12b</th><th>GSM8K</th><th>MATH-500</th><th>HumanEval</th></tr></thead><tbody><tr><td>original model</td><td>.57 @ 3,753 (41% trunc)</td><td>.51 @ 5,078</td><td>.31 @ 6,107 (69% trunc)</td></tr><tr><td>uncompressed SFT (control)</td><td>.68 @ 2,942 (30% trunc)</td><td><strong>.60 @ 4,231</strong></td><td>—</td></tr><tr><td>section-aware, trained bare</td><td><strong>.86 @ 1,679</strong> (10% trunc)</td><td>.49 @ 4,883</td><td><strong>.57 @ 4,777</strong> (43% trunc)</td></tr></tbody></table></div> <p>The compressed model performs a lot better already, both in math and in code generation. But, how does reasoning in a compressed style improve accuracy? We also noticed this with qwen, so, why is happening? Did the model get distracted by the many useless tokens it generated? Maybe it is because using less tokens the context does not get too big and context degradation is less pronounced? Those are real possibilities, but the most obvious answer here is… the original model just thinks for <em>too much time</em>, so much so that it’s results got truncated 41% of the times in GSM8K.</p> <p>That is also the reason why our control also performs better than the original model; the uncompressed traces we used are verified, so only those that actually get to a right answer got included in the training, and that alone steered the behavior of gemma in a good way. gemma-12b might just not be a well optimized reasoner from the start, and for this reason we are able to get massive improvements here.</p> <h3 id="temperature-sweep-surprises">Temperature sweep surprises</h3> <p>Remember how our section-aware trained Qwen got worse at higher temperatures while being a beast at temperature=0? Well, surprisingly, compressed gemma is also a beast at higher temperatures, and it actually gets better the higher the temperature gets!</p> <figure><p><em>Chart: Accuracy across sampling temperatures. It is shown in the post on the site.</em></p>  <figcaption><strong>Figure 2:</strong> Gemma-4-12b across sampling temperatures (n=50). Compression wins at every temperature, and its t=1.0 cell (.96 at 1,421 tokens, zero loops) is the best single result of the study.</figcaption></figure> <p>This means that compressed gemma is retaining the temperature behavior of its original weights, and that this model I built is <em>overall</em> better; I honestly wasn’t satisfied with the results I got from Qwen: either a better model at temperature=0 but mid at higher temps or a better model at temperature=1 but worse at lower temps. This compressed gemma is what I hoped to get from the start, and that is why I also <a href="https://huggingface.co/marcodsn/gemma-4-12b-it-flint-section-merged" rel="nofollow">released it on Hugging Face</a>, as a merged checkpoint!</p> <h2 id="takeaways">Takeaways</h2> <p>To conclude, what did we learn today?</p> <ol><li><strong>Termination is the number one failure we had to deal with</strong>, so be aware of it if you’d also try to play with an LLM’s brain in the future.</li> <li><strong>A behavior can be easily gated</strong>, and this is honestly pretty cool; imagine training a same model with different system prompts to enable or disable various capabilities at will, all in the same weights. I’ll personally experiment more on that in the near future.</li> <li><strong>Distilling across models is more complex than it sounds like</strong>; also keep this in mind the next time you see a “Opus-Fable-GPT-MaximumPerformance-BESTMODELEVER” tune on Hugging Face, they are probably worse than the original models anyway.</li></ol> <h2 id="artifacts">Artifacts</h2> <p>I have also published all the artifacts that got generated in this study (LoRA adapters and datasets), together with a full logbook and code; I’ll leave you to them!</p> <ul><li><a href="https://huggingface.co/collections/marcodsn/caveman-reasoning-compression" rel="nofollow">caveman-reasoning-compression</a> (Hugging Face)</li> <li><a href="https://huggingface.co/collections/marcodsn/reasoning-compression-ablation-arms" rel="nofollow">reasoning-compression-ablation-arms</a> (Hugging Face)</li> <li><a href="https://github.com/marcodsn/reasoning-compression" rel="nofollow">marcodsn/reasoning-compression</a> (GitHub)</li></ul> <p>The code and the logbook were produced by an agent (Fable); the ideas, chosen experiments, successful and failed intuitions are mine.</p>]]></content:encoded>
    </item>
    <item>
      <title>Hardware-in-the-Loop: The Architecture Search Behind LFM2</title>
      <link>https://marcodsn.com/blog/lfm2-architecture-search</link>
      <guid isPermaLink="true">https://marcodsn.com/blog/lfm2-architecture-search</guid>
      <description>An analysis of Liquid&apos;s latest paper on architecture search with hardware-in-the-loop.</description>
      <dc:creator>Marco De Santis</dc:creator>
      <pubDate>Sun, 29 Mar 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[<p>The last two years have produced a wave of efficient hybrid architectures for language models.<small> [Note 1: <a href='https://arxiv.org/abs/2504.03624'>Nemotron-H: A Family of Accurate and Efficient Hybrid Mamba-Transformer Models</a>]</small><small> [Note 2: <a href='https://www.ibm.com/new/announcements/ibm-granite-4-0-hyper-efficient-high-performance-hybrid-models'>IBM Granite 4.0: hyper-efficient, high performance hybrid models for enterprise</a>]</small><small> [Note 3: <a href='https://arxiv.org/abs/2510.26692'>Kimi Linear: An Expressive, Efficient Attention Architecture</a>]</small><small> [Note 4: <a href='https://arxiv.org/abs/2603.15569'>Mamba-3: Improved Sequence Modeling using State Space Principles</a>]</small> They combine convolutions, state-space models, and attention in varying proportions, and each combination arrives with an argument about what each component should contribute. What the papers rarely document is the design process itself. It is usually unclear whether an architecture was searched systematically or assembled from intuition, and ablations of the individual submodules are largely absent. The question hanging over the genre is: <em>how much does each component actually contribute?</em></p> <a href="https://www.liquid.ai/">Liquid AI</a>'s LFM2 report is the rare paper that answers it, because the search itself is the method. Real phones and laptops sit inside the optimization loop, and more than fifty evaluations together with measured latency pick the architecture. We can state what the search converged on up front: a majority of gated short convolutions, a small minority of attention blocks, and nothing else. That simplicity is the finding worth sitting with. We will walk through the search in three steps: the space, the hardware filter, and the selection rule. <h2 id="from-liquid-networks-to-lfms">From liquid networks to LFMs</h2> <p>Liquid AI is a Cambridge, Massachusetts-based company founded in 2023. Its founders debuted with Liquid Neural Networks: compact, adaptive networks inspired by the neural architecture of a microscopic worm (<a href="https://pubmed.ncbi.nlm.nih.gov/4366476/">C. elegans</a>), designed to adjust their behavior to inputs over time, much as biological neurons do.</p> <p>That efficiency-first orientation carried into their language-model work. The first Liquid Foundation Models, released in 2024, departed from the Transformer architecture that still dominates the field. The <a href="https://huggingface.co/collections/LiquidAI/lfm2">LFM2</a> family followed in July 2025: a hybrid design combining gated short convolutions for local sequence mixing with a minority of Grouped Query Attention blocks for long-range interaction. We are interested here in what sets LFM2 apart from the other hybrids: the systematic search that produced that combination, detailed in the <a href="https://arxiv.org/abs/2511.23404">paper published in December 2025</a>.</p> <h2 id="why-proxy-signals-fail">Why proxy signals fail</h2> <p>Neural Architecture Search is not new. The idea is straightforward: define a space of possible architectures, then let an optimization algorithm find the best one according to some performance metric. The catch has always been cost. Training every candidate to convergence is unaffordable, so NAS traditionally leans on proxy signals — perplexity as a stand-in for quality, cache size as a stand-in for efficiency — to rank candidates cheaply.</p> <p>Liquid AI had already been down that road with <a href="https://arxiv.org/abs/2411.17800">STAR</a>, their earlier synthesis framework. The conclusion they drew from that experience shapes everything in the LFM2 paper: proxy signals are not sufficient. They fail worst exactly where an edge-deployment lab cares most, namely predicting how an architecture behaves on real hardware. Theoretical FLOPs and cache-size arithmetic do not capture what a phone’s memory hierarchy, its runtime, and its scheduler will do to a particular composition of blocks.</p> <p>For LFM2 they inverted the approach: optimize directly on an internal suite of more than fifty evaluations (spanning knowledge recall, reasoning, multilingual robustness, tool use, math, and long-context tasks), together with latency and peak memory measured on the target devices themselves.</p> <h2 id="the-search-space">The search space</h2> <p>In optimization terms, a search space is every assignment of the decision variables that respects the problem’s constraints: all 0–1 vectors of length 100, all valid schedules, all graphs with n nodes. In NAS the assignments are neural network architectures. For LFM2, that means decoder-only stacks built from several block families: local-context and subquadratic blocks,<small> [Note 5: Gated short convolutions, sliding-window attention, linear attention variants (GLA, HGRN2), state-space models (S4, Liquid-S4, S5, RTF, Mamba, Mamba2), and Liquid Time-Constant networks (CfC).]</small> global-context blocks,<small> [Note 6: Grouped-Query Attention (GQA) with varying group counts and head dimensions, stabilized with QK-Norm.]</small> and position-wise blocks,<small> [Note 7: SwiGLU FFNs whose expansion ratio is itself a search variable rather than fixed by hand.]</small> plus layout<small> [Note 8: Interleaving patterns of block types, total block counts under fixed parameter budgets, plus options for weight sharing and cache reuse across layers.]</small> and MoE options.<small> [Note 9: Per-layer sparse FFNs with varying width and expert granularity.]</small></p> <p>We want to pause on how broad this space is. It contains pure Transformers, pure state-space models, and essentially every hybrid pattern the recent literature has proposed. Nothing about the setup favors the architecture that eventually won.</p> <h2 id="hardware-in-the-loop">Hardware in the loop</h2> <p>The paper’s central move is what happens to each candidate before quality is ever measured. Every architecture is exported and profiled directly on a Samsung Galaxy S24 Ultra (Qualcomm Snapdragon 8 Gen 3 SoC) and an AMD Ryzen HX 370 laptop CPU, on the release runtimes, recording four quantities:</p> <ul><li><strong>Time to first token (TTFT).</strong> How long the device takes to produce the first output token.</li> <li><strong>Prefill throughput.</strong> Prompt-processing speed, in tokens per second.</li> <li><strong>Decode latency.</strong> Milliseconds per generated token, at p50 and p95.<small> [Note 10: <strong>p50</strong>: median decode latency — the "typical" speed a user experiences. <strong>p95</strong>: the slowest 5% of tokens fall above this threshold, capturing occasional spikes from cache pressure or scheduling jitter.]</small></li> <li><strong>Peak memory.</strong> Measured at 4K and 32K context windows.</li></ul> <p>Candidates that violate any device-side budget (TTFT, decode latency, or peak memory) are discarded outright, and never reach the quality evaluations. The expensive, noisy question of whether an architecture is smart is asked only about architectures already proven deployable.</p> <h2 id="picking-winners-on-the-pareto-frontier">Picking winners on the Pareto frontier</h2> <p>We are left with the surviving candidates, and the question becomes which one is best. There is no single answer, because quality, latency, and memory are competing objectives; an architecture that scores better on evaluations usually pays for it in latency or memory. This is the setting Pareto optimization was designed for. A candidate is <em>Pareto optimal</em> if no other candidate improves on it in every objective simultaneously. The set of all such candidates forms the <em>Pareto frontier</em>, and any point on the frontier is a defensible choice. The figure below illustrates the selection procedure:</p> <figure><p><em>Chart: Illustration of Pareto-frontier selection under a hardware budget. It is shown in the post on the site.</em></p>  <figcaption><strong>Figure 1:</strong> An illustration of the selection procedure (points are illustrative, not paper data). Candidates that exceed any device-side budget are discarded before quality evaluation. Among the survivors, gray points are dominated — some other candidate is better on both axes — and the frontier traces the candidates where improving quality must cost latency.</figcaption></figure> <p>In practice the paper ranks surviving candidates by <em>hypervolume improvement</em> — how much a new candidate expands the volume of objective space dominated by the current frontier. This collapses the three-way trade-off into a single scalar, making candidates directly comparable. Candidates that advance the frontier are carried forward; the rest are dropped.</p> <h2 id="what-the-search-found">What the search found</h2> <p>We come now to what all of this machinery converged on, and it is the paper’s most striking result. Across every size target, the search repeatedly selected the same minimal hybrid: a majority of inexpensive gated short convolution blocks, interleaved with a small minority of GQA blocks, and nothing else. State-space models, linear attention variants, Mamba, and the rest of the subquadratic menagerie were all valid candidates. Under the targeted on-device CPU budgets and runtimes, none of them improved the quality–latency–memory trade-off over the simplest possible combination.</p> <h2 id="closing-thoughts">Closing thoughts</h2> <p>We read the LFM2 search as, in effect, the broad ablation of the hybrid design space that the literature has been missing. The field has spent considerable effort on increasingly intricate hybrids, motivated by theoretical arguments about what each component should contribute. Liquid AI bypasses the arguments: rather than engineering a design from intuition and justifying it afterward, they let the hardware and the downstream tasks decide.</p> <p>What the hardware and the tasks said is that once a handful of global attention layers handle long-range retrieval, inexpensive gated short convolutions appear to be sufficient for everything else. The verdict is specific to the regime in the loop (on-device CPU budgets and release runtimes) and may not transfer elsewhere. Within that regime, however, complexity was not a necessity. We would have no principled way of knowing that without a systematic search, which is, perhaps, the paper’s real contribution: less the architecture than the receipt.</p>]]></content:encoded>
    </item>
    <item>
      <title>Exploring Mimi</title>
      <link>https://marcodsn.com/blog/exploring-mimi</link>
      <guid isPermaLink="true">https://marcodsn.com/blog/exploring-mimi</guid>
      <description>A state-of-the-art audio neural codec developed by Kyutai.</description>
      <dc:creator>Marco De Santis</dc:creator>
      <pubDate>Fri, 04 Oct 2024 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[<p>Today we are going to explore Mimi, a state-of-the-art neural audio codec developed by <a href="https://kyutai.org/" rel="nofollow">Kyutai</a>.
We will compare audio quality before and after Mimi processing,
and we will then study how Mimi works and what types of outputs it produces.</p> <h2 id="what-is-mimi">What is Mimi?</h2> <blockquote><p><em>Mimi codec is a state-of-the-art audio neural codec, developed by Kyutai, that combines semantic and acoustic information into audio tokens running at 12Hz and a bitrate of 1.1kbps.</em></p></blockquote> <p>This is the official description of Mimi from the <a href="https://huggingface.co/kyutai/mimi" rel="nofollow">Kyutai’s Hugging Face repo</a>.</p> <p>Mimi is also the neural audio codec that powers <a href="https://kyutai.org/Moshi.pdf" rel="nofollow">Moshi</a><small> [Note 1: Moshi is Kyutai's real-time, full-duplex speech-to-speech model. Unlike most voice assistants, it can listen and speak simultaneously, rather than taking turns.]</small> (check <a href="http://moshi.chat" rel="nofollow">moshi.chat</a> for a demo), which we may discuss in a future post.</p> <h3 id="what-is-a-neural-audio-codec">What is a Neural Audio Codec?</h3> <p>First, let’s define a codec: A codec, short for “coder-decoder” or “compressor-decompressor”,
is a device or computer program that encodes or decodes a digital data stream or signal.</p> <p>The primary purposes of codecs are to:</p> <ol><li>Reduce file size for efficient storage</li> <li>Decrease bandwidth requirements for transmission</li> <li>Maintain an acceptable level of quality</li></ol> <p>An audio codec is a codec that encodes or decodes audio data. There exist two types of audio codecs:</p> <ol><li><strong>Lossy audio codecs</strong>: These compress audio by removing some data, resulting in smaller file sizes but with some loss in quality (e.g., MP3, AAC).</li> <li><strong>Lossless audio codecs</strong>: These compress audio without losing any original data, maintaining perfect quality but with larger file sizes compared to lossy codecs (e.g., FLAC, ALAC).</li></ol> <p>Finally, a neural audio codec is a type of lossy audio codec that leverages artificial intelligence and machine learning techniques,
neural networks in particular, to compress and decompress audio signals.</p> <p>Some examples of neural audio codecs include:</p> <ul><li><a href="https://research.google/blog/lyra-a-new-very-low-bitrate-codec-for-speech-compression/" rel="nofollow">Lyra</a>: Developed by Google, Lyra is a neural audio codec designed for low-bitrate speech compression</li> <li><a href="https://audiocraft.metademolab.com/encodec.html" rel="nofollow">EnCodec</a>: Created by Meta AI, EnCodec is a high-fidelity neural audio codec that can compress audio at various bitrates while maintaining quality.</li> <li><a href="https://research.google/blog/soundstream-an-end-to-end-neural-audio-codec/" rel="nofollow">SoundStream</a>: Another neural audio codec developed by Google, focusing on high-quality audio compression at low bitrates.</li></ul> <p>Mimi’s architecture is mostly derived from SoundStream and EnCodec, as stated in the <a href="https://kyutai.org/Moshi.pdf" rel="nofollow">official paper</a>, although it has some novel features that set it apart.</p> <h2 id="mimi-in-detail">Mimi in Detail</h2> <p>As mentioned earlier, Mimi is a neural audio codec that combines semantic and acoustic information into audio tokens, running at 12Hz and a bitrate of 1.1kbps. As such, Mimi is a fascinating codec that produces high-quality audio at an incredibly low bitrate.</p> <p>Being an audio codec, Mimi is composed by two main components:</p> <ol><li><strong>An encoder</strong>: This component takes an audio signal as input and compresses it into a smaller representation.</li> <li><strong>A decoder</strong>: This component takes the compressed representation and reconstructs the audio signal.</li></ol> <p>These are both neural networks, and can be visualized as a bottleneck architecture, where the audio signal is first compressed and then reconstructed.</p> <h3 id="the-encoding-process">The Encoding Process</h3> <p>The encoder compresses the audio signal into a sequence of audio codes, split into semantic and acoustic audio tokens. Here’s how it works:</p> <ol><li>The audio signal is split into frames, each lasting 0.08 seconds, with a frame rate of 12.5Hz</li> <li>Each frame is passed through a convolutional neural network (CNN) and a transformer, which convert the frame into a vector of length 512.</li> <li>This vector is then passed through 8 quantizers<small> [Note 2: The quantization method used is Residual Vector Quantization (RVQ). Each quantizer encodes the residual error left by the previous one, progressively refining the representation.]</small>, which quantize the audio signal into audio tokens (each quantizer produces 1 token per frame): <ul><li>1 quantizer for the semantic tokens (which represent the content of the audio)</li> <li>7 (according to the paper, see below for details) residual quantizers for the acoustic tokens (which represent the style of the audio)</li></ul></li> <li>The quantized audio tokens are concatenated to produce a tensor of shape (batch_size, 8, frame_rate * audio_seconds)</li></ol> <p>This is a high-level overview of the encoding process. For a more detailed explanation, you can refer to the <a href="https://kyutai.org/Moshi.pdf" rel="nofollow">official paper</a>.</p> <h3 id="bitrate-calculation">Bitrate Calculation</h3> <p>Let’s calculate the bitrate of Mimi based on the information provided:</p> <ul><li>Frame rate: 12.5Hz</li> <li>Number of audio tokens per frame: 8</li> <li>Number of bits per audio token: log_2(2048) = 11 (since there are 2048 possible audio tokens)</li></ul> <p>Therefore, the bitrate is calculated as:
12.5 * 8 * 11 = 1100 bits per second, or 1.1kbps, as advertised.</p> <p>Although, here we find a discrepancy: the paper states that there are 8 audio tokens per frame,
but the official implementation produces 32 audio tokens per frame, utilizing 32 quantizers instead of 8;
This is significant as it quadruples the bitrate to 4.4kbps and makes us question if the results provided in the paper refer to the official implementation or to an actually 1.1kbps unreleased model.</p> <p>A community post was made on the <a href="https://huggingface.co/kyutai/mimi/discussions/3" rel="nofollow">Hugging Face forum</a> to address this issue, but no official response has been given yet.</p> <h3 id="the-decoding-process">The Decoding Process</h3> <p>The decoder takes the quantized tokens and reconstructs the audio signal. It follows these steps:</p> <ol><li>The tokens are passed through an inverse quantization process.</li> <li>The resulting embeddings are processed by another transformer network.</li> <li>Finally, a decoder CNN (mirroring the encoder’s CNN) reconstructs the audio waveform.</li></ol> <h2 id="audio-quality-comparison">Audio Quality Comparison</h2> <p>In this section we are doing something more practical: we are going to compare the audio quality before and after Mimi’s processing (encoding and reconstruction).</p> <p>The audio clips we are going to use are:</p> <ol><li>The first sample from the <a href="https://huggingface.co/datasets/hf-internal-testing/librispeech_asr_dummy" rel="nofollow">hf-internal-testing/librispeech_asr_dummy</a> validation dataset</li> <li>A <a href="https://youtu.be/dndIOkdod9c" rel="nofollow">Music Clip</a> from the <a href="https://www.youtube.com/@NoCopyrightSounds" rel="nofollow">NCS YouTube channel</a></li> <li>A <a href="https://youtu.be/mQTEgWRi7FU" rel="nofollow">Japanese Speech Clip</a> from the <a href="https://www.youtube.com/@sorathetroll" rel="nofollow">Sora The Troll Youtube channel</a></li></ol> <p>The clips will be presented as both the original audio and the audio after Mimi’s processing, so you can compare the quality for yourself.
Keep in mind that the given original audios have been resampled to 24kHz<small> [Note 3: Resampling to 24kHz is a mild downgrade for music (CD quality is 44.1kHz) but has negligible impact on speech intelligibility, since human speech sits well within the 0–12kHz range.]</small>, as Mimi only supports 24kHz audio.</p> <p>The code we used to process the audio clips is available on my <a href="https://github.com/marcodsn/exploring-mimi" rel="nofollow">GitHub repository</a>.</p> <ol><li><strong>Speech Clip</strong></li></ol> <p>Original Speech Clip<br/><audio controls="" src="https://marcodsn.com/assets/exploring-mimi/audios/librispeech_val_0/original_24kHz.wav" preload="none"></audio></p> <p>Mimi-processed Speech Clip<br/><audio controls="" src="https://marcodsn.com/assets/exploring-mimi/audios/librispeech_val_0/output.wav" preload="none"></audio></p> <ol start="2"><li><strong>Music Clip</strong> (Fourier, Reverse Prodigy, ZAM - Ares (Tear Up My Horizon) [NCS Release])</li></ol> <p>Original Music Clip<br/><audio controls="" src="https://marcodsn.com/assets/exploring-mimi/audios/Fourier_Reverse_Prodigy_ZAM-Ares/original_24kHz.opus" preload="none"></audio></p> <p>Mimi-processed Music Clip<br/><audio controls="" src="https://marcodsn.com/assets/exploring-mimi/audios/Fourier_Reverse_Prodigy_ZAM-Ares/output.opus" preload="none"></audio></p> <ol start="3"><li><strong>Japanese Speech Clip</strong></li></ol> <p>Original Japanese Speech Clip<br/><audio controls="" src="https://marcodsn.com/assets/exploring-mimi/audios/When Japanese Voice Actor Pronounces The Earth/original_24kHz.opus" preload="none"></audio></p> <p>Mimi-processed Japanese Speech Clip<br/><audio controls="" src="https://marcodsn.com/assets/exploring-mimi/audios/When Japanese Voice Actor Pronounces The Earth/output.opus" preload="none"></audio></p> <p>To better show the difference between the original and Mimi-processed audio clips, I am also attaching a waveform comparison for the music clip:</p> <p><img src="https://marcodsn.com/assets/exploring-mimi/images/24kHz_mimi_channel_comparison.webp" alt="Waveform Comparison" width="1600" height="1067"/></p> <p>The light blue waveform represents the original audio, while the orange waveform represents the Mimi-processed audio; above is the left channel, below is the right channel.</p> <p>As you can see (and hear) the Mimi-processed audio is quieter and has a lower dynamic range compared to the original audio, which is to be expected given the low bitrate of Mimi (although I am now curious to know how this same clip would sound with the 1.1kbps model). This results in less spatiality and detail in the audio, especially for music clips, but it still retains the overall structure and intelligibility of the original audio, making it suitable for speech applications.</p> <h2 id="applications-of-mimi">Applications of Mimi</h2> <p>Mimi was primarily developed to power Moshi, a speech-to-speech AI model. To understand its significance, it’s important to know that current chat models (such as GPT and other Large Language Models, or LLMs) primarily operate on text tokens<small> [Note 4: Text tokenization typically uses methods like Byte-Pair Encoding (BPE) or SentencePiece, producing vocabularies of 30k–100k tokens. Mimi's audio vocabulary of 2048 tokens per quantizer is comparatively compact.]</small> - discrete numerical representations of words or parts of words. These models aren’t inherently designed to process audio data.</p> <p>This is where Mimi comes in. It bridges the gap between audio and text by converting audio into discrete tokens, similar to how text is tokenized. Mimi produces these audio tokens in a format that existing text-based LLMs can understand and process. This clever approach allows text-only models to support audio understanding and generation without requiring a complete overhaul of their architecture.</p> <p>The implications of this are significant. Theoretically, we could fine-tune existing text-trained models to work with audio (as demonstrated with Moshi) by teaching them to interpret these audio tokens alongside text tokens. This is an exciting area that I plan to explore further in the future (so be sure to keep an eye on my blog!).</p> <p>Moreover, this Mimi-LLM combination can also be used for speech-to-text and text-to-speech applications, as explored in the <a href="https://kyutai.org/Moshi.pdf" rel="nofollow">Moshi paper</a>.</p> <h2 id="conclusions">Conclusions</h2> <p>Mimi represents a significant step forward in the field of neural audio codecs.
Its ability to compress audio to incredibly low bitrates while maintaining good quality, especially for speech, is impressive.
The separation of semantic and acoustic information into distinct tokens is a novel approach that opens up new possibilities for audio processing and generation.</p> <p>However, it’s important to note the discrepancies between the advertised specifications and the actual implementation.
These differences, particularly in the number of quantizers and the resulting bitrate, raise questions about the exact performance metrics of the model described in the paper versus the one available for public use.</p> <p>Despite these uncertainties, Mimi’s potential applications are exciting.
Its integration with language models, as demonstrated by Moshi, points towards a future where open-source AI can more seamlessly interact with and generate audio content.
Oh, yeah, did I mention that Mimi is ACTUALLY open-source? You can find the model on <a href="https://huggingface.co/kyutai/mimi" rel="nofollow">Hugging Face</a>.</p> <p>I look forward to diving deeper into this and other architectures, and I hope you’ll join me on this journey :)
Until next time, happy exploring!</p>]]></content:encoded>
    </item>
  </channel>
</rss>
