惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
大猫的无限游戏
大猫的无限游戏
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
人人都是产品经理
人人都是产品经理
博客园 - Franky
阮一峰的网络日志
阮一峰的网络日志
腾讯CDC
小众软件
小众软件
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
WordPress大学
WordPress大学
博客园 - 叶小钗
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
博客园 - 【当耐特】
有赞技术团队
有赞技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
Visual Studio Blog
J
Java Code Geeks
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
月光博客
月光博客
IT之家
IT之家
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园_首页
爱范儿
爱范儿
罗磊的独立博客
雷峰网
雷峰网
量子位
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Hugging Face - Blog
Hugging Face - Blog
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
P
Privacy International News Feed
S
Schneier on Security
W
WeLiveSecurity
H
Heimdal Security Blog
I
Intezer
Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 聂微东
美团技术团队
N
News | PayPal Newsroom
T
The Exploit Database - CXSecurity.com
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
aimingoo的专栏
aimingoo的专栏
S
SegmentFault 最新的问题
Project Zero
Project Zero
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org

Hugging Face - Blog

Waypoint-1.5: Higher-Fidelity Interactive Worlds for Everyday GPUs ALTK‑Evolve: On‑the‑Job Learning for AI Agents Safetensors is Joining the PyTorch Foundation Holo3: Breaking the Computer Use Frontier Any Custom Frontend with Gradio's Backend A New Framework for Evaluating Voice Agents (EVA) Bringing Robotics AI to Embedded Platforms: Dataset Recording, VLA Fine‑Tuning, and On‑Device Optimizations One-Shot Any Web App with Gradio's gr.HTML CUGA on Hugging Face: Democratizing Configurable AI Agents New in llama.cpp: Model Management Building Deep Research: How we Achieved State of the Art OVHcloud on Hugging Face Inference Providers 🔥 20x Faster TRL Fine-tuning with RapidFire AI Building for an Open Future - our new partnership with Google Cloud Aligning to What? Rethinking Agent Generalization in MiniMax M2 Building a Healthcare Robot from Simulation to Deployment with NVIDIA Isaac Sentence Transformers is joining Hugging Face! Unlock the power of images with AI Sheets Supercharge your OCR Pipelines with Open Models Google Cloud C4 Brings a 70% TCO improvement on GPT OSS with Intel and Hugging Face Get your VLM running in 3 simple steps on Intel CPUs Nemotron-Personas-India: Synthesized Data for Sovereign AI Introducing RTEB: A New Standard for Retrieval Evaluation Accelerating Qwen3-8B Agent on Intel® Core™ Ultra with Depth-Pruned Draft Models VibeGame: Exploring Vibe Coding Games Nemotron-Personas-Japan: ソブリン AI のための合成データセット Swift Transformers Reaches 1.0 – and Looks to the Future Smol2Operator: Post-Training GUI Agents for Computer Use SyGra: The One-Stop Framework for Building Data for LLMs and SLMs Gaia2 and ARE: Empowering the community to study agents Scaleway on Hugging Face Inference Providers 🔥 Democratizing AI Safety with RiskRubric.ai Public AI on Hugging Face Inference Providers 🔥 `LeRobotDataset:v3.0`: Bringing large-scale datasets to `lerobot` Visible Watermarking with Gradio Introducing the Palmyra-mini family: Powerful, lightweight, and ready to reason! Tricks from OpenAI gpt-oss YOU 🫵 can use with transformers Fine-tune Any LLM from the Hugging Face Hub with Together AI Jupyter Agents: training LLMs to reason with notebooks mmBERT: ModernBERT goes Multilingual Welcome EmbeddingGemma, Google's new efficient embedding model SAIR: Accelerating Pharma R&D with AI-Powered Structural Intelligence Make your ZeroGPU Spaces go brrr with ahead-of-time compilation NVIDIA Releases 6 Million Multi-Lingual Reasoning Dataset Generate Images with Claude and Hugging Face From Zero to GPU: A Guide to Building and Scaling Production-Ready CUDA Kernels MCP for Research: How to Connect AI to Research Tools Kimina-Prover-RL Arm & ExecuTorch 0.7: Bringing Generative AI to the masses Neural Super Sampling is here! TextQuests: How Good are LLMs at Text-Based Video Games? 🇵🇭 FilBench - Can LLMs Understand and Generate Filipino? Introducing AI Sheets: a tool to work with datasets using open AI models! Accelerate ND-Parallel: A guide to Efficient Multi-GPU Training Vision Language Model Alignment in TRL ⚡️ Welcome GPT OSS, the new open-source model family from OpenAI! Measuring Open-Source Llama Nemotron Models on DeepResearch Bench 📚 3LM: A Benchmark for Arabic LLMs in STEM and Code Implementing MCP Servers in Python: An AI Shopping Assistant with Gradio Introducing Trackio: A Lightweight Experiment Tracking Library from Hugging Face Say hello to `hf`: a faster, friendlier Hugging Face CLI ✨ Parquet Content-Defined Chunking TimeScope: How Long Can Your Video Large Multimodal Model Go? Fast LoRA inference for Flux with Diffusers and PEFT Accelerate a World of LLMs on Hugging Face with NVIDIA NIM Arc Virtual Cell Challenge: A Primer Consilium: When Multiple LLMs Collaborate Back to The Future: Evaluating AI Agents on Predicting Future Events Five Big Improvements to Gradio MCP Servers Ettin Suite: SoTA Paired Encoders and Decoders Migrating the Hub from Git LFS to Xet Kimina-Prover: Applying Test-time RL Search on Large Formal Reasoning Models Asynchronous Robot Inference: Decoupling Action Prediction and Execution ScreenEnv: Deploy your full stack Desktop Agent Building the Hugging Face MCP Server Reachy Mini - The Open-Source Robot for Today's and Tomorrow's AI Builders Creating custom kernels for the AMD MI300 Upskill your LLMs With Gradio MCP Servers SmolLM3: smol, multilingual, long-context reasoner Three Mighty Alerts Supporting Hugging Face’s Production Infrastructure Efficient MultiModal Data Pipeline Announcing NeurIPS 2025 E2LM Competition: Early Training Evaluation of Language Models Training and Finetuning Sparse Embedding Models with Sentence Transformers Welcome the NVIDIA Llama Nemotron Nano VLM to Hugging Face Hub Gemma 3n fully available in the open-source ecosystem! Transformers backend integration in SGLang (LoRA) Fine-Tuning FLUX.1-dev on Consumer Hardware Groq on Hugging Face Inference Providers 🔥 How Long Prompts Block Other Requests - Optimizing LLM Performance Learn the Hugging Face Kernel Hub in 5 Minutes Convert Transformers to ONNX with Hugging Face Optimum Intel and Hugging Face Partner to Democratize Machine Learning Hardware Acceleration Director of Machine Learning Insights [Part 3: Finance Edition] The Annotated Diffusion Model Deep Q-Learning with Space Invaders Graphcore and Hugging Face Launch New Lineup of IPU-Ready Transformers Introducing Pull Requests and Discussions 🥳 Efficient Table Pre-training without Real Data: An Introduction to TAPEX An Introduction to Q-Learning Part 2/2 How Sempre Health is leveraging the Expert Acceleration Program to accelerate their ML roadmap
Direct Preference Optimization Beyond Chatbots
Erick Lachmann, Pimenta de Freitas Cardoso · 2026-06-03 · via Hugging Face - Blog

Back to Articles

Erick Lachmann's avatar

Pimenta de Freitas Cardoso's avatar

Using Rejection Pairs From Your Model's Own Failures

In April, we released DharmaOCR, our specialized structured OCR model (available on Hugging Face) along with a paper detailing the methodology behind it and a benchmark demonstrating its superior quality and cost efficiency. The paper benchmarked leading vision-language model families - both open-source and commercial - on a structured document extraction task: OCR on Brazilian Portuguese text. Among the reported metrics was text degeneration rate: the frequency with which a model produces a repetition loop instead of a transcription.

Across the tested open-source families, vanilla degeneration rates ranged from below 1% to above 33%. Supervised fine-tuning reduced those rates for most models - but rarely to production-acceptable levels. The pattern points to a structural limitation: SFT optimizes for correct outputs, but does not explicitly penalize degeneration. There appears to be a ceiling on how much task-focused fine-tuning alone can reduce this failure mode (Text Degeneration Article).

A second training stage - applied after supervised fine-tuning (SFT), on the same documents, using the same model - reduced text degeneration in every family tested. No exceptions. Average reduction: 59.4%. Best case: 87.6%.

image Figure 1: DPO reduced degeneration relative to SFT in every family tested - average reduction of 59.4%, peak of 87.6% (Nanonets-OCR2–3B: 1.61% to 0.20%). The direction is invariant; only the magnitude varies.

That second stage was Direct Preference Optimization (DPO). Almost all published DPO applications target chat alignment - models trained on human judgments about helpfulness or harmlessness (example: Rafailov et al., 2023). OCR carries none of that subjectivity: the task is objective, and there is no conversational context. There is, however, a clear preference signal. A correct transcription is chosen; a degeneration loop is rejected. DharmaOCR used that binary to construct a DPO training set, testing the technique not for alignment, but as a direct mitigation tool for a specific failure mode.

The training signal came from the model itself - specifically from the outputs it produced when it failed. How a failure mode becomes a training signal is a structural question about the failure, not the model.


The Loop Survives Fine-Tuning

Why SFT has a ceiling on degeneration is still an open question - but the leading conjecture points to loss granularity. SFT trains token by token: each prediction is evaluated in isolation, and a repetition loop is never penalized as a completion-level failure. DPO inverts that logic. The training signal is the full output - chosen or rejected - which means a degenerated completion can be explicitly labeled as the wrong outcome, not just a sequence of locally probable tokens.

When a training objective maximizes the likelihood of observed sequences, it concentrates probability mass in the regions of distribution space those sequences occupy. A model that enters one of those high-probability attractor regions during inference assigns elevated probability to the same token at the next step - which increases the probability further, which sustains the loop until the sequence hits the maximum token limit. Text degeneration is the output of this geometry: a self-reinforcing repetition loop that an autoregressive model cannot exit without external intervention (Holtzman et al., 2020). It is not purely a decoding artifact. The attractor involves the training objective, the learned distribution, and how probability mass concentrates during inference - a systems-level failure rather than a failure localized to any single component.

The geometry of this failure is visible at the token level.

image Figure 2: When a token dominates its own conditional distribution, every sampling step deepens the attractor. The decoder samples from this geometry; it does not determine it.

Inference-layer interventions - repetition penalties, temperature adjustments, early-abort logic - operate on the sampling step. They contain the symptom without touching the distribution that produces it. The attractor persists.

Supervised fine-tuning moves the distribution closer to the task domain. For a structured generation pipeline, this means training on domain-specific documents, in the target language, with the required output format. The model gains fluency with longer sequences, constrained syntax, domain vocabulary. What SFT does not do is attack degeneration directly. Its objective - maximizing the likelihood of observed sequences - has no term that penalizes repetition loops. The failure mode is simply outside the scope of what the training signal optimizes for.

One model family in the DharmaOCR benchmark showed an unexpected pattern: vanilla degeneration rate of 0.60%, rising to 3.23% after SFT, before a subsequent DPO stage brought it to 1.41%. It is a single data point - an exception, not a rule - and it would be overstating the evidence to treat it as proof of a mechanism. What it does illustrate is that SFT does not reliably reduce degeneration. Capability and degeneration resistance can move independently.

The distinction matters structurally. SFT and DPO are not interchangeable training stages performing the same operation at different intensities. SFT closes the distance between the model's prior distribution and the task domain. What it does not do is target degeneration as an objective - its effect on the failure mode is incidental, and the benchmark results show it is not consistent. The attractor that produces degeneration is not a problem with the model's proximity to the task - it is a problem with the shape of the distribution space the model now occupies.

Addressing that geometry requires a training signal built specifically to point the model away from its own failure modes. For a structured, non-conversational task with no human preference labels and no conventional "helpful versus harmful" distinction, constructing that signal is a design decision.


The Design Decision: Degenerate Outputs as Rejection Pairs

The DharmaOCR pipeline's contribution to DPO methodology is specific: it used the SFT model's own degenerate outputs as the rejected examples - not as noise to remove, but as the negative training signal the optimization needed.

DPO requires preference pairs: a chosen output and a rejected output for the same input, with a quality difference clear enough for the optimization to learn from. In chat alignment, human annotators produce those judgments - rating responses as more or less helpful, accurate, or safe. Structured generation tasks have no equivalent annotation source. An OCR pipeline either produces a correct transcription or it does not. Quality differences exist, but they are not produced by human preference rankings - they are produced by the task's own criteria for correctness.

The DharmaOCR pipeline identified a preference signal that structured generation tasks already produce: the range of outputs the SFT model generates in inference. A model capable of performing a structured task is also capable of failing at it in characteristic ways. Those failures - outputs that enter the degeneration attractor - are not noise to filter. They are the most informative negative signal available.

The paper implemented this on 23,726 training documents, generating multiple candidate responses per document with the SFT model and scoring each with an automated LLM judge. The pipeline is shown below.

image Figure 3: The critical design decision is not in the pipeline's structure - it is in what the pipeline preserved: outputs displaying text degeneration were deliberately labeled as rejected examples, not filtered out as low-quality noise.

The conventional response when degenerate outputs appear in training data is to remove them. They are low-quality signal; filtering produces a cleaner dataset. The DharmaOCR approach inverted this logic. Degenerate outputs were deliberately retained as the rejected examples in each (chosen, rejected) pair, because they represent exactly the failure mode the DPO stage was designed to suppress. Removing them would have discarded the clearest target available.

The paper describes this as "preference-guided implicit unlikelihood" - the model is trained not only toward better outputs but away from a specific class of failure. Where SFT maximizes the likelihood of high-quality outputs, the DPO stage simultaneously penalizes outputs displaying the degeneration attractor geometry. The direction of the optimization is explicit in a way SFT alone cannot achieve.

Degenerate outputs are particularly well-suited as rejection examples because they represent a consistent failure mode rather than varied low-quality outputs. A transcription that misses words is low quality, but its failure is case-specific. Repetition loops, by contrast, appeared persistently across documents and model families even after SFT - a pattern consistent with a failure mode that likelihood-based optimization does not reliably correct. DPO applies its loss differently: at the completion level, with explicit rejection signals. The post-hoc analysis cannot establish causality, but the evidence suggests that what SFT's objective leaves unresolved, DPO's may address.

This approach requires no specialized annotation infrastructure - only a model capable of producing both acceptable and identifiable-failure outputs, and a scoring model to label preference pairs. A rule-based mechanism could detect repetition loops mechanically - but it could not identify which outputs represented high-quality transcriptions worth preserving as chosen examples.

The scoring model does both: it flags degeneration as the rejected output and validates clean extractions as the chosen one, keeping the model's extraction capability intact while the DPO signal penalizes the failure mode. Whether the resulting training signal successfully moves the distribution in the intended direction - and whether it does so consistently across architectures - is the evidence question.


Consistent Across Five Model Families

The DPO stage reduced text degeneration in every model family tested - with reductions ranging from 37% to 88% and an average of 59.4% relative to SFT alone. The result held across architectures, parameter scales, and starting degeneration profiles that differed by more than one order of magnitude. One case in the dataset saw degeneration increase after the SFT stage before DPO corrected it. That case does not complicate the consistency. It confirms the mechanism more directly than any of the others.

Figure 1 shows the three-stage degeneration rate for each of the five model families tested: Vanilla, SFT, and SFT+DPO. In four of the five families, degeneration falls at each stage. The fifth family's bars move differently - and that difference is the most analytically important data point in the study.

The Qwen2.5-VL-3B result, read carefully, is not a complication. It is a confirmation. The model's vanilla degeneration rate was 0.60% - not because it was stable, but because it was too generic to produce long structured outputs at all. The model was not entering the degeneration attractor because it was not attempting the task seriously enough to find it.

SFT changed that. After domain adaptation, Qwen2.5-VL-3B became capable of the task - producing longer, more structured outputs with the domain vocabulary and format the pipeline required. That capability brought it into proximity with the degeneration attractor for the first time. Its degeneration rate rose to 3.23%.

This is the mechanism made empirically visible: SFT moved the model toward the task and toward the task's failure geometry simultaneously. These are not necessarily the same operation. A training stage that increases task capability can increase failure-mode exposure as a side effect - particularly when the failure mode lives at the edge of the capability frontier. Treated as the same operation, the Qwen2.5-VL-3B result looks like an error. Treated as distinct operations - which is what the SFT + DPO pipeline formally does - the result is consistent with the hypothesis that SFT and DPO address different failure dimensions.

The DPO stage then brought the degeneration rate to 1.41%. It did not restore the vanilla baseline because it was not designed to: the model after SFT was more capable than it had been, and a return to 0.60% would have required undoing that capability. What the DPO stage did was address the failure geometry the SFT stage had introduced.

The remaining four model families add quantitative weight to the same conclusion. Figure 1 shows the SFT-to-SFT+DPO comparison for all five.

image Figure 1: DPO reduced degeneration relative to SFT in every family tested - average reduction of 59.4%, peak of 87.6% (Nanonets-OCR2–3B: 1.61% to 0.20%). The direction is invariant; only the magnitude varies.

No model family showed degeneration increasing after DPO. No family was immune to its effect. The consistency extends to gemma-3–4b-it, which entered the benchmark with the highest vanilla degeneration rate by an order of magnitude - 33.96%, compared to the next highest at 2.62% - and still reached a 75% reduction after the DPO stage. The reduction range - 37.3% to 87.6% - reflects differences in starting configuration and architecture, not inconsistency in the intervention's direction.

This is not a proof of universal applicability. DPO may not transfer to every domain, failure mode, or model family. What the DharmaOCR benchmark provides is evidence across five OCR architectures that the core hypothesis holds: optimizing over complete preference pairs - rather than maximizing token-level likelihood - addresses a failure mode that SFT structurally cannot target. The result was consistent in direction across every model family tested. That consistency, within the scope of this benchmark, is what the evidence supports.


The Pattern Beyond OCR

The DharmaOCR approach was possible because this pipeline satisfied a set of structural conditions that allowed a DPO training stage to function as designed - conditions whose presence or absence determines whether the same methodology applies elsewhere (Dharma OCR Paper on ArXiv). It was not possible because OCR is a unique domain.

The first condition is that the failure mode be identifiable as a distinct class of output, not just a point on a quality continuum. Text degeneration qualifies because a repetition loop is categorically different from a transcription that misses words or misreads a character. The output is not merely suboptimal - it is broken in a specific, behaviorally recognizable way. That categorical distinctness is what allowed the pipeline to construct preference pairs where the rejected examples represented a coherent failure geometry, not noise. A task whose failure modes blend into its range of acceptable variation lacks this property.

The second condition is that a scoring mechanism can reliably distinguish acceptable outputs from failure-mode outputs without requiring human annotation. In the DharmaOCR pipeline, an automated LLM judge scored candidate responses against four task-specific criteria. The scoring did not need to be perfect - it needed to be consistent enough to produce preference pairs with a meaningful quality gap between chosen and rejected. Pairs with ambiguous quality differences contribute noise to DPO training, not signal. The judge's consistency was a design requirement, not an incidental feature.

The third condition is sufficient volume - enough inference outputs to generate a preference dataset with meaningful variance in quality. This is not an extraordinary requirement by fine-tuning standards, but it is a real one.

When all three conditions are present, the methodological move is structurally available. The design decision at the center of the DharmaOCR pipeline - treating the model's own failure outputs as the rejected examples rather than filtering them - applies wherever a model's failures are categorically identifiable, scoreable, and sufficiently numerous.

The practical implication for ML engineers building structured generation pipelines is direct. SFT is necessary - it closes the distance between a generalist model and a task-capable one. It is not sufficient for structured output reliability, because task capability and degeneration resistance are different properties of the distribution. A DPO stage after SFT is a one-time training investment. In the DharmaOCR results, the degeneration reduction did not come at the cost of extraction quality - the paper's benchmark results show both moving together (Specialization Beats Scale article).

What makes a failure mode usable as training signal is not the domain - it is whether the failures are consistent enough, identifiable enough, and numerous enough to constitute a legible signal. In the DharmaOCR pipeline, they were. Whether the same holds in another context is a structural question about the task's failure mode, not a question about the model family or the domain.

The DharmaOCR result does not depend on the domain being special. It depends on the failures being useful.

Text degeneration qualifies as useful because it is categorically distinct from acceptable outputs, consistently produced across inference runs, and reliably scoreable without human annotation. Those three properties - not the OCR context, not the model family, not the language - determined whether the preference dataset was tractable. A failure mode that satisfies them is not noise to remove. It is the most direct evidence available of where the distribution should not go.

The DPO stage used that evidence. Degeneration fell in every model family tested - in models that entered the benchmark with vanilla rates below 1% and in models that entered with rates above 33%. The direction held. The pipeline did not discard its failures. It trained on them.


Sources