Trajectory as the Teacher: Energy-Navigated Distillation for Few-Step Discrete Flow Matching

Energy-Navigated Distillation improves few-step text generation by fixing training trajectory quality, not the student model.
Discrete flow matching generates text by iteratively denoising token sequences, but its high inference cost limits practicality. The paper *Trajectory as the Teacher* argues that poor distillation results stem not from insufficient student model capacity, but from training trajectories built on blind random sampling — causing early errors to propagate through the entire trajectory. To address this, the authors propose Energy-Navigated Distillation, which uses an energy function to guide trajectory construction toward higher-quality intermediate sequences, enabling student models to generate high-quality text in just a few steps.
The Efficiency Problem in Discrete Flow Matching
Discrete Flow Matching is an emerging text generation paradigm that iteratively transforms noisy tokens into coherent language, ultimately producing high-quality text output. Elegant in theory, it faces a significant bottleneck in practice: generating a single fluent passage can require hundreds of forward passes. This steep inference cost makes discrete flow matching difficult to compete with mainstream autoregressive models in real-world deployment.
To address efficiency concerns, researchers typically turn to distillation. The core idea is to have a "student model" learn to replicate the multi-step generation trajectory of a "teacher," compressing what originally required hundreds of steps down to just a few. This direction has been viewed with great optimism — yet results have often fallen short of expectations.

Technically, discrete flow matching is an extension of diffusion models into the discrete domain. Image diffusion models generate images by progressively denoising in a continuous pixel space; discrete flow matching transfers this idea to the discrete token space of text — starting from a sequence of random or masked tokens and gradually "restoring" meaningful words over several steps. Unlike autoregressive models (such as the GPT series), which generate text left-to-right one token at a time, discrete flow matching can modify the entire sequence in parallel, offering theoretically higher parallelism. The tradeoff, however, is the need for multiple complete model forward passes, whereas autoregressive models require only one per token — a gap that is especially pronounced for shorter sequences. This context explains why distillation is needed to compress inference steps before discrete flow matching can be competitive in practice.
The Root Cause: It's the Trajectory, Not the Student
When a distilled student model underperforms, the conventional explanation is "insufficient student capacity" — the model is too small or has too few parameters to learn the complex generation process. However, the paper Trajectory as the Teacher presents a strikingly different view: the real bottleneck is the trajectory itself, not the student model.
The researchers argue that each training trajectory is, in effect, composed of a series of "blind random jumps." In standard discrete flow matching, each sampling step involves no evaluation of the current sequence's quality. The model mechanically replaces tokens according to a probability distribution, with no awareness of whether its intermediate outputs are actually good.
The Cascade of Early Errors
This "blind jump" mechanism has a serious consequence: a poor decision made at an early intermediate point in the generation trajectory will propagate and amplify through every subsequent step. The student model, tasked with faithfully replicating this trajectory, is effectively forced to learn and inherit these early mistakes.
In other words, when the teacher's own demonstrations are flawed, even the most capable student cannot produce high-quality results. The problem lies not in the student's ability to learn, but in the quality of the material being taught. This shift in perspective points toward a new direction for improving few-step discrete flow matching.
This phenomenon is known as compounding errors in control theory and machine learning, and it also appears in the sequential decoding of autoregressive models — but it becomes particularly problematic in the distillation setting for discrete flow matching. In autoregressive generation, each step takes the model's own previous output as input; once the training and inference distributions diverge, errors snowball through subsequent steps — which is why sequence-to-sequence models rely on the "teacher forcing" training technique. In discrete flow matching distillation, the student model is directly trained against flawed intermediate frames from the trajectory, effectively hard-coding incorrect "signposts" into the learning objective itself. This makes the compounding error harder to mitigate through standard regularization than in autoregressive settings.
The Idea Behind Energy-Navigated Distillation
Building on this insight, the paper proposes Energy-Navigated Distillation. The core idea is to introduce a quality-assessment mechanism during trajectory construction — using an "energy" signal to guide the direction of each step, rather than relying entirely on blind random sampling.
By navigating trajectories via an energy function, the method can avoid decision paths that lead to quality degradation early in the generation process, thereby providing the student model with higher-quality, more reliable demonstration trajectories. When the teacher trajectories themselves are better, the student needs only a few steps to reproduce coherent, high-quality text.
This approach shifts the research focus from "how to train a stronger student" to "how to construct better teacher trajectories" — a meaningful reexamination of the distillation paradigm for few-step generation.
The concept of an "energy function" draws from statistical physics and Energy-Based Models (EBMs). In a machine learning context, an energy function is a scalar scoring function that assigns lower energy values to higher-quality samples (more preferred) and higher energy to lower-quality ones. By adjusting token selection probabilities at each sampling step in the direction of energy descent, the model can systematically favor higher-quality intermediate sequences rather than jumping randomly according to a probability distribution. This is conceptually similar to reward shaping in reinforcement learning: rather than waiting until the final output to provide feedback, quality signals are provided at each intermediate state to guide exploration toward better outcomes. The key engineering challenge in energy-navigated distillation lies in designing an energy function that is both computationally efficient and a faithful proxy for text quality — one whose overhead during trajectory construction does not offset the efficiency gains from reducing inference steps.
Implications for Text Generation Paradigms
The value of this work lies not only in the specific method it proposes, but in its challenge to a widely held assumption in distillation research. For a long time, when distillation underperformed, the reflexive explanation was insufficient model capacity — with little scrutiny of the quality of the training signal (the trajectory) itself.
For researchers and engineers focused on reducing the inference cost of generative models, this perspective offers practical insight: rather than simply scaling up the student model, it may be worth first examining the quality of the demonstration data. In iterative generation paradigms such as diffusion models and discrete flow matching, quality control over intermediate steps may be the decisive factor for both final efficiency and output quality.
As few-step generation technology matures, enabling text generation models to dramatically compress inference steps without sacrificing quality will become a central challenge in making these models practical. This paper offers an illuminating entry point into that direction.
Related articles

rag-eval: A Zero-Dependency, No-API-Key RAG Evaluation Tool
rag-eval is a zero-dependency, framework-agnostic open-source RAG pipeline evaluation tool. It supports free local lexical and retrieval metrics with no API keys required, and offers optional LLM Judge for semantic validation. Compatible with Haystack, LangChain, and LlamaIndex.

Vercel AI SDK Releases workflow-harness 1.0.115 Patch Update
Vercel AI SDK releases @ai-sdk/workflow-harness 1.0.115 patch update, syncing the @ai-sdk/harness dependency. Learn about the update, release mechanism, and what it means for developers.

GLM 5.3 Now Available on Serverless Training API — No Sales Process Required
GLM 5.3 is now available on Serverless Training API alongside Kimi K3 and Qwen 3.8 27b. No sales process needed — start fine-tuning directly via docs or pre-made recipes.