Meet LenVM: The 3B Open Source Model That Beats GPT-5.4 at Precise Length Control
What if a tiny 3 billion parameter open source model could outperform the most advanced closed source giants like GPT-5.4 and Claude Opus 4.6 at controlling how long its answers should be? Meet LenVM, a breakthrough approach that brings length control down to the individual token level. This new method opens up a whole new way to train models through scalable value pretraining. With the same token budget, reasoning accuracy jumps by 10 times, from 6% all the way to 63%.
Token is the basic building block of modern AI models. Every single token means forward computation, KV cache memory usage, added delay, and energy cost. As long chain reasoning and agent workflows become more popular, the length of generated text directly affects two things. It is the core factor in computing cost, and it affects reasoning quality. More tokens give the model more room to think, but too many tokens lead to wasted resources.
Current length control methods are simply too rough. During training, models get sequence level penalties, but while generating text they have no idea how much is left. Prompt instructions are basically begging the model to follow rules, with no hard limits. Length predictors before decoding only make one single guess and cannot adjust later. All these methods share the same weakness. They work at the sequence level, but decoding happens one token at a time. No existing framework models remaining length at this fine level.
Looking deeper, value functions have long been proven in reinforcement learning as powerful tools for modeling future rewards. Yet length has never been treated as a value function problem. There was no training method for it, and no proven scaling path.

A research team from UC Santa Barbara, Apple, and other institutions created the Length Value Model, or LenVM for short. It answers two key questions at once.
First, how can we model length at the token level? LenVM turns length modeling into a value estimation problem in reinforcement learning. Every generated token gets a fixed negative reward. These rewards add up with discounting to create a bounded and steady signal for remaining length. This way, the model knows exactly how far it still has to go at every single decoding step.
Second, how can value pretraining scale up? This design naturally brings four properties that are perfect for large scale pretraining. It needs no human labels. The signal is dense and appears at every step. It is unbiased. And it scales smoothly.
This means training LenVM is essentially a self supervised process. No extra human labels or reward models are needed. Just like pretraining language models, you only need to feed it data and it keeps getting stronger.

Paper: https://arxiv.org/abs/2604.27039
Code: https://github.com/eric-ai-lab/Length-Value-Model
Project Page: https://length-value-model.github.io/
Demo: https://length-value-model.github.io/demo/index.html

The Core Idea: Treat Remaining Length as a Value
The key insight behind LenVM is simple but powerful. Treat the length of generation as a cost. Every token has a fixed cost. The remaining length then naturally becomes a value prediction problem.
At each decoding step t, every token has a fixed negative cost. The total discounted return becomes the remaining length signal. When L is the total target length, a discount factor between 0 and 1 is applied. The closer the discount is to 1, the more important future tokens become.

The corresponding return is

From this, the token level temporal difference error directly measures how much the current token changes the expected remaining length. This becomes a strong signal for future planning.

Why not predict raw tokens directly? Generation length ranges from a few tokens to 32 thousand tokens. This huge range makes direct regression hard. The discount return transform maps the original signal to a fixed range between negative one and zero. At the same time, the fine grained discount factor acts like a smooth button. A larger discount gives higher weight, while a smaller discount creates finer detail near the end of generation.

Scalable Value Pretraining: No Labels Needed
Traditional value models suffer from annotation bottlenecks, reward hacking, and scaling limits. LenVM completely avoids these problems. The training target is built purely from token positions and their actual observed discounted remaining length.

Every token position uses the actual observed discounted remaining length as its regression target. This signal is fully self supervised and can be generated automatically from any completion. It has four key properties.

Experiments confirm that LenVM enjoys clean scaling across all three axes. As more compute, data, and model size are added, the length model keeps getting better without saturation. This proves that as a pretraining target, length value estimation is well posed. More resources directly make the length model stronger.


Three Real World Applications
The team verified LenVM through experiments at different stages. They tested it on base models, supervised fine tuned models, and even modified existing models. Here are the key use cases.

Application One: Exact Length Control
At each decoding step, LenVM predicts a state value for candidate tokens. The model then selects tokens based on the target. Equal To picks tokens whose predicted value is closest to the target return. At Most picks the highest value, closest to zero, to make the response shorter. At Least picks the lowest value, closest to negative one, to make the response longer. This gives hard constraints on token choice, unlike soft prompt based methods.
On the LIFEBench benchmark covering news summaries, creative writing, and English essays at 180 tokens, Qwen2.5 3B plus LenVM 1.5B scores 62.6 on length with only 25.6 bias, beating 83% and 56% baselines. It surpasses GPT-5.4 at 37.4, Claude Opus 4.6 at 35.5, and Gemini 3.1 Pro at 49.3. Even the 7B version with LenVM reaches 64.8 with only 44% bias.
Closed source models struggle with prompt based length control and often fail. LenVM gives precise and effective constraints at every single step.


Application Two: Length Efficiency Trade Off
Through exponential tilting, LenVM reweights the token distribution of the base model using length value. When the tilt parameter is positive, tokens that predict longer writing get higher probability. When negative, it falls back to the original model. This creates a smooth length control knob, balancing length and quality without retraining.



On GSM8K, when forced to nude ai generator predict 200 tokens, hard truncation drops pass at one to 6%. LenVM guided generation achieves 63%, a 10 times improvement. This shows that a small model with the right tool can find better reasoning paths. On MATH500 and MathVista, LenVM also beats hard truncation and reaches the Pareto front, balancing length and accuracy.
hentai ai chat

Application Three: Output Length Prediction
LenVM can predict total response length from just the prompt, before generating a single token. This helps systems plan memory, pre allocate KV cache, and schedule tasks. Direct value estimation gives this information immediately, while existing methods only get it after generation finishes. On 32B models, mean relative error drops from 14.9% to 9.8%, and max error falls from 17.1% to much lower, with one simple addition.


Which Tokens Are Stalling and Which Are Wrapping Up
LenVM token level temporal difference error also offers a window into what the model is thinking. Tokens like wait, but, ah, think, and consider show high positive error. These correspond to turning points and reflection moments. The word ah often appears in phrases like Ah I see the mistake, marking an aha moment.
Tokens like therefore, clearly, perfect, and question marks at the end show high negative error. These signal that the model is reaching conclusions and wrapping up. LenVM is not just a control signal. It is also an observation window that reveals a new layer of model behavior.

Summary
LenVM offers a complete solution to the length control problem. It is the first token level length model that gives every decoding step an exact estimate of remaining length. This bridges the gap between training, inference, and prediction, solving a shared weakness of current methods. Prompt design, training tricks, and pre decoding predictors cannot provide dynamic token level constraints. A 3B open source model now beats GPT-5.4 and Claude Opus 4.6 in precise length control, turning what was once a vague prompt request into a concrete token level length signal.
On scaling, the value pretraining target is naturally annotation free, dense, unbiased, and scalable. The model scales smoothly along model size, data, and sampling axes. This proves that length value pretraining is a well defined dimension. You only need data, not labels, and the length model keeps getting stronger.
At the same time, LenVM opens a dedicated value network path for future reinforcement learning training. Methods like PPO can use it as a base value signal, avoiding complex internal value networks and gaining more stable reward distribution.
Length should not be just a number hidden in statistics. Models should know their remaining budget at every step, just like they know grammar. LenVM makes this possible, bringing a new level of intelligence to AI generation.